"3844391","1","4038968","","2010-10-02 04:29:34","2","2216","<p>I'm working on displaying a set of images, then if the users wishes, to have the ability to save the image to the SD card. I need help saving them to external storage. Can someone help me out with this? </p><p><strong>Grid View:</strong> </p><pre><code>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><strong>ImageAdapter:</strong></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;    }    imageView.setImageResource(mThumbIds[position]);    return imageView;}// references to our imagesprivate 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>","420015","","","","","2010-10-28 01:12:46","Android: Image save to location","<java><android><save>","1","0","1","",""
"3844514","1","3845824","","2010-10-02 05:32:52","3","2759","<p>I want to combine two audio files. (A audio file + B audio file = AB audio file)</p><p>After searching around, I think the following steps will work</p><ol><li>Using an AudioTrack.</li><li>Decode PCM from audio files.</li><li>Combine PCM. </li></ol><p>Are the above steps right, if not, what would be another way to achieve it? </p><p>Is there an example and Library source available to look at?</p>","464441","","206367","","2012-07-07 16:27:28","2012-07-07 16:27:28","How to combine two audio files into one in Android","<android><audio>","1","2","","",""
"3844760","1","3844826","","2010-10-02 07:17:25","0","189","<p>I am new to mobile application technologies....We are developing applications for iPhone/android/blackberry/windows mobile.</p><p>I need any PPTs of any PDF books that explain our team abouta General mobile application architecture, trends etc..</p><p>Do any one have any reference..Please help me!</p><p>Thanks in advance!</p>","332013","","","","","2010-10-02 15:29:41","Mobile Application technologies information","<iphone><android><architecture><mobile>","3","0","1","",""
"3844813","1","4623374","","2010-10-02 07:36:40","4","5506","<p>I am working on an SMS Sending application and for login purpose i want to send the username and password using POST method from my Android Application to the web server.</p><p>When  I click on lo-gin button the application is not responding and the console prints the following message in response of the Post request.</p><p><strong>HTTP/1.1 500 Internal Server Error</strong></p><p>While my application running fine with the GET method.</p><p>I am not able to figure out why this is causing...</p><p>the whole code is here:</p><pre><code>package com.vikas.httplogin;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;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.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.widget.TextView;public class HttpLogin extends Activity {    TextView tv;    private static final String tag =""FATAL_ERROR"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                connecttoServer();    }    private void connecttoServer()    {        BufferedReader br = null;        try        {            HttpClient client = new DefaultHttpClient();            HttpPost request = new HttpPost(""url of my site"");            List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(3);            params.add(new BasicNameValuePair(""username"",""vikaspatidar""));            params.add(new BasicNameValuePair(""password"", ""patidar""));            UrlEncodedFormEntity entity = new UrlEncodedFormEntity(params);           request.setEntity(entity);          Log.v(tag,request.getMethod().toString());          HttpResponse response = client.execute(request);           Log.v(tag, response.getStatusLine().toString());            br = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));            StringBuffer sb = new StringBuffer("""");            String line = """";            String NL = System.getProperty(""line.separator"");            while ((line = br.readLine()) != null) {                sb.append(line + NL);            }            br.close();            String result = sb.toString();            Log.v(tag, result);    } catch (ClientProtocolException e)    {        Log.v(tag, e.getMessage());    }     catch (IllegalStateException e) {         Log.v(tag, e.getMessage());    } catch (IOException e) {         Log.v(tag, e.getMessage());    }    }}</code></pre>","457982","","1765573","","2013-07-27 06:46:25","2013-07-27 06:46:25","Internal Server Error","<java><android><http><internal-server-error>","2","0","","",""
"3844890","1","","","2010-10-02 08:03:03","2","1199","<p>Im trying to send the data from my HTC Desire to a tomcat server whichis installed in my PC through Wi-Fi from my android application..</p><p>I can able to send the data from the Emulator. but i can't able tosend the data from the Mobile.</p><p>Im getting an exception  when i sent data from the mobile..Theexception is java.net.SocketTimeoutException: The operation timedout..</p><p>I have included all the permissions in the android manifest file likeINTERNET, ACCESS_WIFI..</p><p>I saw some of the blogs related to this Exception.. I've tried all theways that they have suggested..</p><p>But no use... Is it related to any firewall protection??</p><p>Thanks in advanceUday Kiran Pichika </p>","419389","","","","","2010-10-02 08:03:03","java.net.socketException The Operation timed out","<android>","0","0","","",""
"3844951","1","3845840","","2010-10-02 08:26:44","10","1792","<p>What are different points to note down while testing android applications? What are different techniques or test cases used for android?</p>","363503","","","","","2013-11-14 20:52:02","Points to remember while testing android application","<android><testing>","1","0","15","",""
"3845002","1","","","2010-10-02 08:45:28","1","242","<p>can anyone tell me that in android how can we refresh a service??</p><p>i am developing an app in which my service  is running perfectly and giving me data what i want..BUT each and every time it is giving me same data which it giving on first time i.e. service starting time.after that it is running but that data is stic with that old data ,so i want to know is there any way to refresh service so any time as data changed it give me fresh data or any other way?</p><p>thanks in advance..</p>","450601","","","","","2011-08-26 10:17:57","how to refresh a service","<android><service>","1","2","","",""
"3845023","1","3845078","","2010-10-02 08:53:27","6","512","<p>I want to learn a new programming language and develop for the Android platform.</p><p>I'm a fulltime C# / F# - developer and I also use C# in the most functional way possible (because I like this paradigm far better than the old skool style ""lets iterate and describe to the barkeeper how to make the cocktail"", to quote Microsoft).</p><p>However, I have a strong dislike for Java, because in my opinion it is outdated and, hm, a dinosaur - it lacks exactly the features I like best about C# and F#.</p><p>On the other hand, developing for the Android platform requires JDK use.</p><p>So, would you recommend Scala? Or is the JDK stuff not for me at all?</p>","464513","","","","","2010-10-14 16:22:47","Is Scala for me? (C# developer with focus on functional / OOP style)","<android><scala><functional-programming>","2","3","1","",""
"3845036","1","3845905","","2010-10-02 08:57:40","1","2892","<p>I have CameraList class that provides Cameras list like ""SONY"",""VIVOTEK"",""VIVOTEK 7XXX"",""PIXORD"",""TOSHIBA"",""JVC E-CON""... </p><p>And I want to list them in my spinner but i couldnt. there is my codes..</p><pre><code>public class AddCam extends MainActivity {    CameraList cams = new CameraList();    @Override    public void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);        Toast msg = Toast.makeText(AddCam.this, getString(R.string.add_new), Toast.LENGTH_LONG);        msg.setGravity(Gravity.CENTER, msg.getXOffset() / 2, msg.getYOffset() / 2);        String a = getString(R.string.add_new);        TextView tv = (TextView) findViewById(R.id.head);        tv.setText(getString(R.string.add_new));        Spinner s = (Spinner) findViewById(R.id.spinner);        ArrayAdapter&lt;?&gt; adapter = ArrayAdapter.createFromResource(        this, R.array.cameras, android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        //s.setAdapter(adapter); **** there is null pointer ex.        setContentView(R.layout.spinnerex);    }}</code></pre><p>My camlist code is</p><pre><code>public class CameraList {    private static String[] cameraModelNames = {""AXIS"",""AVOISYS"",""SONY"",""...""}    public  String[] getlist()    {        return cameraModelNames;    }}</code></pre><p>this is my logCat</p><pre><code>10-02 12:33:50.007: ERROR/AndroidRuntime(4624): Uncaught handler: thread main exiting due to uncaught exception10-02 12:33:50.027: ERROR/AndroidRuntime(4624): java.lang.RuntimeException: Unable to start activity ComponentInfo{spexco.hus.cepvizyon/spexco.hus.cepvizyon.AddCam}: java.lang.NullPointerException10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.os.Handler.dispatchMessage(Handler.java:99)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.os.Looper.loop(Looper.java:123)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.ActivityThread.main(ActivityThread.java:4363)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at java.lang.reflect.Method.invokeNative(Native Method)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at java.lang.reflect.Method.invoke(Method.java:521)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at dalvik.system.NativeStart.main(Native Method)10-02 12:33:50.027: ERROR/AndroidRuntime(4624): Caused by: java.lang.NullPointerException10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at spexco.hus.cepvizyon.AddCam.onCreate(AddCam.java:39)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)10-02 12:33:50.027: ERROR/AndroidRuntime(4624):     ... 11 more</code></pre>","463888","","422597","","2010-10-02 10:07:47","2010-10-02 13:22:50","I Can't use spinner.setAdapter(adapter);","<android><android-widget>","1","4","","",""
"3845047","1","","","2010-10-02 09:02:03","1","437","<p>I have this application for getting the contacts and I got the three lists on           spinerClick.  How can I develop onClick event on particular List item click.     </p><pre><code>    package Com.ContactProject;    import android.app.ListActivity;    import android.os.Bundle;    import android.view.View;    import android.widget.AdapterView;    import android.widget.ArrayAdapter;    import android.widget.ListAdapter;    import android.widget.Spinner;    public class ContactSpinners extends ListActivity          implements AdapterView.OnItemSelectedListener {    private static String[] options={            ""Contact Names"",            ""Contact Names &amp; Numbers"",            ""Contact Names &amp; Email Addresses""};private ListAdapter[] listAdapters=new ListAdapter[3];@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main2);    initListAdapters();    Spinner spin=(Spinner)findViewById(R.id.spinner);    spin.setOnItemSelectedListener(this);    ArrayAdapter&lt;String&gt; aa=new ArrayAdapter&lt;String&gt;(this,                                                        android.R.layout.simple_spinner_item,                                                        options);    aa.setDropDownViewResource(                    android.R.layout.simple_spinner_dropdown_item);    spin.setAdapter(aa);}public void onItemSelected(AdapterView&lt;?&gt; parent,                                                            View v, int position, long id) {    setListAdapter(listAdapters[position]);}public void onNothingSelected(AdapterView&lt;?&gt; parent) {    // ignore}private void initListAdapters() {    listAdapters[0]=ContactsAdapterBridge.INSTANCE.buildNameAdapter(this);    listAdapters[1]=ContactsAdapterBridge.INSTANCE.buildPhonesAdapter(this);    listAdapters[2]=ContactsAdapterBridge.INSTANCE.buildEmailAdapter(this);}}</code></pre>","441224","","12388","","2010-10-02 09:46:51","2010-10-02 09:46:51","Android List Activity","<android>","0","0","","",""
"3845147","1","","","2010-10-02 09:35:13","1","601","<p>I am trying to get a reponse of 200 I did all this.If I convert ""TLS"" to ""SSL"" its throws exception again which I am getting alwaz. Please anyone help me to get a response and response data. I dont understd where exactly the problem is?</p><pre><code>public class Signin extends Activity implements OnClickListener{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.signin);        Button signin = (Button) findViewById(R.id.btn_signin1);        signin.setOnClickListener(this);    }    @Override    public void onClick(View v) {        // TODO Auto-generated method stub        switch(v.getId()){        case R.id.btn_signin1:            Intent intent = new Intent(this, Password.class);            createNounce();            httpConnect();            startActivity(intent);            break;        }    }    // always verify the host - dont check for certificate    final static HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {            public boolean verify(String hostname, SSLSession session) {                    return true;            }    };    /**     * Trust every server - dont check for any certificate     */    private static void trustAllHosts() {            // Create a trust manager that does not validate certificate chains            TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {                    public java.security.cert.X509Certificate[] getAcceptedIssuers() {                            return new java.security.cert.X509Certificate[] {};                    }                    public void checkClientTrusted(X509Certificate[] chain,                                    String authType) throws CertificateException {                    }                    public void checkServerTrusted(X509Certificate[] chain,                                    String authType) throws CertificateException {                    }            } };            // Install the all-trusting trust manager            try {                    SSLContext sc = SSLContext.getInstance(""TLS"");                    sc.init(null, trustAllCerts, new java.security.SecureRandom());                    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());            } catch (Exception e) {                    e.printStackTrace();            }    }    boolean isComplete;    InputStream _in;        private StringBuffer msg;    private String responsData;    private String input;    public void httpConnect(){            URL url;            try {                url = new URL(""https://rhel-dev4.acclaris.net/benefits/webservices/GetLoginInfoMAService"");                HttpURLConnection _httpconn = null;                 if (url.getProtocol().toLowerCase().equals(""https"")) {                         trustAllHosts();                         HttpsURLConnection https = (HttpsURLConnection) url.openConnection();                         https.setHostnameVerifier(DO_NOT_VERIFY);                         _httpconn = https;                 } else {                         _httpconn = (HttpURLConnection) url.openConnection();                 }                _httpconn.setRequestMethod(""POST"");                //_httpconn.setRequestProperty(""Content-Type"", ""application/x-www-form-urlencoded"");                _httpconn.setRequestProperty(""SOAPAction"", ""GetLoginInfoMA"");                _httpconn.setRequestProperty(""Content-Type"", ""text/xml"");                _httpconn.setRequestProperty(""User-Agent"", ""kSOAP/1.0"");                 String clen = Integer.toString(input.length());                 _httpconn.setRequestProperty(""Content-Length"", clen);                _httpconn.setDoInput(true);                _httpconn.setDoOutput(true);                System.out.println(""------------clen--------------------------------"");                          int rc = _httpconn.getResponseCode();                 System.out.println(""------------resp code--------------------------------""+rc);                   if(rc == HttpsURLConnection.HTTP_OK)                 {                    isComplete = true;                   _in = _httpconn.getInputStream();                   msg = new StringBuffer();                   byte[] data = new byte[1024];                   int len = 0;                   int size = 0;                   while ( -1 != (len = _in.read(data)) )                   {                        msg.append(new String(data, 0, len));                        size += len;                   }                   responsData = msg.toString();                  System.out.println(""""+responsData.toString());                }            } catch (Exception e) {                // TODO Auto-generated catch block                e.printStackTrace();            }    }    private void createNounce() {         try{             String planeTextUsername = ""objectsolwsuser"";             String planeTextPassword = ""local123"";               UUID guid =  UUID.randomUUID();               String[] txt = TextSplit.split(guid.toString(), ""-"");              System.out.println("" Guid  : "" + txt[0]);              String nonce = txt[0] + txt[0];// + guid.toString() + guid.toString();               byte[] arrNounce = nonce.getBytes();                   String nonceEncode = new String(Base64.encodeBytes(arrNounce, 0, arrNounce.length));             Date created = new Date();             SimpleDateFormat dateFormatter = new SimpleDateFormat(""yyyy-MM-dd'T'HH:mm:ss.S'Z'"");             //dateFormatter.setTimeZone(TimeZone.getTimeZone(""UTC""));             //dateFormatter.applyPattern(""yyyy-MM-dd'T'HH:mm:ss.S'Z'"");             String formattedCreated = dateFormatter.format(created);             System.out.println(""FormattedCreated  : "" + formattedCreated);            String totalPassword = nonce + formattedCreated + planeTextPassword;             byte[] theTextToDigestAsBytes = totalPassword.getBytes();            MessageDigest md = MessageDigest.getInstance( ""SHA-1"" );            md.update( theTextToDigestAsBytes );            // md.update( int ) processes only the low order 8-bits. It actually expects an unsigned byte.            byte[] digest = md.digest();            System.out.print( ""Digest: "" );            for ( byte b : digest )                {                // print byte as 2 hex digits with lead 0. Separate pairs of digits with space                System.out.printf( ""%02X "", b &amp; 0xff );                }            System.out.println();             String encryptPasswordSHA1 = new String(Base64.encodeBytes(digest, 0, digest.length));                  input = ""&lt;soapenv:Envelope xmlns:ser=\""http://www.acclaris.com/servicetypesma\"" xmlns:soapenv=\""http://schemas.xmlsoap.org/soap/envelope/\""&gt;""+            ""&lt;soapenv:Header&gt;""+               ""&lt;wsse:Security soapenv:mustUnderstand=\""1\"" xmlns:wsse=\""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\""&gt;""+                  ""&lt;wsse:UsernameToken wsu:Id=\""UsernameToken-26294097\"" xmlns:wsu=\""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\""&gt;""+                     ""&lt;wsse:Username&gt;objectsolwsuser&lt;/wsse:Username&gt;""+                     ""&lt;wsse:Password Type=\""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\""&gt;""+encryptPasswordSHA1+""&lt;/wsse:Password&gt;""+                     ""&lt;wsse:Nonce&gt;""+nonceEncode+""&lt;/wsse:Nonce&gt;""+                     ""&lt;wsu:Created&gt;""+formattedCreated+""&lt;/wsu:Created&gt;""+                  ""&lt;/wsse:UsernameToken&gt;""+               ""&lt;/wsse:Security&gt;""+            ""&lt;/soapenv:Header&gt;""+            ""&lt;soapenv:Body&gt;""+               ""&lt;ser:GetLoginInfoMA&gt;""+                  ""&lt;ser:userName&gt;objectone&lt;/ser:userName&gt;""+                  ""&lt;ser:param1/&gt;""+                  ""&lt;ser:param2/&gt;""+                  ""&lt;ser:param3/&gt;""+                  ""&lt;ser:param4/&gt;""+               ""&lt;/ser:GetLoginInfoMA&gt;""+            ""&lt;/soapenv:Body&gt;""+         ""&lt;/soapenv:Envelope&gt;"";            System.out.println(""EncryptPasswordSHA1  : "" + encryptPasswordSHA1);             System.out.println(""Nounce  : "" + nonceEncode);        }catch(Exception ex){}     } }</code></pre><p>Thansk ROckOn</p>","162644","","","","","2010-10-02 09:35:13","Android https connection problem responseCode 500","<android>","0","2","","",""
"3845227","1","3845559","","2010-10-02 10:10:19","6","3697","<p>I am using a text file in the assets folder in Android. I would like to change the data inside that text file dynamically. I am trying to open the file as follows:</p><pre><code>FileOutputStream fos=this.getAssets().openNonAssetFd(""data.txt"").createOutputStream();</code></pre><p>But it is generating the error: <code>java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed</code>. Please help me to edit this file. Thank you very much.</p>","247921","","2000012","","2013-07-25 15:25:38","2013-07-25 15:25:38","how can i edit the text files in assets folder in android","<android>","1","0","1","",""
"3845228","1","3845240","","2010-10-02 10:10:27","0","685","<p>i have a xml file and i am parsing it with DOM. `</p><pre><code>&lt;media:group&gt;&lt;media:category label='hi'scheme='http://gdata.youtube.com/schemas/2007/categories.cat'&gt;hello&lt;/media:category&gt;&lt;media:content            url='http://www.youtube.com/1'           expression='full' duration='37' yt:format='5' /&gt;   &lt;media:content            url='rtsp://v8.cache8.c.youtube.com.2.gp'            type='video/3gpp' medium='video' expression='full' duration='37'            yt:format='1' /&gt;   &lt;/media:group&gt;</code></pre><p>(Not original links)</p><p>like this it has many media:group tag...</p><p>my code is giving bellow:</p><pre><code>nodeList = doc.getElementsByTagName(""media:group"");for (int i = 0; i &lt; nodeList.getLength(); i++) {            try {                currentNode = nodeList.item(i);    Element fstElmnt = (Element) currentNode;                NodeList media_list = fstElmnt                        .getElementsByTagName(""media:content"");Element mediaElement = (Element) media_list.item(0);                media_list = mediaElement.getChildNodes();                String urlString = mediaElement.getAttribute(""url"");</code></pre><p>Now my problem is this  i want all url of all media:content tag,, but getting only 1st url of every media:content tag.  so where i am doing mistake please help me...</p>","304961","","","","","2010-10-02 10:20:19","Android DOM parsing problem","<android>","2","0","","",""
"3845355","1","3910091","","2010-10-02 10:56:42","0","4560","<p>I have one function  which is called on list item Click and list items contain      name and phone Numbers,i Use the following query,but what query Should i use      retrieve particular phone Number That Matches (Long id)</p><pre><code> protected void  onListItemClick  (ListView l, View v, int position, long id){    try    {    String[] PROJECTION=new String[] {Contacts._ID,            Contacts.DISPLAY_NAME,            Phone.NUMBER        };    Cursor c=managedQuery(Phone.CONTENT_URI,        PROJECTION, ""where _ID == id "", null, null);    System.out.println(Phone.NUMBER);    c.close();    }    catch(Exception e)    {        e.printStackTrace();    }    for(int i=0;i&lt;=position;i++)    {           if(position==i)        {            Intent i1 = new Intent(v.getContext(),SMS.class);            startActivity(i1);        }   }</code></pre>","441224","","","","","2010-10-11 21:27:25","Android Managed Query","<android>","1","0","","",""
"3845391","1","","","2010-10-02 11:10:23","0","1722","<p>I am curious how to create a simple PowerPoint presentation viewer for Android. I am focusing on the Office 2003 and 2007 formats (which means .ppt and .pptx). How do I read .ppt or .pptx files and show them like a picture slideshow on my Android app?</p>","460866","","149573","","2011-03-12 18:22:30","2013-10-08 07:42:13","How to create a PowerPoint viewer in Android?","<android><powerpoint>","1","0","","",""
"3845417","1","","","2010-10-02 11:19:42","0","1303","<p>How to backup app programmatically on android?</p>","298368","","251173","","2010-10-02 14:01:40","2011-03-28 04:36:44","How to backup app programmatically on android","<java><android><backup>","1","1","","",""
"3845474","1","","","2010-10-02 11:32:20","0","57","<pre><code> I have one function  which is called on list item Click and list items contain  name and phone Numbers,i Use the following query,but what query Should i use  retrieve particular phone Number That Matches (Long id) protected void  onListItemClick  (ListView l, View v, int position, long id){    try    {    String[] PROJECTION=new String[] {Contacts._ID,            Contacts.DISPLAY_NAME,            Phone.NUMBER        };    Cursor c=managedQuery(Phone.CONTENT_URI,        PROJECTION, ""where _ID == id "", null, null);    System.out.println(Phone.NUMBER);    c.close();    }    catch(Exception e)    {        e.printStackTrace();    }    for(int i=0;i&lt;=position;i++)    {           if(position==i)        {            Intent i1 = new Intent(v.getContext(),SMS.class);            startActivity(i1);        }   }</code></pre>","461503","","","","","2010-12-17 21:20:27","Android Cotent Provider","<android>","1","0","","",""
"3845508","1","3845757","","2010-10-02 11:44:13","1","1105","<p>How to open activity from view? I am develop a game if game is over I need to move user to main menu activity.</p>","1746300","","759866","","2014-02-20 17:20:08","2014-02-20 17:20:08","open other activity from view","<android>","2","0","","",""
"3845570","1","","","2010-10-02 11:59:39","7","6162","<p>I am trying to show contact pictures in my application but I am getting pictures of those who were added manually only and not those which are synced with facebook. How to work around this? Here is my code below:</p><pre><code>Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(PhotoId));InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(context.getContentResolver(), uri);return BitmapFactory.decodeStream(input);</code></pre>","439002","","114066","","2010-12-17 11:52:29","2013-02-28 18:53:59","Get contacts photo which are synced with facebook for android","<android><facebook><contacts><sync><image>","5","1","9","",""
"3845625","1","3871446","","2010-10-02 12:14:29","2","1487","<p>I have created a simple application which has a scroll bar. The scroll bar has 5 textviews such as Movies, Top10 Movies and so on, also the scroll bar has 2 arrow images, when I click the arrow image the textviews has to be scrolled. Can any one help me regarding on this, I am struggling on this. </p>","424413","","74815","","2011-08-23 23:10:59","2011-08-23 23:10:59","Need Help on the scrolling Bar in Android?","<android>","2","0","0","2012-05-22 12:31:28",""
"3845774","1","8743815","","2010-10-02 12:50:09","0","647","<p>I would like to notify the users when there is an update because the updates will be coming from my own website and not the market. However, do not want to have to update two places.</p><p>Either that or I would like to share the existing update notifier that is included with android. I am planning on uploading the app to one of our websites instead of the market.</p><p>Thanks!</p>","463304","","","","","2012-01-05 14:05:27","Detect my own app's version or use existing update notifier when publishing on my website and not the market","<android><android-manifest>","1","2","","",""
"3845855","1","","","2010-10-02 13:10:08","1","785","<p>I'm developing what I thought would be a simple listview row layout, but I'm having some trouble getting my views to line up properly.  There are 4 TextViews all using layout_weight within a LinearLayout to size themselves appropriately.  What I can't figure out, however, is how to align them consistently so that each TextView begins in the same position as the one above and beneath it.  </p><p><pre><code></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=""wrap_content""android:background=""#AAAAAA88""&gt;    &lt;TextView        android:id=""@+id/quality""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""2""        android:layout_gravity=""center_vertical|right""        android:textColor=""#ffffff""        android:padding=""5px""    /&gt;    &lt;TextView        android:id=""@+id/route_name""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""3""        android:layout_gravity=""center_vertical|right""        android:textColor=""#ffffff""               android:padding=""5px""               /&gt;    &lt;TextView        android:id=""@+id/route_grade""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:layout_gravity=""center_vertical|right""        android:textColor=""#ffffff""               android:padding=""5px""               /&gt;    &lt;TextView        android:id=""@+id/route_distance""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:layout_gravity=""center_vertical|right""        android:textColor=""#ffffff""               android:padding=""2px""               /&gt;        &lt;/LinearLayout&gt;</code></pre><p></pre></code></p><p>My attempts to use the :gravity tag don't seem to work.  Is LinearLayout the wrong approach here?</p><p>As an edit, I'm making some headway using specific width values in dips.  Now to test if it looks the same across different screens.</p>","458290","","458290","","2010-10-02 15:23:16","2013-10-03 11:46:51","Android Listview Row Layout","<android><user-interface>","2","0","","",""
"3845913","1","","","2010-10-02 13:25:50","16","15196","<p>I have downloaded an Android project. To avoid name conflicts I want to move it fromcom.android.zzz to com.my.zzz.At the moment I'm using Ecplise with the standard android toolkit. Is there a better way to do the rename than to go manually through the files? </p>","25282","","","","","2012-03-16 13:17:24","Easy way to rename a project in android","<android><eclipse>","2","0","1","",""
"3845938","1","","","2010-10-02 13:32:42","3","7060","<p>Short question that i cannot get my finger on, i'd like to launch a new browser from my WebView after people click a hyperlink. But how can i set that target of that link to escape the WebViewClient?? </p><p>Here's my code, any help is greatly appreciated:</p><pre><code>WebView site = (WebView)findViewById(R.id.WebView);  site.setWebViewClient(new WebViewClient());  site.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);  site.getSettings().setJavaScriptEnabled(true);  button1.setOnClickListener(button1OnClickListener);  button2.setOnClickListener(button2OnClickListener);  button3.setOnClickListener(button3OnClickListener);  button4.setOnClickListener(button4OnClickListener);  final AlertDialog alertDialog = new AlertDialog.Builder(this).create();  progressBar = ProgressDialog.show(FlitsersActivity.this, ""Thingy1"", ""Load..."", false, true);  site.setWebViewClient(new WebViewClient() {   public boolean shouldOverrideUrlLoading(WebView view, String url) {       Log.i(TAG, ""Loading..."");       view.loadUrl(url);       return true;   }   public void onPageFinished(WebView view, String url) {       Log.i(TAG, ""Done: "" +url);       if (progressBar.isShowing()) {           progressBar.dismiss();       }   }   public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {       Log.e(TAG, ""Error: "" + description);       Toast.makeText(MyActivity.this, ""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();   } }); site.loadUrl(""http://www.etcetera.com"");}</code></pre>","439774","","13070","","2010-10-02 15:31:11","2010-10-03 10:26:52","How to open new browser from WebViewClient?","<android><webview>","2","0","3","",""
"3845998","1","3846103","","2010-10-02 13:47:16","1","493","<p>This is more out of curiosity than anything else, as I have solved my original problem. I wanted a button the horizontal centre of the screen, with a text box to the left of it, using a Relative Layout. I am curious to know why if I have the following layout:</p><pre><code>    &lt;Button android:id=""@+id/pickTime""    android:layout_width=""wrap_content""    android:layout_below=""@id/to_button""    android:layout_centerHorizontal=""true""    android:layout_height=""wrap_content""/&gt; &lt;TextView android:id=""@+id/timetext""    android:layout_width=""wrap_content""    android:layout_below=""@id/to_button""    android:layout_toLeftOf=""@id/pickTime""    android:layout_alignTop=""@id/pickTime""    android:layout_height=""wrap_content""/&gt;</code></pre><p>The TextView is not displayed, yet if I subsitute:</p><pre><code>  android:layout_toLeftOf=""@/id/pickTime""</code></pre><p>to</p><pre><code>  android:layout_alignParentLeft=""true""</code></pre><p>It does display (albeit left justified to the left margin rather than right justified to the to the button which I was originally expecting). Is this an issue with all Relative Layouts (i.e always have to define widgets in a set order), or is it just something to do with text needing to be read from the left?</p>","278638","","","","","2010-10-02 14:16:01","does textview not like to be placed to left of another widget","<android><layout><textview>","1","0","","",""
"3846093","1","","","2010-10-02 14:13:41","1","430","<p>I'm trying to create a new xml file in <code>/res/drawable</code> (developing for android in eclipse)</p><p>the message i get is ;</p><blockquote>  <p>Multiple annotations found at this  line:    - Premature end of file.    - error: Error parsing XML: no       element found</p></blockquote><p>When I'm in the right folder i press New>File , then I name it to <code>ic_tab_artists.xml</code>, and right after i get the message ^</p><p>So, what am i doing wrong?</p>","447595","","119895","","2010-10-02 14:54:54","2010-12-20 13:45:46","Problem with creating new xml files","<android><eclipse><htc>","1","0","","",""
"3846134","1","","","2010-10-02 14:23:17","2","1073","<p>I have done a small camera app with autofocus in Android. On my nexus one everything works fine but on the htc desire it crashes when i call takePicture() from a Camera object. Here is the stacktrace:</p><pre><code>10-02 11:53:58.476: DEBUG/QualcommCameraHardware(19448): takePicture(479)10-02 11:53:58.476: DEBUG/QualcommCameraHardware(19448): val_ril_status = 0,val_wimax_status = 0,val_hotspot_status = 0,val_low_temp_limit = 5.000000,val_batt_temp = 34.000000,val_low_temp_limit = 15,val_batt_cap  = 6310-02 11:53:58.476: DEBUG/QualcommCameraHardware(19448): FLASHLIGHT is ENABLED10-02 11:53:58.476: ERROR/mm-camera-config-proc(19448): liboemcamera: config_proc_ctrl_command: SEVERE ERROR: attempt to override pending command 1310-02 11:53:58.586: INFO/DEBUG(19299): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***10-02 11:53:58.586: INFO/DEBUG(19299): Build fingerprint: 'htc_wwe/htc_bravo/bravo/bravo:2.2/FRF91/226611:user/release-keys'10-02 11:53:58.586: INFO/DEBUG(19299): pid: 19448, tid: 19628 &gt;&gt;&gt; /system/bin/mediaserver &lt;&lt;&lt;10-02 11:53:58.586: INFO/DEBUG(19299): signal 11 (SIGSEGV), fault addr c0debadd10-02 11:53:58.586: INFO/DEBUG(19299):  r0 c0debadd  r1 deadbeef  r2 17a3a85e  r3 17a3a85e... and so on, and so on....</code></pre><p>i have continous autofocus, but i call takePicture() in the callback function of autofocus, so autofocus should be finished when i am calling takePicture()after this error the following happens:</p><pre><code>10-02 11:53:58.916: WARN/Camera(19604): Camera server died!10-02 11:53:58.916: WARN/Camera(19604): ICamera died10-02 11:53:58.916: WARN/AudioSystem(92): AudioFlinger server died!10-02 11:53:58.916: WARN/AudioSystem(92): AudioPolicyService server died!10-02 11:53:58.916: ERROR/Camera(19604): Error 100 </code></pre><p>and then i get really a lot of MPlayer errors.</p><p>So i am guessing, that there is some kind of race condition or something. Can someone explain what the <strong>pending command 13</strong> is the error message is talking about?</p><p>there is another stackoverflow question about this: <a href=""http://stackoverflow.com/questions/2277149/nexus-1-taking-photo-severe-error-in-config-proc-ctrl-command-liboemcamera"">http://stackoverflow.com/questions/2277149/nexus-1-taking-photo-severe-error-in-config-proc-ctrl-command-liboemcamera</a> but there is no answer over there.</p><p>can someone help me?</p><p>much obliged,Anton</p>","300572","","","","","2012-04-19 16:19:54","Android Taking picture crashes on HTC Desire","<android><camera><autofocus>","1","2","","",""
"3846147","1","","","2010-10-02 14:27:07","0","539","<p>I am trying to develop application for android . how I can get the defining line of textfile ? For instance  I have to read 15. line of textfile. how I can do that?</p>","464638","","","","","2010-10-02 14:54:11","Reading defining line of text file in java","<java><android><text-files>","1","2","","",""
"3846334","1","5127836","","2010-10-02 15:20:01","1","527","<p>Hello I have made a map overlay class and have overridden the onTouchEvent method that looks like this :</p><pre><code> @Override    public boolean onTouchEvent(MotionEvent event, MapView mapView)     {           //TO-DO here we will capture when the users        //has pointed a point to go..        if(event.getAction() != MotionEvent.ACTION_MOVE){            GeoPoint p = mapView.getProjection().fromPixels(                    (int) event.getX(),                    (int) event.getY());                Geocoder geoCoder = new Geocoder(                    getBaseContext(), Locale.getDefault());                try {                    List&lt;Address&gt; addresses = geoCoder.getFromLocation(                        p.getLatitudeE6()  / 1E6,                         p.getLongitudeE6() / 1E6, 1);                    String add = """";                    if (addresses.size() &gt; 0)                     {                        for (int i=0; i&lt;addresses.get(0).getMaxAddressLineIndex();                              i++)                           add += addresses.get(0).getAddressLine(i) + ""\n"";                    }                    Log.e(""##################"",                            ""screen touched: lat:""+(p.getLatitudeE6()/ 1E6)+""long:""+(p.getLongitudeE6()/ 1E6));                    showMap((p.getLatitudeE6()/ 1E6),(p.getLongitudeE6()/ 1E6));                    Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();                }                catch (IOException e) {                                    e.printStackTrace();                }                   return true;        }else            return false;    }        </code></pre><p>the problem is that the map is drawn every time I do a gesture on the map, I would like to do this only when I click on a spot on the map and not when I drag the map, is this approach correct? how to implement this?regards maxsap</p>","234898","","","","","2011-02-26 15:43:32","android map overlay question","<android>","1","2","1","",""
"3846338","1","","","2010-10-02 15:20:26","15","45376","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3725501/how-to-crop-the-parsed-image-in-android"">How to crop the parsed image in android?</a>  </p></blockquote><p>I have an image in my res/drawable folder and I would like to crop (i.e. slice out some part of the image) the image when loading it into an ImageView. However I am unsure how to do this, any suggestions?</p>","655814","","1041533","","2013-03-18 07:56:02","2013-03-18 07:56:02","How to crop an image in android?","<android>","5","0","7","2012-03-17 11:51:32",""
"3846688","1","3848958","","2010-10-02 17:02:42","2","2173","<p>I want to write an Android application that can display some data received(polled) from an internet resource.</p><p>I guess that I need to write some logic that will periodically call and get data from some endpoint, parse the response and display it. Is there a good tutorial for all this steps?</p><p>I know very little about Android programming at the momment and maybe it is better to start with something simpler. I just want to know what to look for while learning an gather some resources on this.</p>","359665","","359665","","2011-09-01 07:41:36","2011-09-01 07:41:36","Android app using data from webservice","<android><web-services><communication>","1","0","","",""
"3846898","1","3857600","","2010-10-02 17:57:29","0","800","<p>Hai  Friends,             I am parsing the url to display the contents in it, my requirement i have to display the each content  in separate textviews.</p><p>For Instance:           Let us assume the contents in that url are FootBall, Carom , chess, VolleyBall and so on . I want to display FootBall as a individual textview similarly others. so i cannot declare the textviews in xml what i usually do.</p><pre><code>(&lt;TextView  android:text="" "" android:layout_width=""wrap_content""                 android:gravity=""center_horizontal"" android:paddingLeft=""7dp"" android:layout_height=""wrap_content""               /&gt;).</code></pre><p>so i planned to create textview via java code  This is my parsing code which parse the url contents and store the result in a string array namely san_tagname; depending upon the length of this variable i want to create number of textviews.</p><pre><code>     List&lt;Message_category&gt; l_obj_tagname = new ArrayList&lt;Message_category&gt;();        l_obj_tagname = obj_parse1.parse_tagname();        System.out.println(""l_obj_tagname""+l_obj_tagname.size());        String[] san = new String[l_obj_tagname.size()];        Iterator&lt;Message_category&gt; it_id1 = l_obj_tagname.iterator();        i=-1;        while (it_id1.hasNext()) {            i++;            san[i] = it_id1.next().toString();            System.out.println(""Id=""+san[i].toString());            san_tagname[i]=san[i];            //vm.setTitle(it.next().toString());        }         for(int z=0;z&lt;san_tagname.length;z++)        {            //how to create textview here ...............        }</code></pre><p>I am really struggling on this, pls help me regarding on this friends.................</p><p>Thanks In AdvanceTilsan The Fighter...</p>","424413","","","","","2010-10-04 17:24:19","How to create Custom Text Views in android?","<android>","2","0","1","",""
"3846913","1","","","2010-10-02 18:01:54","0","25","<p>I want to display a text for two seconds that tells the user that he has made a mistake.I want the behavior of an popup behavior of an AlertDialog. However the alert should close automatically after two seconds and accept no on screen clicks that close it.</p><p>What class should I use?</p>","25282","","","","","2010-10-02 18:04:57","Showing additional object for a second in android","<android>","1","0","1","",""
"3846915","1","3849565","","2010-10-02 18:02:48","2","2072","<p>I am developing a new application which hopefully will use a barcode reader to scan and find books. I will then use the ISBN information to get more information.</p><p>The intents work and I can scan 2d barcodes ok but not the 1d barcodes of books which I know scan fine using the full application. </p><p>This is my code. I have tried it without putting the intent extras and it doesn't change anything.</p><pre><code>Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");intent.putExtra(""SCAN_MODE"", ""ONE_D_MODE"");startActivityForResult(intent, 0);</code></pre><p>Is there something obvious I am missing? The settings in the app also are selected on 1d scanning only.</p><p>Thanks</p>","425459","","425459","","2010-10-03 11:31:00","2010-10-03 11:32:41","ZXing doesn't read 1D barcode in Android app","<android><barcode-scanner><zxing>","2","0","","",""
"3846993","1","","","2010-10-02 18:21:59","3","2441","<p>I'm new to Android and i'm trying to inflate a layout in xml but i get a RuntimeException. I have cut out almost everything except for my activity class and the class extending SurfaceView.Can anyone tell me what i'm doing wrong?</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:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;com.hj.Panel    android:id=""@+id/SurfaceView01""      android:layout_width=""match_parent""      android:layout_height=""match_parent""/&gt;    &lt;/FrameLayout&gt;</code></pre><h2>Rita.java:</h2><pre><code>package com.hj;import android.app.Activity;import android.os.Bundle;public class Rita extends Activity {/** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);  }}</code></pre><h2>Panel.java:</h2><pre><code>package com.hj;import android.content.Context; import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.view.SurfaceView;class Panel extends SurfaceView {      private Paint mPaint;  public Panel(Context context) {    super(context);   }    @Override  public void onDraw(Canvas canvas) {              mPaint = new Paint();      canvas.drawRect(0, 0, 322, 644, mPaint);  }          } </code></pre>","464763","","","","","2010-10-06 20:53:05","Android inflating xml layout generates RuntimeException","<android><xml><inflate>","2","1","","",""
"3847002","1","3854294","","2010-10-02 18:24:09","0","794","<p>How i can return String value from onClick method?</p><pre><code>public class DialogWithInputBox extends Activity {                /** Called when the activity is first created. */                @Override                public void onCreate(Bundle savedInstanceState) {                    super.onCreate(savedInstanceState);                    setContentView(R.layout.main);                    final AlertDialog.Builder alert = new AlertDialog.Builder(this);                    final EditText input = new EditText(this);                    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>","278279","","","","","2010-10-04 10:22:39","Android: Returning data from dialog","<android>","1","0","","",""
"3847109","1","4913769","","2010-10-02 18:53:22","0","480","<p>In my app I have a ListView when user click on an item some action is performed.Now I want to make a context menu for list item with possibility to add this action to home screen as a shortcut.Could somebody offer me some link or a hint how to do this?</p>","120574","","","","","2011-02-06 14:10:47","Shortcut on the home screen to an action in my app","<android><screen><shortcut><home>","1","0","","",""
"3847331","1","","","2010-10-02 20:05:30","0","546","<p>I want to query commondatakinds.photo.photo for a specific contact id .. how should I put this?</p>","439002","","","","","2010-10-03 00:05:37","Android contacts api","<android><api><contacts><photo>","1","0","","",""
"3847548","1","3849774","","2010-10-02 21:10:54","1","2853","<p>I have ActivityLanding which calls an activity called ActivityFolder. In the intent I used putExtra(""folderId"", ""..."") (I know folderId is not the best example)</p><p>I can store that to a variable and use it just fine but if eventually my activity gets killed to save memory I may lose the folderId. When my activity gets launched again,, will the ""extras"" from the intent get preserved? Will the code below work fine?</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.folder);    onNewIntent(getIntent());}@Overrideprotected void onNewIntent(Intent intent) {    super.onNewIntent(intent);    setIntent(intent);    String folderId = intent.getStringExtra(""folderId""); // Might not be all digits    // load from server and fill in the blanks}</code></pre><p>If it <em>does</em> get preserved,, then can I change it using ASyncTask and it still work fine?</p><pre><code>private class MyAsyncTask extends AsyncTask&lt;String, Object, HashMap&lt;String, Object&gt;&gt; {.....................................................................................................................    @Override    protected void onPostExecute(HashMap&lt;String, Object&gt; result) {        if (this.isCancelled())            return;        .....................        .....................        .....................        getIntent().putStringExtra(""folderId"", """"); // The server wants us to change what folder we are looking at    }}</code></pre>","463304","","","","","2010-10-03 12:43:51","Question about activity lifecycle: onNewIntent / onSaveInstanceState","<android><android-lifecycle>","1","0","1","",""
"3847679","1","","","2010-10-02 22:00:15","2","2523","<p>I have a Service and a PreferenceActivity that allows the user to edit some preferences. I would like to restart the Service once the user is done with the PreferenceActivity. </p><p>I understand that I can register onChange listeners for individual preference changes, but I do not want to restart the Service as <em>each</em> preference changes. I would like to do this when the user is done editing all the preferences. Short of having a ""Apply Now"" button in the PreferenceActivity, I do not see a straightforward way of doing this.</p><p>Am I missing something fundamental here?</p><p>Thanks!</p>","464849","","","","","2011-06-23 16:54:21","Android: Service restart after preferences change","<android><service><preferences><restart>","2","0","","",""
"3847681","1","","","2010-10-02 22:01:54","0","394","<p>I'm very new to Android development and am trying to do something fairly simple, select from a picklist of tracks.</p><p>I have some code that in theory works, and this is as follows;</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setType(""vnd.android.cursor.dir/track"");this.startActivity(intent);</code></pre><p>This works perfectly on the emulator, however when running on my Galaxy S, I get the following exception.</p><pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.PICK typ=vnd.android.cursor.dir/track }</code></pre><p>I'm not really sure, nor can I seem to find how to correct the issue.</p><p>I apologise in advance if this is naivity on my part, but I'm just a bit puzzled that the code works on the emulator but not on the phone. Any advice or info would be gratefully received.</p><p>Many thanks in advance,</p><p>Neil.</p>","464850","","614807","","2011-09-14 07:05:49","2011-09-14 07:05:49","Problem with Pick intent and track list","<android>","2","1","","",""
"3847699","1","5904329","","2010-10-02 22:07:46","8","8425","<p>I have an app with Admob ads on it but I find that when I use it the ad almost never refreshes because I don't change activities, instead I just update a text view when buttons are pressed.  I have tried searching this on Google but keep comming up short.</p><p>I would like to tell the app to refresh the add occasionally, such as after two button clicks or something like that.  Does anyone know how to do this and potentially have some sample code for it?</p>","451037","","","","","2013-12-01 12:03:29","How to force Admob to refresh on Android","<android><admob>","4","0","","",""
"3847755","1","","","2010-10-02 22:23:01","0","474","<p>I'm trying to save attachment (mms and GMail)</p><pre><code>Uri uri; uri = Uri.parse(""content://mms/part/"" + mmsPartId);  uri = Uri.parse(""content://gmail-ls/messages/email@gmail.com/messageId/attachments/0.1/BEST/true"");InputStream inputStream = getContentResolver().openInputStream(uri);</code></pre><p><strong>openInputStream</strong> works fine for mms, but for GMail i got error: ""open attachments that are on the sd card with the direct path to the attachment""</p><p>I don't understand what ""direct path to the attachment""?</p>","301249","","","","","2010-11-15 11:05:08","Difference between 2 URI","<android><uri>","1","0","","",""
"3847970","1","3848202","","2010-10-02 23:48:15","0","1300","<p>I'm currently using the event</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent ev){</code></pre><p>To provide feedback from the user for game I'm writing.  This event fires off some game control events that take some time to complete (because there is animation involved).  The problem I'm having is during the animation if I keep touching the screen (AKA firing this event), I will get a timeout error:</p><p>10-02 21:58:30.776: ERROR/ActivityManager(67): Reason: keyDispatchingTimedOut</p><p>Basically while the animation is running, I do not need this event, although it would be nice to queue it.</p><p>What can I do to prevent the timeout and either queue the event, or temporarily disable it?</p><p>Thanks.</p>","432209","","","","","2013-08-26 17:45:05","How do I temporarily disable/bypass the Android OnTouchEvent","<java><android><eclipse><events><ontouchevent>","3","1","","",""
"3847979","1","3849682","","2010-10-02 23:53:12","14","6649","<p>I have a background image about 100 x 100 that I want to center in an Android app. Is there a way to do this?</p><p>I'm thinking it would greatly help with orientation changes for simple apps.</p>","348261","","348261","","2010-10-03 01:14:22","2010-10-03 12:21:47","Centering a background image in Android","<android><background><orientation><center>","1","0","6","",""
"3848040","1","3848058","","2010-10-03 00:20:38","4","3712","<p>I'm trying to parse a file from the web on Android using the DOM method. </p><p>The code in question is:</p><pre><code>try {    URL url = new URL(""https://www.beatport.com/en-US/xml/content/home/detail/1/welcome_to_beatport"");    InputSource is = new InputSource(url.openStream());    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();    DocumentBuilder db = dbf.newDocumentBuilder();    Document document = db.parse(is);    document.getDocumentElement().normalize();} catch(Exception e) {    Log.v(TAG, ""Exception = "" + e);}</code></pre><p>But I'm getting the following exception:</p><pre><code>V/XMLParseTest1(  846):Exception = org.xml.sax.SAXParseException: name expected (position:START_TAG &lt;null&gt;@2:176 in java.io.InputStreamReader@43ea4538) </code></pre><p>The file is being handed to me gzipped. I've checked the <code>is</code> object in the debugger and its length is 6733 bytes (the same as the content length of the file in the response headers) however if I save the file to my harddrive from the browser it's size is 59114 bytes. Furthermore if I upload it to my own server which doesn't gzip XML-s when it serves them and set the URL the code runs just fine.</p><p>I'm guessing that what happens is that Android tries to parse the gzipped stream.</p><p>Is there a way to first unzip the stream? Any other ideas?</p>","179570","","179570","","2013-01-15 14:58:03","2013-01-15 14:58:03","Handling gzipped content on Android","<java><android><gzip>","2","1","1","",""
"3848148","1","3848305","","2010-10-03 01:12:14","36","84507","<p>I have an array of integers in the activity A:</p><pre><code>int array[] = {1,2,3};</code></pre><p>And i want to send that variable to the activity B, so i create a new intent and use the putExtra method:</p><pre><code>Intent i = new Intent(A.this, B.class);i.putExtra(""numbers"", array);startActivity(i);</code></pre><p>In the activity B i get the info:</p><pre><code>Bundle extras = getIntent().getExtras();int arrayB = extras.getInt(""numbers"");</code></pre><p>But this is not really sending the array, i just get the value '0' on the arrayB. I've been looking for some examples but i didnt found anything so.</p>","446234","","2180161","","2013-07-26 14:39:54","2013-07-26 14:39:54","Sending arrays with Intent.putExtra","<android><android-intent><activity><bundle>","2","0","15","",""
"3848226","1","6670506","","2010-10-03 01:53:10","2","3274","<p>Tried to create a random method that would query the database, obtain the number of rows in the database, and then grab a random number between 1 and the total number of rows to fetch a specific item in the database.  It works alright, but not great, if there are less than ten entries in the database it will repeat the same entry about 4 out of ten times.  I think I need a lead on a better method.</p><pre><code> number = mDbHelper.getCount(mDbHelper.mDb); Random generator = new Random();  n = generator.nextInt((int) number); if(n &lt;= 1){   n = 1; }</code></pre><p>Any ideas?</p>","436204","","","","","2011-07-13 12:52:44","android random number problem","<android>","2","0","","",""
"3848536","1","","","2010-10-03 04:01:53","0","398","<p>I have a layout like this:</p><pre><code>&lt;LinearLayout android:background=""mybackgroundimage.jpg""&gt;    ...    &lt;LinearLayout android:weight=1&gt; &lt;!-- another layout to group the                images below and give it weight=1 --&gt;        &lt;ImageButton android:background=""item1bg.png"" .../&gt;        &lt;ImageButton android:background=""item2bg.png"" .../&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The images item1bg and item2bg fade from full image to completely transparent. The desired effect is to have the image blending to the background. </p><p>I've verified the images and they look OK when you open them with whatever. But when applied in the button, they show artifacts in the blending section: some green vertical transparent lines. </p><p>I tried setAlpha(0) but the artifacts remain.</p><p>Any ideas on why this happens and/or how to solve it? </p><p>Thanks!Llappall</p>","284556","","","","","2011-08-17 05:34:14","ImageButton showing artifacts in transparent image","<android>","1","0","","",""
"3848641","1","3848654","","2010-10-03 04:45:21","0","450","<p>My app has three tabs, A, B, C that have three distinct activities.</p><p>Tab A includes a list view. User can either select Tab B or scroll the list view in A, selecting a row will take him to Tab B with the position of the selected row.  </p><p>How can I detect in Tab B that the user has selected a row or clicked on Tab B. Clicking on Tab B selects a default,whereas selecting a row in A makes B do something special with the data. I could create a separate activity that is launched when a row is selected, but that is code duplication and I prefer trying to find out if B can detect how it was launched. </p>","327415","","","","","2010-10-03 04:54:26","Selecting a Tab activity two ways","<android><android-tabhost>","1","0","1","",""
"3848721","1","3849756","","2010-10-03 05:35:33","1","621","<p>I'm trying to put together an Android view that has several elements stacked on top of one another. Some of these elements need to have HTML formatting applied, and I plan to stack enough of them that they will run off the screen, requiring a ScrollView. As an example, I would expect the layout to look something like this:</p><pre><code>&lt;ScrollView&gt;    &lt;LinearLayout vertical&gt;        &lt;TextView /&gt;        &lt;Button /&gt;        &lt;Html /&gt;        &lt;TextView /&gt;        &lt;Button /&gt;        &lt;Html /&gt;        Etc...    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>The obvious choice up front for the HTML portion is a WebView, since it renders everything exactly as I would want to see it, but the problem is that the WebView begins to fall apart when used in a ScrollView. It's difficult to get it to even show up without some manual refreshing.</p><p>Given that, what would be the most effective way to display this type of content?</p>","25968","","21234","","2010-10-18 20:59:44","2010-10-18 20:59:44","HTML formatted content in a ScrollView","<android><webview><scrollview>","1","1","","",""
"3848751","1","","","2010-10-03 05:49:10","1","996","<p>Yes, I know. It sounds weird, but I can't think of any other way to explain it. </p><p>I start Activity MainActivity. It calls startActivity(B). B calls startActivity(C). In C, I have a button with an <em>onClickListener</em> that looks like this:</p><pre><code>startActivity(new Intent(getApplicationContext(), MainActivity.class));</code></pre><p>When I hit the button, I get to activity B, not Main!</p><p>LogCat shows this:<br>Activitymanager   Starting activity: ... MainActivity<br>ActivityManager   Starting activity: ... B</p><p>So, it looks like my MainActivity (A) gets started and then something-or-someone-mysterious starts activity B immediately. </p><p>Ideas? I'm at a loss...</p><p>Thanks!<br><em>Llappall</em></p><p>EDIT:A couple of notes to clarify:<br/>1) I'm not overriding any lifecycle methods in MainActivity. I just have onCreate.<br/>2) MainActivity's layout shows an image that covers the whole screen. I capture where the user touches in the image's OnTouchListener and, depending on that, I call different intents. The code looks like this:</p><pre><code>if (touchX &gt; 0 &amp;&amp; touchX &lt; 0.5 &amp;&amp; touchY &gt; 0.25    &amp;&amp; touchY &lt; 0.46) {    Intent i = new Intent(context, ShowListsActivity.class);    i.putExtra(""option"", 0);    startActivity(i);} else if // if the location of the click is different I call another .class</code></pre>","284556","","231716","","2011-12-19 19:27:56","2011-12-19 19:27:56","Android: startActivity() starting a ""chain"" of activities?","<android>","1","6","1","",""
"3848821","1","3870824","","2010-10-03 06:19:25","2","708","<p>Well, the title/subject pretty much covers the issue.  Using various examples and and the API on googlecode, it seems like my extended GLSurfaceView class ought to be a good place to work my onTouchEvent inputs but when I try to set variables involving getHeight() and getWidth() when I make the call to my ""where did the user touch class"", the getHeight() and getWidth() are zero.  I have verfied this by telling the class method to return the getHeight() or getWidth() int I passed it and it comes back as zero.  </p><p>I am using an extended SpriteTextRenderer to display the values from my ""where did the user touch class"", and I know that it is working well because because I can change the other method to return event.getX() or event.getY() and those values display and update just fine.</p><p>My question is, is the extended GLSurfaceView class the place where I should be asking to get the getHeight() and getWidth() values?</p>","464401","","","","","2010-10-06 08:48:36","In Java Android OpenGL ES, my extended GLSurfaceView sees getHeight()/getWidth() as 0","<java><android><opengl-es>","1","0","","",""
"3848824","1","3848832","","2010-10-03 06:22:38","4","1500","<p>In theory, can I write a game for iOS in openGL ES and expect to easily port it to Android? How about from Android to iOS?</p>","224988","","220819","","2010-10-03 06:27:12","2010-10-06 08:24:21","iOS OpenGL ES compatible with Android OpenGL ES?","<android><opengl-es><cross-platform><ios><compatibility>","2","2","","",""
"3848922","1","","","2010-10-03 07:09:15","2","287","<p>I have a database with 5 columns, 1 column which is a TEXT with the name of a drawable that is /res/drawable folder.</p><pre><code>    private void fillData() {    mCursor = db2.getAllAchievements();    startManagingCursor(mCursor);    String[] from = new String[]{achHelper.ROW_NAME, achHelper.ROW_DESCRIPTION, achHelper.ROW_POINTS, achHelper.ROW_TROPHY};    int[] to = new int[]{R.id.achTitle, R.id.achDescription, R.id.achPoints, R.id.trophy};    SimpleCursorAdapter classes =            new SimpleCursorAdapter(this, R.layout.ach_row, mCursor, from, to);    setListAdapter(classes);}</code></pre><p>R.id.trophy is a ImageView, how can I set the background image based on the data that is being pulled from achHelper.ROW_TROPHY? </p>","443376","","","","","2012-07-03 06:46:52","Android database setting ImageView","<android><database><imageview><setting>","1","0","","",""
"3849054","1","3849712","","2010-10-03 08:08:18","0","2277","<p>If found many tips about how to stream from classic url link, but nothing about ftp.Is it the same way to proced ?</p><p>Thanks you.AL. </p>","348175","","","","","2010-10-03 12:30:49","How to play video from ftp streaming file?","<android><ftp><video-streaming>","1","0","","",""
"3849124","1","3849746","","2010-10-03 08:40:15","0","308","<p>I have a class A which is responsible for fetching data from web services in android and i have a class B which is responsible for creating and rendering List View in android</p><p>Now how can i populate data on List View once the data is fetched successfully.well i have following options but which one is better .. (if someone has anyother then i don't mind)</p><blockquote>  <p>1) Create an intent of Class B and  pass the data that need to be  populated</p>    <p>2) Creating a static method int Class  B which will accept the data as an  argument and call setListAdapter</p></blockquote><p>in class B i have used Holder Patter to create ListActivity. ( for reference List14.java in samples of Android )</p>","405383","","","","","2010-10-03 12:37:24","passing object between ListView and Webservices class","<android>","1","0","","",""
"3849197","1","","","2010-10-03 09:16:31","3","2872","<p>In my application I have an activity to add/remove/edit records inside a <code>SortedMap</code>. The activity is implemented as an extension of <code>ListActivity</code>. I have implemented custom <code>ArrayAdapter</code> for the collection items.</p><p>Every <code>ListView</code> item (which corresponds to an underlying record) consists of <code>TextView</code>s, <code>EditText</code>s, and a <code>Button</code> to delete the record itself. The layout is roughly as follows:</p><pre><code>ListView----------------------------------------------------[TextView] [EditText] [TextView] [EditText] [Button]----------------------------------------------------[TextView] [EditText] [TextView] [EditText] [Button]</code></pre><p>My goal is to process the input a user types to the <code>EditText</code>s as soon as the user finished editing, i.e. when the user has navigate away from the <code>EditText</code> or the user has pressed back to dismiss the onscreen keyboard. </p><p>I have tried implementing this by handling <code>onFocusChanged</code>, to process the text visible in the <code>EditText</code>. However this method is not working well, <code>onFocusChanged</code> method is called very often and randomly, even for unselected &amp; unedited <code>EditText</code>s. This is probably due to <a href=""http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html"" rel=""nofollow"">this article on Android Blog</a> from this <a href=""http://stackoverflow.com/questions/2825571/android-edittext-in-listview"">StackOverflow question</a>.</p><p>Is there a better way to do this?</p>","398621","","398621","","2010-10-05 02:17:57","2013-11-13 20:47:06","How to correctly handle Android EditText input inside a ListView?","<android><listview><edittext><lost-focus>","1","0","3","",""
"3849320","1","","","2010-10-03 10:05:12","0","1746","<p>Iam new with Android, and writting a small application for tracking call events. Every time i try to bind the listner, the os forces the app to close unexspectly. What did i miss? Here is my code:</p><p>package com.example.helloandroid;</p><p>import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.telephony.CellLocation;import android.telephony.PhoneStateListener;import android.telephony.ServiceState;import android.telephony.TelephonyManager;import android.widget.TextView;</p><p>public class helloAndroid extends Activity {</p><p>TextView textOut; TelephonyManager telephonyManager; PhoneStateListener phoneStateListener;</p><p>@Override public void onDestroy(){  telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);<br> }</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);    setContentView(R.layout.main); // Get the UI    textOut = (TextView) findViewById(R.id.textOut); // Get the telephony manager    telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);    // Create a new PhoneStateListener    phoneStateListener = new PhoneStateListener() {     public void onCallForwardingIndicatorChanged(boolean cfi) {}     public void onCallStateChanged(int state, String incomingNumber) {}     public void onCellLocationChanged(CellLocation location) {}     public void onDataActivity(int direction) {}     public void onDataConnectionStateChanged(int state) {}     public void onMessageWaitingIndicatorChanged(boolean mwi) {}     public void onServiceStateChanged(ServiceState serviceState) {      String stateString = ""N/A"";         switch (serviceState.getState()) {         case TelephonyManager.CALL_STATE_IDLE:           stateString = ""Idle"";           break;         case TelephonyManager.CALL_STATE_OFFHOOK:           stateString = ""Off Hook"";           break;         case TelephonyManager.CALL_STATE_RINGING:           stateString = ""Ringing"";           break;         }         textOut.append(String.format(""\nonCallStateChanged: %s"", stateString));     }     public void onSignalStrengthChanged(int asu) {}     };    // Register the listener with the telephony manager    telephonyManager.listen(phoneStateListener,       PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR |       PhoneStateListener.LISTEN_CALL_STATE |       PhoneStateListener.LISTEN_CELL_LOCATION |       PhoneStateListener.LISTEN_DATA_ACTIVITY |       PhoneStateListener.LISTEN_DATA_CONNECTION_STATE |       PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR |       PhoneStateListener.LISTEN_SERVICE_STATE |       PhoneStateListener.LISTEN_SIGNAL_STRENGTH); }</code></pre><p>}</p>","465091","","","","","2010-10-03 10:26:55","telephonyManager.listen forces application to terminate","<android>","1","1","","",""
"3849343","1","5131992","","2010-10-03 10:12:09","2","20565","<p>I want to add a view inside a FrameLayout programmatically and to place it in a specific point within the layout with a specific width and height. Does FrameLayout support this? If not, should I use an intermediate ViewGroup to achieve this?</p><pre><code>int x; // Can be negative?int y; // Can be negative?int width;int height;View v = new View(context);// v.setLayoutParams(?); // What do I put here?frameLayout.addView(v);</code></pre><p>My initial idea was to add an AbsoluteLayout to the FrameLayout and place the view inside the AbsoluteLayout. Unfortunately I just found out that AbsoluteLayout is deprecated.</p><p>Any pointers will be much appreciated. Thanks.</p>","143378","","168868","","2013-04-03 17:34:13","2014-03-25 13:11:47","Place view inside FrameLayout in Android","<android><android-layout><framelayout>","5","1","2","",""
"3849355","1","","","2010-10-03 10:18:03","0","1225","<p>I am newbie. I'm sorry if i ask ridiculous question.</p><p>I want to have generic Adapter class implements <code>ListAdapter</code> . And I have to override some functions of it like <code>getView</code> .</p><p>getView function is i think the most important part and it is calling when it is rendering (like asp.net (I think)).</p><p>I have written some code in the simplest level below:</p><pre><code>package com.yeni.listAdapter;import android.app.ListActivity;import android.os.Bundle;public class baslangicAktivitesi extends ListActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //setContentView(R.layout.main);        setListAdapter(new NewAdapter(this));    }}</code></pre><p>And this is my generic ListAdapter class:</p><pre><code>package com.yeni.listAdapter;import android.content.Context;import android.database.DataSetObserver;import android.view.View;import android.view.ViewGroup;import android.view.ViewGroup.LayoutParams;import android.widget.LinearLayout;import android.widget.ListAdapter;import android.widget.TextView;public class NewAdapter implements ListAdapter {    private Context ctx;    public NewAdapter(Context _ctx) {        super();        ctx = _ctx;    }    @Override    public int getCount() {        // TODO Auto-generated method stub        return 0;    }    @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    public int getItemViewType(int arg0) {        // TODO Auto-generated method stub        return 0;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        TextView tv = new TextView(ctx);        tv.setText(""This text will be shown"");        LinearLayout lila = new LinearLayout(ctx);        lila.addView(tv,new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,                LayoutParams.WRAP_CONTENT));        return lila;    }    @Override    public int getViewTypeCount() {        // TODO Auto-generated method stub        return 0;    }    @Override    public boolean hasStableIds() {        // TODO Auto-generated method stub        return false;    }    @Override    public boolean isEmpty() {        // TODO Auto-generated method stub        return false;    }    @Override    public void registerDataSetObserver(DataSetObserver observer) {        // TODO Auto-generated method stub    }    @Override    public void unregisterDataSetObserver(DataSetObserver observer) {        // TODO Auto-generated method stub    }    @Override    public boolean areAllItemsEnabled() {        // TODO Auto-generated method stub        return false;    }    @Override    public boolean isEnabled(int position) {        // TODO Auto-generated method stub        return false;    }}</code></pre><p>The thing that i am wondering is how is the mechanism of ListAdapter and if i want to write template with xml in (i think it will be) <code>res-&gt;layout</code> how it should be (composite view that i want to write something ImageView and TextView?</p><p>Thank you very very much...</p>","104085","","104085","","2010-10-03 10:30:16","2010-10-03 11:13:44","How does generic ListAdapter works?","<android>","1","0","","",""
"3849607","1","3849619","","2010-10-03 11:51:01","10","4817","<p><code>setBackgroundColor()</code> only takes ints. I don't really know what int equals to what color.Is there a simple way to convert a string like <code>#2222FF</code> on runtime into an <code>int</code>?</p>","25282","","251173","","2013-08-05 20:25:55","2013-08-05 20:25:55","Converting android color string in runtime into int","<android>","1","0","","",""
"3849615","1","","","2010-10-03 11:54:40","3","513","<p>When i have an ImageButton and a drawable and i want to do something like the Drawer or Twitter where when i press the button and the corner of the image is highlighted over the edge, in drawer its yellow, in twitter its white. Like the one below.<br /><img src=""http://i.stack.imgur.com/oVZXz.png"" alt=""alt text""><br />How do i set my drawable without using a lot of images?</p>","258648","","","","","2010-10-03 12:33:32","Highlight edge on Drawable in Android","<android><android-widget>","1","0","","",""
"3849669","1","","","2010-10-03 12:17:08","1","1439","<p>I'm creating a news app for android where news data transfered to clients using xml. The problem is how can i embed news content inside xml ? News content contains html tag. Here is part of my xml data</p><pre><code>&lt;title&gt;xxx&lt;/title&gt;&lt;date&gt;xx&lt;/date&gt;&lt;content&gt;html here&lt;/content&gt;</code></pre>","431041","","","","","2010-10-03 12:19:53","Embed HTML in XML","<android><xml>","1","0","","",""
"3849705","1","3850389","","2010-10-03 12:29:38","2","1290","<p>i want to develop an Android application that will take the content from internet (server) and present it in the application.</p><p>(ex. i take the todays weather forecast, put the numbers in SQLite database or .txt file , put the database/txt file on internet server so when i open the application, the app connects&amp;downloads the database via the net and presents me with todays forecast)</p><p>If you can references me to some example/video tutorial/book that deals with this issue i will be very thankful! </p>","465149","","","","","2013-05-15 21:21:10","Updateing Android application content via internet?","<android><database><internet>","1","4","3","",""
"3849868","1","3850334","","2010-10-03 13:08:47","16","20491","<p>I am trying to autostart my nightclock application on charging using the following BroadcastReceiver implemented in the onPause() method:</p><pre><code>BroadcastReceiver test = new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        unregisterReceiver(this);        Intent i = new Intent(context, NightClock.class);        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        context.startActivity(i);       }           };registerReceiver(test, new IntentFilter(Intent.ACTION_POWER_CONNECTED));</code></pre><p>The onReceive() method is fired when the USB-cable is plugged in, but the activity doesn't start. However the log shows this:</p><pre><code>I/ActivityManager(   79): Starting activity: Intent { flg=0x10000000 cmp=com.meins.nightclock/.NightClock }</code></pre><p>Any ideas why the log says the activity is started, but nothing happens?</p>","415304","","760489","","2011-09-12 12:38:06","2013-05-21 09:30:33","startActivity() from BroadcastReceiver","<android><activity><broadcastreceiver>","2","2","4","",""
"3849876","1","3849925","","2010-10-03 13:10:17","0","1433","<p>Why doesn't the following code align with the center?What do I have to do to fix it?</p><pre><code>&lt;AbsoluteLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_gravity=""center""     android:id=""@+id/parent""     android:layout_height=""match_parent""     android:layout_width=""match_parent""     android:background=""@color/blue""&gt;&lt;RelativeLayout    android:layout_height=""wrap_content""     android:layout_gravity=""center""     android:layout_width=""wrap_content""&gt;    &lt;Button         android:layout_gravity=""center""         android:id=""@+id/Question01""         android:text=""12 + 23""         android:gravity=""center_vertical|center_horizontal""        android:layout_height=""70px""         android:lines=""1""         android:textSize=""40px""         android:layout_alignWithParentIfMissing=""true"" android:background=""@drawable/orange_button"" android:layout_margin=""5px"" android:layout_width=""230px"" android:textColor=""@color/blue""/&gt;&lt;/RelativeLayout&gt;&lt;/AbsoluteLayout&gt;</code></pre>","25282","","","","","2010-10-03 13:26:20","Aligning with center in android with hierarchical Layouts","<android><android-layout>","1","0","","",""
"3849909","1","3851346","","2010-10-03 13:19:32","3","218","<p>I am totally new to Android, and I am following this <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">tutorial</a>. My problem is that the Adroid Emulator does not show the Hello World text, it just displays ""ANDROID"" on the center of the screen and no buttons works. Is this a know problem, how do I get it fixed?</p><p>Thank you</p>","190803","","","","","2010-10-03 19:49:08","Hello World example not working on OS X","<android><android-emulator>","1","2","","",""
"3849996","1","3865555","","2010-10-03 13:46:55","4","784","<p>I am writing a game for Android and I think I have a fatal flaw in my architecture and/or code.</p><p>The architecture is basically two threads, one that just continuously draws the screen and the other than controls the movement of the drawables on the screen based on the user's touch screen input.</p><p>In the latter thread, I'm basically doing manual animation (insert correct term here), meaning I move the drawables on the screen via methods that change the Drawables Rect as the game progresses.  The ""no-no"" I believe I'm doing is inserting delays into these methods, so that it ""appears like an actual animation.""</p><p>This all works fine and dandy because I have no reason to process any user input during these animations, but it's really bugging me that I'm designing a flaw into a lot of hard work with my game.  I'm sure many of you can relate to this in terms of code design.</p><p>What is the proper way to design this ""manual animation"" so my code can still process user events (like touching the screen), while the animation is occurring?</p><p>Here is a reference example of one of my methods:</p><pre><code>public void BadAnimation() {        for (int k = 0; k &lt; mAnimationHeight; k++) {        for (int i = 0; i &lt; mRows; i++) {            for (int j = 0; j &lt; mCols; j++) {                if (myObject.mFlag[i][j]) {                    myObject[i][j].mRect.top++                }            }        }        try {              Thread.sleep(3);        }         catch (InterruptedException e) {              // TODO Auto-generated catch block              e.printStackTrace();        }    }}</code></pre>","432209","","","","","2012-01-04 21:21:59","How do I design ""manual animation"" into an Android game without code delays","<java><android><eclipse><animation>","2","0","","",""
"3850066","1","3850314","","2010-10-03 14:05:53","0","1119","<p>I am trying to make a stacked layout with a fixed header, expandable body and fixed footer. I am very close however the body section with the webview displays behind the footer rather than between the header and footer.  TIA</p><p>Jim</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/header""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;  &lt;LinearLayout   android:id=""@+id/header""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageView      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:src=""@drawable/icon"" /&gt;  &lt;TextView        android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:text=""Karen"" /&gt; &lt;/LinearLayout&gt; &lt;RelativeLayout   android:layout_width=""wrap_content""       android:layout_height=""fill_parent""      android:layout_below=""@id/header""      &gt; &lt;WebView      android:id=""@+id/webview""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:background=""#000000""  /&gt; &lt;LinearLayout android:id=""@+id/footer"" android:layout_width='fill_parent' android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true"" android:orientation=""horizontal"" android:background=""#000000""&gt;&lt;EditText  android:id=""@+id/inputText"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent""    android:text=""Is on the bottom""    android:layout_weight=""1""    android:textSize=""15sp""    /&gt;  &lt;Button  android:layout_width=""wrap_content"" android:layout_height=""fill_parent""  android:textSize=""15sp"" android:text=""send"" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","465199","","21234","","2010-10-03 14:08:32","2010-10-03 15:19:21","Help with stacked layout","<android><layout>","2","0","","",""
"3850165","1","3850358","","2010-10-03 14:35:54","1","1127","<p>this is the code for my custom provider,<br>mostly copied from the SDK notepad project<br>i cant understand why am i getting nullPointException,<br>why doesnt the provider instance get created?</p><p>thanks ! :)</p><h2>RegistrationProvider.java</h2><pre><code>package alon.beginner.registerform;import android.database.SQLException;import java.util.HashMap;import alon.beginner.registerform.RegistrationFormMetaData.Users;import android.content.ContentProvider;import android.content.ContentUris;import android.content.ContentValues;import android.content.Context;import android.content.UriMatcher;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteQueryBuilder;import android.net.Uri;import android.text.TextUtils;import android.util.Log;/** * Provides access to the database of registered users. * each user has a  * name, email , birthday date, a creation date and modification date */public class RegistrationProvider extends ContentProvider {  private static final String TAG = ""RegistrationProvider"";  private static final String DATABASE_NAME = ""register_yourself.db"";  private static final int DATABASE_VERSION = 1;  private static final String USERS_TABLE_NAME = ""users"";   private static HashMap sUsersProjectionMap;  private static final int USERS = 1;  private static final int USER_ID = 2;  private static final UriMatcher sUriMatcher;  static {   sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);   sUriMatcher.addURI(RegistrationFormMetaData.AUTHORITY, ""users"", USERS);   sUriMatcher.addURI(RegistrationFormMetaData.AUTHORITY, ""users/#"", USER_ID);   sUsersProjectionMap.put(Users._ID, Users._ID);   sUsersProjectionMap.put(Users.FULL_NAME, Users.FULL_NAME);   sUsersProjectionMap.put(Users.EMAIL, Users.EMAIL);   sUsersProjectionMap.put(Users.BIRTHDAY_DATE, Users.BIRTHDAY_DATE);   sUsersProjectionMap.put(Users.CREATED_DATE, Users.CREATED_DATE);   sUsersProjectionMap.put(Users.MODIFIED_DATE, Users.MODIFIED_DATE);  }  /**    * this class helps to create, open , and upgrade the database files   */  private static class DatabaseHelper extends SQLiteOpenHelper{   DatabaseHelper(Context context){    super(context, DATABASE_NAME, null, DATABASE_VERSION);   }   @Override   public void onCreate(SQLiteDatabase db){    db.execSQL(""CREATE TABLE "" + USERS_TABLE_NAME + "" (""       + Users._ID + "" INTEGER PRIMARY KEY, ""       + Users.FULL_NAME + "" TEXT, ""       + Users.EMAIL + "" TEXT, ""       + Users.BIRTHDAY_DATE + "" TEXT, ""       + Users.CREATED_DATE + "" INTEGER, ""       + Users.MODIFIED_DATE + "" INTEGER""       + "");""  );     }        @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 users"");            onCreate(db);        }  }  private DatabaseHelper mOpenHelper;  @Override  public boolean onCreate() {   mOpenHelper = new DatabaseHelper(getContext());   return true;  }  @Override  public Cursor query(Uri uri, String[] projection, String selection,    String[] selectionArgs, String sortOrder) {      SQLiteQueryBuilder qb = new SQLiteQueryBuilder();      qb.setTables(USERS_TABLE_NAME);      switch(sUriMatcher.match(uri)){      case USERS:        qb.setProjectionMap(sUsersProjectionMap);        break;      case USER_ID:       qb.setProjectionMap(sUsersProjectionMap);       break;      default:       throw new IllegalArgumentException(""Unknown URI "" + uri);      }      //if no sort order is specified use the default      String orderBy;      if (TextUtils.isEmpty(sortOrder)){       orderBy = Users.DEFAULT_SORT_ORDER;      } else {       orderBy = sortOrder;      }      //get the Database and run the query      SQLiteDatabase db = mOpenHelper.getReadableDatabase();      Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy);      //Tell the cursor what uri to watch, so it knows when its source data changes      c.setNotificationUri(getContext().getContentResolver() , uri);   return c;  }//here i am  @Override  public String getType(Uri uri) {  switch(sUriMatcher.match(uri)){  case USERS:   return Users.CONTENT_TYPE;  case USER_ID:   return Users.CONTENT_ITEM_TYPE;  default:    throw new IllegalArgumentException(""Unknown URI "" + uri);  }  }  @Override  public Uri insert(Uri uri, ContentValues initialValues) {   //Validate the requested uri   if (sUriMatcher.match(uri) != USERS )    throw new IllegalArgumentException(""Unknown URI "" + uri);   ContentValues values;   if (initialValues != null){    values = new ContentValues(initialValues);   } else {    values = new ContentValues();   }   Long now = Long.valueOf(System.currentTimeMillis());   //Make sure that the fields are all set   if(values.containsKey(Users.CREATED_DATE) == false )    values.put(Users.CREATED_DATE, now);   if(values.containsKey(Users.MODIFIED_DATE) == false )    values.put(Users.MODIFIED_DATE, now);   if(values.containsKey(Users.FULL_NAME) == false )    throw new IllegalArgumentException(""Missing a full name field"");   if(values.containsKey(Users.EMAIL) == false )    throw new IllegalArgumentException(""Missing an Email field"");   if(values.containsKey(Users.BIRTHDAY_DATE) == false)    throw new IllegalArgumentException(""Missing a birthday date field"");   SQLiteDatabase db = mOpenHelper.getWritableDatabase();   long rowId = db.insert(USERS_TABLE_NAME,Users.FULL_NAME, values);   if (rowId > 0){    Uri userUri = ContentUris.withAppendedId(Users.CONTENT_URI, rowId);    getContext().getContentResolver().notifyChange(userUri, null);    return userUri;   }   throw new SQLException(""Failed to insert row into "" + uri);  } @Override public int delete(Uri uri, String where, String[] whereArgs) {  SQLiteDatabase db = mOpenHelper.getWritableDatabase();  int count;  switch (sUriMatcher.match(uri)){  case USERS:   count = db.delete(USERS_TABLE_NAME, where, whereArgs);   break;  case USER_ID:   String userId = uri.getPathSegments().get(1);   count = db.delete(USERS_TABLE_NAME,       Users._ID + ""="" + userId +       (!TextUtils.isEmpty(where) ? "" AND ("" + where + ')' : """"),       whereArgs);   break;  default:   throw new IllegalArgumentException(""Unknown URI "" + uri);  }  getContext().getContentResolver().notifyChange(uri, null);  return count; } @Override public int update(Uri uri, ContentValues values, String where,   String[] whereArgs) {  SQLiteDatabase db = mOpenHelper.getWritableDatabase();  int count;  switch (sUriMatcher.match(uri)){  case USERS:   count = db.update(USERS_TABLE_NAME, values, where, whereArgs);   break;  case USER_ID:   String userId = uri.getPathSegments().get(1);   count = db.update(USERS_TABLE_NAME, values,      Users._ID + ""="" + userId + (!TextUtils.isEmpty(where) ?  "" AND ("" + where + ')' : """"),      whereArgs);   break;  default:    throw new IllegalArgumentException(""Unkown URI "" + uri);  }  getContext().getContentResolver().notifyChange(uri, null);  return count; }}</code></pre><h2>LogCat</h2><pre><code>10-03 14:25:14.476: INFO/ActivityManager(63): Start proc alon.beginner.registerform for activity alon.beginner.registerform/.RegisterForm: pid=287 uid=10041 gids={}10-03 14:25:14.488: INFO/AndroidRuntime(281): NOTE: attach of thread 'Binder Thread #3' failed10-03 14:25:15.388: INFO/ARMAssembler(63): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x34e7d0:0x34e8dc] in 893200 ns10-03 14:25:15.545: INFO/ActivityThread(287): Publishing provider alon.beginner.registerform.RegistrationFormMetaData: alon.beginner.registerform.RegistrationProvider10-03 14:25:15.623: WARN/dalvikvm(287): Exception Ljava/lang/NullPointerException; thrown during Lalon/beginner/registerform/RegistrationProvider;.10-03 14:25:15.634: WARN/dalvikvm(287): Class init failed in newInstance call (Lalon/beginner/registerform/RegistrationProvider;)10-03 14:25:15.634: DEBUG/AndroidRuntime(287): Shutting down VM10-03 14:25:15.634: WARN/dalvikvm(287): threadid=1: thread exiting with uncaught exception (group=0x4001d800)10-03 14:25:15.660: ERROR/AndroidRuntime(287): FATAL EXCEPTION: main10-03 14:25:15.660: ERROR/AndroidRuntime(287): java.lang.ExceptionInInitializerError10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at java.lang.Class.newInstanceImpl(Native Method)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at java.lang.Class.newInstance(Class.java:1429)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.installProvider(ActivityThread.java:4494)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.installContentProviders(ActivityThread.java:4281)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4237)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.access$3000(ActivityThread.java:125)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.os.Handler.dispatchMessage(Handler.java:99)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.os.Looper.loop(Looper.java:123)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at java.lang.reflect.Method.invokeNative(Native Method)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at java.lang.reflect.Method.invoke(Method.java:521)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at dalvik.system.NativeStart.main(Native Method)10-03 14:25:15.660: ERROR/AndroidRuntime(287): Caused by: java.lang.NullPointerException10-03 14:25:15.660: ERROR/AndroidRuntime(287):     at alon.beginner.registerform.RegistrationProvider.(RegistrationProvider.java:45)10-03 14:25:15.660: ERROR/AndroidRuntime(287):     ... 15 more</code></pre>","465209","","","","","2010-10-03 15:27:42","ContentProvider Instantiation failure - NullPointerException","<android><android-contentprovider>","1","0","","",""
"3850171","1","","","2010-10-03 14:37:09","1","350","<p>I'm currently working on a game for android.</p><p>I have three ImageView's next to each other, they're positioned next to each other using the ""android:layout_toRightOf"". The views are located within a RelativeLayout tag. Each of these views are centered into the middle of the screen using ""android:scaleType=""fitCenter"""" and they fill the entire screen. </p><p>I'm attempting to implement a horizontal scroll from one view to another so that I basically get one view on my screen at a time. </p><p>Here is the code that I'm currently using</p><pre><code>&lt;HorizontalScrollView android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:fillViewport=""true""      android:scrollbars=""none""&gt;  &lt;RelativeLayout android:id=""@+id/GameBg""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;     &lt;ImageView  android:id=""@+id/GameImageContainer3""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:scaleType=""fitCenter""      android:layout_toRightOf=""@+id/GameImageContainer2""      /&gt;     &lt;ImageView  android:id=""@+id/GameImageContainer2""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:scaleType=""fitCenter""      android:layout_toRightOf=""@+id/GameImageContainer1""      /&gt;      &lt;ImageView  android:id=""@+id/GameImageContainer1""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:scaleType=""fitCenter""      /&gt;  &lt;/RelativeLayout&gt;&lt;/HorizontalScrollView&gt;</code></pre><p>What I'm currently getting is three images next to each other -- but sometimes they take up less then an entire screen. I want both the left and right padding to be correct, so that I can only see one image at a time.</p><p>Any ideas?</p>","109097","","","","","2011-02-02 14:19:13","Scrolling between views","<android><relativelayout><horizontalscrollview>","2","0","","",""
"3850206","1","","","2010-10-03 14:49:28","12","2764","<p>I live near the border and work in another country. So I have selected my own network provider as the favorite. However, I notice that it sticks with the provider for as long as it can. So when I start from my country I keep my network even when I am across the border, however, when I go the other way around, it will keep the foreign network even when my favorite network is already available. I know this, because when I want to manually select it, it is available from the list.</p><p>Now, I would like to create an application that would automatically search for my preferred network when it is roaming, each time it connects to another cell tower.Now I understand, that previously I could have listened to Cell Location changed with a broadcast receiver, but that is now impossible. (Which is a pity)And I read from this:<a href=""http://stackoverflow.com/questions/2373727/programatically-connecting-to-another-network-operators"">http://stackoverflow.com/questions/2373727/programatically-connecting-to-another-network-operators</a>That it seems that I would be unable to select another provider from an application for security reasons. (At least with documented api calls).</p><p>However, I don't care about public api or not, because I don't intent to distribute this in the Android Market. It is just an app to make MY life easier, will probably open up the source code, so other people can use it if they want to.</p><p>I could use some hints, to get this working though.So maybe there are other things that are broadcast for which I can listen to, like signal strength or something, this would start my code to check if I can switch network.I would prefer this to work as a Broadcast Receiver, I also have read that when using Cell location from a Service that I won't get updates when the screen is turned off, which in this case defeats the purpose.</p><p>And then, I would greatly appreciate some hints/pointers as for how to search the Android source for stuff that I can use to select the network automatically.</p>","392445","","151019","","2012-01-11 13:52:28","2012-08-08 09:24:56","Really Prefer Network: select my own network provider as soon as it is available (from code)","<android><networking>","1","3","","",""
"3850350","1","3862622","","2010-10-03 15:26:38","2","1074","<p>I have a reservation wizard in android, when i say wizard i mean i have multiple activities (meaning screens) that are passed from one to another until booking is complete. in each step of the way my info may be invalid and so ill have to back track 2-3 activities and start all over, all the activities i back tracked should be destroyed, they may need to invalidate a singleton data container that they filled with their data.I thought of 2 ways to do this:</p><ol><li>start all activities related to the wizard with <code>startActivityForResult()</code> so i get notification when an activity is finished and with which error code (finished OK or error occurred) and act accordingly (for instance: if in the middle an activity fails it will return failed and the previous one will return failed as well until i get to the wizard's first activity where i either declare the error with a dialog or show the 'thank you' screen.)</li><li>I can send an react on intents with certain parameters so i have a 'close and clean' intent message that close down the previous activity etc...</li></ol><p>which way is better, any other interesting\efficient way to do this ?</p>","312288","","85661","","2012-10-10 19:53:15","2012-10-10 19:53:15","Best way to terminate a wizard in android","<android><ipc><wizard><android-intent>","1","3","1","",""
"3850395","1","3850439","","2010-10-03 15:36:01","6","12431","<p>I have a view. I want to place a bitmap image as its background image. I was not able to do that.</p><pre><code>//My code is belowBitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.grape);part1 = new View(this); Bitmap map2 = Bitmap.createBitmap(targetWidth, targetHeight,Bitmap.Config.ARGB_8888);canvas.drawBitmap( bitmapOrg,new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()), new Rect(0, 0, targetWidth, targetHeight), null);part1.setBackgroundResource(map2); //i couldn't place map2 as bgresource to my view part1</code></pre><p>can anyone help?</p>","655814","","61332","","2010-10-03 15:39:21","2010-10-03 17:16:03","place a bitmap as background of a view","<android>","1","0","2","",""
"3850751","1","3850984","","2010-10-03 17:18:39","1","186","<p>I'm working on an Android application with an activity that uses a tab layout. There are two tabs which switch between the content being shown in a <code>ListView</code> below.</p><p>This means that the two tab specifications point to the same <code>ListView</code> for content, <code>R.id.main_list</code>:</p><pre><code>&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/main_list"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>This somewhat works - if I switch to tab #2 and back to #1, I can see the ListView and my database code gets the right data based on the selected tab. However, when the activity launches, the ListView can't be seen before tabs are changed. This is obviously a problem.</p><p>What's the least hacky way to get around this?</p>","235960","","","","","2010-10-03 18:21:33","Using the same view on both tabs in Android","<android><android-listview>","1","0","","",""
"3850793","1","","","2010-10-03 17:31:14","0","594","<p>I'm considering writing an internet filter app for Android which would allow parents to block objectionable web sites on their children's phones.  I'm assuming this would also be useful on GoogleTV when it comes out.  How would I even start?  Is it possible to block access to specific sites without requiring the user to root their phone?</p><p>I'm guessing I could do it with iptables, but that would probably require a rooted phone.</p><p><strong>Edit:</strong></p><p>If the phone was rooted, how would one go about doing this?  Are ip tables the way to go or is there a better way?</p>","240566","","240566","","2010-10-04 20:28:25","2011-11-11 17:07:17","How would I write an app to block specific webisites on Android?","<android><filter><internet><content><google-tv>","3","0","","",""
"3850795","1","3851161","","2010-10-03 17:31:40","3","8408","<p>I am trying to create an android app that will let me display images fullscreen with next and previous buttons on top to change between them.</p><p>Can anybody point me to some tutorials where i can find instructions on something similar?</p><p>If not, what is the best method to use to get the images into the app? I have tried several ways from creating object classes for the images and instantiating it with a drawable in each using the Bitmap Factory to return the image but that won't work.</p><p>I am a beginner to android and could really use reference material but can't find anything useful that covers this subject.</p>","353674","","","","","2012-12-04 11:18:03","android image ""viewer"" app","<android><image><gallery>","2","0","2","",""
"3850799","1","","","2010-10-03 17:32:17","32","8931","<p>What is the difference between Uses-Permission and Permissions tag in AndroidManifest.xml .I understood uses-permission tag as it is used to  access Internet,Location from our application. But I did not understand when and why should we use permissions tag in Manifest file and what is  its difference from uses-permission.</p><p>Thanks in Advance,</p>","429501","","","","","2010-10-03 19:06:43","Diffrences between Uses-Permission and Permissions tag in AndroidManifest.xml","<android>","1","0","9","",""
"3850959","1","3852259","","2010-10-03 18:16:12","1","1345","<p>I'm very very new on Android development.</p><p>I have designed two xmls layouts (main.xml and secondpage.xml). I want to go from main.xml to secondpage.xml when the user click on a button.</p><p>I've found on android's documentation the following methods:</p><ul><li><a href=""http://developer.android.com/reference/android/app/Activity.html#startActivity%28android.content.Intent%29"" rel=""nofollow"">startActivity</a><br/></li><li><a href=""http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent,%20int%29"" rel=""nofollow"">startActivityForResult</a><br/></li></ul><p>and more and more methods...</p><p>Should may use these methods to navigate throug pages?</p><p>Thank you.</p>","68571","","","","","2010-10-04 01:10:02","Navigation through pages","<android><navigation><android-layout>","1","0","","",""
"3850999","1","","","2010-10-03 18:24:28","6","5570","<p>I've got an app on the Android Market and have been using the SoundPool classes for the sound effects. I've noticed that, of all the parts of the Android API, this seems to have caused me the most problems. For example:</p><ul><li><p>HTC Desire has problems playing WAV files (this causes it to lock up randomly). Using .ogg files fixes this</p></li><li><p>On the Droid, if you exceed the number of channels in the init setup call:</p></li></ul><p><code>mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);</code></p><p>the handset would lock up. If you can imagine the difficulty in debugging that! On a handset I don't own. It required a lot of selfless help from my customers. Changing the '4' to '16' eliminated the problem. I have no doubt that if 16 sounds were played simultaneously it would still crash. Thankfully the chances of that are low.</p><ul><li>Also getting random crashes on various devices. I have got a catlog from one of my customers which has 'Heap overflow' errors pertaining to playing sounds.</li></ul><p>I have now changed my sound manager to use MediaPlayer. This seems to be working out fine for now. I am just wondering if any other developers are experiencing these problems?</p>","465286","","464988","","2011-04-21 23:13:20","2011-04-21 23:13:20","Android Soundpool problems","<android><soundpool>","1","0","1","",""
"3851111","1","","","2010-10-03 18:52:13","1","489","<p>My app used to use a standard ListView, and registerForContextMenu(getListView()) and everything worked just fine.</p><p>I needed to change my app to accommodate nested lists so I replaced the ListView with ExpandableListView.  I changed the Activity to ExpandableListActivity. I also changed my adapter to a tree adapter and implemented a custom view class to populate the list with (based on a FrameLayout view).</p><p>Suddenly my context menus stopped working and I can't figure out why.  I can't long click on any of my list items and I'm completely stuck on where to start looking.</p>","131871","","","","","2012-05-17 18:43:41","Why won't expandablelistview work with context menus?","<android><listview><expandablelistview>","1","0","1","",""
"3851234","1","3851382","","2010-10-03 19:19:04","0","646","<p>I have a <strong>ViewFlipper</strong> with two <strong>ImageView</strong> widgets. I have set the in and out animation as <strong>android.R.anim.slide_in_left</strong> and <strong>android.R.anim.slide_out_right</strong></p><p>Now when the two ImageViews have two different drawables, then the animation is sleek and smooth. But when I set the both the ImageViews to the same Drawable, the screen flickers. Why is this happening and how do I prevent it?</p>","421372","","","","","2011-04-08 08:33:07","ViewFlipper FLICKERING problem?","<android><drawable><viewflipper>","1","0","","",""
"3851253","1","3851429","","2010-10-03 19:25:10","2","2005","<p>I'm having trouble reading in from a .CSV file in an android app. Mainly a ""FileNotFound"" error. Where would be the easiest place to put the file, and what would be the address to it. I have been messing around with a few different places but have had no luck.</p><p>Can anyone point me in the right direction?</p>","348261","","","","","2010-10-03 20:16:54","Locations of CSV files in Android","<android><csv><location>","1","0","","",""
"3851363","1","3852226","","2010-10-03 19:54:44","6","2694","<p>Several of my Android applications show the following type message in the logcat output:</p><pre><code>I/UsageStats(   59): Unexpected resume of com.totsp.test while already resumed in com.totsp.test</code></pre><p>In this case I created the default Hello World app by letting the ADT tool generate it, and it still gets this message. I am not doing anything special in <em>onCreate</em> and don't even have any other methods defined. </p><p>I realize this is an INFO level message, and it doesn't appear to hurt anything, but I was curious what was going on so I made a test application that keeps track of the <em>onResume</em> invocations. It is indeed re-resuming when this occurs. I'm wondering why this this occurs? While I haven't noticed a problem (other than these annoying log messages), it seems like it could be using more resources than necessary to do all this stuff an extra time.  </p><p>I have searched and read a similar question here on SO, and the answer there seems dubious to me: <a href=""http://stackoverflow.com/questions/2606470/unexpected-resume-of-package-name-while-already-resumed-in-package-name-erro"">http://stackoverflow.com/questions/2606470/unexpected-resume-of-package-name-while-already-resumed-in-package-name-erro</a>. Specifically, no, you don't want to use <em>android:configChanges=""orientation""</em> because that is just subverting the orientation tear down/resume, rather than fixing it. Even the documentation notes ""this attribute should be avoided and used only as a last-resort"" (<a href=""http://developer.android.com/intl/de/guide/topics/manifest/activity-element.html#config"">http://developer.android.com/intl/de/guide/topics/manifest/activity-element.html#config</a>). </p><p>Also I have seen thread in the Android dev group where Mr. Murphy says the ""unexpected resume"" is ""benign"": <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/567410dbfcc163c2"">http://groups.google.com/group/android-developers/browse_thread/thread/567410dbfcc163c2</a>. </p><p>I'll dig into the source when I get a chance, but I figured I would first just ask the all-knowing hivemind and see if someone already knows: why does this occur, and is it truly benign?  </p>","252676","","252676","","2010-10-04 00:04:52","2012-11-20 03:35:54","What is going on with the ""Unexpected resume of <packagename> while already resumed"" message on Android?","<android>","2","3","","",""
"3851420","1","","","2010-10-03 20:13:05","2","8095","<p>I have a list view which uses a custom adapter in order to show my custom content. Its layout is the following.</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;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;ImageView            android:id=""@+id/itemimage""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""5""            android:scaleType=""fitCenter""/&gt;        &lt;TextView            android:id=""@+id/itemdescription""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""10dp""            android:textSize=""16sp""            android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;        &lt;TextView            android:id=""@+id/itemtext""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""TEXT CONTENT""            android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;    </code></pre><p>I would like that the listview only showed the view with the ids itemimage and item description, keeping the itemtext hidden.The idea is to have an onclicklistener on each item of the list, in order to expand that item so it shows the itemtext content. I know I should use Tweening animation in order to expand/collapse each item, but I can't figure out how to do that.</p><p>Can anyone help me with it? If you need more code snippets, feel free to ask.</p><p>Thanks in advance.</p>","465361","","","","","2012-12-25 17:35:52","Adding animation to a ListView in order to expand/collapse content","<android><listview><animation><collapse>","2","1","3","",""
"3851507","1","3870685","","2010-10-03 20:37:27","8","26742","<p>How can I change the text of an Android button widget within code and not the XML file?</p>","314554","","445131","","2013-09-15 18:26:19","2013-09-25 14:51:51","Android widget: How to change the text of a button","<android><button><widget>","3","1","3","",""
"3851551","1","","","2010-10-03 20:53:30","1","280","<p>What is best way to implement custom SoftKeyboard, so it recognize where user push, and where user release, and then use both coordinates to determine character?E.g. if i push Q, then move finger to E, then release. Application should get 2 coordinates. Basically simple line. </p><p>One way is to make it trough buttons and using onTouch(View v, MotionEvent event) method when button is touched. Then dispatch MotionEvent.Other way is to handle all input, and draw layout as ""image"". Same as above example, but just without buttons.Or maybe there is some better way (as I'm new to android and don't know it well yet)?</p><p>Thank you for any help or advices.</p>","177634","","","","","2010-10-03 20:53:30","android softkeyboard onTouch()","<android><input><touchscreen><android-softkeyboard><soft-keyboard>","0","0","","",""
"3851560","1","","","2010-10-03 20:56:18","4","11215","<p>I'm new to android development - using a book called Sams Teach Yourself Android Application Development in 24 hours. Followed it so far but got stuck trying to use SharedPreferences. </p><p>In the folder src/com.androidbook.triviaquiz I've got a file called QuizActivity, in it I've got the following:</p><pre><code>package com.androidbook.triviaquiz;import android.app.Activity;import android.os.Bundle;import android.content.SharedPreferences;public class QuizActivity extends Activity {    public static final String GAME_PREFERENCES = ""GamePrefs"";    SharedPreferences settings = getSharedPreferences(GAME_PREFERENCES, MODE_PRIVATE);    SharedPreferences.Editor prefEditor = settings.edit();    prefEditor.putString(""UserName"", ""JaneDoe"");    prefEditor.putInt(""UserAge"", 22);    prefEditor.commit();}</code></pre><p>This is what the book tells me to use, but it returns errors at the following points:    under the ""."" after the first 2 prefEditor statements,    under (""UserName"", ""JaneDoe"")    under (""UserAge"", 22);    and under ""commit""</p><p>I've looked on loads of websites for help but all seem to use the same code. What am I doing wrong?</p>","465381","","390989","","2010-10-03 20:57:18","2013-04-14 17:22:37","How to use SharedPreferences","<android><sharedpreferences>","2","0","0","2013-06-10 14:35:21",""
"3851576","1","","","2010-10-03 21:00:42","0","536","<p>I bought the Augen Gentouch78 to start dabbing in development for Android tablets, but this device is gravely excruciating to use (and I'm returning it). Is there a way to configure the emulator to tablet specs (namely Samsung Galaxy Tab)??</p>","399639","","","","","2011-06-24 13:34:54","Can I develop for Android Tablets without an actual tablet device?","<android><emulator><tablet>","2","0","","",""
"3851712","1","","","2010-10-03 21:41:28","8","8390","<p>I am trying to create a folder and several subdirectory within it on the SD Card... I then want to transfer files that I have stored in /res/raw to that folder... I addition, I want this to only happen once, the first time the program is ever run. I realize that this is ridiculously open-ended, and that I am asking a lot... but any help would be greatly appreciated.</p>","459921","","","","","2011-04-08 13:13:29","Android: How to create a directory on the SD Card and copy files from /res/raw to it?","<android>","2","0","4","",""
"3851802","1","3851836","","2010-10-03 22:16:53","3","3741","<p>I have an Android app with a ListView, and each row in the list has a TextView and a Button. What I want to do is add an OnClickListener to each Button in the ListView, but I can't figure out how to get some sort of reference to every Button... Can anyone please give me a hint?</p><p>Here's my XML that's bound to the ListAdapter:</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/row_text""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:textSize=""18sp""&gt;&lt;/TextView&gt;&lt;Button    android:id=""@+id/row_button""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentRight=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>And I tried something like this, but it doesn't work:</p><pre><code>SimpleCursorAdapter rows = new SimpleCursorAdapter(this, R.layout.row_layout, cursor, from, to);setListAdapter(rows);Button button = (Button) getListAdapter().getView(0, null, getListAdapter()).findViewById(R.id.row_button);button.setOnClickListener(new View.OnClickListener() {    @Override public void onClick(View v) {        Log.i(TAG, ""clicked"");    }}); </code></pre>","459550","","","","","2012-11-04 23:21:07","Android: Add event listeners to every item in a ListView","<android><event-handling><android-layout>","2","0","","",""
"3851954","1","","","2010-10-03 23:10:23","0","353","<p>I am new to Android programming and have done a lot of searching for the answer to this question however I can not find an answer.  Maybe I am using the wrong search terms because it seems like a pretty basic request.I my design (as an example), I would have two text fields defined in my relative layout followed by an image and I would like the image to span the remainder of the screen.  Here is what I have so far:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutandroid:id=""@+id/widget29""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ImageViewandroid:id=""@+id/widget38""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/widget37""android:layout_alignParentLeft=""true""&gt;&lt;/ImageView&gt;&lt;TextViewandroid:id=""@+id/widget37""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""second view""android:layout_below=""@+id/widget36""android:layout_alignParentLeft=""true""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/widget36""android:layout_width=""fill_parent""android:layout_height=""50px""android:text=""first view""android:layout_alignParentTop=""true""android:layout_alignParentLeft=""true""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>How do I tell my ImageView to span fill the remainder of the screen.  If I define the height and width as ""fill_parent"" it fills over the two text views.Thanks in advance for any help you can provide.</p><p>Jon</p>","465427","","","","","2010-10-04 06:18:59","Android UI Layout Question","<android><user-interface><layout>","2","0","","",""
"3852154","1","4939319","","2010-10-04 00:33:54","15","12645","<p>What I'm doing seems like it should be simple, but I'm still lost after I've read every possible Stackoverflow answer I can find and Googled every article I can find.</p><p>I'm using a preview SurfaceView and capturing an image from an activity that is set for screenOrientation=""landscape"" in my AndroidManifest.xml.</p><p>I followed the sample Camera app code and thought things were working until I tried my app on a few Motorola devices running 1.5.</p><p>I have the OrientationEventListener running OK and I use reflection to see if set the rotation as such:</p><pre><code>final int latchedOrientation = roundOrientation(mLastOrientation + 90);Parameters parameters = preview.camera.getParameters();JPLog.d(""Setting camera rotation = %d"", latchedOrientation);try {    // if &gt;= 2.0    Method method = Camera.Parameters.class.getMethod(""setRotation"",        int.class);    if(method != null) {        method.invoke(parameters, latchedOrientation);    }} catch(Throwable t) {    // if &lt; 2.0    parameters.set(""rotation"", latchedOrientation);}preview.camera.setParameters(parameters);</code></pre><p><strong>NexusOne (OS 2.2)</strong> - Works great.  latchedOrientation = 0, picture OK without any rotation in the EXIF header.</p><p><strong>T-Mobile G1 (OS 1.6)</strong> - Also works great.  latchedOrientation = 0, picture OK.</p><p><strong>Motorola Backflip (OS 1.5)</strong> - Image rotated.  latchedOrientation = 0, picture has no EXIF rotation in it.</p><p><strong>Motorola CLIQ (OS 1.5)</strong> - Image rotated.  latchedOrientation = 0, picture has no EXIF rotation in it.</p><p>What's going on with these Motorola devices?  I thought my problem was the Motorola camera driver wasn't rotating the images, so found the Sanselan EXIF reading classes for Android and was preparing to rotate them myself.  Funny thing is, there is EXIF headers but no rotation element.</p><p>If I set the rotation manually to 90 degrees, the images come out perfect the Motorola devices, but now the G1 and the NexusOne have images that are rotated 90 degrees (not what I want).  There has to be something I'm not getting here.</p><p>I'm doubting this is a 1.5 issue, or else someone would've posted info on it?</p>","465442","","","","","2012-06-15 08:43:43","Android camera unexplainable rotation on capture for some devices (not in EXIF)","<android><camera><rotation><orientation><capture>","5","0","15","",""
"3852191","1","","","2010-10-04 00:48:13","0","620","<p>I am trying to have my app create a directory on the root of the SD Card, if that directory does not already exist. When I run the app, the ""Creating Home Directory..."" toast notification displays, but the directory is not created... What am i doing wrong?? (P.S. permissions are set for writing to external storage)</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);     // Check SD Card for Read/Write            boolean mExternalStorageWriteable = false;            String state = Environment.getExternalStorageState();            if (Environment.MEDIA_MOUNTED.equals(state)) {                // We can read and write the media                mExternalStorageWriteable = true;            } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {                // We can only read the media                mExternalStorageWriteable = false;            } else {                // Something else is wrong. It may be one of many other states, but all we need                //  to know is we can neither read nor write                mExternalStorageWriteable = false;            }            if (mExternalStorageWriteable == false) {            //Toast Notification that SD Card is not Accessible              Context context = getApplicationContext();             CharSequence text = ""SD Card is NOT Accessable, Please Remount and Try Again"";             int duration = Toast.LENGTH_SHORT;             Toast toast = Toast.makeText(context, text, duration);             toast.show();            } else {             //Check If Home Dir Exists             boolean exists = (new File(""/AndGuard/"")).exists();             if (exists) {              Context context = getApplicationContext();                 CharSequence text = ""Accessing Data Files..."";                 int duration = Toast.LENGTH_SHORT;                 Toast toast = Toast.makeText(context, text, duration);                 toast.show();             } else {              Context context = getApplicationContext();                 CharSequence text = ""Creating Home Directory..."";                 int duration = Toast.LENGTH_SHORT;                 Toast toast = Toast.makeText(context, text, duration);                 toast.show();            // Create a directory; all non-existent ancestor directories are         // automatically created           // Create a directory; all non-existent ancestor directories are         // automatically created         File root = Environment.getExternalStorageDirectory();         boolean success = (new File(root,""directoryName"")).mkdirs();         if (!success) {             // Directory creation failed         }             }                     }</code></pre><p>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=""soapbox.sym3try.andguard""      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;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&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>I tried this as well, it didn't work, but it might be a step in the right direction as it creates the directory and populates it with a file from res/raw all in one step:</p><pre><code> 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 block          return false;         }         String path=""/sdcard/AndGuard/List1"";         String filename=""hosts"";         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;         }        return exists;    }</code></pre>","459921","","459921","","2010-10-04 03:55:23","2013-05-17 13:21:02","Trouble Creating a Directory on the SD Card","<android>","4","2","","",""
"3852414","1","","","2010-10-04 02:05:47","9","7971","<p>I would like to allow redirects to happen naturally in the WebView and only catch a new url if it is a happening because a user clicked something.</p>","445348","","","","","2012-11-14 17:16:14","In a WebView is there a way for shouldOverrideUrlLoading to determine if it is catching a redirect vs. a user clicking a link?","<android><webview>","3","0","5","",""
"3852463","1","3852846","","2010-10-04 02:22:12","0","759","<p>Since I already have a mobile phone (and contract), I bought a <strong>droid X</strong> <em>without a contract</em> so I could write apps for it.</p><p>I am confused about how to update this device to 2.2 Froyo so I can get started with developing.  Is there a guide or guidelines for the upgrade/installation process?  It looks like the <a href=""http://android.git.kernel.org/"" rel=""nofollow"">code is here</a>, but I need help understanding how to move it from git to device.</p><p>Thank you!  (FWIW, <a href=""http://stackoverflow.com/questions/468722/developing-for-a-windows-mobile-phone-without-a-contract"">this question</a> is very similar to mine... but for windows mobile)</p>","62255","","","","","2010-10-04 05:30:07","updating a device without cellular contract to froyo2.2","<android>","1","0","","",""
"3852530","1","3854621","","2010-10-04 02:44:28","2","5678","<p>I have an existing app that was working just fine on all phones.<br>I added the permission WAKE_LOCK so I could control when the app goesto sleep.<br>It worked fine on my HTC Hero, so I published the new update. Iimmediately started getting emails from Droid users that the app wouldnot launch anymore on their phones after they udpated. They get ""couldnot launch requested activity"" when the try to start the app, but itwill allow them to run the app once if they run it from the App Storebutton.<br>I removed the permission, and now Droid users can run the appnormally.<br>Here is my 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.krugism.EntitySensor""     android:versionName=""2.8"" android:versionCode=""12""&gt;   &lt;application android:icon=""@drawable/icon""       android:label=""@string/app_name"" android:debuggable=""false""       android:permission=""android.permission.WAKE_LOCK""&gt;       &lt;activity android:name="".EntitySensor""                 android:label=""@string/app_name""                 android:screenOrientation=""portrait""                 android:permission=""android.permission.WAKE_LOCK""&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="".SettingsPref"" android:label=""@string/app_name""&gt;       &lt;/activity&gt;   &lt;/application&gt;       &lt;uses-sdk android:minSdkVersion=""3""     /&gt;       &lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;&lt;/manifest&gt;</code></pre><p>Any ideas why this would be a problem on Droid phones? I have not heard of any other phones having this problem.<br>Thanks,Scott</p>","465483","","","","","2010-10-04 11:02:28","Added permission WAKE_LOCK, now problems on Droids","<android>","1","0","2","",""
"3852544","1","3852717","","2010-10-04 02:48:45","3","3735","<p>I want to copy the image drawn in one canvas (<a href=""http://developer.android.com/reference/android/graphics/Canvas.html"" rel=""nofollow"">details</a>) into another canvas. The commonly discussed solution of using bitmaps will not work because the Bitmap class does not have many of the important methods belonging to the Canvas class. Are there any other solutions?</p>","419109","","","","","2014-01-12 11:53:45","want to copy from one canvas to another","<android><gui><canvas>","1","1","","",""
"3853140","1","3853175","","2010-10-04 05:52:07","5","2763","<p>Just now I have developed an application and now I am ready to upload it to Android market,but when I am trying to upload, it shows the following error message:</p><blockquote>  <p>Market does not accept apk signed with the debug certificate. Create a new certificate that is valid for atleast 50 years. Market requires that the certificated used to sign the apk be Valid until at least October 22, 2033. Create a new Certificate.</p></blockquote><p>Now how do I fix this problem, so that I can upload the APK file to Android market successfully?</p>","379693","","812149","","2012-09-26 10:19:35","2012-09-26 10:19:35","Android Market - Error While Uploading APK file","<java><android><google-play><apk>","1","0","1","",""
"3853176","1","","","2010-10-04 06:00:31","3","618","<p>In my Android game I am loading websites in WebView by calling <code>webViewRowA.loadUrl(www.website.com)</code> and after some time (random) the device crashes with the following traceback.</p><pre><code>java.lang.NullPointerExceptionat android.webkit.BrowserFrame.getRequestInterceptor(BrowserFrame.java:1108)at android.webkit.FrameLoader.handleRequestIntercept(FrameLoader.java:426)at android.webkit.FrameLoader.handleHTTPLoad(FrameLoader.java:226)at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:124)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.os.HandlerThread.run(HandlerThread.java:60</code></pre>","395458","","418183","","2011-06-08 05:57:12","2011-06-08 05:57:12","WebView crashing after some time","<android><webview>","2","1","","",""
"3853200","1","3853284","","2010-10-04 06:06:44","2","1936","<p>I want a certain functionality when Enter key is pressed on a Button. When I override onKey(), I write the code to be executed for KEY_ENTER. This works fine.</p><pre><code>setupButton.setOnKeyListener(new OnKeyListener() {            public boolean onKey(View v, int keyCode, KeyEvent event) {                if (KeyEvent.KEYCODE_ENTER == keyCode)                {                    Intent setupIntent = new Intent(getApplicationContext(),SetUp.class);                    startActivityForResult(setupIntent, RESULT_OK);                }                return true;            }        });</code></pre><p>But no other keys work for the Button now like the Up, Down arrow keys etc. I know this is because I have overriden the onKey() for only ENTER.</p><p>But is there a way I can retain the functionality for all other keys and override only for some specific keys?</p><p>Note: All this is because my onClick() is not called when Enter key is pressed. Hence, I need to override onKey() itself.</p><p>-Kiki</p>","454660","","","","","2010-10-04 07:17:14","Android: Problem with overriding onKeyListener for a Button","<android><view><override><keylistener>","1","0","","",""
"3853370","1","","","2010-10-04 07:33:13","2","3049","<p>I want to play online radio in android application?It can be done RTMP.But i am not aware how to move ahead.Can some one throw light on this?</p><p>i am able to play static mp3 filehere  s below working code:</p><pre><code>package org.example.video;import android.view.KeyEvent;import android.view.View;import android.widget.VideoView;import android.app.Activity;import android.content.Context;import android.net.Uri;import android.os.Bundle;import android.widget.VideoView;import android.media.*;public class Video extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        setVolumeControlStream(AudioManager.STREAM_MUSIC);        Context appContext = getApplicationContext();        MediaPlayer urlPlayer = MediaPlayer.create(appContext,        Uri.parse(""http://naachradio.com/data/addSound.mp3""));        urlPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);    //  urlPlayer.prepare();        urlPlayer.start();     }    }</code></pre>","460236","","464988","","2011-04-27 22:14:26","2011-04-27 22:14:26","sample code to implement rtmp in android","<android><rtmp>","0","0","","",""
"3853472","1","3853814","","2010-10-04 07:51:26","28","33153","<p>I have been trying to create a directory in <code>/sdcard</code> programmatically, but it's not working.  The code below always outputs <code>directory not created.</code></p><pre><code>boolean success = (new File(""/sdcard/map"")).mkdir(); if (!success) {    Log.i(""directory not created"", ""directory not created"");} else {    Log.i(""directory created"", ""directory created"");}</code></pre>","397901","","750613","","2012-07-05 09:46:24","2014-01-31 15:22:07","Creating a directory in /sdcard fails","<android><file><directory><io>","7","0","9","",""
"3853639","1","3853771","","2010-10-04 08:25:45","0","948","<p>I have created a Library Project which I import into another project.In that Library Project at some point I retrieve it's android:versionNameTo do that you need to supply the package name. The problem arises when that code is executed when the Library Project is included within another project, then it seems that that code throws an exception :10-04 10:15:36.987: WARN/System.err(1407): getSoftwareVersion(), Caught Exception : android.content.pm.PackageManager$NameNotFoundException: mobilaria.android.LandenPlayerCodeBase.baseplayer</p><p>Thats the package name of the package of the Project Library... it seems it cannot find it even though the same code that is executing that call is part of the Library itself...</p><p>Does anyone have experienced something like this or has an idea on how to solve this ?</p>","162147","","","","","2011-04-29 09:28:23","Retrieve android:versionName from Library Project","<android><version>","2","0","","",""
"3853696","1","3870544","","2010-10-04 08:36:26","1","211","<p>I have a problem with designing an UI Android activity. There are two blocks of misplaced graphics on the left and right of the activity - they are two lines just bellow the titlebar with 1px height and about 5-10px width. They cause buttons to break at their left and right parts. I cannot figure out what the problem is. I am using Eclipse with Android SDK 0.9.9. The lines appear not only with the emulator but in a HTC Wildfire (Android 2.1). These lines are also visible in a newly created Android project (HelloWorld).</p><p>Sorry, but I was not allowed to post images, being too new here :)</p><p><a href=""http://www.ka-service.eu/MisplacedLines.png"" rel=""nofollow"">Link to the Broken widgets - note the button's left and right sides</a></p><p>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_height=""fill_parent"" android:layout_width=""fill_parent"" android:fitsSystemWindows=""true""&gt;&lt;TextView android:layout_height=""wrap_content"" android:text=""This text view should act as header  "" android:id=""@+id/expenseHeaderTxt"" android:layout_width=""fill_parent"" android:paddingLeft=""5px"" android:paddingRight=""5px""/&gt;&lt;ScrollView android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:layout_marginBottom=""50dip"" android:id=""@+id/expenseScrollView""&gt;  &lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:scrollbars=""none"" android:paddingLeft=""5px"" android:paddingRight=""5px""&gt;    &lt;EditText android:layout_height=""wrap_content"" android:id=""@+id/expenseAmountEdit"" android:hint=""@string/ExpenseAmountHint"" android:layout_width=""wrap_content"" android:layout_alignParentTop=""true"" android:layout_alignParentRight=""true"" android:selectAllOnFocus=""true"" android:digits=""0123456789"" android:inputType=""number|numberDecimal"" android:maxLines=""1""&gt;&lt;/EditText&gt;    &lt;EditText android:layout_height=""wrap_content"" android:id=""@+id/expenseTypeEdit"" android:layout_width=""fill_parent"" android:layout_toLeftOf=""@+id/expenseAmountEdit"" android:hint=""@string/ExpenseSpendTypeHint"" android:inputType=""text|textCapSentences"" android:maxLines=""1""&gt;&lt;/EditText&gt;    &lt;ToggleButton android:layout_below=""@id/expenseTypeEdit"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/expenseTypeSignToggle"" android:textOn=""@string/ExpenseTypeSignPlusToggle"" android:textOff=""@string/ExpenseTypeSignMinusToggle""&gt;&lt;/ToggleButton&gt;&lt;EditText android:layout_below=""@id/expenseTypeSignToggle"" android:layout_height=""wrap_content"" android:id=""@+id/expenseNoteEdit"" android:layout_width=""fill_parent"" android:hint=""@string/ExpenseNoteHint""&gt;&lt;/EditText&gt;&lt;/RelativeLayout&gt;&lt;/ScrollView&gt;&lt;RelativeLayout android:layout_marginTop=""-50dip"" android:gravity=""bottom"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:paddingLeft=""5px"" android:paddingRight=""5px""&gt;  &lt;Button android:id=""@+id/expenseAddBtn"" android:layout_width=""fill_parent"" android:text=""A button that should always be at the bottom"" android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","465616","","465616","","2010-10-04 10:29:06","2010-10-06 08:09:19","Two misplaced lines in UI for Android activity","<android>","1","4","","",""
"3853760","1","","","2010-10-04 08:47:01","4","2309","<p>I am using six tabs in tab view. In portrait mode tab size become very small .So i want to scroll the tabs in horizontal so that size of each tab will remain original . How we can do this?</p>","324225","","261392","","2011-07-20 02:19:42","2013-02-23 14:26:04","how to scroll the tabs in tabview","<android><scroll><tabbar>","2","1","","",""
"3853783","1","6905469","","2010-10-04 08:51:21","4","2422","<p>I have code for capturing a video clip on Android:</p><pre><code>Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);intent.putExtra(""android.intent.extra.durationLimit"", 30000);intent.putExtra(""EXTRA_VIDEO_QUALITY"", 0);startActivityForResult(intent, ActivityRequests.REQUEST_TAKE_VIDEO);</code></pre><p>This code works well on API 2.2, but the duration limit does not work on API 2.1 (Galaxy S). Is there some constant or parameter for setting this time, or is there a better approach than the one I am taking? </p><p>I ask because I found another application that works on the Galaxy S (called <code>Vibrant</code>) which can record video for a short amount of time.</p>","455877","","763080","","2011-08-03 03:15:45","2013-04-10 14:38:14","Max duration for capture video on android","<android><video><android-intent><video-capture>","2","3","1","",""
"3853794","1","3856199","","2010-10-04 08:53:51","13","13228","<p>How do you disable all touch events in an Android WebView (or scrolling in particular)? I would like the activity to handle all touch events.</p>","143378","","143378","","2010-10-04 09:10:59","2012-08-21 08:59:20","Disable WebView touch events in Android","<android><webview><touch>","2","0","5","",""
"3853841","1","3854106","","2010-10-04 09:02:13","0","1420","<p>I'm having a couple of problems with an alarm app I am developing.</p><p>The first thing that I think is a bit weird is that when an alarm goes of and wakes the phone up. These things happend. </p><p>oncreateonresumeonpauseonresume </p><p>Why are they run in that order?  The last two should not be called?  And this is what's causes me big trouble, because when i press home or back on the phone,  onPause is run, which I want to call finish() from. And that part works as it should, but that does not work when the phone wakes upp from sleep bacause of the onPause call...  </p><p>I would appreciate if someone could point me in the right direction, because I'm stuck.</p><p>Thanks in advance. </p>","465627","","","","","2011-01-07 18:43:46","How to handle Android activity lifecycle on wake up (alarm app)","<android><activity><wakeup><onresume>","3","0","","",""
"3854100","1","","","2010-10-04 09:48:30","0","992","<p>Hi I want to know what is the exact difference between Android, Windows mobile and Apple iOS and what art their limitation</p>","465670","","","","","2010-10-04 10:37:35","What is the Difference between Android, Windows mobile and Apple iOS?","<android>","2","5","","2010-10-04 11:13:21",""
"3854114","1","","","2010-10-04 09:50:49","1","1225","<p>i have an application to store files in root folder. do i need to to check the status of the root folder?? amd how can i store files in the root folder???</p>","462695","","","","","2011-09-26 13:12:35","need to store files in root folder","<android>","1","1","","",""
"3854130","1","5654918","","2010-10-04 09:54:51","2","501","<p>What is the fastest way to constantly send and receive data between 2 Android phones?</p><p>e.g. long, lat, IM or just some number.</p><p><strong>not for</strong> an always-on connection or push services. The app is running on foreground and waiting for data on both sides.</p>","178016","","178016","","2010-10-04 10:01:00","2011-04-13 20:01:48","Fastest way to constantly send and receive data between 2 Android phones","<android><p2p><instant-messaging>","1","3","2","",""
"3854163","1","","","2010-10-04 10:00:42","5","1763","<p>I've read the Android SDK and I've found that the MediaRecorder class can take input from a Camera, Audio or other source and compress it. Through the setOutputFile method you can specify where you want the data to be stored (File or URI), but what if I want to store that data in a memory buffer and send it over a connection? Or process it before sending it? I mean is there a way not to create a file but to use a memory buffer only?</p>","138606","","213269","","2011-08-12 09:13:27","2011-08-12 09:13:27","Android MediaRecorder and setOutputFile","<android><mediarecorder><output-file>","1","0","2","",""
"3854191","1","3854209","","2010-10-04 10:04:42","1","469","<p>Is it possible to set the width of the button while clicking the same button ?</p>","436765","","1470567","","2012-07-19 18:25:36","2012-07-19 18:25:36","Setting the width of the button in android","<android><button>","1","0","","",""
"3854213","1","","","2010-10-04 10:09:04","0","153","<p>In my application if i press a button map is loaded in my layout.again i press the button i got error like this.</p><p>onlu one map is added to a single map activity . how to solve this.</p>","462716","","","","","2010-10-04 10:43:45","Android Map View","<android>","1","0","","",""
"3854353","1","","","2010-10-04 10:29:36","5","2610","<p>I am developing an <code>AppWidget</code> where I need a <code>TextView</code> to display text as a marquee. I have tried using the following code (as one would do in a regular <code>Activity</code>), but the text does not scroll.</p><pre><code>&lt;TextView    android:layout_width=""150dip""     android:layout_height=""wrap_content""    android:text=""@string/marquee_forever""    android:singleLine=""true""    android:ellipsize=""marquee""    android:marqueeRepeatLimit=""marquee_forever"" /&gt;</code></pre><p>Can anyone tell me how to fix this?</p>","444538","","","","","2010-10-04 12:02:22","Marquee TextView on App Widget","<android><textview><marquee><appwidget>","3","1","1","",""
"3854506","1","4087628","","2010-10-04 10:49:04","1","338","<p>map activity allows one map in a activity, i have a scenario and hard time implementing it, i have a list of records and for each record i show google map now this is not becoming possible in lmap activity with list having earch row a seperate map?, how can this be achived any recomendations</p>","392574","","","","","2010-11-03 13:44:53","Maps in List in a map activity","<android><google-maps><map>","1","1","","",""
"3854529","1","","","2010-10-04 10:51:32","1","2194","<p>I'm sending an image from an Android phone to an AppEngine.  The AppEngine is throwing content exceptions. My process of elimination has failed so I suspect I've done something larger wrong.  Do I have a content type problem or a larger problem?</p><p>The AppEngine log shows the following errors depending on the content type [content type -->  resulting error]:</p><p>multipart/mixed stream  -->   org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found the request was rejected because no multipart boundary was found</p><p>image/jpg     -->  org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:  the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is image/jpg</p><p>binary/octet-stream  --> org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is binary/octet-stream</p><p>ANDROID CODE:</p><pre><code>static void apachePost(File file) {    File file = new File(directory, fileName);    try {        String url = ""http://chexserve.appspot.com/chexappengine"";        HttpClient httpclient = new DefaultHttpClient();        HttpPost httpPost = new HttpPost(url);        FileEntity entity = new FileEntity(file, ""multipart/mixed stream"");        httpPost.setEntity(entity);        Log.v(Constants.CHEX,                ""executing request "" + httpPost.getRequestLine());        HttpResponse response = httpclient.execute(httpPost);        Log.v(Constants.CHEX, ""received http response "" + response);        HttpEntity resEntity = response.getEntity();        httpclient.getConnectionManager().shutdown();    } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }</code></pre><p>APPENGINE CODE:</p><pre><code> public class ChexAppEngineServlet extends HttpServlet {private static final Logger LOG = Logger        .getLogger(ChexAppEngineServlet.class.getName());/** Processes the incoming request */@Overrideprotected void doPost(HttpServletRequest request,        HttpServletResponse response) throws ServletException, IOException {    LOG.info(""LOG: received post"");    System.out.println(""PRINTLN: received post "" + request);    try {        ServletFileUpload upload = new ServletFileUpload();        FileItemIterator iter;        iter = upload.getItemIterator(request);        if (iter.hasNext()) {            FileItemStream imageItem = iter.next();            InputStream imgStream = imageItem.openStream();            System.out.println(""PRINTLN: created imgStream "" + imgStream);            // construct our entity objects            Blob imageBlob = new Blob(IOUtils.toByteArray(imgStream));            MyImage myImage = new MyImage(imageItem.getName(), imageBlob);            System.out.println(""PRINTLN: created my image "" + myImage);        } else {            System.out.println(""PRINTLN: no file in post"");            LOG.info(""LOG: no file in post"");        }    } catch (FileUploadException e) {        LOG.info(""failed to parse post request: "" + e);        e.printStackTrace();    }}</code></pre><h3>Update:</h3><p>AppEngine is still rejecting the request with ""the request was rejected because no multipart boundary was found"" error after I changed the Android's entity line to:</p><pre><code>FileEntity entity = new FileEntity(file, ""multipart/mixed"");</code></pre><p>According to the documentation [http://hc.apache.org/httpclient-3.x/preference-api.html],""The multipart boundary string to use in conjunction with the MultipartRequestEntity. When not set a random value will be generated for each request.""</p><p>Further, there are no setter methods for the boundary.</p><p>How can I set the boundary?</p>","465723","","1288","","2011-03-03 12:18:31","2011-03-03 12:18:31","android to appEngine image content type","<android><google-app-engine><content-type>","1","0","2","",""
"3854531","1","","","2010-10-04 10:51:51","2","1049","<p>Hey I'm relatively new to Android programming (but not programming in general).</p><p>The Setup:HTC Wildfire (running Android 2.1)LM058 (RS232 Serial Cable Replacement)LM058 will later on be attached to a MCU but for now it's connected to my laptop (terminal)</p><p>The Goal:To connect Wildfire to LM058 to each other with a 'bidirectional-stream' (like: ""Hello from Android"", response: ""Hey from LM058"").</p><p>So far:I've managed to connect the two devices (paired), I can tell by the LEDs on the LM058. </p><p>Problem:I can't seem to send anything from my Wildfire to LM058, and can't write anything back. They are paired and Connected.</p><p>Code example:</p><pre><code>            String message = ""Hello message from client to server."";            byte[] msgBuffer = message.getBytes();            try {             outStream.write(msgBuffer);       Log.e(TAG, ""App was here!"");            } catch (IOException e) {                    Log.e(TAG, ""ON RESUME: Exception during write."", e);            }</code></pre><p>I have previously made a similar connection using a Windows Mobile succesfully, but Android seems to give me some trouble at this point.</p><p>If you can help me get passed this small hurdle I would be very gratefull!</p><p>Could it have anything to do with BaudRate, because when a link is established (paired and Connected) it should replace the two devices (as a simple RS232 cable), so my Terminal on the PC should be set to a certain BaudRate (since I can't seem to find Baud Rate in Android). But still I can't see anything, if Baudrate was wrong then I would be able to see something (even though it might be rubbish) or?</p>","465721","","465721","","2010-10-04 13:23:24","2012-05-14 18:40:37","Android 2.1 Bluetooth SPP to LM058 (Serial Cable Replacement) problem","<android><connection><bluetooth><serial-port>","1","0","4","",""
"3854597","1","3855038","","2010-10-04 11:00:17","1","364","<p>Current the google map display US as default. <img src=""http://i.stack.imgur.com/lTMAQ.png"" alt=""alt text""></p><p>I want to dispaly India as default on the map.How can i do this?</p>","443075","","443075","","2010-10-04 11:56:24","2012-01-14 12:25:59","How to draw default postion on the google map in android?","<android>","2","0","","",""
"3854599","1","3857211","","2010-10-04 11:00:21","6","758","<p>I created an Android app that serves the touch screen sensor data to a java client that is listening on Debian Lenny machine.</p><p>The client maps this data to locations on the screen just like a wacom pad does. I would like to out put the x_loc and y_loc to a file and have the file recognized as a device.(I foggily believe this is how it is supposed to work)</p><p>I have experience with Linux but have not had to create a device before. How do I tell Linux that this file is a mouse. Do I have to create a driver?</p>","310678","","","","","2010-10-04 16:57:16","Android phone as computer mouse","<android><io><debian>","2","0","3","",""
"3854610","1","","","2010-10-04 11:01:34","1","279","<p>friend's   I need help on posting the feed in facebook when string contains double quote,at the time facebook haven't accepting..for example if the content is something like this, <strong>Help on posting ""feed"" in facebook for android.</strong></p><p>suppose i need to post above at the time the feed title is getting null because of double quotes,how can i replace it with the same i have to post.</p><p>thanks in advance.</p>","393953","","","","","2010-10-04 12:37:14","how to make double quote to accepted by facebook feed post","<android>","1","0","","",""
"3854669","1","3855179","","2010-10-04 11:09:00","2","2502","<p>I want to display GridView (with text and image) and group of text box below grid view.</p><p>Problem is my gridview do not have fixed entries. It is varying between 1 &amp; 10. I want to resize it as per count of items in grid view. How can i do that? Where can i get height of gridview in JAVA code?</p><p>Also, i want to display my group of text boxes ALWAYS at bottom of activity. How can i do that?</p><pre><code>      </code></pre><p>Thanks,JC</p>","465751","","465751","","2010-10-04 11:25:34","2010-10-04 12:26:11","UI - How to display GridView and Linear layout togather","<android><gui>","1","0","","",""
"3854899","1","","","2010-10-04 11:44:33","1","855","<p>Like in Blackberry, do we have any API method (similar to <code>DeviceInfo.isSimulator()</code>) to check if device is simulator or real device?</p>","465778","","496830","","2011-11-10 17:44:16","2012-05-11 07:40:25","Checking if Android phone is simulator or real device","<java><android><android-emulator>","1","1","","",""
"3854939","1","3888722","","2010-10-04 11:51:31","1","613","<p>My activity has a set of buttons on the left half of the screen and a ListView on the right. Initially the focus is on the first button. When I browse the buttons by pressing DOWN arrow key and then press the RIGHT arrow key, the focus does not go to the topmost list item. Instead, the list item correspondingly on the right gets focused.</p><p>Is there a way that when I press the RIGHT arrow key, the focus goes to the topmost item on the Listview?</p><p>Any inputs would be appreciated!</p><p>Regards,kiki</p>","454660","","","","","2010-10-08 08:02:20","To make control(focus) flow from a Button to top of a list view in Android","<android><button><focus><arrow-keys>","1","0","","",""
"3854966","1","","","2010-10-04 11:55:11","6","6050","<p>I'm trying to load/reference images from the app's assets folder from within a HTML page in a WebView. Unlike in most of the examples the HTML page itself is not located in the assets folder but is loaded from a server via http. The background of this question are some performance improvements which should reduce the loading time (and the amount of transferred data) by loading static images directly from the device. I'm not sure if Android has some restrictions here because there's a certain possibility to exploit the app by allowing access to the local file storage from a remotely loaded webpage.</p><p>I first tried to load images using <code>&lt;img src=""file:///android_asset/myimage.png""&gt;</code> but this failed (for obvious reasons). My next attempt was to use a <code>ContentProvider</code> class and reference images using <code>&lt;img src=""content://com.myapp.assetcontentprovider/myimage.png""&gt;</code>. This ContentProvider is implemented as follows:</p><pre><code>public class AssetContentProvider extends ContentProvider{private static final String URI_PREFIX = ""content://com.myapp.assetcontentprovider"";public static String constructUri(String url) {    Uri uri = Uri.parse(url);    return uri.isAbsolute() ? url : URI_PREFIX + url;}@Overridepublic ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {    Log.d(""AssetContentProvider"", uri.getPath());    try {        return getContext().getAssets().openFd(uri.getPath().substring(1)).getParcelFileDescriptor();    } catch (IOException e) {        Log.d(""AssetContentProvider"", ""IOException for "" + uri.getPath());        throw new FileNotFoundException();    }}// more methods irrelevant for this post}</code></pre><p>When loading the HTML page I can see in the debug log that <code>openFile()</code> is actually triggered from the WebView and it returns a valid <code>ParcelFileDescriptor</code> object but still the image is not displayed. There are no error messages shown in the log which would tell me that WebView refused to load/display the image. Any ideas if and how this could work?</p>","465762","","","","","2011-02-20 16:28:24","Android: How to reference asset images from a remotely loaded html page in webview","<android><webview><assets><android-webview>","2","1","6","",""
"3854969","1","3855422","","2010-10-04 11:55:39","0","1223","<p>I have a database with 3 tables in it. They are ""Projects"", ""Contacts"" and ""Project Types"". I have a UI for creating (adding a record) a new project which adds a record to the ""Projects"" table. In that UI, I have a button to fetch Contact Names from the ""Contacts"" table which in turn displays a ListView of all Contacts. When the name is selected, it should go back to the Projects UI and the name has to be displayed in the EditText. However, i keep getting this in the EditText: <em>android.database.sqlite.SQLiteCursor@43d34310</em></p><p>Am attaching code snippets to the post for advice.</p><p>The ListActivity onCreate() code:</p><pre><code>public class ContactsList extends ListActivity {DBAdapter dbContactList;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.editproject_list);    dbContactList = new DBAdapter(this);    // Pull the data from the database    String[] fields = new String[]    {    dbContactList.TABLE_CON_NAME    };    int[] views = new int[]    {    android.R.id.text1    };    Cursor c = dbContactList.getAllContacts();    startManagingCursor(c);    // Set the ListView    ListAdapter prjName = new SimpleCursorAdapter(this,            android.R.layout.simple_list_item_1, c, fields, views);    setListAdapter(prjName);    dbContactList.close();}</code></pre><p>The onListItemClick code:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    // Get the item that was clicked    Intent selectedContact = new Intent();    Object o = this.getListAdapter().getItem(position);    String keyword = o.toString();    selectedContact.putExtra(""selectedcontact"", keyword);    setResult(RESULT_OK, selectedContact);    finish();}</code></pre><p>And the Projects UI code to start the activity for the ListView and for getting the results:</p><pre><code>public void onClickContactPicker(View target){    Intent contactPicker = new Intent(this, com.dzinesunlimited.quotetogo.ContactsList.class);    startActivityForResult(contactPicker, contact);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    String contact = data.getExtras().getString(""selectedcontact"").toString();    ((EditText)findViewById(R.id.txtProjectContacts)).setText(contact);}</code></pre><p>This is the query() from the DB Adapter</p><pre><code>public Cursor getAllContacts(){    Cursor cursor = null;    try    {        cursor = db.query(TABLE_CONTACTS, new String[] {                  TABLE_CON_ID, TABLE_CON_NAME, TABLE_CON_EMAIL,                TABLE_CON_EXPERTISE, TABLE_CON_CHARGES},                 null,                null,                 null,                 null,                 null);    }    catch (SQLiteException e)    {        Log.e(""Database.addRow"", ""Database Error: "" + e.toString());        e.printStackTrace();    }    return cursor;}</code></pre><p>Please advice on the solution to this.</p><p>Thanks in advance.</p>","450534","","236247","","2011-06-25 15:29:47","2011-06-25 15:29:47","Problem casting result from SQLite database into EditText","<android><sqlite><edittext>","1","2","1","",""
"3854982","1","","","2010-10-04 11:57:04","2","1208","<p>I'm using android-opencv (android-opencv -- <a href=""http://code.google.com/p/android-opencv/"" rel=""nofollow"">http://code.google.com/p/android-opencv/</a> -- ) , it was built successfully and worked like charm.Then I tried to use ""cvCanny"" to detect faces but the linker reported an error ""undefined reference"".</p><p>I tried lot's of things to fix this, but couldn't solve it.</p><blockquote>  <p>/home1/apps/c/opencv-android/opencv/obj/local/armeabi-v7a/libobjdetect.a(haar.o):  In function <code>cvHaarDetectObjects':  /home1/apps/c/opencv-android/opencv/modules/objdetect/src/haar.cpp:1127:  undefined reference to</code>cvCanny'  collect2: ld returned 1 exit status</p></blockquote><p>compile command</p><blockquote>  <p>/home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc  -nostdlib -Wl,-soname,libandroid-opencv.so -Wl,-shared,-Bsymbolic  /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/yuv420sp2rgb.o  /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/gen/android_cv_wrap.o  /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/image_pool.o  /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/gl_code.o  /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/Calibration.o /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/Processor.o  /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/objs/android-opencv/gen/cvcamera_swig.o  -Wl,--whole-archive  -Wl,--no-whole-archive  /home1/android-ndk-crystax/build/platforms/android-5/arch-arm/usr/lib/libmissing.a  /home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/lib/libstdc++.a  /home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/lib/libsupc++.a  /home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/libgcc.a  /home1/android-ndk-crystax/build/platforms/android-5/arch-arm/usr/lib/libc.so  /home1/android-ndk-crystax/build/platforms/android-5/arch-arm/usr/lib/libm.so  -Wl,--fix-cortex-a8   -Wl,--no-undefined -Wl,-z,noexecstack -L/home1/android-ndk-crystax/build/platforms/android-5/arch-arm/usr/lib  -L/home1/apps/c/opencv-android/opencv/bin/ndk/local/armeabi-v7a  -L/home1/apps/c/opencv-android/opencv/obj/local/armeabi-v7a  -Wl,-rpath-link=/home1/apps/c/opencv-android/opencv/obj/local/armeabi-v7a  -lfeatures2d  -lcalib3d -limgproc -lvideo  -lhighgui -lml -llegacy -lcore -lopencv_lapack -lflann -lobjdetect -lzlib -lpng -ljpeg -ljasper -llog -lGLESv2 -Wl,-rpath-link=/home1/android-ndk-crystax/build/platforms/android-5/arch-arm/usr/lib  /home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/lib/libstdc++.a  /home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/lib/libsupc++.a  /home1/android-ndk-crystax/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/libgcc.a  -o /home1/apps/c/opencv-android/opencv/android/obj/local/armeabi-v7a/libandroid-opencv.so</p></blockquote><p>When I inspect ""libimgproc.a"" with ""nm"" command, it says it has the symbol of ""cvCanny"" , but the linker complains ...</p><blockquote>  <p>nm  /home1/apps/c/opencv-android/opencv/obj/local/armeabi-v7a/libimgproc.a  | grep cvCanny </p>    <p>00000000 r <em>ZZ7cvCannyE19</em>_PRETTY_FUNCTION__ </p>    <p>00000001 T cvCanny</p></blockquote><p>Please give me a hint about this liking problem...? </p>","452033","","","","","2013-12-05 20:56:32","android-opencv cvCanny link error","<android><opencv>","2","0","1","",""
"3855037","1","","","2010-10-04 12:05:26","0","263","<p>I have some map pin in map view. i want to generate a callout on touch event over the map pin and want to show some info. in callout.. How to do it.. please give proper code..thnx..</p>","489762","","","","","2010-10-04 12:51:17","Google map in android","<android>","1","0","","",""
"3855112","1","3855251","","2010-10-04 12:17:37","1","861","<p>I'm trying to create a ""what's new"" pop-up dialog when users update (or, I guess, install) my app. I have the following bit of logic to check that the last installed version was then compare it to the current version, then save the current version as the ""last"" version (this is called at the end of the onCreate() of my ""first"" <code>Activity</code>):</p><pre><code>    int lastVersion = getPreferences(MODE_PRIVATE).getInt(LAST_VERSION, 34);    try {        int currentVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;        Log.d(getClass().getSimpleName(), ""Old Version = "" + lastVersion);        Log.d(getClass().getSimpleName(), ""New Version = "" + currentVersion);        if (currentVersion != lastVersion) {            // write the current version to the preferences so they won't see the popup again            getPreferences(MODE_PRIVATE)                .edit()                .putInt(LAST_VERSION, lastVersion)                .commit();            // tell the user the new thing            AlertDialog dia = new AlertDialog.Builder(this)                .setTitle(R.string.main_menu_new_title)                .setMessage(R.string.main_menu_new_body)                .create();            dia.show();        }    } catch (NameNotFoundException ex) {}        </code></pre><p>The problem is that no matter how many times I run the app I always get the default value for <code>lastVersion</code>, so the pop-up ALWAYS happens. Ideas?</p>","76835","","","","","2010-10-04 12:35:06","Android Preferences not saving","<android><preferences>","1","0","","",""
"3855151","1","3903754","","2010-10-04 12:21:52","3","9486","<p>I am using a media player.</p><p>I have the option for starting ,stopping and pausing the player. The problem I have is that I cannot find the option to resume the song from the point that it previously was paused..</p><p>Any help provide would be really helpful.</p>","438864","","1122476","","2012-08-20 03:14:03","2013-08-10 17:55:08","How to resume the mediaplayer?","<android><media-player>","3","0","6","",""
"3855187","1","3855657","","2010-10-04 12:26:42","15","7768","<p>Is it a bad idea to use printStackTrace() in Android Exceptions like this?</p><pre><code>} catch (Exception e) {    e.printStackTrace();}</code></pre>","398460","","","","","2012-05-10 20:32:58","Is it a bad idea to use printStackTrace() in Android Exceptions?","<java><android><exception><printstacktrace>","4","0","3","",""
"3855218","1","","","2010-10-04 12:31:19","14","10684","<p>I'm trying to get the real size of an image displayed in an image view. Actually my image is larger than the screen and the imageview is resizing the image to diplay it. I'm looking for this new size.</p><p>I've tried to override the onDraw method of the ImageView in a custom view but I'm not getting the correct height and width...</p><pre><code>public class LandImageView extends ImageView{    public LandImageView( Context context )    {        super( context );    }    public LandImageView(Context context, AttributeSet attrs)    {        super(context, attrs);    }    public LandImageView(Context context, AttributeSet attrs, int defStyle)    {        super(context, attrs, defStyle);    }    @Override    protected void onDraw( Canvas canvas )    {        super.onDraw( canvas );        int test = this.getWidth();        int test2 = this.getHeight();    }    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh)    {        super.onSizeChanged(w, h, oldw, oldh);    }}</code></pre><p>Do you have any clues ?</p>","465803","","21234","","2010-10-04 12:55:01","2013-03-21 03:16:54","Trying to get the display size of an image in an ImageView","<android><imageview><ondraw>","10","4","9","",""
"3855272","1","3855884","","2010-10-04 12:37:32","0","79","<p>I'm new to android and I was wandering is there a way to show a stream or a pic to the screen directly even without the manifest?</p><p>Or how do I load resources files without using the manifest on the Android platform?</p>","356350","","15825","","2010-10-04 13:26:09","2010-10-04 13:54:09","How do I show things directly to the screen in Android?","<android>","1","3","","",""
"3855578","1","5123755","","2010-10-04 13:18:09","26","8791","<p>I'm using <a href=""http://developer.android.com/reference/android/graphics/Matrix.html"">Matrix</a> to scale and rotate Bitmaps. Now I'm wondering what the difference between preconcat &amp; postconcat is, or more precisely the difference between:</p><ul><li><a href=""http://developer.android.com/reference/android/graphics/Matrix.html#postRotate%28float%29"">postRotate</a></li><li><a href=""http://developer.android.com/reference/android/graphics/Matrix.html#preRotate%28float%29"">preRotate</a></li><li><a href=""http://developer.android.com/reference/android/graphics/Matrix.html#setRotate%28float%29"">setRotate</a></li></ul><p>From what I could figure out so far setRotate always overwrites the whole matrix, while with preRotate and postRotate I can apply multiple changes to a matrix (e.g. scaling + rotation). However, either using postRotate or preRotate didn't cause any different results for the cases I used them.</p>","184367","","","","","2012-09-26 07:39:56","Android: Matrix -> what is the different between preconcat and postconcat?","<android><matrix>","3","0","11","",""
"3855729","1","","","2010-10-04 13:37:23","2","19236","<p>I am Having 8 Screenns.I have prepared  8 Activities for that.In First Activity I have given this codeTo Switch from Ist Activity to IIndOn Image Button gives On Click<pre><code>public void onClick(View v) { Intent myIntent = new Intent(v.getContext(), Activity2.class);     v.getContext().startActivity(myIntent);});</code></pre>What to do to Switch on 2nd Activity to 3rd Activity ,3rd Activity to 4th Activity , and so on.</p><p>Pls help me in regard.</p>","459161","","195802","","2010-10-04 13:40:09","2011-11-06 13:34:06","How to switch beteen Multiple Activities in Android","<android><activity><switching>","2","2","1","",""
"3855745","1","3856300","","2010-10-04 13:39:15","1","2214","<p>Is there a way to notify an activity/service of a force-close request right before it gets killed?</p><p>I mean when the user hits the force close button in Menu>Settings>Applications>Manage applications>app name>Force Close.</p><p>Thanks!</p>","445548","","","","","2010-10-04 14:42:52","Handle force close?","<android><kill><taskkill>","2","0","3","",""
"3855754","1","","","2010-10-04 13:40:04","1","394","<p>i have one  image button and image view. i have set the background of both. but the problem  is when i click on image view and image button  it is taking me to another activity but it is not showing that button was clicked.(any fade in color of image is not showing).</p><p>how can i do that?</p>","383597","","199972","","2012-06-12 22:02:19","2012-06-12 22:02:19","Android Image view click problem","<android><android-widget>","0","0","","",""
"3855885","1","","","2010-10-04 13:54:12","2","928","<p>I'm writing an application that needs to work on a variety of Android devices, each with their own carrier-specific themeing.</p><p>Unfortunately, there's a problem in that the tab themes for each device are incompatible --- stock Android uses light-background, dark-foreground for the selected tab, but the HTC Desire uses dark-background, light-foreground, which means that icons designed for one look wrong on the other. (Also, the HTC Desire's themes has a bug where they've forgotten to set the foreground colour for selected tabs, which means what you actually get is dark-background, dark-foreground. The system applications all appear to set the foreground manually, but I've observed this in several user applications.)</p><p>So, in order to make the application look right on all devices, I figure that I have two real options:</p><ul><li><p>completely customise my tab theme so we don't rely on the system theme at all</p></li><li><p>other</p></li></ul><p>I'd rather not do the first because that why our application won't match the other applications on the device. But unless there's a clever way around this issue, that's what I'll have to do. Any suggestions? I can't be the first person to come across this. Is there, for example, any way to make Android change the colour of the icons automatically?</p><p>(In addition, there's an issue I'm still working on which is that system applications appear to display tabs different to user applications: there must be some theme setting somewhere I haven't found yet, but after scouring the source code there's no sign of it. Pointers appreciated.)</p>","404568","","","","","2010-12-05 18:16:37","Correct Android tab appearance across platforms?","<android><themes><tabs><android-tabhost>","1","2","","",""
"3856075","1","3856147","","2010-10-04 14:15:08","1","1396","<p>I have a button which I want to occupy 75% of the screen:  </p><p><img src=""http://i.stack.imgur.com/6kFJr.jpg"" alt=""Panic""></p><p>On a 480x800 resolution screen this would be 360 pixels wide.<br>On a 280x320 resolution screen this would be 210 pixels wide.</p><p><em>How do I go about specifying this in my layout XML file?</em> </p><p>I understand there is a DIP unit of measurement, but does that also work to scale screen images for resolutions? What DIP measurement would I use for this, and do the images need to be saved at 160dpi.</p>","21574","","","","","2010-10-05 05:50:30","Scaling ImageButtons for multiple resolutions","<android><imagebutton>","2","1","","",""
"3856124","1","3856877","","2010-10-04 14:21:08","0","1490","<p>I have a web service, .asmx that when consumed gives a response in the form:</p><pre><code>&lt;lData&gt;&lt;name&gt;...&lt;/name&gt;&lt;posx&gt;..&lt;/posx&gt;&lt;posy&gt;...&lt;/posy&gt;&lt;/lData&gt;</code></pre><p>I use Ksoap2 to consume the web service in Android, and I see the response as a string anyType {lData=anyType{name=....;posx=....;posy=....;};}</p><p>So, I get the right data from my web service, but i don't know how to parse it correctly. I want to find a way to iterate through the different nodes. </p><p>I have tried to use a SAXParser, but can't seem to understand what I should use instead of the url. In the tutotirals I have followed the link to a xml-file on a url, but my url is only part ""finished"" since i need to consume the web service first.</p><pre><code>MyXMLHandler myXMLHandler = new MyXMLHandler();xr.setContentHandler(myXMLHandler);xr.parse(new InputSource(sourceUrl.openStream()));</code></pre><p>Is this above something I should use, but have another openStream?</p><p>Thanks for any help!</p><p>AK</p>","455479","","199122","","2010-10-04 14:43:06","2010-10-04 15:52:34","How can i parse through xml data from consumed web service Android?","<android><xml><service><xml-parsing>","1","0","","",""
"3856340","1","3857730","","2010-10-04 14:47:00","3","1765","<p>When calling Location.distanceBetween() and getting the initial and final bearing, what scale is the bearing in?  I'm getting negative values, which doesn't make sense to me.  Bearing goes from 0 to 360 degrees (relative or absolute, it doesn't matter).  The only thing I could think of is N through E through S is 0 through 180 degrees, and N through W through S is 0 through -180 degrees.</p><p>Can someone shed some light on this?</p>","100518","","","","","2010-10-05 05:31:41","What scale is initial bearing in returned from Location.distanceBetween()","<android><gps><bearing>","1","0","1","",""
"3856423","1","4628503","","2010-10-04 14:57:55","2","1278","<p>I'm looking for a way to show and hide the statusbar with an <code>onClickListener</code>, but only showing it works.</p><pre><code>WindowManager.LayoutParams lp = getWindow().getAttributes();if (isStatusbarVisible)    lp.flags = LayoutParams.FLAG_FULLSCREEN;else    lp.flags = LayoutParams.FLAG_FORCE_NOT_FULLSCREEN;getWindow().setAttributes(lp);isStatusbarVisible = !isStatusbarVisible;</code></pre><p>Hiding the statusbar using <code>FLAG_FULLSCREEN</code> seems to work only if the flag is set before calling <code>setContentView()</code>.</p><p>Is there another way to hide the statusbar?</p>","415304","","","","","2011-01-07 17:43:10","How to toggle the Statusbar?","<android><statusbar>","1","0","2","",""
"3856694","1","3904367","","2010-10-04 15:30:25","0","558","<p>It seems background images are automatically shrunk in Android, for example, I use setBackgroundDrawable to set background of a view:</p><pre><code>Drawable background = getBackground();myView.setBackgroundDrawable(background);</code></pre><p>Instead of shrinking, I want the image to be cropped to fit the screen size. How to do it? Thanks.</p>","111896","","","","","2011-08-27 07:45:16","Disabling background image shrinking in Android","<android>","1","0","","",""
"3856767","1","3856940","","2010-10-04 15:39:49","19","33307","<p>I have a service that is defined as:</p><pre><code>public class SleepAccelerometerService extends Service implements SensorEventListener</code></pre><p>Essentially, I am making an app that monitors accelerometer activity for various reasons while the user sleeps with his or her phone/device on the bed. This is a long-running service that MUST NOT be killed during the night. Depending on how many background apps and periodic processes occur during the night, android sometimes kills off my process, thereby ending my service. Example:</p><pre><code>10-04 03:27:41.673: INFO/ActivityManager(1269): Process com.androsz.electricsleep (pid 16223) has died.10-04 03:27:41.681: INFO/WindowManager(1269): WIN DEATH: Window{45509f98 com.androsz.electricsleep/com.androsz.electricsleep.ui.SleepActivity paused=false}</code></pre><p>I do not want to force the user to have 'SleepActivity' or some other activity in my app as the foreground. I can't have my service run periodically, because it is constantly intercepting onSensorChanged.</p><p>Any tips? source code is here: <a href=""http://code.google.com/p/electricsleep/"">http://code.google.com/p/electricsleep/</a></p>","127422","","","","","2014-03-03 21:37:25","Android: keeping a background service alive (preventing process death)","<android><process><service>","5","0","21","",""
"3857104","1","7628145","","2010-10-04 16:19:52","0","1319","<p>I'm trying to disable a TextView within a ViewFlipper via setVisibility to GONE and cannot get it to act like I'm wanting. My code:</p><pre><code>switch(index) {            case 0:        //Do Stuff     findViewById(R.id.o2).setVisibility(8);     findViewById(R.id.o3).setVisibility(8);     break;    case 1:        //Do Stuff     findViewById(R.id.o3).setVisibility(8);              break;    case 2:        //Do Stuff     break;    }</code></pre><p>my XML</p><pre><code>&lt;ViewFlipper android:id=""@+id/oFlipper""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:flipInterval=""1000""     android:inAnimation=""@anim/push_up_in""     android:outAnimation=""@anim/push_up_out""&gt;        &lt;TextView android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:gravity=""center_horizontal""         android:textSize=""26sp""         android:text=""Opponents:""/&gt;        &lt;TextView android:id=""@+id/o1""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:gravity=""center_horizontal""         android:textSize=""26sp""         android:visibility=""gone""/&gt;        &lt;TextView android:id=""@+id/o2""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:gravity=""center_horizontal""         android:textSize=""26sp""         android:text=""2""/&gt;        &lt;TextView android:id=""@+id/o3""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center_horizontal""            android:textSize=""26sp""            android:text=""3""/&gt; &lt;/ViewFlipper&gt;</code></pre><p>I've tried the code before and after .startFlipping() to no avail. It appears that the TextView is gone for one view flip and then reappears. But even when hardcoded to GONE in the XML file the view is simply blank rather than shifting the other views up in its place. I basically just want the TextView to go away completely. Is there any way to accomplish this?</p>","466025","","664054","","2012-05-08 16:53:26","2014-02-17 06:40:00","setVisibility not working within ViewFlipper","<android><visibility><viewflipper>","1","2","","",""
"3857114","1","","","2010-10-04 16:21:12","9","12566","<p>Can you please tell me how can I do memory profile for an android application?I want to find out how are the objects created and where did those created.</p><p>Thank you.</p>","286802","","","","","2010-10-04 16:27:48","How to do memory profiling for an android application?","<android>","0","6","1","2014-03-30 19:55:41",""
"3857294","1","3860859","","2010-10-04 16:40:17","2","566","<p>Hey!     I have a SlidingDrawer in my application. When it opens, I want everything underneath it to be blurred. Anyway I can do this? Thanks.</p>","363441","","","","","2010-10-05 04:33:21","Blur the layer underneath","<java><android><canvas><blur>","1","0","1","",""
"3857508","1","","","2010-10-04 17:14:23","4","1040","<p><strong>Question:</strong></p><p>Could more than one RFCOMM channels be created per time? </p><p><strong>Testing method:</strong></p><p>Create connections from Cellphone(Samsung GALAXY S) to two terminals in the PC. PC has two different bluetooth devices(build-in and USB dongle) and using different COM ports, say COM1 and COM2.</p><p>Steps:</p><ol><li><p>Testing each connection from cellphone to different bluetooth devices in PC using SPP, separately. ----> OK, cellphone could read what PC has sent in terminal using each bluetooth device. This means PC, bluetooth device 1(BD1), bluetooth device 2(BD2) are working fine via SPP. Now, I am going to test two connections simultaneously.</p></li><li><p>Establish one connection, say cellphone-> BD1. ---> OK. Cellphone could read data from terminal 1 in PC using this connection. </p><p>2.1 Establish another connection( cellphone -> BD2).  ---> OK. No exception be threw and the link was established successfully.</p></li></ol><p><strong>PROBLEM:</strong></p><p>Once the second connection was established, what I typed in terminal 1 will be forward and received by second connection. In the other hand, no data will be received in connection 2 that was typed in terminal 2.</p><p><strong>Discussion</strong>I paste my bug report <a href=""https://docs.google.com/document/pub?id=1RpgAZa0Emo_pD9W5eMBU_nPjNZ0s3svu1SZy_Sot58k"" rel=""nofollow"">HERE</a>. If I were right, the blue font part is the process that establish first connection, and the black font, under the blue font, is the process to establish second connection. </p><p>The reason I doubt that ""more than one RFCOMM could be established"" is in the bug report, I put it as bold fonts. We could see that both of them are using ""<strong>rc chan 1</strong>"", does this mean they ues the same RFCOMM??</p><p>Any recommend or suggestions are very very welcome!</p>","462358","","","","","2012-11-30 04:05:47","Could more than one RFCOMM channels be created per time?","<android><bluetooth><rfcomm>","1","1","2","",""
"3857569","1","3857589","","2010-10-04 17:20:49","1","159","<p>I have a question about when you distribute your app with an existing DB.</p><p>Right now I've created a basic app, and from my understanding, the .db file should be in the assets folder, and when the user first runs your app it should check if the DB exists in the \data\data\ folder, if it's not there it should copy it over...correct?</p><p>My question is, what about updates? When the user downloads an update to said app, we'll need to insert a more rows into a couple specific tables (I think there's about 8 tables in total). How should this be handled? Should the DB be overwritten completely or is there a way copy over the differences?</p><p>Thanks for your help! Sorry if it sounds a bit confusing.</p>","326468","","","","","2010-10-04 18:42:07","Android SQLite DB Question","<android><sqlite><google-play>","2","0","","",""
"3857576","1","4087348","","2010-10-04 17:21:24","31","76293","<p>While configuring MJAndriod I have got an error as follows:</p><pre><code>Project has no default.properties file! Edit the project properties to set one.</code></pre><p>I have a <code>default.properties</code> which us set to a perfect target and works for another application in the same workspace.</p><p>Kindly help me resolve this.</p>","446668","","1554935","","2013-10-24 04:58:01","2014-03-03 13:04:44","Project has no default.properties file! Edit the project properties to set one","<android><eclipse>","21","0","6","",""
"3857578","1","3916017","","2010-10-04 17:21:39","15","30257","<p>I am struggling with getting a live radio stream to work on android.  I am using the <code>MediaPlayer</code> class and just setting the URL and playing it.  It works great for the most part, but after 5-30 minutes it inevitably dies.  On 2.1 phones (more specifically a hero) I get this log output</p><pre><code>W/MediaPlayer( 7919): info/warning (1, 26)I/MediaPlayer( 7919): Info (1,26)I/MediaStreamService( 7919): mPlayer info code:1  extra:26E/MediaPlayer( 7919): error (1, -11)E/MediaPlayer( 7919): Error (1,-11)</code></pre><p>Where <code>MediaStreamService</code> is my Service containing the <code>MediaPlayer</code> the output is coming from the <code>OnInfoListener</code></p><p>On 2.2 phones I don't get the <code>OnInfoListener</code> callback ever, the stream just dies.  But I do see this in the logcat</p><pre><code>E/HTTPStream( 1020): recv failed, errno = 11 (Try again)E/HTTPDataSource( 1020): retrying connection failed</code></pre><p>Seems to work flawlessly on my 1.6 phone despite the constant logcat spam of</p><pre><code>E/PlayerDriver( 82): Invalid percentage value &lt;big growing number&gt;</code></pre><p>My question is, what do the error codes (1, 26) mean?  What is causing my mediaPlayer to crash?  Is the 2.1 problem at all related to the 2.2 problem? Thanks,Nathan</p><p>Edit:  I was looking in the source code to <code>OnInfoListener</code>  and found <code>public static final int MEDIA_INFO_UNKNOWN = 1;</code>I'm not sure exactly what it means, and can't find where these extras are kept either..  Any insight on to what Media info unknown means?  or what this 26 stands for would be very appreciated. </p>","384306","","384306","","2010-10-07 01:50:57","2011-11-25 11:53:27","Android MediaPlayer error codes?","<android><media-player>","3","0","9","",""
"3857676","1","3857787","","2010-10-04 17:36:28","1","1103","<p>I have written my own Exception (MyException) and implemented Logging and showing Error Messages in Form of Toasts. Here is the shortform of it...</p><pre><code>public class MyException extends Exception {   public MyException(String msg) {      Looper.prepare();       Toast.makeText(Controller.getInstance().getApplicationContext(), msg , Toast.LENGTH_LONG).show();       //Looper.loop();       Looper.myLooper().quit();   }}</code></pre><p>Everything was fine until I now implemented Threads where Exceptions are being thrown and caught.</p><p>You probably already have seen, that I played with the Looper Class, but honestly I don't know how to make it work. Is that the right approach? You also can see that I already store a reference of the ApplicationContext in my Controller. Shall I do it with the ActivityContext as well and than make the Toast from this ActivityContext? (But I heard that this is not a good practice in terms of performance) </p><p><strong>Update</strong></p><p>Is this the way I should go, when an Exception is being caught in a Thread in an Activ ity?</p><pre><code>private Runnable exceptionCatchingThread   = new Runnable() {          @Override          public void run() {           try {                 throw new Exception();           } catch (Exception e) {              this.e = e;              runOnUiThread(handleThreadExceptions); }           }    }private Runnable  handleThreadExceptions  = new Runnable() {             @Override              public void run() {               //Show toast or call the general ExceptionHandler,                //which is doing logging and stuff                Helper.handleException(e);               }}</code></pre>","433718","","433718","","2010-10-05 07:54:34","2010-10-05 07:54:34","My ""MyException"" which shows Toast causes trouble while thrown in threads. How should I reorganize Exception handling?","<android><multithreading><exception-handling><thread-exceptions>","1","0","0","",""
"3857707","1","3857904","","2010-10-04 17:40:02","2","2187","<p>My application has a portrait mode, and a landscape mode. I want the user to be able to force the landscape orientation by clicking on a button. How can I do this programatically?</p>","19875","","","","","2010-10-04 18:06:13","How can I force horizontal orientation programatically?","<java><android><layout><orientation>","1","0","","",""
"3857886","1","3857933","","2010-10-04 18:03:49","0","1235","<p>I get a very common crash below from the code below.</p><p>I thought my try, catches will have handled that.</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.NullPointerExceptionat java.io.Reader.&lt;init&gt;(Reader.java:65)at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:65)at com.test.test.FinderMain.grabPlaneRoute(FinderMain.java:759)at com.test.test.FinderMain.access$7(FinderMain.java:729)at com.test.test.FinderMain$GetRouteTask.doInBackground(FinderMain.java:684)at com.test.test.FinderMain$GetRouteTask.doInBackground(FinderMain.java:1)at android.os.AsyncTask$2.call(AsyncTask.java:185)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)</code></pre><p>Line 759 is within grabPlaneRoute and is the line containing the ""StringBuilder total = new StringBuilder();""</p><p>Can someone help with this, it is driving me crazy! :-)</p><pre><code>private void grabPlaneRoute(String adshex) {    List&lt;GeoPoint&gt; localList = new ArrayList&lt;GeoPoint&gt;();    HttpURLConnection con = null;    URL url;    InputStream is=null;    try {        url = new URL(""http://www.testurl.com&amp;test="" + adshex);        con = (HttpURLConnection) url.openConnection();        con.setReadTimeout(20000 /* milliseconds */);        con.setConnectTimeout(60000 /* milliseconds */);        con.setRequestMethod(""GET"");        con.setDoInput(true);        // Start the query        con.connect();        is = con.getInputStream();    }catch (IOException e) {                    //handle the exception !        e.printStackTrace();        return;    }    //localList = decodePoly(convertStreamToString(is));    //Log.i(""HTTP DUMP"", convertStreamToString(is));    BufferedReader r = new BufferedReader(new InputStreamReader(is),8024);    StringBuilder total = new StringBuilder();    String line;     try {    while ((line = r.readLine()) != null) {        String[] separated = line.split("","");        GeoPoint p = getPoint(Double.valueOf(separated[0]),Double.valueOf(separated[1]));        localList.add(p);    }     }catch (IOException e) {         //handle the exception !            e.printStackTrace();      }    drawPlaneRoute(localList);}</code></pre>","103999","","","","","2010-10-04 18:14:34","NullPointerException with StringBuilder","<android><nullpointerexception>","2","0","","",""
"3857976","1","3858009","","2010-10-04 18:16:27","0","420","<p>I have two EditText and one Button in my Layout. If the two EditText both contain a text, i want to enable the button:</p><pre><code>@Override public boolean onKey(View v, int keyCode, KeyEvent event) {  System.out.println(""Key input"");  String usr = user.getText().toString();  String pw = password.getText().toString();  if ( (!usr.equals("""")) &amp;&amp; (!pw.equals(""""))) {   ok.setEnabled(true);  } else {   ok.setEnabled(false);  }  return true; }</code></pre><p>So i tried to register several listeners on the EditText fields:</p><pre><code>user.setOnKeyListener(focusListener);password.setOnKeyListener(focusListener);</code></pre><p>Unfortunately, the onKeyListener does not seem to work at all. So i also tried the FocusChangedListener and the ActionListener. But none of them provided the behaviour i'd like.</p><p>Any hints how to implement that?</p>","","anon","","","","2010-10-04 18:22:30","How to check if two EditText contain text","<java><android>","1","0","","",""
"3858041","1","3955381","","2010-10-04 18:27:24","1","1319","<p>I am attempting to use Restlet for Android to query an OData data source. However, I am not impressed with its performance in both the emulator as well on a real device. I have the requests made in a wrapper <code>AsyncTask</code> to make the UI responsive but it still takes over 1 minute to finally return the objects.</p><p>I get plenty of these in the LogCat window:</p><pre><code>10-04 18:20:41.667: DEBUG/dalvikvm(278): GC freed 7872 objects / 523928 bytes in 279ms</code></pre><p>What can I do to speed up the queries?</p>","23528","","","","","2010-10-17 21:27:32","How can I speed up Restlet for Android when using OData?","<java><android><rest><odata><restlet>","2","0","1","",""
"3858123","1","3858644","","2010-10-04 18:39:38","1","2426","<p>I am Optimizing the Android 2.2 OS to make it in such a way that it can be ported to the  tablet. Can anyone suggest me how to change the themes and icons of Android 2.2 OS.</p>","412168","","78782","","2010-10-04 19:41:52","2010-10-04 19:56:40","how to change the themes and icons of Android 2.2 OS?","<android>","1","1","","",""
"3858139","1","3917798","","2010-09-29 11:34:55","2","4679","<p>I'm using Eclipse 3.5.2 for Android development on Ubuntu 10.04. I installed:</p><ul><li>Sun's JDK from Ubuntu's repositories;</li><li>Eclipse 3.5.2 (Classic) from eclipse.org, unpacked to <code>/opt/eclipse</code></li><li>The Android SDK from android.com, unpacked to <code>/opt/android-sdk</code></li></ul><p>My problem is that when I'm in an Android project, JavaDoc will not work (neither for Android classes nor for Java classes). For example, if I hover my mouse over <code>DateFormat</code>, I get:</p><blockquote>  <p><strong>java.text.DateFormat</strong></p>    <p><em>Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc.</em></p></blockquote><p>However, if I hover my mouse over <code>DateFormat</code> while I'm editing a normal, Java project, I do get the correct JavaDoc:</p><blockquote>  <p><strong>java.text.DateFormat</strong></p>    <p>DateFormat is an abstract class for date/time formatting subclasses which formats and parses dates or time in a language-independent manner. ...</p></blockquote><p>So the JavaDoc <strong>is there</strong>, it's just not accessible from inside Android projects, for some strange reason.</p><p>Any ideas what that reason might be?</p>","180784","Felix","180784","","2010-10-05 15:35:56","2011-05-21 19:30:26","JavaDoc not working in Android project","<android><eclipse>","2","2","2","",""
"3858220","1","3858686","","2010-10-04 18:54:28","7","2137","<p>I am using a Gallery view where the view corresponding to each item is non-trivial and consists of text as well as multiple buttons.</p><p>When I click to drag the gallery view (somewhere not on one of the buttons) the button's drawable state changes to pressed and appears as if all of the buttons are currently being pressed. Additionally, the same behavior happens for the selected state (e.g. all of the text of the child TextViews changes color).</p><p>I am trying to prevent this behavior and have found the android:duplicateParentState xml attribute as well as the setDuplicateParentStateEnabled property. This seems like it should accomplish what I am trying to do, but it seems to have no effect.</p><p>Any ideas?</p>","80617","","932225","","2012-07-13 09:32:52","2012-07-13 09:32:52","Gallery/AdapterView Child Drawable State","<android><gallery><viewstate><drawable><android-adapterview>","3","0","1","",""
"3858229","1","3858439","","2010-10-04 18:55:19","0","1022","<p>I have a need of a function/library that can quickly encrypt an image on a low-powered device (cell phone, tablet, etc).</p><p>I need to provide a string which can act as a password to encrypt and decrypt the image file.</p><p>Ideally, I would like something that retains the image file format and just scrambles the pixels. I have tried prototyping this and haven't been able to find an efficient method to do so (10-30 seconds to encrypt on a PC, crashes on device). The idea here is to visually show the user that their image has been encrypted. I realize that I may have to fake this feature, or do without it completely.</p><p>I need the image file to be encrypted on the client and sent to a server where it can be stored without the user worrying about who can access it. The encryption doesn't have to be terribly tough (referring to the NSA question). The image file will then later be downloaded by the user and decrypted with a password.</p><p>Is there anything out there that fits this description?</p>","2715","","2715","","2010-10-04 20:25:54","2012-03-16 03:00:17","Fast, ""Cheap"" Image Encryption","<android><image><encryption><mobile><ios4>","3","2","2","",""
"3858341","1","3858639","","2010-10-04 19:12:07","1","363","<p>I'm trying to do some blending of images in Java. After succcesfully doing multiply and screen blending, ""normal"" blending is causing me headaches. </p><p>I found on Wikipedia that the formula for blending two pixels with alpha is:<img src=""http://upload.wikimedia.org/math/3/c/3/3c377902304f3e4c105ad360abbbc180.png""/><i>Co being resulting color, Ca color of top image, Cb color of bottom image and Aa -> alpha of top, Ab -> alpha of bottom.</i></p><p>I've tried to translate this to Java, and now have:</p><p><i>(t_X == Components from top image, b_X == Components from bottom image)</i></p><pre><code>float t_a = (topPixels[i] &gt;&gt; 24) &amp; 0xff, t_r = (topPixels[i] &gt;&gt; 16) &amp; 0xff, t_g = (topPixels[i] &gt;&gt; 8) &amp; 0xff, t_b = topPixels[i] &amp; 0xff;float b_a = (bottomPixels[i] &gt;&gt; 24) &amp; 0xff, b_r = (bottomPixels[i] &gt;&gt; 16) &amp; 0xff, b_g = (bottomPixels[i] &gt;&gt; 8) &amp; 0xff, b_b = bottomPixels[i] &amp; 0xff;destPixels[i] =     (255 &lt;&lt; 24 |    (int)((t_r * t_a) + ((b_r * b_a) * (((255 - t_a) / 255)))) &lt;&lt; 16 |      (int)((t_g * t_a) + ((b_g * b_a) * (((255 - t_a) / 255)))) &lt;&lt; 8 |       (int)((t_b * t_a) + ((b_b * b_a) * (((255 - t_a) / 255)))) &lt;&lt; 0                     );</code></pre><p>But this seems to be wrong as the resulting image comes out wrong.</p><p>Any ideas what I'm missing, or is my lack of mathematical skill getting the best of me again when translating the formula to code?</p>","251455","","251455","","2010-10-04 19:48:32","2010-10-04 19:55:38","Problems with ""normal"" blending of two images with alpha","<java><android><image-processing>","2","4","","",""
"3858362","1","3858873","","2010-10-04 19:14:56","10","3179","<p>I need to be able to hide the soft keyboard in response to clicking a button.  I have seen numerous posts on this subject and it seems that the solution is to use the <code>InputMethodManager</code>, but I have been unable to get it to work for me.  Supposedly the following will hide the soft keyboard:</p><pre><code>  InputMethodManager inputManager = (InputMethodManager)          getSystemService(INPUT_METHOD_SERVICE);  inputManager.hideSoftInputFromInputMethod(editView.getWindowToken(), 0);</code></pre><p>However, this is not working for me (can any suggest why?), and even if it did, I want to be able to hide the keyboard regardless of what view has the input, and I may not know what view that is.</p><p>I found that the call:</p><pre><code>inputManager.toggleSoftInput(0, 0);</code></pre><p>will hide the keyboard if it is currently being shown.  Unfortunately it will also show it if it is currently hidden.  So for this to work for me, I would need a way to determine whether it is currently visible.</p><p>Any ideas?</p><p>Thanks</p>","457607","","802469","","2011-12-20 22:16:12","2013-02-06 15:50:56","Hide Soft Keyboard","<android>","1","0","2","",""
"3858378","1","3858499","","2010-10-04 19:17:47","0","1231","<p>I have a WebView that is loading a URL that plays a Flash file. This works in the regular Android Browser, or if I use an Intent. For some reason it won't load in my WebView. It tells me I need to download Flash Player, even though it has already been installed:</p><pre><code>public void setupWebView(){        webView = (WebView) findViewById(R.id.WebView);        if(webView != null){            webView.getSettings().setJavaScriptEnabled(true);            webView.loadUrl(""http://66.135.33.137/apps/ibiybqepljofmg16xdvs/tv2beta/tvstation_viewer_v2.html"");        }    }</code></pre>","19875","","","","","2010-10-04 19:39:05","Problem getting WebView to play Flash file","<java><android><flash><webview>","1","0","1","",""
"3858380","1","","","2010-10-04 19:17:54","0","408","<p>I have a basic service that sends a 'Toast' message when the service starts (Service.OnCreate). Is there a was to capture the cells logs or does anyone know why a service would randomly restart. If it were a crash, it wouldn't restart as far as I know.</p><p>Thanks</p>","401263","","","","","2010-10-04 19:17:54","my app service keeps restarting (crashing?)","<android>","0","2","","",""
"3858584","1","","","2010-10-04 19:48:24","0","698","<p>Text SMS have a limit of 160 characters and to send more than that you have to send using multipart SMS.</p><p>Is this applicable for Data SMS too? If the size of the data SMS exceeds (160 Characters * 7 (I believe each character is encoded using 7 bits), you have to split and send it? </p><p>I tried receiving a data SMS in the emulator, (sending a UTF-8 encoded String, using getBytes(),) however I was not able to convert back the message completely, the message is filled with different characters, when I try to get back the string.</p><p>Any suggestions?</p>","13046","","","","","2011-08-17 14:13:12","Do sending Data SMS have a size limit in android?","<android><android-emulator>","1","0","","",""
"3858593","1","3863570","","2010-10-04 19:50:06","4","20460","<p>I didn't really want to post here as there is so much information on the net, but I've trawled the depths and can't figure it out.</p><p>Ok so I can't get this to work in two scenario's hopefully the answer is the same for both.</p><p>My problem is I set the request header but it doesn't seem to send it.</p><p>I have a session id s=e32ff223fwefd3 , and I want to store this under ""Cookie"" , but it doesn't seem to be working.</p><p>Here is the quickest code example I have</p><pre><code>import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.HttpResponse;private static String sessionCookie = ""s=12342342352354234"";public static void get(String url) {    HttpClient client = new DefaultHttpClient();    HttpGet request = new HttpGet(url);        if(sessionCookie != null){            Log.d(TAG, ""Setting Cookie: ""+sessionCookie);            request.setHeader(""Cookie"", sessionCookie);        } else {            Log.i(TAG, ""Null session request get()"");        }        HttpResponse response = client.execute(request);        Header[] headers = response.getAllHeaders();        for (int i=0; i &lt; headers.length; i++) {            Header h = headers[i];            Log.i(TAG, ""Header names: ""+h.getName());            Log.i(TAG, ""Header Value: ""+h.getValue());        }}</code></pre><p>So when my response comes out the other side it doesn't have my s=232342w3f23f id attached to it!</p><p>I think I've explained this right, any help is appreciated</p>","413127","","115145","","2010-10-04 21:32:24","2010-10-05 12:25:56","Android Http get Session Cookie","<android><http><cookies><http-headers><httpclient>","2","1","4","",""
"3858600","1","3859248","","2010-10-04 19:50:49","15","10112","<p>I am following the standard example of how to add a <code>RatingBar</code>. To control the number of stars I tried to use <code>android:numStars=""5""</code>. The problem is that the number of stars doesn't seem to do anything at all. In portrait-layout I get 6 stars and when I flip the phone I get about 10 stars. I tried to set the number of stars in my Activity (<code>myBar.setNumStars(5)</code>) that loads the xml but there was no success with that option either. </p><p>So my question is how do I define my layout so that it will only show five stars? Set <code>numStars</code> doesn't seem to work.</p><p>Thanks in advance,Roland</p>","435267","","1627730","","2014-01-15 17:05:54","2014-01-15 17:05:54","How to make RatingBar to show five stars","<android><xml><layout>","9","0","5","",""
"3858718","1","3858884","","2010-10-04 20:06:40","0","289","<p>When I use sp as my font size unit in the XML file, I go to spare parts and change font size, my app's font size is not changing. Does anyone know a way to resolve that?</p>","463304","","","","","2010-10-04 20:31:45","android make application sensitive to font size","<android><android-fonts>","1","1","","",""
"3858743","1","","","2010-10-04 20:10:54","0","772","<p>I am trying to make it so a MapView zooms to a current location based on a GeoPoint.  I am setting the location using the geo fix command in telnet.  My problem is that when I first input a location using geo fix my code will correctly navigate to a location on the map.  If I try to set another location using geo fix however it does not update.  Here is the code to update:</p><pre><code>public void updateLocation(Location loc) {    p = new GeoPoint((int)(loc.getLongitude() * 1E6),(int)(loc.getLatitude() * 1E6));    mc = mapView.getController();    mc.animateTo(p);}</code></pre><p>and here is my code to call the update:</p><pre><code>LocationListener onLocationChange=new LocationListener() {    public void onLocationChanged(Location location) {        updateLocation(location);    }</code></pre><p>etc...</p><p>I have the following in onResume():</p><pre><code>    super.onResume();    myLocationManager.requestLocationUpdates(""gps"", 0, 200, onLocationChange);</code></pre><p>The points I am trying to geo fix to are far enough apart to meet the minimum distance requirement.  Anyone have any ideas of what I'm missing?</p>","466194","","","","","2012-11-01 09:47:19","Location not being updated on new geo fix in android emulator","<java><android><android-emulator>","2","0","","",""
"3858767","1","3859808","","2010-10-04 20:13:56","2","1292","<p>I am busy writing an app and I have noticed that it sometimes crashes, and when it does and I get back to my computer then I only have the stack trace.</p><p>Is there a way for me to take a memory dump of the app at crash time?</p><p>Thanks</p>","407133","","","","","2010-10-04 23:09:47","Is there a way to take a memory dump on app crash?","<android>","3","0","1","",""
"3858869","1","3858950","","2010-10-04 20:29:30","0","164","<p>I'm creating ""maps"" for a game I'm making, and it's working fine on &lt;=Android 2.1, but 2.2 is causing problems.</p><p>I'm not sure if this is a common method, so I'll explain what I'm doing. First, I draw the map which the user is going to see then I draw a map of identical size with nothing but white and pink (0xffFF006E). Anywhere I draw the pink color is an area/boundary I don't want the player to be able to enter/cross.</p><p>So, in-game, the regular map is constantly being drawn and the ""bordermap"" with the pink color is loaded into a Bitmap (but never actually drawn). To see if the player is <em>attempting</em> to cross a border, I check the player's x,y pos against the bordermap:</p><pre><code>private boolean overBorder(int x, int y){   //The int 'COLOR_border' is predefined as 0xffFF006Eif(mPlayerDirection == UP &amp;&amp; mMapBorders.getPixel(x, y-mPlayerHeight/2) == COLOR_border)return true;if(mPlayerDirection == DOWN &amp;&amp; mMapBorders.getPixel(x, y+mPlayerHeight/2) == COLOR_border)return true;if(mPlayerDirection == LEFT &amp;&amp; mMapBorders.getPixel(x-mPlayerWidth/2, y) == COLOR_border)return true;if(mPlayerDirection == RIGHT &amp;&amp; mMapBorders.getPixel(x+mPlayerWidth/2, y) == COLOR_border)return true;   //If those fail, false       return false;}</code></pre><p>If that code returns true, I stop the player. Like I said, this works excellently pre-2.2. If anyone has any insight on how to fix 2.2 compatibility I would appreciate it greatly.</p>","408178","","","","","2010-10-04 20:41:16","Bitmap-analysis code works pre-2.2, not 2.2","<android><bitmap><compatibility>","1","2","","",""
"3858897","1","3858958","","2010-10-04 20:33:36","1","725","<p>I have a class that is essentially a message manager (a singleton) that has a timer that polls for status. (statusPollerTask is just a derived class of TimerTask that has the run() defined)</p><pre><code>timer.scheduleAtFixedRate(this.statusPollerTask, 0, 1000);</code></pre><p>Several Activities register themselves with the msg-man for updates (observer pattern style) as they become visible.  Works fine, except if the user presses the Home button and minimizes the app.  Sometimes the timer keeps polling other times it doesn't.  I need to maintain the polling even when the app is not visible.  I feel like I'm just missing something simple here.  Any help is appreciated!</p>","418714","","","","","2010-10-04 20:43:05","Android Timer stops running","<android>","1","0","","",""
"3858914","1","","","2010-10-04 20:36:14","8","1111","<p>I would like to implement Google Analytics in my iPad application. </p><p>I am wondering if there are any approval process issues with this?</p><p>Is there a best practice for allowing users to disable or enable tracking?</p><p>Do you have any opinons about how ethical it is to track user app habits?</p>","363522","","","","","2010-10-05 11:05:18","What are the ethical issues with using analytics in Mobile Applications?","<iphone><android><analytics><ethics>","3","3","1","","2010-10-04 23:30:28"
"3858930","1","3859143","","2010-10-04 20:38:32","0","220","<p>How can I tell android to not crop my layout when displaying the on-screen keyboard but to instead resize it? </p>","463304","","","","","2013-06-26 19:52:12","Tell android that my layout can be resized instead of cropped","<android><android-layout>","1","0","","",""
"3859067","1","","","2010-10-04 21:01:53","0","572","<p>I use an BaseAdapter to display a list of objects. This objects are fetched from a server. The getView() method of the BaseAdapter is the following:</p><pre><code>/* (non-Javadoc)         * @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup)         */        @Override        public View getView(int position, View convertView, ViewGroup parent) {            LinearLayout content = (LinearLayout) View.inflate(lexs, R.layout.favorite_item, null);            LinearLayout paragraphView = new LinearLayout(lexs);             paragraphView.setBackgroundColor(Color.RED);            paragraphView.setGravity(Gravity.CENTER_VERTICAL);            paragraphView.setOrientation(LinearLayout.HORIZONTAL);            ImageView img = new ImageView(lexs);            img.setImageResource(R.drawable.down);            paragraphView.addView(img);            img.setPadding(0, 0, 5, 0);            img.setOnClickListener(new WorkspaceOnClickListener(position));            TextView text = new TextView(lexs);            text.setTextColor(Color.WHITE);            text.setText(favorites.get(position).getParentChapter().getBook().getName() + "": §"" + favorites.get(position).getName());            text.setOnClickListener(new ParagraphOnClickListener(position));            DisplayMetrics metrics = new DisplayMetrics();            lexs.getWindowManager().getDefaultDisplay().getMetrics(metrics);            int maxWidth = metrics.widthPixels - 100;            text.setMaxWidth(maxWidth);            text.setMinWidth(maxWidth);            paragraphView.addView(text);            ImageView imgClose = new ImageView(lexs);            imgClose.setMinimumHeight(30);            imgClose.setMinimumWidth(30);            imgClose.setImageResource(R.drawable.close);            imgClose.setPadding(5, 0, 0, 0);            paragraphView.addView(imgClose);            imgClose.setOnClickListener(new CloseListener(position));            content.addView(paragraphView);            content.setPadding(0, 0, 0, 10);            if (favorites.get(position).isExpanded()) {                LinearLayout textLayer = new LinearLayout(lexs);                textLayer.setBackgroundColor(Color.rgb(214, 214, 214));                LinearLayout left = new LinearLayout(lexs);                left.setOrientation(LinearLayout.VERTICAL);                ImageView moveUp = new ImageView(lexs);                moveUp.setImageResource(R.drawable.move_up);                moveUp.setOnClickListener(new MoveListener(UP, position));                moveUp.setPadding(0, 0, 0, 10);                left.addView(moveUp);                ImageView moveDown = new ImageView(lexs);                moveDown.setImageResource(R.drawable.move_down);                moveDown.setOnClickListener(new MoveListener(DOWN, position));                left.addView(moveDown);                TextView paragraphText = new TextView(lexs);                paragraphText.setText(favorites.get(position).getText());                paragraphText.setTextColor(Color.BLACK);                LinearLayout right = new LinearLayout(lexs);                right.setOrientation(LinearLayout.HORIZONTAL);                right.addView(paragraphText);                textLayer.addView(left);                textLayer.addView(right);                content.addView(textLayer);                img.setImageResource(R.drawable.up);            }            return content;        }    }</code></pre><p>So I'd like that this whole method is called in background and during the method is executed, a ProgresDialog is shown. I defined the ProgressDialog the following way:</p><pre><code>public class LoadingInformation {    private static ProgressDialog progressDialog;    public static void showProgressInformation(Context view) {        progressDialog = ProgressDialog.show(view, ""Please wait..."", ""Doing Extreme Calculations..."", true);        System.out.println(""Start Loading Screen"");    }    public static void stopShowingProgressInformation() {        Handler handler=new Handler();        handler.post(new Runnable(){public void run(){progressDialog.dismiss();}});        System.out.println(""Stop Loading Screen"");    }}</code></pre><p>But the problem is, i don't know how to implement the calls correctly. I tried to replace all lines:</p><pre><code>adapter.notifyDataSetChanged();</code></pre><p>With the following code:</p><pre><code>public void updateFavoriteList() {        LoadingInformation.showProgressInformation(lexs);        new Thread() {            public void run() {                lexs.runOnUiThread(new Runnable() {                    @Override                    public void run() {                        adapter.notifyDataSetChanged();                        LoadingInformation.stopShowingProgressInformation();                    }                });            }            }.start();    }</code></pre><p>But unfortunately this doesn't work as expected. Has anybody a hint how to do it betteR?</p>","","anon","","","","2010-10-05 01:17:56","How to implement a ProgressDialog correctly so that time-consuming methods are called in background?","<java><android>","2","0","","",""
"3859144","1","3859327","","2010-10-04 21:12:06","2","4111","<p>I am trying to remove an ImageButton's background in only the default state. I'd like the pressed and selected states to behave as usual so that they look correct on different devices, which use different colors for the pressed and selected states.</p><p>Is there any way to set an ImageButton's background default state's drawable without affecting the pressed and selected states?</p><p>I've tried to do this with a selector, but it does not appear to allow you to use the default drawables for some states - you have to set all the states yourself. Since there's no API to retrieve the device's default pressed/selected drawables, I don't know what to set the pressed/selected states to.</p><p>I also tried getting the StateListDrawable object for the button that the system creates when you are not using a selector and then modify it change the default state. That didn't work either.</p><p>I seems that on Android, if you want to change the drawable for one state of a button, then you must set all the states, and thus cannot preserve the default drawables for the other states. Is this correct?</p><p>Thanks!-Tom B.</p>","462297","","","","","2010-10-04 21:51:22","How to modify the default button state in Android without affecting the pressed and selected states?","<android><button><default><selector>","1","0","","",""
"3859181","1","","","2010-10-04 21:16:23","4","484","<p>i've noticed that the default look of tabs has changed between Android versions (see screenshot). I like the first version better, but i need to set my android target to version 8 (android 2.2) so that app2sd works. but then i have the darker backgrounds. how can i switch to the old one? setting the background color manually produces ugly results </p><p><img src=""http://i.stack.imgur.com/lGqss.jpg"" alt=""alt text""></p>","424514","","424514","","2010-10-04 21:25:00","2010-10-05 06:40:51","TabHost color changed between Android versions","<android><android-tabhost>","1","0","1","",""
"3859216","1","3859278","","2010-10-04 21:20:19","0","257","<p>I have a quite problematic UI layout to implement, and I'm not sure if it's even possible using standard UI widgets. It looks something like this:</p><p><a href=""http://kepfeltoltes.hu/101004/problem1_www.kepfeltoltes.hu_.png"" rel=""nofollow"">Picture 1</a></p><p>The green, lined thing is supposed to be a ListView, and the red rectangle is another View. This red View should be scrolled with the ListView, as if it's part of it. Some list-elements should also be narrower, because that embedded View gets in their way. Could you please recommend any ideas? Can this be done somehow with the Android UI framework? I was thinking about some kind of a floating View above the ListView, which reacts to the List's scrolling events too, but it doesn't seem like an elegant solution.</p><p>Thanks</p>","446529","","","","","2010-10-04 22:07:07","Handling an embedded view inside a ListView?","<android><user-interface><listview>","2","0","","",""
"3859305","1","3859485","","2010-10-04 21:33:34","9","4558","<p>I'm trying to use <a href=""http://www.mozilla.org/rhino/"">Mozilla Rhino</a> in my Java application for Android to evaluate some JavaScript. I am using Eclipse + ADT plugin.</p><p>First I tried simply downloading the Rhino .jar file from Mozilla's website and adding it to the project as a library in Eclipse. Eclipse recognised it fine and compiled the application. However, when running it I get an exception when calling <code>Context.evaluateReader()</code> (see below for stack trace).</p><p>Then I tried adding the Rhino source code as a separate Android project in Eclipse, marking it as a library and referencing it in my project, which was enough to get Eclipse to get it to compile, but led to the same error.</p><p>This is the stacktrace I get (<code>java.lang.UnsupportedOperationException: can't load this type of class file</code>)</p><pre><code>Thread [&lt;7&gt; Thread-8] (Suspended (exception UnsupportedOperationException))     DefiningClassLoader(ClassLoader).defineClass(String, byte[], int, int, ProtectionDomain) line: 338      DefiningClassLoader.defineClass(String, byte[]) line: 62        Codegen.defineClass(Object, Object) line: 159       Codegen.createScriptObject(Object, Object) line: 114        Context.compileImpl(Scriptable, Reader, String, String, int, Object, boolean, Evaluator, ErrorReporter) line: 2440      Context.compileReader(Reader, String, int, Object) line: 1326       Context.compileReader(Scriptable, Reader, String, int, Object) line: 1298       Context.evaluateReader(Scriptable, Reader, String, int, Object) line: 1137      TimetableProcessor.evaluate(InputStream, String, String[]) line: 31     TimetableProcessor.processBasicData(InputStream, String) line: 58       TimetableProcessor.process(InputStream, String) line: 52        TimetableUpdater.update() line: 53      Main$1$1.run() line: 22</code></pre><p>The bit of my code that hits the exception looks like this:</p><pre><code>        Context cx = Context.enter();        cx.setLanguageVersion(Context.VERSION_1_7);        Scriptable scope = cx.initStandardObjects();        try {            Object result = cx.evaluateReader(scope, new InputStreamReader(data), /* &lt;&lt;&lt; exception here */                    filename, 0, null);        } catch (IOException e) {            // ...        }</code></pre><p>I also found <a href=""http://divineprogrammer.blogspot.com/2009/11/javascript-rhino-on-android.html"">this blog post</a> which contains similar code and says it works. The author says he used a jar file from the <a href=""http://code.google.com/p/android-scripting/"">Android Scripting</a> site. The only jar file I found there was in <code>rhino_extras_r3.zip</code>. However, it doesn't contain <code>.class</code> files but rather a <code>classes.dex</code> file. When I added this as a library in Eclipse, it didn't recognise the classes it contains and thus failed to compile my project because of the missing references to Rhino classes.</p><p>Any help at all on how to get this to work is appreciated!</p>","58785","","","","","2012-05-09 16:20:53","Problems using Rhino on Android","<java><android><rhino>","3","0","5","",""
"3859489","1","3860059","","2010-10-04 22:02:43","7","9804","<p>I am writing an app which needs to periodically check the server for new messages and notify the user. I have seen some examples using AlarmManager to hit a BroadcastReciever which seems like the right thing to do, but i cant seem to get it to work.</p><p>Can anyone show me a step by step tutorial for this sort of thing (repeating alarm which triggers some kind of background code that fires a Notification)?</p><p>TIA</p>","339428","","","","","2011-04-15 12:20:51","android: running a background task using AlarmManager","<android><notifications><broadcastreceiver><alarmmanager>","1","3","17","",""
"3859502","1","3859657","","2010-10-04 22:04:15","3","5627","<p>My WebView doesn't fill the entire width of my phone. I am telling to fill_parent. Not sure why?</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""&gt;    &lt;WebView android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:id=""@+id/WebView""&gt;&lt;/WebView&gt;    &lt;/LinearLayout&gt;</code></pre>","19875","","234039","","2010-10-04 22:29:30","2013-09-16 08:21:53","Why isn't my WebView filling up the entire width of my screen?","<android><layout><webview><android-webview>","4","4","1","",""
"3859556","1","","","2010-10-04 22:13:04","1","3858","<p>I was using some of the code from DeskClock and found that when I tried to modify the CursorAdapter that newView was getting called for each item. (I actually wanted to add a divider and it seems like adding the dividers separately is better than adding them into a single listView) </p><p>If I have 3 items I get the following behavior:</p><pre> newView - called with item: 0  bindView - called with item: 0  bindView - called with item: 1  bindView - called with item: 2  bindView - called with item: 0 newView - called with item: 1  bindView - called with item: 1 newView - called with item: 2  bindView - called with item: 2 newView - called with item: 0  bindView - called with item: 0  bindView - called with item: 1  bindView - called with item: 2</pre><p>I would've expected newView/bindView to be called once per cursor item. But, that doesn't seem to be the case. This was kind of a problem for me because I wanted to select the appropriate view depending on the cursor data, but since bindView could be called before newView that doesn't work.</p><p>Is this some odd recycler behavior (or somehow normal/expected)? Or is there something broken with the code (I removed everything except the ListView and it's still doing this)? I'm not quite sure why you would try to bind views that haven't been created, and why newView gets called on the first item twice.</p><p>Thanks!</p><p>Btw, if someone has an easy way of adding dividers to ListViews I'd love to know. I was going to try to dig through the contacts example to see how they did it there if not.</p><hr><p>Btw, in case anyone's wondering MergeAdapter was neat to mess around with and try (I'll use it in some other situations). But, I did just end up writing a single adapter that handles multiple views. It computes the type of each item (which is small), stores it in a map, initializes it at adapter creation, and updates it in notifyDataSetChanged.</p><p>Then you just need to have getViewTypeCount() return the number of possible views. And getItemViewType to return the type from the map (which is 0 based, so 0-getViewTypeCount()). If you can compute your type from the position you don't need the map, but doing this on the fly wasn't possible so I just pre/recompute when needed.</p>","466254","","466254","","2010-10-14 15:47:30","2013-11-15 13:25:34","CursorAdapter calling bindView on every item","<android><cursor><listadapter>","3","0","2","",""
"3859661","1","","","2010-10-04 22:36:02","0","1008","<p>(sensorManager is a SensorManager)I'm trying to implement an orientation listener for my program. I declare the listener as a SensorEventListener. The API says I need to pass registerListener a SensorEventListener, Sensor, rate, and handler. What is the handler for?</p><p>Also, when I mouse over the error, it insists I use the deprecated veresion of the method for a SensorListener instead of a SensorEventListener. And this deprecated version doesn't require a handler. Anyone know why?</p>","426554","","","","","2010-10-04 23:08:47","why does sensorManager.registerListener require a handler?","<android>","1","0","","",""
"3859675","1","","","2010-10-04 22:38:15","5","1075","<p>My Android app uses a web service that can only be accessed from the office network. I would like to debug at home. I can VPN into my office network with ssh on a MAC or putty in windows. Will the Android emulator ""automatically"" access the office network under VPN or do it requires a specific set-up?</p>","327415","","","","","2012-07-10 15:06:20","will android emulator access a network using a vpn on the host machine","<android><android-emulator>","1","0","2","",""
"3859691","1","3865339","","2010-10-04 22:40:39","0","704","<p>I want to create a own View which containst two buttons without useing xml.</p><p>I tried this:</p><pre><code>public class ZoomPlate extends LinearLayout {    private Context context;    private Button plus;    private Button minus;    public ZoomPlate(Context context) {        super(context);        init(context);    }    public ZoomPlate(Context context, AttributeSet attrs) {        super(context, attrs);        init(context);    }    private void init(Context context) {        this.context = context;             LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,0);        plus = new Button(context);        plus.setText(""Plus"");        plus.setLayoutParams(params);        minus = new Button(context);        minus.setText(""Minus"");        minus.setLayoutParams(params);        setOrientation(LinearLayout.VERTICAL);        addView(plus);        addView(minus);    }}</code></pre><p>so that i can use the Zoomplate in XML like a button or a textview like:</p><pre><code>&lt;at.bartinger.zoomplate.ZoomPlate    android:id=""@+id/zoomplate""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;</code></pre><p>but when i try this nothing gets displayd</p>","401171","","935779","","2012-06-19 23:29:28","2012-06-19 23:29:28","Create own custom View without useing XML","<java><android><xml><view>","2","0","","",""
"3859732","1","","","2010-10-04 22:50:26","1","2575","<p>here is the problem: i have searched for an answer for this and so far i made it work for the custom camera app that comes with htc phones. </p><p>i have the folowing</p><pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data){         if (requestCode == REQUEST_FROM_CAMERA &amp;&amp; resultCode == RESULT_OK) {                 InputStream is=null;                 File file=mInterface.getTempFile();                 try {                     is=new FileInputStream(file);                 } catch (FileNotFoundException e) {                     e.printStackTrace();                 }                 if(is==null){                     try {                         u = data.getData();                         is=getContentResolver().openInputStream(u);                         mInterface.saveStringPreferences(GlobalInterface.URI_SAVENAME, u.toString());                     } catch (FileNotFoundException e) {                         e.printStackTrace();                     }                 }                 //Now ""is"" stream contains the required photo, you can process it                 setImage(is);               }</code></pre><p>//and this is the code to the function that calls the intent:</p><pre><code> Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     // intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(mInterface.getTempFile()));      startActivityForResult(intent, REQUEST_FROM_CAMERA);</code></pre><p>the remaining functions getTempFile() is to create a temp file on /sdcard/blabla.tmpand a function to set the captured image in an image view. </p><p>so the problem is that i tested this code on the custom camera on a lg phone and it crashes. the question is: is there a way to get an uri for the image location (i dont need a specific save location it could be the default set from the camera) and there were also some issues i came across which i dont need to solve like getting a smaller resolution image. i just need one image and to be able to set it in an imageView and the method to work for every camera app that is there, custom or native regardless.</p><p>is this possible or i need to create a new camera class for this? in my opinion the camera apps that come with the phone are more adjusted to the phone model so i would prefer using them against building a custom one.</p><p>tnx.</p>","448192","","","","","2013-01-02 08:36:43","using android intent to call and receive a result from camera app no matter if it is custom built","<android><camera><uri><android-intent><image>","1","2","","",""
"3859793","1","3859857","","2010-10-04 23:05:46","2","560","<p>I am attempting to orbit an object around a center point, much like the sun and our planets. However I am having no luck at all. Any help would be really great. Thanks. I'm writing in luna and I dont think there is a category for that here, but this probably is just general code. But if its in the wrong place, my apologies.</p><pre><code>local function animate(event)    local rads = degrees * (Math.PI / 180);    ballOne.x = 20 * Math.cos(rad);    ballOne.y = 20 * Math.sin(rad);    degrees = degrees + 1endRuntime:addEventListener(""enterFrame"", animate)</code></pre>","360481","","","","","2010-10-05 17:03:39","Orbit Object Around Center Point","<iphone><android>","1","0","1","",""
"3859798","1","3859961","","2010-10-04 23:07:06","2","2159","<p>I currently have a tab layout with 2 tabs, one tab with a list view and one with the option make strings so I can add them in the list view. Both tabs have their own activity because this made the code much more structured, and I dont have to repeat my self later.</p><p>Lets say im in the tab that offer me to create an string, and i press the update list button, how do I update the list view without startActivity()? If i use startActivity(), it starts List.java, and instead of displaying the list in the list view tab, it takes full screen, which defies the purpose of the tab view. In other words, the startActivity() steals the focus from the tab view of the list, and sends it fulscreen.</p><p>Thanks for your time.</p><p>Edit: I want to update the activity in my list view tab, without starting a new activity that goes to fullscreen, and doesnt update the one in the tab. </p>","466303","","466303","","2010-10-05 12:02:20","2012-02-12 07:28:04","Can I update a list view in one activity while im in another activity?","<android><listview><activity><tabs><android-intent>","2","0","1","",""
"3860008","1","3861130","","2010-10-04 23:55:11","28","19049","<p>I want to bulk insert about 700 records into the Android database on my next upgrade.  What's the most efficient way to do this?  From various posts, I know that if I use <code>Insert</code> statements, I should wrap them in a transaction.  There's also a <a href=""http://stackoverflow.com/questions/2887119/populate-android-database-from-csv-file"">post</a> about using your own database, but I need this data to go into my app's standard Android database.  Note that this would only be done once per device.</p><p>Some ideas:</p><ol><li><p>Put a bunch of SQL statements in a file, read them in a line at a time, and exec the SQL.</p></li><li><p>Put the data in a CSV file, or JSON, or YAML, or XML, or whatever.  Read a line at a time and do <code>db.insert()</code>.</p></li><li><p>Figure out how to do an import and do a single import of the entire file.</p></li><li><p>Make a sqlite database containing all the records, copy that onto the Android device, and somehow merge the two databases.</p></li><li><p>[EDIT] Put all the SQL statements in a single file in res/values as one big string.  Then read them a line at a time and exec the SQL.</p></li></ol><p>What's the best way?  Are there other ways to load data?  Are 3 and 4 even possible?</p>","85348","","85348","","2010-10-05 00:27:47","2014-04-16 16:39:51","Bulk Insertion on Android device","<android><sqlite><bulkinsert>","4","0","18","",""
"3860055","1","3860132","","2010-10-05 00:09:05","1","427","<p>I'm developing a series of applications for mobile devices, we'll call them Orange, Cherry, and Pear.  Now, because of my familiarity with Blackberry, I chose to begin implementing the first of these three applications, Orange, on the Blackberry platform.  I found a way to integrate a number of Blackberry platforms (since they use relatively the same API among different BB operating systems, with some exceptions) into the same codebase.  Currently, my codebase looks something like this:</p><pre><code>Orange/  trunk/   src/     ... orange's source tree...  branches/    1.0/     ... orange's source tree as it looked at release 1.0 ...  tags/     1.0.0/     1.1.0/</code></pre><p>So, basically, I'm using a version-based methodology to my branching.  Now, however, we want to migrate this application to the Android platform (and, at some point in time, probably to other mobile or even desktop platforms).  So, my question is, what is the best method for branching with a single application across multiple platforms?  I have read <a href=""http://stackoverflow.com/questions/34975/branching-strategies"">http://stackoverflow.com/questions/34975/branching-strategies</a>, as well as a number of branching strategy webpages (e.g. <a href=""http://www.codinghorror.com/blog/2007/10/software-branching-and-parallel-universes.html"" rel=""nofollow"">http://www.codinghorror.com/blog/2007/10/software-branching-and-parallel-universes.html</a> ), but I'm still unconvinced at branching based on having a 'common' trunk (e.g. as described in the last link as 'Branch per Technology').  </p><p>The reason I remain unconvinced is that I'm a believer in the version-based branching strategy.  It seems logical; if you want to maintain separate stages of development, then branches seem like the ideal way to do this.  If I have aspects of the code that are 'common' between all three platforms, then I decide to make an android release, do I branch all of the code from the common and android trunks to make a new release tag?  Or, do I keep all of the code in the 'common' branch in the android and blackberry branches as well?</p><p>I thought that perhaps another thing I could do would be to create separate projects, for instance orange-blackberry and orange-android.  This might clutter my svn repository, however, since we keep all of our projects in the same repository.  So, inevitably, I will have orange-blackberry, orange-android, cherry-android, cherry-blackberry, pear-android, pear-blackberry, along with a series of project folders for any other application I create.</p><p>So, I'm looking for some feedback about what might be the best way to manage all of this chaos.  Also, if you could throw in some ideas about the logistics of transferring from my current implementation to the newer one, (i.e. what svn commands I should use to maintain history), that would be very much appreciated.  </p>","281460","","","","","2010-10-05 00:35:56","Strategy for branching in subversion with mobile releases","<android><svn><blackberry><mobile><branch>","1","0","1","",""
"3860119","1","","","2010-10-05 00:29:42","1","193","<p>I'm running mac osx.I just cant find a answer to this error:</p><p>BUILD FAILED/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:395: The following error occurred while executing this line:/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:209: com.android.sdklib.build.ApkCreationException: Debug Certificate expired on 4/10/2497, 17:55 ?.</p><p>Total time: 22 seconds/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:395: The following error occurred while executing this line:/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:209: com.android.sdklib.build.ApkCreationException: Debug Certificate expired on 4/10/2497, 17:55 ?</p><p>i'm try remove ~/.android/debug.keystore and change machine's locale (date and time).It don't work.</p><p>Can any one give me an answer to this problem please?</p><p>Thank you.</p>","460784","","","","","2010-10-05 01:50:10","ant_rules_r3.xml:209 & 395 ERROR","<android><android-sdk-2.2>","1","2","","",""
"3860180","1","3860609","","2010-10-05 00:47:14","0","1496","<p>The line ""return db.insert(DATABASE_TABLE, null, initialValues);"" is returning a null pointer and I cant figure out why! I'd be grateful for any help</p><pre><code>public class Database extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);            DBAdapter db = new DBAdapter(this);    if(db != null){     long id = db.insertUser(""test"", ""test"");     Cursor c = db.getUser(id);             Log.d(""DB"", c.getString(1));     Log.d(""DB"", c.getString(2));    }    db.close();}}</code></pre><p>-</p><pre><code>public class DBAdapter {    public static final String KEY_ROWID = ""_id"";    public static final String KEY_USERNAME = ""username"";    public static final String KEY_PASSWORD = ""password"";    private static final String TAG = ""DBAdapter"";    private static final String DATABASE_NAME = ""test"";    private static final String DATABASE_TABLE = ""users"";    private static final int DATABASE_VERSION = 1;    private static final String DATABASE_CREATE =        ""create table IF NOT EXISTS users (_id integer primary key autoincrement, ""        + ""username text, password text);"";    private final Context context;     private DatabaseHelper DBHelper;    private SQLiteDatabase db;    public DBAdapter(Context ctx)     {        this.context = ctx;        DBHelper = new DatabaseHelper(context);    }    private static class DatabaseHelper extends SQLiteOpenHelper     {        DatabaseHelper(Context context)         {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db)         {            db.execSQL(DATABASE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,         int newVersion)         {            Log.w(TAG, ""Upgrading database from version "" + oldVersion                     + "" to ""                    + newVersion + "", which will destroy all old data"");            db.execSQL(""DROP TABLE IF EXISTS titles"");            onCreate(db);        }    }        //---opens the database---    public DBAdapter open() throws SQLException     {        db = DBHelper.getWritableDatabase();        return this;    }    //---closes the database---        public void close()     {        DBHelper.close();    }    //---insert a title into the database---    public long insertUser(String username, String password)     {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_USERNAME, username);        initialValues.put(KEY_PASSWORD, password);        return db.insert(DATABASE_TABLE, null, initialValues);    }    //---deletes a particular title---    public boolean deleteTitle(long rowId)     {        return db.delete(DATABASE_TABLE, KEY_ROWID +           ""="" + rowId, null) &gt; 0;    }    //---retrieves all the titles---    public Cursor getAllUsers()     {        return db.query(DATABASE_TABLE, new String[] {          KEY_ROWID,           KEY_USERNAME,          KEY_PASSWORD,               },                 null,                 null,                 null,                 null,                 null);    }    //---retrieves a particular title---    public Cursor getUser(long rowId) throws SQLException     {        Cursor mCursor =                db.query(true, DATABASE_TABLE, new String[] {                  KEY_ROWID,                  KEY_USERNAME,                   KEY_PASSWORD,                                    },                   KEY_ROWID + ""="" + rowId,                   null,                  null,                   null,                   null,                   null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    //---updates a title---    public boolean updateTitle(long rowId, String username,     String password)     {        ContentValues args = new ContentValues();        args.put(KEY_USERNAME, username);        args.put(KEY_PASSWORD, password);        return db.update(DATABASE_TABLE, args,                          KEY_ROWID + ""="" + rowId, null) &gt; 0;    }}</code></pre>","169743","","61","","2010-10-05 04:17:45","2010-10-05 04:17:45","Problem inserting new record into SQLite on Android","<android><sqlite>","1","1","","",""
"3860518","1","3860679","","2010-10-05 02:42:06","1","1558","<p>i met a problem , i have a expandableListView has 5 groups</p><p>if i wanna add some items to the second group , and update the expandableListView at run time,</p><p>could someone teach me how to do that?</p>","422405","","356580","","2010-10-05 03:36:15","2011-05-05 13:24:49","android expandableListView - add items to a specific group at run time","<android><cursor><adapter><expandablelistview>","2","0","","",""
"3860651","1","3862863","","2010-10-05 03:27:39","0","439","<p>I'm using HTC Dream and trying to read the images stored in the ""default"" album folder of this phone. But I've yet to found out what's the folder path to those images file.</p><p>When I mount the phone to my comp, some of the default images are in: /E0FD-1813/DCIM/and the photos taken using the phone are stored in /E0FD-1813/DCIM/100MEDIA/</p><p>But using those paths, accessing the images throws a ""No Such File"" error. </p><p>So </p><ol><li><p>do you know what's the path to that image folder? What would be the path patterns (if any) in other Android phones?</p></li><li><p>I don't need to set any additional permission to access those files, do I?</p></li><li><p>Do you know how I can build a ""file browsing"" widget in my activity? I've searched and seems like there is no such widget and I've to install app that does file browsing. In any case, how to incorporate that as a file-browsing view in my current activity? </p></li></ol><p>Thanks for your kind advice!</p>","397455","","","","","2010-10-05 10:40:50","Accessing image files + file browsing in Android","<android><file-io><htc>","1","0","","",""
"3860675","1","3860731","","2010-10-05 03:33:46","3","3549","<p>can we set the width of a view in android?</p>","655814","","","","","2011-06-18 05:19:32","Set width of view in android","<android>","3","1","2","",""
"3860693","1","","","2010-10-05 03:41:40","1","523","<p>I'm trying to have a jQuery UI Slider on a webpage to be displayed on an Android phone. The slider does not work by default, but when JS code that converts touch events to mouse events is dropped in (<a href=""http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/"" rel=""nofollow"">http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/</a>), the slider works.</p><p>Only problem being, with the new code, if there's also textboxes on the page, they no longer focus when tapped on.</p><p>How can I solve one problem without creating another?</p>","376486","","","","","2010-10-05 03:41:40","How can I make a JQuery UI slider and a textbox coexist on a mobile browser?","<javascript><jquery><android><jquery-ui>","0","0","2","",""
"3860711","1","5646770","","2010-10-05 03:47:11","1","2656","<p>I'm trying to get TTS to run in the background. But, I never get any sound. I have a broadcast receiver which starts a service. I put my TTS code in both of those, but it never speaks. I know the method is being called (I put a breakpoint on it), but it still doesn't work.</p><p>Here's my log, but it doesn't seem to contain anything about the TTS service.</p><pre><code>10-04 22:45:30.663: WARN/InputManagerService(209): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4423df4010-04 22:45:37.363: INFO/PollingManager(449): calculateShortestInterval(): shortest interval is 54000010-04 22:45:37.413: INFO/TLSStateManager(449): org.apache.harmony.nio.internal.SocketChannelImpl@4400ece0: Wrote out 29 bytes of data with 0 bytes remaining.10-04 22:45:38.043: ERROR/IMAPEmailService(480): Can't create default IMAP system folder Trash. Please reconfigure the folder names.10-04 22:45:40.123: ERROR/EONS(303): EF_PNN: No short Name10-04 22:45:41.543: ERROR/WMSTS(171): Month is invalid: 010-04 22:45:42.043: WARN/AudioFlinger(172): write blocked for 212 msecs, 24 delayed writes, thread 0xb998</code></pre><p>Thanks everyone in advance!</p>","253567","","168868","","2012-01-01 20:51:44","2013-12-07 13:26:08","Start Android TTS from Broadcast Receiver or Service","<android><android-service><text-to-speech>","3","1","3","",""
"3860823","1","3860867","","2010-10-05 04:20:29","22","2281","<p>If I store some user settings and information in shared preferences in my android apps, and then I update the app in the Market, will those settings be erased when the app updates?</p>","179518","","","","","2014-02-13 19:10:20","Are shared preferences in Android apps deleted when a user updates the app?","<android>","1","0","","",""
"3860915","1","4094505","","2010-10-05 04:49:08","1","194","<p>I have 2 activities, A1 and A2. </p><p>My application opens in Activity A1. None of the views in A1 are focused at startup, until I use the arrow keys to navigate through the views.</p><p>A button press in A1 launches activity A2.</p><p>When A2 opens, the first Button in A2 is focused by default. I do not want this happen. What I want is when A2 opens, none of the buttons are focused until arrow keys are used to naviagte through them(just like it is in A1).</p><p>Any idea how I can achieve this?</p>","454660","","","","","2012-08-06 22:52:34","Android: To ensure none of the Views are focused when an Activity opens?","<android><focus><activity>","1","5","","",""
"3860946","1","","","2010-10-05 04:55:53","1","139","<p>HI, </p><p>There is a strange out of memory error issue.</p><p>I create a class to parse live streaming, and the class needs buffers to keep these raw data.</p><p>Here are code snippets:</p><pre><code>/* Initial and uninitial buffer in class */private final int MAX_BUFFER = 16;protected byte[][] m_byStreamBuf = null; // Frame bufferpublic void InitBuffer() {  m_byStreamBuf = new byte[MAX_BUFFER][];  m_byStreamBuf[0] = new byte[512*1024]; // for I Frame  for (int i = 1; i &lt; MAX_BUFFER; i++) {    m_byStreamBuf[i] = new byte[256*1024]; // for P frame     } }public void UninitBuffer {  this.m_byStreamBuf = null;  System.gc();}</code></pre><p>Out of memory error will occur after start and close the application several times(maybe three or four times actually).</p><p>I check that the error occurs on the line which allocates memory.</p><p>I have try to call System.gc() when close application every time.</p><p>But it seems that the application still allocate too much memory and do not release all of them.</p><p>Thanks for any suggestion.</p><p>Regards,</p><p>Caxton</p>","449332","","","","","2012-08-03 00:12:40","Out of memory after executing application several times","<java><android><memory-leaks>","3","4","","",""
"3860998","1","","","2010-10-05 05:13:53","1","669","<p>I am able to parse XML using SAX Parser and able to display the points in text view.But now I want the points to be displayed on the map.The XML Contains tags for latitude and longitude.I want to read the latitiudes and longitudes and display them on map.</p><p><strong>UPDATE:</strong>  </p><pre><code>public void parsing(){    try    {    SAXParserFactory spf = SAXParserFactory.newInstance();    SAXParser sp = spf.newSAXParser();    XMLReader xr = sp.getXMLReader();    XMLHandler handler = new XMLHandler();    xr.setContentHandler(handler);    InputStream in=this.getResources().openRawResource(R.raw.poi);    xr.parse(new InputSource(in));}    catch(Exception e){        System.out.println(""XML Parsing Excpetion = "" + e);}    poilist=XMLHandler.POIList;    ArrayList&lt;Integer&gt; Latitude=new ArrayList&lt;Integer&gt;();    ArrayList&lt;Integer&gt; Longtitude=new ArrayList&lt;Integer&gt;();    for(int i=0;i&lt;poilist.getlat().size();i++)    {        Latitude.add(i);        Longtitude.add(i);    }}</code></pre><p>Now I want to pass these latitude and longitude values to the Geopoint..Any suggestions??</p>","424831","","214668","","2011-12-14 02:46:00","2011-12-14 02:46:00","I want to generate geopoints after parsing XML using SAX Parser","<android>","1","0","","",""
"3861016","1","3861368","","2010-10-05 05:20:09","1","3579","<p>I have created a subclass of <code>View</code> as an inner class in my <code>Activity</code>. I just want to inflate an xml into the class which extends <code>View</code>. Can anyone provide some code/syntax of both class and xml?</p><pre><code>public class DrawAct extends Activity {       DrawView drawView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        drawView = new DrawView(this, null);         setContentView(drawView);    }    public class DrawView extends View implements OnTouchListener {        Path path;        Paint paint = new Paint();        private ShapeDrawable mDrawable;        private ArrayList&lt;Path&gt; graphics = new         public DrawView(Context context,AttributeSet attrs) {            super(context,attrs);            //I want to load the contents of an xml in this class    //  }}</code></pre><p>xml is</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        xmlns:app=""http://schemas.android.com/apk/res/com.drawing""        android:orientation=""vertical""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt; &lt;Button android:id=""@+id/Button02""     android:layout_width=""wrap_content""     android:layout_height=""200dip""     android:layout_gravity=""right""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","461386","","592025","","2012-10-09 04:25:04","2012-10-09 04:25:04","LayOut Inflater in android?","<android><android-layout><layout-inflater>","2","5","","",""
"3861073","1","3861268","","2010-10-05 05:39:33","15","14269","<p>I am trying to make a program that shows all the active applications.</p><p>I searched everywhere but could only find code that shows the <strong>package name</strong> only.</p><p>It would be of great help if you masters can tell me how to display all the active <strong>application name</strong></p>","466474","","445131","","2013-03-13 20:14:53","2013-03-13 20:14:53","Get active Application name in Android","<android><android-package-managers>","3","0","8","",""
"3861174","1","3861246","","2010-10-05 06:02:54","2","1256","<p>I am creating a simple android app to view a comic book. The pages are large(0.5-1 mb each), high quality .png's and I am loading them into a webview to make use of the built in zoom controls. So far I only have 17 files and the APK size is already about 16 mb. I'm looking to add over 200 files in future updates. I can't really reduce the quality too much because there is small text that  must be zoomed-in on to read. Any suggestions? A similar question was posted here: <a href=""http://stackoverflow.com/questions/3815269/how-to-reduce-app-apk-size"">How to reduce App (.apk) Size</a>, but I don't want to lose the quality of the images. I'm not sure if it's appropriate to link to here, but you can have a look at my app by searching for Tracer (by Detour Mobile) on the android market if it helps at all. Thanks in advance.</p>","431327","","","","","2010-10-05 06:19:28","Smaller APK size with large assets?","<android><png><android-webview><filesize><android-assets>","1","1","1","",""
"3861210","1","","","2010-10-05 06:11:19","0","1222","<p>I am currently trying to develop a 3D compass myself. I have been trying for almost a week now, and still no luck. So please help me out. This is the code I use for my orientation handler:</p><pre><code>public void onSensorChanged(int sensor, float[] values) { // azimuth pitch roll        if (sensor == SensorManager.SENSOR_ACCELEROMETER) {            direction = values[2];        } else if (sensor == SensorManager.SENSOR_ORIENTATION) {            if (direction &lt; 0) {                angleX = values[1];                angleY = -values[2];                angleZ = values[0];            } else {                angleX = -values[1];                angleY = -values[2];                angleZ = values[0];            }            //          angleX = values[0];            //          angleY = values[1];            //          angleZ = values[2];        }</code></pre><p>angleX, Y and Z are the degrees I rotate my 3D object with. At first I tried the commented code, but the object doesn't rotate around the correct axis. But now the problem is that at a certain point the object ""jumps"" from one position to another. This particularly happens when the pitch becomes lower than -90 and thus begins to increase while on the other hand the yaw is increased with a 180 degrees and so is the roll.</p><p>Please tell why my code isn't working correctly and how can I fix it.</p>","247927","","23897","","2010-10-05 06:15:59","2011-04-07 06:08:14","How to create a 3D compass in Android?","<android><3d><orientation><compass-geolocation><angle>","0","3","1","",""
"3861335","1","3861645","","2010-10-05 06:38:00","5","3745","<p>I've tried to filter my ListView from my EditText box, but currently, it's not working.</p><p>I have a ListView that get data properly and they are added to my own ListView using a ArrayAdapter class and my own ArrayList class. When I for example, typing in ""table"" I want it to sort from the loaded titles in my ListView and than it should show me the items that are left and matching table. </p><p>My current code:</p><pre><code>private ArrayList&lt;Order&gt; orders; /* ArrayList class with my own Order class to define title, info etc. */private OrderAdapter adapter; //Own class that extends ArrayAdapterorders = new ArrayList&lt;Order&gt;();adapter = new OrderAdapter(this, R.layout.listrow, orders); /* listrow defining asingle item in my ListView */setListAdapter(adapter); //Set our adapter to a ListViewsearch.addTextChangedListener(filterTextWatcher); //search is my EditTextprivate TextWatcher filterTextWatcher = 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) {        adapter.getFilter().filter(s); //Filter from my adapter        adapter.notifyDataSetChanged(); //Update my view    }};</code></pre><p>Okay, so how can I achieve this? When I entering some value into the EditText box everything disappear, even if there is a match.</p><p>Thanks in advance and tell me if you need more code snippets or if this question i unclear!</p>","386562","","","","","2010-10-05 09:09:06","How to filter text in a ListView properly?","<android><search><filter>","1","0","1","",""
"3861398","1","","","2010-10-05 06:50:49","1","495","<p>Anybody idea how to integrate flicker to my application on android?. i got API key secrete key for my application from flicker.com site. i am confused how to use it. Api key separate for every user? how to get token number for flickr by code ? i have refer photostream and Flicker free code . but both code give the exceptiion.?</p><p>plz any body have code ,plz give me it?</p><p>also explain steps for implement it?</p><p>Thank you,</p>","1101841","","","","","2010-10-05 07:32:14","Please help flicker implement on android","<android>","1","0","","2012-09-13 11:12:10",""
"3861415","1","4817347","","2010-10-05 06:53:07","1","2886","<p>I want to play video files in my application which are part of my application.for that i create 'raw' folder in 'res' and write following code in my activity. </p><pre><code>MediaPlayer mp = MediaPlayer.create(VideoPlayer.this,R.raw.jeevrangala);mp.start();</code></pre><p>now i am testing it on emulator, but it does not displaying any thing.is any one have solution to play video files in raw folder. please let me know.</p>","395627","","104117","","2011-01-27 14:15:03","2013-05-02 09:21:04","To play video files using MediaPlayer class in android","<android>","2","1","1","",""
"3861434","1","3861613","","2010-10-05 06:56:05","8","10150","<p>Can anybody please tell What Inflator is and how it is being used in an Android application?</p><p>I don't know the exact use of it and Why it is being used.</p>","422859","","464552","","2013-07-05 08:18:54","2013-07-05 08:18:54","Inflator in Android Application Development","<android>","2","0","3","",""
"3861454","1","3861562","","2010-10-05 06:59:31","0","147","<p>I have been searching for this for the past few days and every tutorial I see needs for me to use an external package. Is there anything built into the Android SDK that would allow me to create a database? I thought I saw something on it a long time ago, but I can't find anything to back that foggy memory up.</p>","348261","","","","","2010-10-05 07:18:36","Is it possible to create an Android database without external tools?","<android><database><sdk><package>","1","2","","",""
"3861578","1","","","2010-10-05 07:21:23","1","186","<p>I need to set the ic_launcher_browser icon from the Browser Application in my package for a particular Activity in AndroidManifest.xml (android:icon="""")</p><p>How do i do that??</p><p>Like android:icon=""@android:drawable/xyz""</p><p>Can't we specify android:icon=""@packagename:drawable/xyz""</p><p>Regards,Sanat</p>","466535","","466535","","2010-10-05 11:41:11","2010-10-05 11:41:11","point the drawable from another application in AndroidManifest.xml","<android><android-manifest>","0","1","","",""
"3861596","1","3862869","","2010-10-05 07:23:17","0","293","<p>Is there a way to use ListAdapter in preferences screen ?or i must use only chekboxpreference, textpreferences, etc....</p>","431652","","","","","2010-10-05 10:41:45","ListAdapter in preferences?","<android><preferences><listadapter>","1","0","","",""
"3861660","1","3871417","","2010-10-05 07:34:14","0","2122","<p>hi i have samsung i5503 galaxy.but i got a problem in developing app.</p><p>first i attach the phone with pc and turn usb debugging on,install the driver than as i run my app ,my phone is not appeared as running android device...so how can i run and test my app on real device....secondly i make apk of my app and than mail it than i open this mail n my phone and try to install the app but error was app not installed.what is the problem..plz help me.my phone's is os is android 2.1(eclair) and firmware version is 2.1 update-1.</p>","450601","","","","","2012-06-27 13:13:13","Application not installed on phone","<android><phone>","4","2","","",""
"3861716","1","","","2010-10-05 07:44:43","3","14157","<p>I am a beginner in Android Developing.Can any1 please guide me how to call a Method of a class kept under other package.</p><p>Like class A in Package 1 calls a method in Class B of Package 2 which returns An array or object.</p><p>Do i have to create an Intent for that?? actually i have to gather all information in 1 class from different classes kept under different packages.</p><p>Thanks in advance.</p><pre><code>package com.xyz.Master;import android.app.Activity;import android.content.Context;import android.os.Build;import android.telephony.CellLocation;import android.telephony.TelephonyManager;import android.telephony.gsm.GsmCellLocation;public class PhoneInfo extends Activity {TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);GsmCellLocation location = (GsmCellLocation) tm.getCellLocation();  public int cellID, lac,mcc,mnc;public String imei,manufacturer,model,product;String[] phoneInfo;int[] phoneLocationInfo;    public String[] getHandsetInfo(){    manufacturer = Build.MANUFACTURER;    model = Build.MODEL;    product = Build.PRODUCT;    imei=tm.getDeviceId();            String softwareVersion = tm.getDeviceSoftwareVersion();    phoneInfo = new String[5];    phoneInfo[0]=imei;    phoneInfo[1]=product;    phoneInfo[2]=model;    phoneInfo[3]=manufacturer;    phoneInfo[4]=softwareVersion;    return phoneInfo;}public int[] getHandsetLocationInfo(){    phoneLocationInfo= new int[4];    String networkOperator = tm.getNetworkOperator();     if (networkOperator != null) {            mcc = Integer.parseInt(networkOperator.substring(0, 3));            mnc = Integer.parseInt(networkOperator.substring(3));      }     CellLocation.requestLocationUpdate();      cellID = location.getCid();     lac = location.getLac();     phoneLocationInfo[0]=cellID;     phoneLocationInfo[1]=lac;     phoneLocationInfo[2]=mcc;     phoneLocationInfo[3]=mnc;     return phoneLocationInfo;}}</code></pre><p>I want to call above methods from other class and get these arrays.How to do that, is there any error in above code??</p>","457146","","3248316","","2014-02-02 16:55:17","2014-02-02 16:55:17","how to call a Method of a class kept under other package","<java><android>","2","2","3","",""
"3861731","1","","","2010-10-05 07:46:22","0","659","<p>I need populate three columns in Android activity with dynamic data. How  can I do it?</p>","444463","","23897","","2010-10-05 07:47:27","2010-10-05 08:26:26","How create and populate three columns on Android","<android><layout>","1","0","","",""
"3861784","1","","","2010-10-05 07:54:22","0","127","<p>I have 300 url links that I want store, I plan to have 10 xml's, below is my code, how can I store the urls in a xml and retrieve them in this code??  I want to get the coordinates based on the users selection from a list view.</p><pre><code>public class official extends Activity {@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {        mWebView.goBack();        return true;    }    return super.onKeyDown(keyCode, event);}    WebView mWebView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.browser1);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""http://google.com"");        mWebView.setWebViewClient(new HelloWebViewClient());    }}class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;    }}</code></pre>","445174","","445174","","2010-10-05 08:06:02","2012-04-19 14:54:21","Storing and retrieving url links","<java><android><eclipse>","1","4","","",""
"3861903","1","","","2010-10-05 08:14:26","0","605","<p>I have 100 map coordinates which I plan to store in 5 xml,s, how can I store them in a xml and retrive them in this code.</p><pre><code>MapView mapView; MapController mc;GeoPoint p;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.map1);    mapView = (MapView) findViewById(R.id.mapView);    new LinearLayout.LayoutParams(            android.view.ViewGroup.LayoutParams.WRAP_CONTENT,             android.view.ViewGroup.LayoutParams.WRAP_CONTENT);     mapView.displayZoomControls(true);    mc = mapView.getController();    String coordinates[] = {"" 53.804224"", ""-1.759057""};    double lat = Double.parseDouble(coordinates[0]);    double lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint(        (int) (lat * 1E6),         (int) (lng * 1E6));    mc.animateTo(p);    mc.setZoom(17);     mapView.invalidate();}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}</code></pre>","445174","","212275","","2010-10-05 20:04:58","2010-10-05 20:04:58","How can I store map coordinates and retrieve them","<java><android><eclipse>","3","1","","",""
"3861904","1","","","2010-10-05 08:14:34","2","413","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3803871/android-apps-communicating-with-a-device-plugged-in-the-usb-port"">Android apps, communicating with a device plugged in the USB port</a>  </p></blockquote><p>We can access the android device from PC through USB port.But here i want to do a bit different thing. That is,I want to send message from PC to android device programmatically. That means there are two application one will be installed on android device and the other will be install on PC. I will send message from PC to the device and the device's app will get the message.</p><p>So how can I do this?Can anyone know the answer or any advice, please answer me.</p><p>Thanks in Advance,gsmaker</p>","424854","","","","","2010-10-05 08:14:34","how to communicate from PC to Android device?","<android>","0","1","1","2011-08-05 03:05:16",""
"3861956","1","3862623","","2010-10-05 08:21:42","0","403","<p>Starting with 2.2, scrollbars would disappear once the scrolling has stopped.<br>Is there a way to make them always visible like before?</p>","15187","","","","","2012-03-11 02:03:08","Prevent scrollbar from hiding on froyo","<android>","3","0","","",""
"3862073","1","3929307","","2010-10-05 08:42:16","1","678","<p>In a nutshell, I use regular views for all my application except for on that uses a GLSurfaceView.</p><p>the UI flow works well. I can navigate form one to the over </p><p>except whith the GLSurfaceView</p><p>when I open the first time the GLSurfaceView everything works fine, but when I switch to another view and come back (pause menu) my view is completly black...</p><p>I tried several things and the closest I got from fixing it is to recreate the GLSurfaceView completly (but that takes too much time ...)</p><p>What I want is be able to do this:if(glView){    activity.setContentView(mView);}else{    activity.setContentView(id);}(id being an xml layout)</p><p>can somebody tell me what I'm doing wrong or point me to a tutorial that explain how to swap form GLViews to regular views </p><p>thanks a lot </p><p>Jason </p>","440336","","","","","2010-10-14 01:04:59","GlSurfaceView is completly black when reloaded","<android><opengl-es><glsurfaceview>","1","0","1","",""
"3862131","1","","","2010-10-05 08:50:46","1","877","<p>I need to display notification in the status bar with the application icon. but i didn't find any way to retrieve the application icon id ?(I currently use the 1.5 SDK)</p>","164460","","","","","2012-01-18 21:55:53","android application icon id","<android><icons>","2","0","","",""
"3862136","1","3862929","","2010-10-05 08:51:16","0","2453","<p>Can anyone tell me how to add a boarder to a TableLayout in android, like the one below?</p><p><a href=""http://developer.android.com/images/table_layout.png"" rel=""nofollow"">http://developer.android.com/images/table_layout.png</a></p>","145598","","","","","2010-10-05 10:49:23","How to style a tablelayout in android","<android><coding-style><tablelayout>","2","0","","",""
"3862207","1","4609413","","2010-10-05 09:01:05","5","1683","<p>I need to find out which broadcast receivers can handle a given Intent.</p><p>It seems that <em>queryBroadcastReceivers()</em> does not return receivers registered in code using <em>registerReceiver()</em> but only receivers declared in <em>AndroidManifest.xml</em>.</p><p>Is this behavior by design?</p><p>Any other way to find <strong>all</strong> installed receivers for some Intent ?</p><p>Thanks.</p>","451779","","","","","2012-08-22 12:51:16","queryBroadcastReceivers does not find receivers registered with registerReceiver","<android><broadcastreceiver>","2","1","2","",""
"3862275","1","3863043","","2010-10-05 09:12:35","0","277","<p>hi i am new to Android.what i did is i am creating a sqllitedatabase in class A.I am creating a table and inserting the some values.Now what i need is i have to insert some more values from class B to the same database.how can i done this.pls help me.Thank u in advance.</p>","699226","","699226","","2010-10-05 09:49:51","2010-10-05 11:05:36","how to modify database in android","<android>","1","2","","",""
"3862281","1","12931731","","2010-10-05 09:13:34","3","6505","<p>I'm trying to create a ListView that will consist of two types of elements: Strings and a GridView.<br>I.e. putting both Strings and a GridView inside one single ListView.</p><p>The layout should look something like this:</p><ul><li>String Item 1.1</li><li>String Item 1.2</li><li>String Item 1.3</li><li>String Item 1.4</li><li>GridView Item 1 GridView Item 2 <br />GridView Item 3 GridView Item 4</li><li>String Item 2.1</li><li>String Item 2.2</li><li>String Item 2.3</li><li>String Item 2.4</li></ul><p>Is there any way to do this?</p><p>As per now I can only show the first item in the GridView, and it acts just as a regular String element in the ListView.</p><p>The code can be viewed here:</p><p><a href=""http://pastebin.com/kFyX75Hb"" rel=""nofollow"">Code list</a> (Since I only can post one link)</p><p>Any help is appreciated :)</p>","367101","","707111","","2013-07-15 15:26:16","2013-07-15 15:26:16","Add a GridView to a ListView in Android","<android><gridview><listview>","2","0","4","",""
"3862409","1","3863114","","2010-10-05 09:33:46","7","13110","<p>I've been looking around for quite some time now, and I can't get a straight answer for my question.</p><p>It's quite simple: How can I get a nice scrolling text just like the long app names in the Market when you select an application?</p>","367101","","","","","2012-05-03 21:40:38","Horizontal scrolling text in Android","<android><text><textview><horizontal-scrolling>","4","0","6","",""
"3862576","1","3862602","","2010-10-05 09:58:53","1","119","<p><img src=""http://i.stack.imgur.com/XIABK.png"" alt=""alt text"">I have seen the above marked (Encircled in Red) widget in quiet a few applications, what is it?</p>","421372","","","","","2010-10-05 10:03:04","Identify this Android Widget","<android><widget>","1","0","","",""
"3862581","1","3864469","","2010-10-05 09:59:36","0","3447","<p>Can anybody have any idea how to read a binary file which resides in sdcard using Streams, like Inputstream, CountingInputStream or SwappedDataInputStream?</p><p>I am using these three streams to read a file which is currently in the Resouces folder, but now i want to move that file in sdcard but I cannot change these stream because I have done so much work on it and I cannot roll back my work.i am doing it this way but its giving me FileNotFoundException. i need your help please.</p><blockquote>  <p>AssetManager assetManager = getResources().getAssets(); final File  folder = new File(Environment.getExternalStorageDirectory() + ""/map"");         boolean success = false;        if(!folder.exists())        {             success = folder.mkdir();       }       else        {             Log.i(""folder already exists"", ""folder already exists"");        }</p>    <p>try {            iStream =  assetManager.open(Environment.getExternalStorageDirectory().getAbsolutePath().concat(""/map/map.amf""));                                } catch (IOException e) {           // TODO Auto-generated catch block          e.printStackTrace();        }        cis = new  CountingInputStream(iStream);          input = new  SwappedDataInputStream(cis);</p></blockquote><p>Thanks a lot for any suggestion.</p>","397901","","2624806","","2012-10-31 13:09:34","2012-10-31 13:09:34","Reading binary file from sdcard using Stream classes in android","<java><android><file><filestream>","1","0","","",""
"3862582","1","","","2010-10-05 09:59:36","0","694","<p>I am currently working on a mobile application which uses OWL ontologies.</p><p>I am planning on using the androjena lib which is a port of the java jena lib.</p><p><a href=""http://code.google.com/p/androjena/"" rel=""nofollow"">http://code.google.com/p/androjena/</a></p><p>As instructed in the documentation, I have added the 5 .jar files included with Androjena to the build path of the Android Project.</p><p>This results in the following errors when compiling:</p><p><b>[2010-10-05 11:19:28 - MS Project] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)</p><p>[2010-10-05 11:19:46 - Dex Loader] Unable to execute dex: null</p><p>[2010-10-05 11:19:46 - MS Project] Conversion to Dalvik format failed: Unable to execute dex: null</b></p><p>Anyone experienced similar problems?</p><p>Thanks!</p>","466674","","","","","2013-04-08 10:25:42","Build failures Jena on Android (Androjena)","<java><android><jena>","2","0","","",""
"3862635","1","3886847","","2010-10-05 10:07:30","2","3533","<p>I have a FrameLayout that has 2 images, a big one that that fills the FrameLayout and a very small one that I want to move around.</p><p>I try to move the small one like this:xml file</p><pre><code>   &lt;FrameLayout android:id=""@+id/layTrackMap""                      android:layout_width=""wrap_content""                                android:layout_height=""wrap_content""                               android:visibility=""gone""&gt;         &lt;ImageView android:id=""@+id/imgTrackMap""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""               /&gt;         &lt;ImageView android:id=""@+id/imgPosition""                android:layout_width=""wrap_content""               android:src=""@drawable/position""                android:layout_height=""wrap_content""               /&gt;         &lt;/FrameLayout&gt;   </code></pre><p>and the code:</p><pre><code>imgPosition = (ImageView)findViewById(R.id.imgPosition);    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);    //Neither this:    //lp.setMargins(30, 20, 0, 0);    //Or this    lp.leftMargin=30;    lp.topMargin=80;    imgPosition.setLayoutParams(lp);</code></pre><p>The small image doesn't move. I want to be able to move the small image around in layout.</p><p><strong>LATER EDIT:After trying several suggestions I came to the conclusion that is simpler to just make a custom View and override onDraw to do the job.</strong></p>","379865","","379865","","2010-10-20 16:18:30","2011-06-21 10:08:35","ImageView setMargins doesn't work","<android><imageview>","3","0","","",""
"3862731","1","3862816","","2010-10-05 10:20:39","2","4401","<p>How i can get the latitude and longitude of the current location, from android?</p>","436765","","","","","2011-12-28 15:13:13","Latitude and Longitude of the current location","<android>","1","4","3","",""
"3862756","1","","","2010-10-05 10:24:23","3","2571","<p>i'd like to show a dialog, like when i use showDialog(...) on the Activity, but i need to do that on a widget, so i can't use showDialog(...). How can i do that?</p><p>I tried this on my onReceive method but it crash:</p><pre><code>AlertDialog.Builder builder;            builder = new AlertDialog.Builder(context);            builder.setMessage(""Are you sure?"")            .setCancelable(false)            .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    db.open();                    db.remove_last();                    db.close();                    dialog.dismiss();                }            })            .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    dialog.cancel();                }            });            builder.show();</code></pre><p>Thanks, Valerio</p>","314554","","","","","2011-07-22 10:13:32","How to show a dialog on a widget?","<android><dialog><widget>","2","0","2","",""
"3862839","1","3862906","","2010-10-05 10:36:45","0","325","<p>Higuys, i have an application in j2me which uses the method RecordStore.listRecordStores().i need to implement the same application in android. does anyone know the corresponding method in android???</p>","462695","","","","","2010-10-05 13:05:39","found missing ""record stores"" in android from j2me","<android>","2","0","","",""
"3862987","1","3863848","","2010-10-05 10:57:03","1","151","<p>I would like to know how i can attach the Android clock or calendar into my application.<br>That is when my application comes up one part of the view will be reserved for this application.  </p><p>Please guide me.</p><p>Thanks,<br>Sen</p>","449378","","","","","2010-10-05 13:01:55","How can I attach a clock or a calendar to my application?","<android>","2","0","","",""
"3863056","1","","","2010-10-05 11:07:08","1","321","<p>in one xml file i have created some layouts with flipper.main xml 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:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:background=""#ffffff""android:id=""@+id/layout_main""&gt;&lt;ViewFlipper android:id=""@+id/details""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:id=""@+id/facebook_layout""&gt;    &lt;LinearLayout android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:background=""#ffffff""        android:id=""@+id/videolist""&gt;&lt;ImageView android:id=""@+id/image1""                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:background=""#ffffff"" android:id=""@+id/videolistdisplay""&gt;            &lt;ScrollView android:id=""@+id/scroll""                android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;                &lt;LinearLayout android:id=""@+id/container""                    android:orientation=""vertical"" android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""&gt;&lt;/LinearLayout&gt;            &lt;/ScrollView&gt;***        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;</code></pre><p>in videolistdisplay i am creating dynamic list with the help of linear layout</p><pre><code>private void createListLayOut(Drawable image, String desc, String title,        final int pos){    final float scale = getBaseContext().getResources().getDisplayMetrics().density;    arrow_image = new ImageView(this);    video_title = new TextView(this);    descDetail = new TextView(this);    final ImageView thumbImage = new ImageView(this);    linearContainer = new LinearLayout(this);    titlewithdesc = new LinearLayout(this);    line = new LinearLayout(this);    linearContainer.setId(pos);    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(            LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);    titlewithdesc.setOrientation(LinearLayout.VERTICAL);    titlewithdesc.setPadding(1, 1, 1, 1);    titlewithdesc.setLayoutParams(lp);    lp = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,            LayoutParams.WRAP_CONTENT);    linearContainer.setOrientation(LinearLayout.HORIZONTAL);    linearContainer.setGravity(Gravity.CENTER_VERTICAL);    linearContainer.setLayoutParams(lp);    linearContainer.setPadding(3, 3, 3, 3);    line.setOrientation(LinearLayout.HORIZONTAL);    line.setGravity(Gravity.CENTER_VERTICAL);    line.setLayoutParams(lp);    line.setPadding(1, 1, 1, 1);    line.setBackgroundColor(Color.BLACK);    lp = new LinearLayout.LayoutParams((int) (225 * scale),            (int) (50 * scale));    // linearContainer.setBackgroundColor(0);    thumbImage.setBackgroundDrawable(image);    thumbImage.setId(pos);    lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT);    lp.setMargins(30, 0, 0, 0);    video_title.setLayoutParams(lp);    video_title.setLines(2);    lp = new LinearLayout.LayoutParams((int) (175 * scale),            (int) (90 * scale));    lp.setMargins(30, 18, 0, 0);    descDetail.setLayoutParams(lp);    descDetail.setLines(3);    video_title.setTextColor(Color.BLUE);    video_title.setText(title);    descDetail.setText(desc);    descDetail.setTextColor(Color.BLACK);    descDetail.setPadding(0, 5, 0, 0);    titlewithdesc.addView(video_title);    titlewithdesc.addView(descDetail);    linearContainer.addView(thumbImage);    linearContainer.addView(titlewithdesc);    linearContainer.setId(pos);    video_title.setId(pos);    linearMain.addView(linearContainer);    linearMain.addView(line);    thumbImage.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // TODO Auto-generated method stub            Intent myIntent = new Intent(PlayActivity.this,                    VideoDisplay.class);            myIntent.putExtra(""IndexNumber"", v.getId());            startActivity(myIntent);        }    });}</code></pre><p>Problem is this all layout flliping properly but ""videolistdisplay"" is not going to flip</p><p>for slide effect i wrote :</p><pre><code>public boolean onTouch(View arg0, MotionEvent arg1) {    // Get the action that was done on this touch event    switch (arg1.getAction())    {        case MotionEvent.ACTION_DOWN:        {            // store the X value when the user's finger was pressed down            downXValue = arg1.getX();            break;        }        case MotionEvent.ACTION_UP:        {            // Get the X value when the user released his/her finger            float currentX = arg1.getX();                        // going backwards: pushing stuff to the right            if (downXValue &lt; currentX)            {                // Get a reference to the ViewFlipper                 ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);                 // Set the animation                  vf.setAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_out));                  // Flip!                  vf.showPrevious();            }            // going forwards: pushing stuff to the left            if (downXValue &gt; currentX)            {                // Get a reference to the ViewFlipper                ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);                 // Set the animation                 vf.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_left_in));                  // Flip!                 vf.showNext();            }            break;        }    }    // if you return false, these actions will not be recorded    return true;}</code></pre><p>All of layout working perfectly but <strong>videolistdisplay</strong> layout display only one time and i can not slide it left or right way.. please tell where i am doing mistake</p>","304961","","","","","2010-10-05 11:07:08","flipper problem in android","<android>","0","0","","",""
"3863128","1","7450056","","2010-10-05 11:17:37","3","1153","<p>Im having a problem starting or running any activity unit tests from within eclipse.</p><p>Even i start a clean project and make a simple test class it always prints to the console:</p><pre><code>[2010-10-05 13:10:24 - testAndroid] Collecting test information[2010-10-05 13:10:25 - testAndroid] Test run failed: Test run incomplete. Expected 2 tests, received 0</code></pre><p>Any ideas ?</p><p>Just for testing, I have created a fresh Android project called Demo with a test project called DemoTest</p><p>The main activity to test is called Main and I have created a simple testclass MainTest that looks like this:</p><pre><code>package net.demo.test;import android.test.ActivityInstrumentationTestCase2;import net.demo.Main;    public class MainTest extends ActivityInstrumentationTestCase2&lt;Main&gt;    {        public MainTest()        {            super(""net.demo"", Main.class);            // TODO Auto-generated constructor stub        }    }</code></pre><p>My tests used to run fine before, but suddenly I cant run any of them, they all fail with the same error, even I create new a project. It seems like it something to do with Eclipse or and not with the Code.</p><p><strong>Update:</strong>Seems like extending <code>SingleLaunchActivityTestCase&lt;Main&gt;</code> is working, but still got no clue about how to make <code>ActivityInstrumentationTestCase2&lt;Main&gt;</code> working. </p>","133858","","403455","","2011-08-22 19:17:06","2012-02-03 19:49:41","Problems with running Android Activity unit-testing from Eclipse","<android><unit-testing>","2","1","","",""
"3863159","1","3863349","","2010-10-05 11:21:54","0","1019","<p>Sorry I am a noob, I am trying to learn about sqlite databases using linux, I cannot find any tutorial that covers what I need from setup to creating to using.  At the moment tutorials I find say open a shell using adb shell command but when I open a terminal this does not work even if I navigate to the android tools folder, I can get the sqlite command working but the tutorials dont explain how I use it.  For instance, how do I store urls  and map coordinates and how to I reference them.</p><p>I have tried to use the firefox plugin but I havent got a clue what it all means and every tutorial says sqlite database is easy but it seems so complicated.......HELP!!!!</p><p>P.S would it be possible to create the data within the application code, I have seen some apps that do this </p><p>Does anyone have a set up guide and tutorial that can help? </p>","445174","","445174","","2010-10-05 11:28:47","2010-10-21 17:37:51","Setting up sqlite database","<java><android><eclipse><sqlite3>","6","0","1","",""
"3863278","1","3863345","","2010-10-05 11:40:14","0","1017","<p>I have created one custom view that contains the horizontalscrollview. Now when i changes the orientation its scroll state change to 0 every time.</p><p>I got the previous scroll state by using <code>onSaveInstanceState(Bundle savedInstanceState)</code> and <code>onRestoreInstanceState(Bundle savedInstanceState)</code> . in <code>onRestoreInstanceState</code> i am using following method to get reposition the scroll,</p><pre><code>hoz_scroll.scrollTo(hoz_x_pos, hoz_scroll.getScrollY());</code></pre><p>But there is not effect at all. Help appreciated.  Thanks.</p>","266097","","","","","2014-01-29 07:56:57","How to maintain the scrolling state while orientation change in android","<android><user-interface><android-widget>","4","0","","",""
"3863288","1","3863445","","2010-10-05 11:42:02","0","241","<p>Is it advisable to create your own Activity stack (which contains only the activity names rather then the complete activity as in the default stack) to improve the memory consumption of the application.</p><p>What im basically doing is maintaining a string stack containing the activity names and override the back button functionality to launch Intent with the stack top and finish the current activity. I also add a parameter to decide if the current activity should go into the stack or not (useful in certain situation). So basically I do a <code>startActivity</code> every time I have to launch a new activity and finish the current one so that there is nothing in the default stack and on back press also start the activity from my stack and finish the current activity.</p><p>Ques 1: Is it advisable to do it this way? What are the possible problems that could happen?  </p><p>Ques 2: Can someone give me an idea of the memory usage of the default Android activity stack so that I can compare it with my own implementation?  </p>","237403","","","","","2010-10-05 12:06:54","Overriding the default Activity stack","<android>","1","0","","",""
"3863299","1","","","2010-10-05 11:44:24","0","2625","<p>I need android code to display the video listing from the gallery or sdcard and play when click on that.can anybody help.Please.I have run the following code.but it shows the application has stopped unexpectedly</p><p>public class StartActivity extends Activity {</p><pre><code>/** Called when the activity is first created. */private final static Uri MEDIA_EXTERNAL_CONTENT_URI = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;private final static String _ID = MediaStore.Video.Media._ID;private final static String MEDIA_DATA = MediaStore.Video.Media.DATA;private GridView _gallery;private Cursor _cursor;private int _columnIndex;private int[] _videosId;private Uri _contentUri;protected Context _context;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    initVideosId();    setGalleryAdapter();}private void initVideosId() {    try {    //Here we set up a string array of the thumbnail ID column we want to get back     String [] proj={_ID};      //Now we create the cursor pointing to the external thumbnail store     _cursor = managedQuery(_contentUri,     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 count= _cursor.getCount();     // We now get the column index of the thumbnail id     _columnIndex = _cursor.getColumnIndex(_ID);     //initialize     _videosId = new int[count];     //move position to first element     _cursor.moveToFirst();      for(int i=0;i&lt;count;i++)     {      int id = _cursor.getInt(_columnIndex);     //     _videosId[i]= id;     //     _cursor.moveToNext();     //     }    }    catch(Exception ex)    {    showToast(ex.getMessage().toString());     }    }private void setGalleryAdapter() {    _gallery.setAdapter(new VideoGalleryAdapter(_context));    _gallery.setOnItemClickListener(_itemClickLis);    }private class VideoGalleryAdapter extends BaseAdapter {public VideoGalleryAdapter(Context c){_context = c;}public int getCount(){return _videosId.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 imgVw= new ImageView(_context);;try{if(convertView!=null){imgVw= (ImageView) convertView;}imgVw.setImageBitmap(getImage(_videosId[position]));imgVw.setLayoutParams(new GridView.LayoutParams(96, 96));imgVw.setPadding(8, 8, 8, 8);}catch(Exception ex){System.out.println(""StartActivity:getView()-135: ex "" + ex.getClass() +"", ""+ ex.getMessage());}return imgVw;}// Create the thumbnail on the flyprivate Bitmap getImage(int id) {Bitmap thumb = MediaStore.Video.Thumbnails.getThumbnail(getContentResolver(),id, MediaStore.Video.Thumbnails.MICRO_KIND, null);return thumb;}}private OnItemClickListener _itemClickLis = new OnItemClickListener(){public void OnItemClick(AdapterView parent, View v, int position, long id){// Now we want to actually get the data location of the fileString [] proj={MEDIA_DATA};// We request our cursor again_cursor = managedQuery(_contentUri,proj, // Which columns to returnnull,       // WHERE clause; which rows to return (all rows)null,       // WHERE clause selection arguments (none)null); // Order-by clause (ascending by name)// We want to get the column index for the data uriint count = _cursor.getCount();_cursor.moveToFirst();_columnIndex = _cursor.getColumnIndex(MEDIA_DATA);// Lets move to the selected item in the cursor_cursor.moveToPosition(position);// And here we get the filenameString filename = _cursor.getString(_columnIndex);//*********** You can do anything when you know the file path showToast(filename);//}@Overridepublic void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {    // TODO Auto-generated method stub}};protected void showToast(String msg){Toast.makeText(_context, msg, Toast.LENGTH_LONG).show();}</code></pre>","402980","","402980","","2010-10-06 06:32:49","2010-10-06 06:32:49","android code to play the video from the sd card","<android><android-emulator><android-sdcard>","0","2","","",""
"3863364","1","4162666","","2010-10-05 11:54:04","4","3877","<p>I have successfully installed the Openfire XMPP server and built an Android app to text chat, How can I implement VOIP functionality to my application? Can  this be done by connecting openfire with a SIP server?</p><p>Can someone guide me?</p>","274107","","","","","2010-11-12 08:05:31","Chat and VOIP Application","<android><xmpp><voip><sip><openfire>","2","1","6","",""
"3863456","1","3863507","","2010-10-05 12:08:17","0","628","<p>I am looking for an optimized solution to display image in different screen size.</p><p>I have a image in server which I would like to display in different handled devices like iPhone, iPad ,Android based tablets or mobiles etc.</p><p>Some of the solution I have thought of are</p><ol><li>Have different images in server for each screen size. </li><li>Have a single image in server then scale the image in device to fit to screen size.</li><li>Hybrid of above two technique --- I will store some of the screen sizes images in server then in device end I will download image to its nearest screen size and scale to fit.</li></ol><p>I appreciate your thought one this and welcome all valuable suggestion. </p><p>I believe this is common issue when there are so many different sized screens in the market. Please let me know if I am missing any proven solution to this problem.</p><p>Girish Kolari</p>","231885","","","","","2010-10-05 12:14:57","Image in different screen size","<iphone><android><image><ipad>","1","0","","",""
"3863480","1","3864220","","2010-10-05 12:11:33","0","297","<p>I'm experimenting with REST and XML on an Android application, primarily to create a REST client</p><p>For handling XML returned from a given REST service, I'm tempted to use a simple framework such as <a href=""http://xstream.codehaus.org/tutorial.html"" rel=""nofollow"">XStream</a>. This allows me to easily map an object onto XML and vice versa, it doesn't come with the memory overhead like DOM, and requires considerably less coding that SAX</p><p>Can anyone offer any disadvantages to going down such route?</p>","155695","","","","","2010-10-05 15:29:45","Android; are there any disadvantages to using XML parsing frameworks over SAX/DOM?","<android><xml><rest>","2","0","","",""
"3863493","1","3952938","","2010-10-05 12:13:02","1","5254","<p>I am displaying a Progress bar in Android, which is as below:</p><p><img src=""http://i.stack.imgur.com/iKMla.png"" alt=""alt text""></p><p>but there is a <strong>white border</strong> around the progress-bar, what if i <strong>dont want to display any border?</strong></p><p>i.e. Only progress-bar circle and text should be shown in progress-bar dialog.</p><p>How do i display below progress bar? <strong><em>(How do i display progress dialog as Searching in below image:)</em></strong></p><p><img src=""http://i.stack.imgur.com/RMdBV.png"" alt=""alt text""></p><p><strong>Update:</strong>I am failed to find the solution for this, but i think there should be some trick to display progressbar dialog in this way, i mean to say there should be a way by extending some styles in styles.xml. Please anybody focus on this question and help me to display such dialog.</p>","379693","","379693","","2010-11-01 12:19:35","2014-01-30 05:23:33","Progressbar dialog Without Border","<android><progress-bar><android-progressbar>","3","2","1","",""
"3863498","1","15969807","","2010-10-05 12:13:55","2","3773","<p>Hi am wondering if anyone knows of a IDE for my Android tablet that I can edit compile and upload sketches to my Arduino board via USB?</p>","455923","","","","","2013-04-12 11:08:02","Arduino IDE on Android tablet","<android><ide><arduino>","5","2","","",""
"3863515","1","4882393","","2010-10-05 12:16:29","0","896","<p>HI.. This is my code in xml</p><pre><code>&lt;EditText android:longClickable=""false""                    android:layout_marginLeft=""5dp"" android:id=""@+id/txt""                    android:width=""150dp"" android:singleLine=""true"" android:text=""@string/value""                    android:inputType=""none"" android:cursorVisible=""false"" /&gt;</code></pre><p>I have manually disabled soft keyboard in my application. </p><pre><code>InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);        imm.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);</code></pre><p>where view is the EditText. However I m unable to disable the input from hardware keyboard (slide keyboard) like the ones in droid for that particular EditText. How can this be achieved ?</p>","368084","","","","","2011-02-03 03:28:58","How to disable hardware keyboard for a particular EditText?","<android>","1","2","","",""
"3863529","1","6227602","","2010-10-05 12:18:47","1","1768","<p>I'm trying to find a solution for following thing.</p><p>Autocompletetextview with filtering on sqlite side.</p><p>I guess, I should write custom CursorAdapter, which implements Filterable, but I have no idea, where to start.</p><p>Did anybody see any examples / tutorials for that?</p><p>Mur</p>","408780","","","","","2011-06-03 13:19:37","Android. Autocompletetextview and sqlite","<android><sqlite><autocomplete>","1","3","1","",""
"3863776","1","3863990","","2010-10-05 12:53:50","1","682","<p>I'm trying to develop an android application that uses network connection. The server is up and running, but when i am trying to access it from the device that runs the android app (in debug mode-using eclipse) it outputs a message that 'cannot find the server' after a UnknownHostException occurs! I have tested the server with a java application and it works fine! What is the problem then with the device?</p>","466825","","","","","2010-10-05 13:18:14","Cannot access the internet while i debug android on device","<android><android-manifest>","1","3","","",""
"3863825","1","3864017","","2010-10-05 12:59:45","1","250","<p>Currently porting an iPhone application to Android. I've encountered an issue that I haven't been able to overcome.</p><p>On the iPhone, translating your text is trivial. Put all your strings/text in Localizable.strings in the format:""sentence to translate"" = ""sentence translated""</p><p>The original string can contain any characters of any type.</p><p>Trying to reproduce something similar on Android, in the strings.xml I added all keys like:sentence translated</p><p>Then I was hoping to do something like:<br><code>int resID = getResources().getIdentifier(tmp, ""strings"", ""com.name.app_name"");</code>where tmp contains the string.Once I get the resID, I can get the translated string with findresourcebyId.</p><p>Unfortunately, found out that it ain't so easy. The name of the string can't contain space, can't start with a digit and so on.</p><p>Eclipse doesn't show me anything, but when trying to run the code, I simply get a ""Your project contains errors. Please fix them before running your application"" and that's it. Can't see anything in the error log etc..</p><p>So, what are the restrictions in the name of a resource on Android. Or is there a way to circumvent it and easily replace one string with another. I'd like to keep the original dictionary of text I was using on the iPhone to keep things simple and not introduce any unnecessary errors.</p><p>Thanks</p>","298699","","420851","","2010-10-05 15:20:25","2010-10-05 15:20:25","Restrictions on resource name or how to do generic internationalisation","<java><android><xml><internationalization>","1","0","","",""
"3863850","1","","","2010-10-05 13:02:01","1","383","<p>I have two questions:</p><ul><li><p>What is the function of dispatchDraw()? The documentation says that it draws the children for the widget. Is this called after the onDraw() of the widget or is it totally unrelated.</p></li><li><p>I saw the source code for the SlidingDrawer widget on the Android website. They have not overridden onDraw() for it. I tried doing it, but it did not draw on the canvas for the SlidingDrawer. Any idea why? Does the dispatchDraw() call onDraw() for the <b>content</b> of the SlidingDrawer?</p></li></ul><p>Sorry if they seem silly. But I really want to know! Thanks!</p>","363441","","","","","2010-10-05 13:02:01","Overriding OnDraw() for a SlidingDrawer","<java><android><android-widget><slidingdrawer>","0","1","","",""
"3863857","1","3863933","","2010-10-05 13:02:31","0","325","<p>I'm looking for the Java equivalent to the XML assignment for assignments such as 'android:id=""@android:id/tabcontent""'.</p><p>thnx</p>","353616","","223590","","2010-10-05 13:09:13","2010-10-05 13:12:00","How do I programmatically assign an id such as 'android:id/tabcontent''?","<android><android-widget>","1","0","","",""
"3863871","1","3863894","","2010-10-05 13:04:10","0","191","<p>I am new to android development.I am tried installing android sdk with eclipse 3.6, but i later found that there some issues with eclipse 3.6 through <a href=""http://developer.android.com/sdk/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/sdk/eclipse-adt.html</a>.</p><p>So i am headed towards getting eclipse 3.5.But i am not able to download it from the official website.(http://www.eclipse.org/downloads/packages/release/galileo/r)</p><p>Can anyone please provide me any other mirror available for eclipse 3.5 or 3.4 ??(Probably this not a question to be asked here )Or please let me know if android SDK can be used with eclipse 3.6 ???</p><p>thanks !</p>","466842","","","","","2010-10-05 15:18:43","Not able to download eclipse 3.5","<android>","1","0","","",""
"3863992","1","","","2010-10-05 13:18:33","0","337","<p>I have one activity in which i have opened device camera and taking pictures after 1 min each.This is working without any problem.Now my camera is always on.When i press either home screen key or call key,my camera activity is going to background.When i again clicking on my application,ideally my camera activity should come to foreground and camera should be opened.</p><p>But this is not happening.When i am clicking on my application icon,my application is crashing.</p><p>Is anybody know how to solve this problem?</p><p>Thanks and Regards.</p><p>Rohan Wagh  </p>","466848","","","","","2011-11-02 00:51:28","Problem with camera","<android>","1","2","","",""
"3864041","1","3864111","","2010-10-05 13:25:36","3","2725","<p>Can anyone possible explain what the following code does?</p><pre><code>  public View getView(int position, View convertView, ViewGroup parent) {   // TODO Auto-generated method stub   View myView = null;   try {    myView = convertView;    if (null == myView) {     LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);     myView = li.inflate(R.layout.demographic_list_item, null);    }    if (mScan_listItems[position] != null) {     // read the values and attach them.     TextView tv1 = (TextView) myView       .findViewById(R.id.DemoGraphicItem_Text);     tv1.setText(mScan_listItems[position]);    }   } catch (Exception e) {    e.printStackTrace();   }   return myView;  } }</code></pre>","456936","","244296","","2010-10-05 13:28:01","2013-02-27 05:48:03","question on getView()","<android>","3","4","1","",""
"3864044","1","3864061","","2010-10-05 13:25:40","1","391","<p>Does the Twitter4J library for Android work for all Android versions?  I cannot find anything regarding this issue on twitter4j's website, or anywhere else.<a href=""http://twitter4j.org/en/index.html"" rel=""nofollow"">twitter4j.org</a></p>","416412","","","","","2011-01-22 08:32:14","What versions of Android are unsupported with Twitter4J?","<android><twitter4j>","2","0","","",""
"3864084","1","3864166","","2010-10-05 13:31:11","1","713","<p>I am writing the program for reading contacts from android.when i am executing the following code   it successfully gets the name but failed to get phone number and showing the ArrayIndexoutofBoundException....The code is</p><pre><code>Cursor people = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);while(people.moveToNext()) {    int nameFieldColumnIndex = people.getColumnIndex(PhoneLookup.DISPLAY_NAME);    String contact = people.getString(nameFieldColumnIndex);    contactView.append(contact);    int numberFieldColumnIndex = people.getColumnIndex(PhoneLookup.NUMBER);    String number = people.getString(numberFieldColumnIndex);    contactView.append(number);}</code></pre>","461972","","122313","","2010-10-05 13:35:23","2010-10-05 13:41:28","Reading contacts in Android","<android>","1","0","","",""
"3864367","1","3865492","","2010-10-05 14:02:52","0","2978","<p>I have an Android application which uses sqlite database to store textual data for a particular user. The data is read/written from/to the database from a service that runs periodically after every n seconds. My requirement is to clear data depending on age. Like, if the file is more than 24 hours old it should be deleted.  </p><p>Checking the age of the file seems easy, just compare current time with the File creation time. The problem is:  </p><ol><li><p>where should I put this check and delete the file; inside application onCreate() or when the user logs in/ logs out? What would be an ideal place to trigger this logic from? Should I schedule an Alarm when the user logs in?  </p></li><li><p>Should I delete the file or simply delete the rows? If I don't trigger the Cache clearance logic from login/logout, won't deleting the file cause problems, especially if the service is still trying to read and write from the database?  </p></li></ol><p>Please advice.</p><p>Thanks.</p>","236128","","","","","2010-10-05 16:02:04","Clearing Application database","<android><caching><sqlite3>","1","0","","",""
"3864384","1","3864476","","2010-10-05 14:04:30","0","1127","<p>My app Consists an intro page with ""Start"", ""About"", etc..</p><p>I managed to create a functional version of the app by having the ""Start"" button call a new layout in which a new onclick listener is defined. </p><p>This doesn't seem clean to me that I@m defining a new onClick listener for each Layout I use and wonder how the correct way would be to create individual pages (including my ""About"" and any other screens I implement).</p><p>Any advice is appreciated, thanks.</p>","353674","","","","","2010-10-05 14:21:04","Android pages Activity or Layout?","<android><layout><activity><screen>","1","0","","",""
"3864533","1","5629161","","2010-10-05 14:18:26","1","646","<p>So today I had a bright idea to rename my packages, now my android application which I have schedule for release on thursday is not working.</p><p>I am getting a similar error as follows:</p><pre><code>Error: Activity class {org.me.androidapplication2/com.albertrosa.DEMO.MainActivity} does not exist.</code></pre><p>I have modified the manifest to reflect the change:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""     package=""com.albertrosa.DEMO""     android:versionCode=""1""     android:versionName=""1.0""</code></pre><p>there is more to the manifest but this is all that I have changed. is there something I am missing or doing wrong. I am using netbeans to build this app.</p>","154570","","180538","","2010-10-05 14:35:20","2011-12-09 02:58:41","Renamed packages and now activity cannot be found","<android><package>","3","0","","",""
"3864546","1","3864954","","2010-10-05 14:19:29","2","2372","<p>I need to change Activity to ListActivity. But I can't start my project... do i need change manifest.xml for it?? </p><p>Or how can I change screen from Activity to ListActivity? Is there any difference to <code>startActivity(new Intent(this, list.class))</code> ?</p><pre><code>10-05 17:34:54.722: ERROR/AndroidRuntime(11550): java.lang.RuntimeException: Unable to start activity ComponentInfo{spexco.hus.cepvizyon/spexco.hus.cepvizyon.CepVizyon}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.os.Handler.dispatchMessage(Handler.java:99)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.os.Looper.loop(Looper.java:123)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ActivityThread.main(ActivityThread.java:4363)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at java.lang.reflect.Method.invokeNative(Native Method)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at java.lang.reflect.Method.invoke(Method.java:521)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at dalvik.system.NativeStart.main(Native Method)10-05 17:34:54.722: ERROR/AndroidRuntime(11550): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ListActivity.onContentChanged(ListActivity.java:236)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:201)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.Activity.setContentView(Activity.java:1622)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at spexco.hus.cepvizyon.CepVizyon.onCreate(CepVizyon.java:21)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)10-05 17:34:54.722: ERROR/AndroidRuntime(11550):     ... 11 more10-05 17:34:55.432: ERROR/PowerManagerService(129): setPowerState SystemProperties.get siBefornormal10-05 17:35:01.872: ERROR/PowerManagerService(129): setPowerState SystemProperties.get siBefornormal     public class CepVizyon extends ListActivity  {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                   WindowManager.LayoutParams.FLAG_FULLSCREEN);         setContentView(R.layout.main);         ListView list=(ListView) findViewById(R.id.list);        ImageButton b1 = (ImageButton) findViewById(R.id.menu_mycameras);        ImageButton b2 = (ImageButton) findViewById(R.id.menu_aboutus);        ImageButton b3 = (ImageButton) findViewById(R.id.menu_help);        b1.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                Intent intent=new Intent(CepVizyon.this, CameraSelectScreen.class);                startActivity(intent);                // TODO Auto-generated method stub            }        });        b2.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                Intent intent=new Intent(CepVizyon.this,MainActivity.class);                startActivity(intent);                // TODO Auto-generated method stub            }        });        b3.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub            }        });    }}</code></pre><p>this is my class..</p><p>And This is my main.xml    I dont use list there, i put it for error stack. but nothing change. </p><p></p><pre><code>&lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical"" android:layout_weight=""3""&gt;&lt;ImageButton android:layout_weight=""1"" android:id=""@+id/menu_mycameras""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:background=""@drawable/menu_cameras""&gt;&lt;/ImageButton&gt;&lt;ListView android:id=""@+id/list"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" &gt;&lt;/ListView&gt;&lt;ImageButton     android:paddingTop=""20px""    android:layout_weight=""1"" android:id=""@+id/menu_aboutus""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:background=""@drawable/menu_aboutus""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_weight=""1"" android:id=""@+id/menu_help""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:background=""@drawable/menu_help""&gt;&lt;/ImageButton&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","463888","","463888","","2010-10-05 15:00:47","2010-10-05 15:05:13","what difference have ListActivity between Activity?","<android><activity><android-widget><listactivity>","2","3","0","",""
"3864760","1","3864797","","2010-10-05 14:41:44","2","2797","<p>How to get that working:</p><pre><code> if(findViewById(ResIdWithUnkownType) instanceof Bitmap) {       Bitmap bitmap = (Bitmap) findViewById(ResIdWithUnkownType); } else if(findViewById(ResIdWithUnkownType) instanceof ImageView) {       ImageView = (ImageView) findViewById(ResIdWithUnkownType); }</code></pre>","433718","","","","","2014-03-25 09:07:30","How to check the type of a view widget?","<android><android-widget><imageview><android-layout>","2","1","","",""
"3864787","1","3864982","","2010-10-05 14:44:58","2","4302","<p>I created a weather widget. I store its configuration in <code>SharedPreferences</code>. The widget is updated by a service. I keep the weather information together with forecasts in an array. After the phone is off for the night i find that the array values are gone,maybe the system suspended? the service. Is there a way to store the array in <code>SharePreferences</code> so it is more sticky.</p>","364418","","948041","","2012-06-20 07:14:36","2012-06-20 07:14:36","Android Sharepreferences and array","<android><arrays><sharedpreferences>","1","1","2","",""
"3864847","1","","","2010-10-05 14:51:07","9","2033","<p>I have some code that generates a ""read me"" dialog and does some initial directory creation on the sd card, which currently resides in the onCreate method... I would like to segregate this code and have it execute only once, at the apps first run.. and then after all subsequent upgrades. I've noticed that most apps on the market do this, yet have not figured out how to implement it in mine yet... any help would be appreciated.</p>","459921","","","","","2010-10-05 15:06:17","Android: Executing code only on first run and every subsequent upgrade","<android>","1","0","4","",""
"3864860","1","","","2010-10-05 14:52:15","4","7611","<p>Hey guys,I´ve got a small problem im stucked with.I have a kind of an ApplicationLauncher that has to start the build-in gallery. But I dont want to get any result from that gallery... I just want to start it and want my ""Launcher"" to close after that.</p><p>What ive tried:</p><pre><code>    Intent intentBrowseFiles = new Intent(Intent.ACTION_GET_CONTENT);    intentBrowseFiles.setType(""image/*"");    intentBrowseFiles.setFlag(Intent.FLAG_ACTIVITY_NEW_TASK);    startActivity(intentBrowseFiles);</code></pre><p>but it doestn even work with this flag... as soon as I click on a pic in the gallery, it closes and returns to my ""Launcher"".Is there any way to achieve what i want to do?Thanks in advance,Max</p>","466962","","","","","2013-07-19 03:26:28","how to open gallery via intent without result","<android><android-intent><gallery>","4","0","3","",""
"3864977","1","5098427","","2010-10-05 15:07:47","2","2234","<p>Here is my Bitmap</p><pre><code>Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(url).getContent());//Need some code to access ""dynamicItem"" and exchange it with my Bitmap</code></pre><p>And here is my layer list (nothing spectacular). I want to exchange the dynamicItem with my Bitmap.</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        android:id=""@+id/dynamicItem""        android:drawable=""@drawable/defaultItem"" /&gt;      &lt;item&gt;        &lt;bitmap          android:src=""@drawable/some_stuff_on_top""          android:gravity=""top|left"" /&gt;      &lt;/item&gt;    &lt;/layer-list&gt;</code></pre>","433718","","21234","","2010-12-08 11:02:42","2012-06-13 19:27:44","How to exchange an image in a layer-list by a bitmap?","<android><android-widget><android-layout><layer>","2","0","3","",""
"3864990","1","3865596","","2010-10-05 15:09:01","1","1094","<p>I have a 2d array of strings. I would like to use a spinner to allow users to select values from the 2nd lvl of the array but I would like to display the selection options in a expandablelistview using the values of the 1st lvl of the array as category headers.</p><p>Is this possible, can someone point me in the right direction of how this should be implemented ?</p>","271395","","","","","2010-10-05 16:14:40","Is it possible to use an expandablelistview as a dropdownview for a spinner?","<android><spinner><expandablelistview>","1","0","","",""
"3865074","1","3865398","","2010-10-05 15:17:56","0","1130","<p>Every time that I want to do a Layout, I'm getting a black layout preview then I can drop stuff on it, that's ok, but how can I change the size of that blank surface (xml). The question came because I set a folder layout-large and then when I add a new layout.xml to that folder it came with the same size, as a layout-normal, so I’ve something like that<br/><br/><br/>(folder)layout<br/>    layout.xml<br/><br/></p><p>(folder)layour-large<br/>    layout.xml<br/></p><p>Both file has the same physical or visible size, how can I increase the large one?</p>","493723","","","","","2010-10-05 15:51:16","How can I change the default size (width + height) of the XML layout preview in ADT plugin for Eclipse?","<android>","1","0","","",""
"3865119","1","","","2010-10-05 15:22:43","5","670","<p>I have an app that only requires the value of a textview field to be saved... what would be the most simple and efficient way to save such a small amount of data? Creating a database for this seems like overkill. would onSaveInstanceState be sufficient?</p>","459921","","","","","2010-10-05 21:56:25","Android: Whats the easiest way to save small amounts of data?","<android>","4","0","","",""
"3865128","1","","","2010-10-05 15:24:13","1","754","<p>We have a website that makes use of OAM for single sign on (form-based authentication). When we submit credentials to WebGate / Access Server the authorization succeeds, however after the authentication is performed, the form action (as configured in the Authentication Scheme - with passthrough:no) returns a server error instead of redirecting to the originally requested URL.</p><p>If we use Mini Opera, we are able to get authenticated and forwarded properly.</p><p>This problem happens on numerous Android phones (versions ranging from 1.5-2.2), as well as the Emulator provided with the SDK.</p><p>This is proving to be a real problem as the default browser on Android phones is not able to get access to our sites(and this is the only browser that is having this problem).</p><p>I have created a WebView-based custom browser with the hope of seeing a client-side error and tried trapping every possible error....none show up....</p><p>I have tried to trace all of the http requests and found only a single difference in the requests... the http header for Connection:keep-alive is not sent by the Android WebView.</p><p>I have provided some tracing info below...</p><p>Has anyone run into this problem? Has anyone solved this?Any insight to this issue would be greatly appreciated.Thanks,Tim</p><p>Request RAW Data-</p><ul><li>POSThttp: // MYSERVER/security/ATLAFunction HTTP/1.1 Host: MYSERVER:7777<br>Accept-Encoding: gzip<br>Accept-Language: en-US<br>Cookie:ObSSOCookie=loggedoutcontinue<br>Accept-Charset: utf-8, iso-8859-1,utf-16, <em>;q=0.7<br>Referer:http://10.84.32.71:7777/tpf/login.html<br>User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF42) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br>Origin: http: // MYSERVER<br>Accept:application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,</em>/*;q=0.5<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 27<br>uname=auser&amp;pwd=appas</li></ul><p>Raw Response Data - </p><ul><li><p>HTTP/1.1 503 Service TemporarilyUnavailable<br> Date: Tue, 05 Oct2010 14:26:12 GMT<br> Set-Cookie:ObSSOCookie=II%2F4n5pFreT6B6hOAumv6pI6CZh6l04VhyXHrCzuRUT5hDEHMK%2FJCX659uyCkxgIyJ8ywB3BKrHxorsCwZwivpn91t9Mu%2FCKT7PrY23S518xoBeOam26tr%2B0pSfCbo%2FZXLmFIxjHFOPHPGxi5tHrOlUroXXA9Fe0GZz3SbJLMgAkCw0euuAVewOHKIjoDh8MwAdGtL4lo%2BmHhk5kB316iFJ4Aljr7cQYpAp1r%2BVGD9FbLkYl4ekY5hrlNfwYS%2BVjnR0uSIFjc0toiKkGN33z7%2FiElh2Ue2iWQrpCRcgFpxE%3D;httponly; path=/;<br> Cache-Control:no-cache<br> Pragma: no-cache<br>Content-Length: 312<br> Connection:close<br> Content-Type: text/html;charset=iso-8859-1<br></p><p>&lt;!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML 2.0//EN""&gt;<br>&lt;html&gt;&lt;head&gt;<br>&lt;title&gt;503 Service TemporarilyUnavailable&lt;/title&gt;<br>&lt;/head&gt;&lt;body&gt;<br>&lt;h1&gt;Service TemporarilyUnavailable&lt;/h1&gt;<br>&lt;p&gt;Sorry!The server iscurrently unable to handle therequest<br> due to a temporaryoverloading or maintenance of theserver.&lt;/p&gt;<br>&lt;/body&gt;&lt;/html&gt;<br></p></li></ul>","367387","","367387","","2010-10-05 15:41:48","2010-10-05 15:41:48","Android WebView-based browsers not able to access protected resources through Oracle Access Manager (OAM)","<android><oracle><webview><single-sign-on>","0","2","1","",""
"3865197","1","3865573","","2010-10-05 15:30:31","6","3429","<p>I have a ListView which is populated using a CursorAdapter.  I'd also like to have some separators in my ListView.  I have accomplished this with an ArrayAdapter, but I'm not sure how to accomplish this with a CursorAdapter.  Are there any strategies for doing so?  Or am I out of luck?</p>","406790","","","","","2011-06-13 00:29:21","ListView separators using a CursorAdapter","<android><listview><listviewitem><separator>","2","0","3","",""
"3865248","1","3865289","","2010-10-05 15:35:29","1","1216","<p>This code below causes infinate loop problem (as documented). So how do I set the editText contents?I have a text message app where the EditText says ""Type to compose"",I want to removethe instructions once a user starts to enter a message. TIA</p><pre><code>et.addTextChangedListener(new TextWatcher() {            public void afterTextChanged(Editable s) {            }           public void beforeTextChanged(CharSequence s, int start, int count, int after) {        if(et.getText().toString().equals(getString(R.string.txtMessage_type_to_compose))) {        try {            et.setText("""");        } catch (Exception e) {             Log.d(TAG,""exception : "" + e.toString());        }               }  });</code></pre>","465199","","199122","","2010-10-05 15:38:25","2010-10-05 15:40:12","Proper method to change EditText contents in OnTextChanged event","<android><edittext>","1","0","","",""
"3865273","1","3865395","","2010-10-05 15:37:41","0","815","<p>I'm trying to write  test harness for part of my Android mapping application. </p><p>I would like to run the test as a Java console app under Eclipse. The only Google maps class that I require is a GeoPoint. I've included the maps.jar in the build path and imported the com.google.android.maps.GeoPoint so it compiles OK but generates a runtime error of : </p><p>""The JAR of this class file belongs to container 'Google APIs[Android2.1 - update1]' which does not allow modifications to source attachments on its entries"". </p><p>Is it possible to use this jar in a console app, and if so how?</p>","440010","","","","","2010-10-05 15:50:57","Is it possible to use the Google API maps.jar in a console app?","<android>","1","0","","",""
"3865347","1","","","2010-10-05 15:46:25","6","6978","<p>In the <a href=""http://developer.android.com/guide/topics/fundamentals.html#actlife"" rel=""nofollow"">Android Application Fundamentals</a> it says that after the call to the onStart()-method of the activity lifecycle either the callback method <code>onResume()</code> or <code>onStop()</code> is called. In case of an ""normal"" Start of an activity the system calls <code>onCreate()</code>, <code>onStart()</code>, <code>onResume()</code>. But does somebody know an example where <code>onStart()</code> - <code>onStop()</code> are executed one after another?</p>","413078","","597657","","2012-05-28 04:50:26","2012-05-28 05:18:23","Android Activity Lifecycle: onStart() -> onStop() possible?","<android>","2","2","5","",""
"3865502","1","","","2010-10-05 16:02:52","-1","2934","<p>I am very new to Android and ksoap2 development.  I have been searching on the forums for an answer to my error and still have not found a fix.  Hopefully someone will be able to figure how to fix the error.</p><p>I am calling a Webservice with 10 parameters in my sample android app using the Ksoap2-Android-assembly-2.4 jar library.</p><p>The error from the responsedump call:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;    &lt;soap:Body&gt;    &lt;soap:Fault&gt;        &lt;faultcode&gt;soap:Client&lt;/faultcode&gt;        &lt;faultstring&gt;Server was unable to read request. ---&amp;gt; There is an error in XML document (1, 435). ---&amp;gt; Input string was not in a correct format.&lt;/faultstring&gt;        &lt;detail /&gt;    &lt;/soap:Fault&gt;    &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>The request from the requestdump call:</p><pre><code>&lt;v:Envelope xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:d=""http://www.w3.org/2001/XMLSchema"" xmlns:c=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:v=""http://schemas.xmlsoap.org/soap/envelope/""&gt;&lt;v:Header /&gt;&lt;v:Body&gt;    &lt;InsertAnalyzerQueue xmlns=""http://63.237.52.216/service.asmx/"" id=""o0"" c:root=""1""&gt;        &lt;uploadcustomerkey i:type=""d:int""&gt;11111&lt;/uploadcustomerkey&gt;    &lt;uploadcustomertype i:type=""d:string""&gt;C&lt;/uploadcustomertype&gt;    &lt;description i:type=""d:string""&gt;ANDROIDTEST&lt;/description&gt;    &lt;uploadedfile i:type=""d:string""&gt;Myfile&lt;/uploadedfile&gt;    &lt;companionfile i:type=""d:string""&gt;C&lt;/companionfile&gt;    &lt;emailaddress i:type=""d:string""&gt;tom@transferexpress&lt;/emailaddress&gt;    &lt;generatedfilename i:type=""d:string""&gt;MyFileName&lt;/generatedfilename&gt;    &lt;companyname i:type=""d:string""&gt;MyCompany&lt;/companyname&gt;    &lt;dealerid i:type=""d:string""&gt;TEST&lt;/dealerid&gt;    &lt;phonenbr i:type=""d:string""&gt;4409181900&lt;/phonenbr&gt;    &lt;/InsertAnalyzerQueue&gt;&lt;/v:Body&gt;&lt;/v:Envelope&gt;</code></pre><p>My actual code: </p><pre><code>package com.example.soapconnect2;import java.io.IOException;import org.ksoap2.transport.AndroidHttpTransport;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.PropertyInfo;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.xmlpull.v1.XmlPullParserException;import android.app.Activity;import android.os.Bundle;import android.widget.Toast;public class SoapConnect2 extends Activity {/** Called when the activity is first created. */private static final String SOAP_ACTION = ""http://63.237.52.216/service.asmx/InsertAnalyzerQueue"";  //Need to include WebService methodprivate static final String METHOD_NAME = ""InsertAnalyzerQueue"";          //WebServiceprivate static final String NAMESPACE = ""http://63.237.52.216/service.asmx/"";       //Only use IP address plus the asmx file nameprivate static final String URL = ""http://63.237.52.216/service.asmx"";         //Only use IP address plus the asmx file name//HttpGet httpPost = new HttpGet(""http://63.237.52.215/serce.asmx/IsValidReferenceID?referenceID='092010-0123A1of1'""); //private static final String URL = ""http://63.237.52.216/service.asmx/InsertAnalyzerQueue?uploadcustomerkey=1111&amp;uploadcustomertype=T&amp;description=TESTTESTTEST&amp;uploadedfile=My_file.jpg&amp;companionfile=&amp;emailaddress=tom@test.com&amp;generatedfilename=MyFileName.jpg&amp;companyname=MyCompany&amp;dealerid=TEST&amp;phonenbr=5555555555"";String[] results;String resultdata;Toast mtoast;PropertyInfo mPropertyInfo;String mRequestDump = null;String mResponseDump = null;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);        try {             SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);             mPropertyInfo = new PropertyInfo();            //mPropertyInfo.elementType.setValue(request.addProperty(""uploadcustomerkey"", ""11111""));            //mPropertyInfo.setElementType(elementType)= PropertyInfo.INTEGER_CLASS;            //Adds parameters   &lt;parameter name&gt;, &lt;value&gt;            request.addProperty(""uploadcustomerkey"", 11111);             request.addProperty(""uploadcustomertype"", ""C"");             request.addProperty(""description"", ""ANDROIDTEST"");             request.addProperty(""uploadedfile"", ""Myfile"");             request.addProperty(""companionfile"", ""C"");             request.addProperty(""emailaddress"", ""tom@transferexpress"");             request.addProperty(""generatedfilename"", ""MyFileName"");             request.addProperty(""companyname"", ""MyCompany"");             request.addProperty(""dealerid"", ""TEST"");             request.addProperty(""phonenbr"", ""4409181900"");             SoapSerializationEnvelope mEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);             mEnvelope.dotNet=true;             mEnvelope.setOutputSoapObject(request);             mEnvelope.encodingStyle = SoapSerializationEnvelope.XSI;            AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);             androidHttpTransport.debug = true;            try {    androidHttpTransport.call(SOAP_ACTION, mEnvelope);    }             catch (XmlPullParserException e) {    // TODO Auto-generated catch block    e.printStackTrace();       }             catch (IOException e) {       // TODO Auto-generated catch block       e.printStackTrace();       }            mRequestDump = androidHttpTransport.requestDump;            mResponseDump = androidHttpTransport.responseDump;            //SoapObject result = (SoapObject)envelope.bodyIn;            //resultdata = result.getProperty(0).toString();   }  catch (IllegalArgumentException e) {     // TODO Auto-generated catch block   e.printStackTrace();   }  mtoast = Toast.makeText(getBaseContext(), resultdata, Toast.LENGTH_LONG);  mtoast.show();    }       }</code></pre><p>The actual Webservice WSDL:<code>http://63.237.52.216/service.asmx?wsdl</code></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt; - &lt;wsdl:definitions xmlns:soap=""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:tm=""http://microsoft.com/wsdl/mime/textMatching/"" xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:mime=""http://schemas.xmlsoap.org/wsdl/mime/"" xmlns:tns=""http://63.237.52.216/service.asmx/"" xmlns:s1=""http://microsoft.com/wsdl/types/"" xmlns:s=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://schemas.xmlsoap.org/wsdl/soap12/"" xmlns:http=""http://schemas.xmlsoap.org/wsdl/http/"" targetNamespace=""http://63.237.52.216/service.asmx/"" xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/""&gt;- &lt;wsdl:types&gt;- &lt;s:schema elementFormDefault=""qualified"" targetNamespace=""http://63.237.52.216/service.asmx/""&gt;  &lt;s:import namespace=""http://microsoft.com/wsdl/types/"" /&gt; - &lt;s:element name=""IsValidReferenceID""&gt;- &lt;s:complexType&gt;+ &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""referenceID"" type=""s:string"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""IsValidReferenceIDResponse""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""IsValidReferenceIDResult"" type=""s:boolean"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""GetDealersUploadedItems""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""dealerID"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""phoneNumber"" type=""s:string"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""GetDealersUploadedItemsResponse""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""GetDealersUploadedItemsResult"" type=""tns:ArrayOfUploadItem"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:complexType name=""ArrayOfUploadItem""&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""unbounded"" name=""UploadItem"" nillable=""true"" type=""tns:UploadItem"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;- &lt;s:complexType name=""UploadItem""&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""UploadRefID"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""UploadedDate"" type=""s:dateTime"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""UploadedFileName"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""UpdatedFlag"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""Description"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""StatusName"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""EmailAddress"" type=""s:string"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;- &lt;s:element name=""UpdateOrderStatus""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""referenceIDs"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""orderStatus"" type=""s:int"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""newCustomerID"" type=""s:string"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""UpdateOrderStatusResponse""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""UpdateOrderStatusResult"" type=""s:int"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""InsertAnalyzerQueue""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""uploadcustomerkey"" type=""s:int"" /&gt;   &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""uploadcustomertype"" type=""s1:char"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""description"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""uploadedfile"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""companionfile"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""emailaddress"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""generatedfilename"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""companyname"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""dealerid"" type=""s:string"" /&gt;   &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""phonenbr"" type=""s:string"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""InsertAnalyzerQueueResponse""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""InsertAnalyzerQueueResult"" type=""s:int"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;- &lt;s:element name=""MyTestService""&gt;  &lt;s:complexType /&gt;   &lt;/s:element&gt;- &lt;s:element name=""MyTestServiceResponse""&gt;- &lt;s:complexType&gt;- &lt;s:sequence&gt;  &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""MyTestServiceResult"" type=""s:string"" /&gt;   &lt;/s:sequence&gt;  &lt;/s:complexType&gt;  &lt;/s:element&gt;  &lt;s:element name=""boolean"" type=""s:boolean"" /&gt;   &lt;s:element name=""ArrayOfUploadItem"" nillable=""true"" type=""tns:ArrayOfUploadItem"" /&gt;   &lt;s:element name=""int"" type=""s:int"" /&gt;   &lt;s:element name=""string"" nillable=""true"" type=""s:string"" /&gt;   &lt;/s:schema&gt;- &lt;s:schema elementFormDefault=""qualified"" targetNamespace=""http://microsoft.com/wsdl/types/""&gt;- &lt;s:simpleType name=""char""&gt;  &lt;s:restriction base=""s:unsignedShort"" /&gt;   &lt;/s:simpleType&gt;  &lt;/s:schema&gt;  &lt;/wsdl:types&gt;- &lt;wsdl:message name=""IsValidReferenceIDSoapIn""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:IsValidReferenceID"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""IsValidReferenceIDSoapOut""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:IsValidReferenceIDResponse"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""GetDealersUploadedItemsSoapIn""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:GetDealersUploadedItems"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""GetDealersUploadedItemsSoapOut""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:GetDealersUploadedItemsResponse"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""UpdateOrderStatusSoapIn""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:UpdateOrderStatus"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""UpdateOrderStatusSoapOut""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:UpdateOrderStatusResponse"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""InsertAnalyzerQueueSoapIn""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:InsertAnalyzerQueue"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""InsertAnalyzerQueueSoapOut""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:InsertAnalyzerQueueResponse"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""MyTestServiceSoapIn""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:MyTestService"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""MyTestServiceSoapOut""&gt;  &lt;wsdl:part name=""parameters"" element=""tns:MyTestServiceResponse"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""IsValidReferenceIDHttpGetIn""&gt;  &lt;wsdl:part name=""referenceID"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""IsValidReferenceIDHttpGetOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:boolean"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""GetDealersUploadedItemsHttpGetIn""&gt;  &lt;wsdl:part name=""dealerID"" type=""s:string"" /&gt;   &lt;wsdl:part name=""phoneNumber"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""GetDealersUploadedItemsHttpGetOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:ArrayOfUploadItem"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""UpdateOrderStatusHttpGetIn""&gt;  &lt;wsdl:part name=""referenceIDs"" type=""s:string"" /&gt;   &lt;wsdl:part name=""orderStatus"" type=""s:string"" /&gt;   &lt;wsdl:part name=""newCustomerID"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""UpdateOrderStatusHttpGetOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:int"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""InsertAnalyzerQueueHttpGetIn""&gt;  &lt;wsdl:part name=""uploadcustomerkey"" type=""s:string"" /&gt;   &lt;wsdl:part name=""uploadcustomertype"" type=""s:string"" /&gt;   &lt;wsdl:part name=""description"" type=""s:string"" /&gt;   &lt;wsdl:part name=""uploadedfile"" type=""s:string"" /&gt;   &lt;wsdl:part name=""companionfile"" type=""s:string"" /&gt;   &lt;wsdl:part name=""emailaddress"" type=""s:string"" /&gt;   &lt;wsdl:part name=""generatedfilename"" type=""s:string"" /&gt;   &lt;wsdl:part name=""companyname"" type=""s:string"" /&gt;   &lt;wsdl:part name=""dealerid"" type=""s:string"" /&gt;   &lt;wsdl:part name=""phonenbr"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""InsertAnalyzerQueueHttpGetOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:int"" /&gt;   &lt;/wsdl:message&gt;  &lt;wsdl:message name=""MyTestServiceHttpGetIn"" /&gt; - &lt;wsdl:message name=""MyTestServiceHttpGetOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""IsValidReferenceIDHttpPostIn""&gt;  &lt;wsdl:part name=""referenceID"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""IsValidReferenceIDHttpPostOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:boolean"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""GetDealersUploadedItemsHttpPostIn""&gt;  &lt;wsdl:part name=""dealerID"" type=""s:string"" /&gt;   &lt;wsdl:part name=""phoneNumber"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""GetDealersUploadedItemsHttpPostOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:ArrayOfUploadItem"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""UpdateOrderStatusHttpPostIn""&gt;  &lt;wsdl:part name=""referenceIDs"" type=""s:string"" /&gt;   &lt;wsdl:part name=""orderStatus"" type=""s:string"" /&gt;   &lt;wsdl:part name=""newCustomerID"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""UpdateOrderStatusHttpPostOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:int"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""InsertAnalyzerQueueHttpPostIn""&gt;  &lt;wsdl:part name=""uploadcustomerkey"" type=""s:string"" /&gt;   &lt;wsdl:part name=""uploadcustomertype"" type=""s:string"" /&gt;   &lt;wsdl:part name=""description"" type=""s:string"" /&gt;   &lt;wsdl:part name=""uploadedfile"" type=""s:string"" /&gt;   &lt;wsdl:part name=""companionfile"" type=""s:string"" /&gt;   &lt;wsdl:part name=""emailaddress"" type=""s:string"" /&gt;   &lt;wsdl:part name=""generatedfilename"" type=""s:string"" /&gt;   &lt;wsdl:part name=""companyname"" type=""s:string"" /&gt;   &lt;wsdl:part name=""dealerid"" type=""s:string"" /&gt;   &lt;wsdl:part name=""phonenbr"" type=""s:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:message name=""InsertAnalyzerQueueHttpPostOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:int"" /&gt;   &lt;/wsdl:message&gt;  &lt;wsdl:message name=""MyTestServiceHttpPostIn"" /&gt; - &lt;wsdl:message name=""MyTestServiceHttpPostOut""&gt;  &lt;wsdl:part name=""Body"" element=""tns:string"" /&gt;   &lt;/wsdl:message&gt;- &lt;wsdl:portType name=""ServiceSoap""&gt;- &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;wsdl:input message=""tns:IsValidReferenceIDSoapIn"" /&gt;   &lt;wsdl:output message=""tns:IsValidReferenceIDSoapOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;wsdl:input message=""tns:GetDealersUploadedItemsSoapIn"" /&gt;   &lt;wsdl:output message=""tns:GetDealersUploadedItemsSoapOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;wsdl:input message=""tns:UpdateOrderStatusSoapIn"" /&gt;   &lt;wsdl:output message=""tns:UpdateOrderStatusSoapOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;wsdl:input message=""tns:InsertAnalyzerQueueSoapIn"" /&gt;   &lt;wsdl:output message=""tns:InsertAnalyzerQueueSoapOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;wsdl:input message=""tns:MyTestServiceSoapIn"" /&gt;   &lt;wsdl:output message=""tns:MyTestServiceSoapOut"" /&gt;   &lt;/wsdl:operation&gt;  &lt;/wsdl:portType&gt;- &lt;wsdl:portType name=""ServiceHttpGet""&gt;- &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;wsdl:input message=""tns:IsValidReferenceIDHttpGetIn"" /&gt;   &lt;wsdl:output message=""tns:IsValidReferenceIDHttpGetOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;wsdl:input message=""tns:GetDealersUploadedItemsHttpGetIn"" /&gt;   &lt;wsdl:output message=""tns:GetDealersUploadedItemsHttpGetOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;wsdl:input message=""tns:UpdateOrderStatusHttpGetIn"" /&gt;   &lt;wsdl:output message=""tns:UpdateOrderStatusHttpGetOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;wsdl:input message=""tns:InsertAnalyzerQueueHttpGetIn"" /&gt;   &lt;wsdl:output message=""tns:InsertAnalyzerQueueHttpGetOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;wsdl:input message=""tns:MyTestServiceHttpGetIn"" /&gt;   &lt;wsdl:output message=""tns:MyTestServiceHttpGetOut"" /&gt;   &lt;/wsdl:operation&gt;  &lt;/wsdl:portType&gt;- &lt;wsdl:portType name=""ServiceHttpPost""&gt;- &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;wsdl:input message=""tns:IsValidReferenceIDHttpPostIn"" /&gt;   &lt;wsdl:output message=""tns:IsValidReferenceIDHttpPostOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;wsdl:input message=""tns:GetDealersUploadedItemsHttpPostIn"" /&gt;   &lt;wsdl:output message=""tns:GetDealersUploadedItemsHttpPostOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;wsdl:input message=""tns:UpdateOrderStatusHttpPostIn"" /&gt;   &lt;wsdl:output message=""tns:UpdateOrderStatusHttpPostOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;wsdl:input message=""tns:InsertAnalyzerQueueHttpPostIn"" /&gt;   &lt;wsdl:output message=""tns:InsertAnalyzerQueueHttpPostOut"" /&gt;   &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;wsdl:input message=""tns:MyTestServiceHttpPostIn"" /&gt;   &lt;wsdl:output message=""tns:MyTestServiceHttpPostOut"" /&gt;   &lt;/wsdl:operation&gt;  &lt;/wsdl:portType&gt;- &lt;wsdl:binding name=""ServiceSoap"" type=""tns:ServiceSoap""&gt;  &lt;soap:binding transport=""http://schemas.xmlsoap.org/soap/http"" /&gt; - &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;soap:operation soapAction=""http://63.237.52.216/service.asmx/IsValidReferenceID"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;soap:operation soapAction=""http://63.237.52.216/service.asmx/GetDealersUploadedItems"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;soap:operation soapAction=""http://63.237.52.216/service.asmx/UpdateOrderStatus"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;soap:operation soapAction=""http://63.237.52.216/service.asmx/InsertAnalyzerQueue"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;soap:operation soapAction=""http://63.237.52.216/service.asmx/MyTestService"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;  &lt;/wsdl:binding&gt;- &lt;wsdl:binding name=""ServiceSoap12"" type=""tns:ServiceSoap""&gt;  &lt;soap12:binding transport=""http://schemas.xmlsoap.org/soap/http"" /&gt; - &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;soap12:operation soapAction=""http://63.237.52.216/service.asmx/IsValidReferenceID"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;soap12:operation soapAction=""http://63.237.52.216/service.asmx/GetDealersUploadedItems"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;soap12:operation soapAction=""http://63.237.52.216/service.asmx/UpdateOrderStatus"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;soap12:operation soapAction=""http://63.237.52.216/service.asmx/InsertAnalyzerQueue"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;soap12:operation soapAction=""http://63.237.52.216/service.asmx/MyTestService"" style=""document"" /&gt; - &lt;wsdl:input&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;soap12:body use=""literal"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;  &lt;/wsdl:binding&gt;- &lt;wsdl:binding name=""ServiceHttpGet"" type=""tns:ServiceHttpGet""&gt;  &lt;http:binding verb=""GET"" /&gt; - &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;http:operation location=""/IsValidReferenceID"" /&gt; - &lt;wsdl:input&gt;  &lt;http:urlEncoded /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;http:operation location=""/GetDealersUploadedItems"" /&gt; - &lt;wsdl:input&gt;  &lt;http:urlEncoded /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;http:operation location=""/UpdateOrderStatus"" /&gt; - &lt;wsdl:input&gt;  &lt;http:urlEncoded /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;http:operation location=""/InsertAnalyzerQueue"" /&gt; - &lt;wsdl:input&gt;  &lt;http:urlEncoded /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;http:operation location=""/MyTestService"" /&gt; - &lt;wsdl:input&gt;  &lt;http:urlEncoded /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;  &lt;/wsdl:binding&gt;- &lt;wsdl:binding name=""ServiceHttpPost"" type=""tns:ServiceHttpPost""&gt;  &lt;http:binding verb=""POST"" /&gt; - &lt;wsdl:operation name=""IsValidReferenceID""&gt;  &lt;http:operation location=""/IsValidReferenceID"" /&gt; - &lt;wsdl:input&gt;  &lt;mime:content type=""application/x-www-form-urlencoded"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""GetDealersUploadedItems""&gt;  &lt;http:operation location=""/GetDealersUploadedItems"" /&gt; - &lt;wsdl:input&gt;  &lt;mime:content type=""application/x-www-form-urlencoded"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""UpdateOrderStatus""&gt;  &lt;http:operation location=""/UpdateOrderStatus"" /&gt; - &lt;wsdl:input&gt;  &lt;mime:content type=""application/x-www-form-urlencoded"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""InsertAnalyzerQueue""&gt;  &lt;http:operation location=""/InsertAnalyzerQueue"" /&gt; - &lt;wsdl:input&gt;  &lt;mime:content type=""application/x-www-form-urlencoded"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;- &lt;wsdl:operation name=""MyTestService""&gt;  &lt;http:operation location=""/MyTestService"" /&gt; - &lt;wsdl:input&gt;  &lt;mime:content type=""application/x-www-form-urlencoded"" /&gt;   &lt;/wsdl:input&gt;- &lt;wsdl:output&gt;  &lt;mime:mimeXml part=""Body"" /&gt;   &lt;/wsdl:output&gt;  &lt;/wsdl:operation&gt;  &lt;/wsdl:binding&gt;- &lt;wsdl:service name=""Service""&gt;- &lt;wsdl:port name=""ServiceSoap"" binding=""tns:ServiceSoap""&gt;  &lt;soap:address location=""http://63.237.52.216/service.asmx"" /&gt;   &lt;/wsdl:port&gt;- &lt;wsdl:port name=""ServiceSoap12"" binding=""tns:ServiceSoap12""&gt;  &lt;soap12:address location=""http://63.237.52.216/service.asmx"" /&gt;   &lt;/wsdl:port&gt;- &lt;wsdl:port name=""ServiceHttpGet"" binding=""tns:ServiceHttpGet""&gt;  &lt;http:address location=""http://63.237.52.216/service.asmx"" /&gt;   &lt;/wsdl:port&gt;- &lt;wsdl:port name=""ServiceHttpPost"" binding=""tns:ServiceHttpPost""&gt;  &lt;http:address location=""http://63.237.52.216/service.asmx"" /&gt;   &lt;/wsdl:port&gt;  &lt;/wsdl:service&gt;  &lt;/wsdl:definitions&gt; </code></pre>","467045","","944070","","2013-04-10 13:53:41","2013-04-10 13:53:41","Android 2.1 and Ksoap2-Android-assembly-2.4 -- SoapFault Error","<android><xml><ksoap2><soapfault><envelope>","2","1","","",""
"3865557","1","3865964","","2010-10-05 16:10:11","3","1325","<p>I have a Service that uses the LocationListener, and it will be running from boot, indefinitely. My question is, how often is too often to listen for location updates? Is 5 minutes a battery killer? What about 1?</p>","50391","","","","","2011-03-06 15:43:12","Android LocationListener polling interval","<android><battery>","2","0","1","",""
"3865567","1","3865623","","2010-10-05 16:12:01","8","7447","<p>While creating a new android project in eclipse 3.5, i have selected Android 2.1 Update1 as build target. But i forgot to give the mini SDK version. Now when the build the project, its giving a warning message ""<strong><em>WARNING: Application does not specify an API level requirement!Device API version is 8 (Android 2.2)</em></strong>""</p><p>The application is running fine..but when i run that application is my Samsung Galaxy S which is having android 2.1, the application is behaving differently.</p><p>I have even tried adding <code>&lt;uses-sdk minSdkVersion=""7"" /&gt;</code> in the manifest file..But still i am getting the warning message..</p><p>So how can i change the mini SDK of my project in eclipse to 7,so that i get the same result in my emulator and Mobile phone?</p><p>Thanks in advanceShijilal</p>","466474","","343845","","2012-03-08 20:04:14","2012-03-08 20:04:14","How to change the minSDK Version in eclipse?","<android><eclipse><android-emulator>","1","0","2","",""
"3865607","1","","","2010-10-05 16:16:35","3","2746","<p>Launching a Streetview intent for a location doesn't guarantee that a Streetview exists for that location.  If the Streetview doesn't exist, the user just sees a black screen that spins. Is there a way to programmatically check if it exists before launching the Streetview intent?</p>","408956","","","","","2012-12-19 10:32:23","How to tell if a Streetview exists before launching Streetview intent","<android><google-street-view>","5","1","1","",""
"3865687","1","","","2010-10-05 16:26:41","0","1336","<p>I have an application that downloads data in a background service and I want to be able to update an activity UI if they are currently running the application or trigger a Notification if they are not.</p><p>How do I know if the application is currently in the foreground?</p><p>I could register a BroadcastReceiver inner class in the activity and trigger this if its in the foreground otherwise uses notification but I don't know how I can check what action to take.</p><p>Thanks for any replies.</p>","249075","","","","","2010-10-05 17:03:30","SendBroadcast if Activity or Notification","<android>","1","1","1","",""
"3865797","1","3890706","","2010-10-05 16:40:59","2","155","<p>Hi    I'd like to add an option when long-pressing a number in the call list. Actually I have:</p><ul><li>Dial</li><li>Send SMS</li><li>Add to contact</li><li>Edit before calling</li><li>Remove</li></ul><p>Is it possible to add an option there? Such option should start my application through an Intent when pressed.</p><p>Thanks</p>","295525","","295525","","2010-10-08 09:44:28","2010-10-08 13:00:35","Add an option when long-pressing a number","<android><android-intent><android-contacts>","1","2","","",""
"3865883","1","3866012","","2010-10-05 16:52:38","3","1611","<p>Can screen brightness changes be tested in the Android emulator?  I've tried various examples that all use the following code snippet:</p><pre><code>WindowManager.LayoutParams lp = window.getAttributes();lp.screenBrightness = (*some float percentage*);window.setAttributes(lp);</code></pre><p>But I don't see any change in brightness in the emulator.  I've tested it in cupcake and 2.2.</p>","467085","","12707","","2010-10-05 16:53:28","2010-10-05 17:08:50","Changing screen brightness in Android emulator","<android>","1","0","0","",""
"3866190","1","3866603","","2010-10-05 17:37:10","7","12780","<p>I'm developing an Android application and I'm very new on Java and Android.</p><p>I want to create some constants to use in some activities. Where can I define these constants?</p><p>Thanks.</p>","68571","","","","","2014-01-01 23:27:58","Java constants file","<java><android><constants>","4","0","2","",""
"3866457","1","3873411","","2010-10-05 18:11:51","4","1434","<p>I have ported an application from Android to desktop that uses AES to encrypt some private data.Both applications are able to encrypt and decrypt the data for their own use but unable to decrypt the other applications data.The AES keys, IVs, and algorithms are identical.The main difference between the two applications is that the android-sdk comes with the BouncyCastle provider already added to the security while the desktop application needed </p><pre><code>Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());</code></pre><p>Android app:</p><pre><code>public class AesFileIo { public final static String EOL = ""\n""; public static final String AES_ALGORITHM = ""AES/CTR/NoPadding""; public static final String PROVIDER = ""BC"";  private static final SecretKeySpec secretKeySpec =   new SecretKeySpec(AES_KEY_128, ""AES""); private static final IvParameterSpec ivSpec = new IvParameterSpec(IV); public String readAesFile(Context c, String fileName) {  StringBuilder stringBuilder = new StringBuilder();  try {   InputStream is = c.openFileInput(fileName);   Cipher cipher = Cipher.getInstance(AES_ALGORITHM, PROVIDER);   cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivSpec);   CipherInputStream cis = new CipherInputStream(is, cipher);   InputStreamReader isr = new InputStreamReader(cis);   BufferedReader reader = new BufferedReader(isr);   String line;   while ((line = reader.readLine()) != null) {    stringBuilder.append(line).append(EOL);   }   is.close();  } catch (java.io.FileNotFoundException e) {   // OK, file probably not created yet   Log.i(this.getClass().toString(), e.getMessage(), e);  } catch (Exception e) {   Log.e(this.getClass().toString(), e.getMessage(), e);  }  return stringBuilder.toString(); } public void writeAesFile(Context c, String fileName, String theFile) {  try {   Cipher cipher = Cipher.getInstance(AES_ALGORITHM, PROVIDER);    cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivSpec);   byte[] encrypted = cipher.doFinal(theFile.getBytes());    OutputStream os = c.openFileOutput(fileName, 0);   os.write(encrypted);   os.flush();   os.close();  } catch (Exception e) {   Log.e(this.getClass().toString(), e.getMessage(), e);  } }}</code></pre><p>Desktop app:</p><pre><code>public class AesFileIo {    private static final String EOL = ""\n"";    private static final String AES_ALGORITHM = ""AES/CTR/NoPadding"";    private static final SecretKeySpec secretKeySpec =            new SecretKeySpec(AES_KEY_128, ""AES"");    private static final IvParameterSpec ivSpec = new IvParameterSpec(IV);    public void AesFileIo() {        Security.addProvider(new org.bouncycastle.jce.provider                .BouncyCastleProvider());    }    public String readFile(String fileName) {        StringBuilder stringBuilder = new StringBuilder();        try {            ObjectInputStream is = new ObjectInputStream(                new FileInputStream(fileName));            Cipher cipher = Cipher.getInstance(AES_ALGORITHM);            cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivSpec);            CipherInputStream cis = new CipherInputStream(is, cipher);            InputStreamReader isr = new InputStreamReader(cis);            BufferedReader reader = new BufferedReader(isr);            String line;            while ((line = reader.readLine()) != null) {                stringBuilder.append(line).append(EOL);            }            is.close();        } catch (java.io.FileNotFoundException e) {            System.out.println(""FileNotFoundException: probably OK"");        } catch (Exception e) {            e.printStackTrace();        }        return stringBuilder.toString();    }    public void writeFile(String fileName, String theFile) {        try {            Cipher cipher = Cipher.getInstance(AES_ALGORITHM);            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivSpec);            byte[] encrypted = cipher.doFinal(theFile.getBytes());            ObjectOutputStream os = new ObjectOutputStream(                new FileOutputStream(fileName));            os.write(encrypted);            os.flush();            os.close();        } catch (Exception e) {            e.printStackTrace();        }    }}</code></pre>","398460","","648313","","2012-02-07 23:20:28","2012-02-07 23:20:28","Why is desktop AES file IO incompatible with Android AES file IO?","<java><android><aes><bouncycastle>","1","0","","",""
"3866499","1","3866912","","2010-10-05 18:18:07","5","9133","<p>I would like to have a linearlayout with a header section on top and a webview below. The header will be short and the webview may be longer and wider than the screen.</p><p>What is the best way to get horizontal and vertical scrolling? Is a ScrollView nested inside a HorizontalScrollView a good idea?</p>","463304","","","","","2014-03-28 21:01:37","two directional scroll view","<android><scrolling><android-layout>","6","0","4","",""
"3866653","1","","","2010-10-05 18:36:08","0","1353","<p>Okay, so I'm writing my first Android app and am basically stuck. The app is a short 4 question quiz with two choices per question. This creates 16 possible results, which I've created descriptions for. I want the app to display the description corresponding to the user's responses on each of the questions after the 4th question is answered. </p><p>Right now I am storing the values in a string, which is supposed to build upon the previous string answer, after each question. So the first answer is t1, the second answer is t2, and so on. Here is the code for the second question:</p><pre><code>public class Question2 extends Question1 implements OnClickListener{ private Button b1; private Button b2; public String t2; public TextView text2; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.question2); b1=(Button)findViewById(R.id.gamma); b2=(Button)findViewById(R.id.delta); b1.setOnClickListener(this); b2.setOnClickListener(this); text2 = (TextView)findViewById(R.id.TextView02); } public void onClick(View v) {  Intent a = new Intent(this, Question3.class); if(v == b1) {   t2= t1+""gamma"";  text2.setText(t2); startActivity(a); }  if(v == b2) { t2= t1+""delta""; text2.setText(t2); startActivity(a); }}}</code></pre><p>My problem is that the strings won't hold the values I assign them in the previous question. I have a textview that briefly displays the values returned by the question's answer string (t2 for Question2) and it displays nullalpha or nullbeta, depending on the user's response. </p><p>How do I retain the t1's previously assigned value into Question2 so I can add to it? For instance, if t1 = ""alpha"" from Question1, and the user selects button b1 in Question2 how do I make t2 actually equal ""alphagamma"" instead of ""nullgamma""? Is this even possible with strings?</p><p>Any answers and suggestions are much appreciated.</p>","467151","","182689","","2010-10-05 18:38:55","2013-01-17 21:34:41","Beginning Android Programming - Building a short Quiz","<java><android>","1","2","1","",""
"3866785","1","3866948","","2010-10-05 18:53:21","0","562","<p>I have published a free app on the android market. I want to edit the description and add a couple of screen shots. </p><p>While the  ""Upload Aplication"" screen on <a href=""http://market.android.com/publish"" rel=""nofollow"">http://market.android.com/publish</a> lets me make these changes &amp; saves them too, they don't show up in the description of the app when I go the android market. Do I have to unpublish &amp; republish the app (in which case I might run into version issues)?</p><p>Or else, how do I make these changes to description appear on the android market?</p>","289918","","","","","2010-10-05 19:22:32","Editing description/screenshots on a published app","<android><google-play>","1","0","","",""
"3866819","1","","","2010-10-05 18:59:19","1","800","<p>I am creating a scrolling panel with many child views (e.g. buttons). Each child view has a fixed location based on their row and column index. I cannot create them at the beginning since there are tons of them and I will run out of memory, so I'd like to only add a child view when it intersects with the screen view port (when users scrolls to that area). I override the onLayout() method with something like this:</p><pre><code>@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {    super.onLayout(changed, l, t, r, b);    for (int row = 0; row &lt; ROW_NUM; row++) {        ColumnAdapter columnAdapter = mRowAdapter.getItem(row);        for (int col = 0; col &lt; COLUMN_NUM; col++) {            ItemView itemView = columnAdapter.getView(col, null, this);            if (isOnScreen(row, col)) {                itemView.layout(col * 100, row * 100, (col + 1) * 100, (row + 1) * 100);                addViewInLayout(itemView, row + col, null, true);            }        }    }    scrollTo(getScrollX(), getScrollY());}</code></pre><p>(ColumnAdapter is an Adapter extension and ItemView is button extension). This wouldn't work because onLayout() is not called during scrolling. What should I do to add ItemViews dynamically as user scrolls? </p>","436323","","932225","","2012-07-13 10:30:42","2012-07-13 10:30:42","Add child views when scrolling in (extened) AdapterView","<android><android-widget><android-adapterview>","2","0","","",""
"3866840","1","3883229","","2010-10-05 19:02:04","0","2615","<p>I just started learning titanium for mobile using the android. I followed all the install steps and got the hello world script to work just find in the android emulator. The problem is Im trying to use example code to see how it all works. The example code Im currently having problems with is:</p><pre><code>    var win = Titanium.UI.currentWindow;var mapview = Titanium.Map.createView({    mapType: Titanium.Map.STANDARD_TYPE,    region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},    animate:true,    regionFit:true,    userLocation:true});win.add(mapview);</code></pre><p>When I run this in the emulator I get the following error:</p><p>TypeError: Cannot call method ""add"" of null.</p><p>What am I doing wrong?</p>","439883","","","","","2012-04-13 15:26:30","Cannot add to current window in titanium appcelerator. Get type error","<android><types><titanium><appcelerator>","1","0","1","",""
"3866861","1","3867630","","2010-10-05 19:05:31","0","71","<p>S60 platform's Java environment has a LandmarkStore class which saves Landmarks. A Landmark is just an object that gives a name to a location. Similar to a waypoint in GPS devices. Basic idea in S60 platform is that LandmarkStore is accessible to every application on the device. For instance, I can create a new Landmark on one Java application and this new landmark can be used in all Java applications on this device.</p><p>Is there a similar common-to-all-applications location store in Android platform? Or do I just have to ask the user to give coordinates of Home, Office and Pablo's pub when installing my location aware application?</p><p>Am I totally lost, or shouldn't the Intent system be able to provide locations for my application?</p>","102658","","","","","2010-10-05 20:53:06","Is there an android equivalent for S60 platform's LandmarkStore","<android><geolocation><android-intent><location>","1","1","","",""
"3866913","1","","","2010-10-05 19:16:59","4","970","<p>Is it possible to have a spannable in TextView similar to this functionality in WebView?</p><pre><code>Bob McDonalds &lt;span style=""white-space: nowrap""&gt;&amp;lt;b.mcdonalds@domain.com&amp;gt;&lt;/span&gt;</code></pre><p>I am trying to avoid</p><pre><code>|Email: Bob McDonalds &lt;b.          ||mcdonalds@domain.com&gt;             |</code></pre><p>I would rather</p><pre><code>|Email: Bob McDonalds              ||&lt;b.mcdonalds@domain.com&gt;          |</code></pre>","463304","","463304","","2011-08-17 18:56:15","2013-11-11 05:31:19","Android: ""nowrap"" in Spannable in TextView","<android><textview><nowrap><spannable>","1","0","1","",""
"3866976","1","3867916","","2010-10-05 19:25:56","2","1765","<p>I would like to display some UI Elements on a android xml layout file. I try to make an application, where two players can sit at each end of the mobile device, and play against each other.</p><p>So need to show some Button 180 degrees rotateted.</p><p>Is this possible? I tried android:gravity, but this did not work.</p><p>Thanks for you help,Martin</p>","467229","","1104926","","2011-12-19 13:25:06","2013-01-30 18:57:54","How to display Android UI Elements about 180 degrees rotated","<java><android><user-interface><user>","4","0","","",""
"3866983","1","4983030","","2010-10-05 19:27:11","1","874","<p>I currently found out, that my Application developed for Android 1.6 does not work on Android 2.2. I'm quite puzzled about this, because its a very simple Application which almost does nothing.</p><p>The Expeption I get is like that:</p><pre><code>java.lang.RuntimeException: Unable to instantiate application [packagename].AndApp:java.lang.ClassNotFoundException: [packagename].AndApp in loaderdalvik.system.PathClassLoader[/data/app-private/[packagename]-1.apk]</code></pre><p>The weirdest part is, that the Class it is searching for here does not exist and never has...</p><p>The app itself does nothing than show some text in a textview.</p><p>In Android 1.6 I dont get this problem and I cant see a reason, it event works in 2.1.</p><p>Has anybody a clue what this problem might be?</p><p>The Manifest looks like that:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""[packagename]"" android:versionName=""1.02"" android:versionCode=""3""&gt;    &lt;application android:label=""@string/app_name"" android:icon=""@drawable/stop_48""        android:description=""@string/Description"" android:name=""@string/app_name""&gt;        &lt;activity android:name="".DefaultActivity"" 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;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""4""&lt;/uses-sdk&gt;&lt;/manifest&gt; </code></pre>","17558","","17558","","2010-10-06 09:18:15","2011-02-13 07:33:30","Upgrading and Application from Android 1.6 to Android 2.2 does not work","<android><upgrade><android-2.2-froyo><android-1.6-donut>","3","0","","",""
"3867104","1","","","2010-10-05 19:42:11","1","705","<p>How can I have a checkbox in my ui alter my ui live? For example, if the box is unchecked I want a spinner to be displayed, and if the box is checked I want a text box to be displayed in place of the spinner. I know how to create the checkbox and check its status but I don't know how to hide and reveal other elements in an activity.</p>","278220","","","","","2010-10-05 19:56:15","Android checkbox ui change","<android><gui><checkbox>","2","0","1","",""
"3867375","1","","","2010-10-05 20:17:20","0","482","<p>I am trying to implement smth like context menu but with icons </p><pre><code>public class MenuItem {    private  int type;     private String nameItem;    private int imageResource;}menu.xml // ImageView ant TextViewpublic final class  MenuItemProvider {//create our menu items}   public class MenuListAdapter extends ArrayAdapter&lt;MenuItem&gt; { private Activity context; private List&lt;MenuItem&gt; menuItems; public MenuListAdapter(Activity context, List&lt;MenuItem&gt; menuItems) {        super(context, R.menu.menudlg, menuItems);        this.context = context;        this.menuItems = menuItems;      } @Override  public View getView(int position, View convertView, ViewGroup parent) {    LayoutInflater inflater = context.getLayoutInflater();    View row = inflater.inflate(R.menu.menudlg, parent, false);    TextView label = (TextView) row.findViewById(R.id.text_item);    label.setText(menuItems.get(position).getName());    ImageView icon = (ImageView) row.findViewById(R.id.icon_item);    icon.setImageResource(menuItems.get(position).getImageResource());    return row;  }</code></pre><p>}</p><p><strong>Question</strong> I don't understand how to handle event in this menu(event of filled menu item), one of the ways send in builder.setAdapter dialogListener ,but i don't know how create them</p><pre><code>    listView = getListView();            listView.setOnItemClickListener(new OnItemClickListener() {     @Override    public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {       AlertDialog.Builder builder = new AlertDialog.Builder(context);       builder.setTitle(title);       builder.setAdapter(new AccountsTypesListAdapter(context, AccountTypesProvider.accountTypes), dialogListener);    builder.create().show();    }</code></pre>","278279","","278279","","2010-10-05 20:30:27","2010-10-05 20:30:27","Android: Handling events in menu","<android>","1","0","","",""
"3867399","1","","","2010-10-05 20:21:12","2","1694","<p>I have an SQL statement that I can use to return distinct rows from my Android sqlite3 database and I would like to pass it through a <code>ContentProvider</code>'s query.</p><p>For example:</p><pre><code>select lastName from peopleTable where upper(lastName) like upper(""%smith%"");</code></pre><p>needs to be</p><pre><code>select DISTINCT lastName from peopleTable where upper(lastName) like upper(""%smith%"");</code></pre><p>Is there a clean way to pass the extra keywords to the select statement?</p>","157804","","844882","","2012-03-22 23:32:37","2012-03-22 23:32:37","How can one inject the sqlite3 keyword DISTINCT into an Android ContentProvider's query?","<android><sqlite3><distinct><android-contentprovider>","1","3","","",""
"3867407","1","","","2010-10-05 20:23:12","0","271","<p>can someone please help me?</p><p>I would like to write a program which uses a service to periodically update a text view on an activity.</p><p>I do this by having ActivityA with a 2 buttons to start/stop my service. In the service I run a timer which triggers every second. From here I need to have this launch and update a text view on ActivityB which at present is just a counter value.</p><p>I'm sure there are likely better ways to do this, such as using only one activity, maybe using a thread but the main design consideration is to have the service running even if my activity is destoyed (the counter value would instead go trigger some alarm or file write instead of a text view update).</p><p>Sorry for rambling. I find the android developer resources offer too many solutions!</p><p>Thanks</p><p>Ben</p>","467273","","","","","2010-10-05 21:59:49","Advice on structuring a service, activity, thread","<android><service><activity>","2","0","0","",""
"3867431","1","3867473","","2010-10-05 20:26:17","0","737","<p>I would like to pass a considerable sized amount of data (~1500 bytes) between two applications in Android where performance and resource allocation is a priority. The data is basically key-value pairs. The rate at which it needs to be passed from one application to another can vary from a trickle to ~50 packets within a second. I figure I can either:</p><ol><li><p>Wrap all the data inside a bundle, and pass the bundle via an Intent from one application to another. I worry about the performance implications of allocating and de-allocating all that memory to store the bundles.</p></li><li><p>Write all the data to a SQLite database and provide it to the other application via a content provider. Here I worry about the performance implications of writing all that data to disk, and then having to read it back from disk when it is requested.</p></li></ol><p>So, which is the lesser of two evils?</p>","467267","","","","","2010-10-05 20:32:00","Which is less performance intensive - passing a bundle via an Intent or using a Content Provider","<android><performance><content><android-intent><provider>","1","2","","",""
"3867453","1","3867828","","2010-10-05 20:28:29","2","2440","<p>I created a xsd and I created Java objects using Castor. Then I imported this in my Android project and tried to build an XML from the object, using the marshal method.</p><pre><code>Marshaller.marshal(v, writer);</code></pre><p>I received some wired exception trouble processing ""<code>javax/xml/parsers/DocumentBuilder.class</code>"":...</p><p>So my question is Can I use Castor inside Android, If yes how can I work around this.</p><p>If no, what is the neat solution available to convert object to xml and xml to object in Android, similar to Castor. </p><p>Thanks in Advance. </p>","284606","","284606","","2011-10-21 21:15:04","2012-11-01 07:48:00","Android Converting objects to XML and vice versa","<android><xml><xsd><xml-schema><castor>","2","2","1","",""
"3867557","1","3868109","","2010-10-05 20:42:08","5","752","<p>I am experiencing a problem with my app. The 1st screen that appears is a map that displays pins that are located based on an XML file that is loaded from our server. </p><p>Sometimes the app loads as expected. Other times, the map loads but none of the pins appear until you touch the screen. </p><p>Any ideas why this may be happening and what can be done to fix the problem?</p>","300129","","23897","","2010-10-05 20:43:52","2011-11-16 09:27:43","Android app's map pins not appearing until screen is touched","<android><google-maps>","3","2","1","",""
"3867586","1","","","2010-10-05 20:46:59","2","1078","<p>HI,I am willing to implement a logic in which i need to know about the amount of motion made by phone on x y or z axis,using accelerometer i can only find acceleration on these axis, even if i try calculating the relative x coordinate value based on acceleration on x axis, its of no use as i cannot determine the direction of motion (i.e whether it was left movement or right)i must be missing on something.. it will be great if anyone could provide any pointers to this.. :)thanks in advance...</p>","434912","","","","","2010-10-06 05:25:31","Detect Motion on axis in android","<android><detect><direction><motion><coordinate>","1","0","","",""
"3867804","1","3867866","","2010-10-05 21:15:35","1","466","<p>In my Android app I need to extract data from a xml file (the file will have less than 2000 lines). I have no experience with XML parsing, so I don't know what the best approach is. DOM parser is perhaps not a good option, because I am on a mobile device. On the other hand with SAX I would probably end with more complicated code. What would you recommend?</p>","243225","","","","","2010-10-06 13:37:46","What Java XML parser to extract data from 2000 lines file (on mobile device)","<java><android><xml>","4","1","","",""
"3867818","1","","","2010-10-05 21:18:29","0","454","<p>In my app is the ability to read a file.This works perfectly, but there's a problem.No line breaks or whatever they are called get added when I append the file's contents to my big EditText, so this:</p><pre><code>function hmm(){ echo 'Hello, PHP!';}</code></pre><p>would turn into this:</p><pre><code>function hmm(){ echo 'Hello, PHP!'; }</code></pre><p>How can I stop this and make it appear in the EditText as it appears in the file?</p><p>Thanks for reading,Alex.</p><p><strong>UPDATE:REALLY sorry for wasting your time, I went stupid and didn't think about adding ""\n"" after the while loop has appended each line.</strong></p>","427234","","427234","","2010-10-05 21:47:37","2010-10-06 19:04:54","Android Development: How To Automatically Add Linebreaks When Using setText()?","<android><file><open><edittext><settext>","1","5","","",""
"3867942","1","","","2010-10-05 21:36:02","0","585","<p>For a given Notification ID is it possible (using standard android packages) not to set a notification if there is an existing notification from the app ?</p><p>I have a news application notifying users on breaking news headlines, one of the requirement is not to over write a breaking news if the user has not cleared it or has not clicked to view it.</p><p>Im using a SharedPreference to set a flag to figure out if Im already showing a headline plus a delete intent that'll clear it. However the deleteIntent isn't always invoked when the user clears all notification.</p><p>Thanks in advance.</p><p>Sandeep</p>","123926","","","","","2011-06-23 12:55:35","Don't overwrite existing Notification","<android><notifications><android-notifications>","1","0","","",""
"3868124","1","3868280","","2010-10-05 22:04:54","0","2134","<p>I am new to Android development and having a problem with what SHOULD be a very simple task. I want to receive KeyEvents whenever a user is typing in an EditText field because I want to save their entered values to data structures in the background on each key stroke.</p><p>I have mimic'd the code in the Beginner's Dev guide at <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html#EditText"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-formstuff.html#EditText</a> and set up an OnKeyListener. Here is a snippet of my code:</p><p><code>cell.amountEditText.setOnKeyListener(new View.OnKeyListener() {</p><pre><code>public boolean onKey(View v, int keyCode, KeyEvent event) {    System.err.println(""onKey for Amount, key=""+event.getDisplayLabel());    if (event.getAction() == KeyEvent.ACTION_DOWN) {        return onKeyDownInAmount(finalPosition, (EditText)v, keyCode, event);    } else {        return false;    }}</code></pre><p>});</code></p><p>Behavior on the emulator is spotty at best, some times it will deliver the KeyEvents for the virtual keyboard, sometimes it won't. When I install the app on my device (HTC Hero which has a virtual keyboard only) then NONE of the events fire. I never receive a single KeyEvent.</p><p>What am I doing wrong?</p><p>Any help is appreciated.</p>","416631","","","","","2010-10-05 22:37:21","Android Key Events for EditText not happening on device","<android><event-handling><edittext>","1","0","","",""
"3868170","1","3868572","","2010-10-05 22:13:32","2","2482","<p>I'm trying to populate a list of files, and I'm using a custom ArrayAdapter so that each list item contains multiple Views. The code I use to populate the list is:</p><pre><code>File home = MEDIA;    int numFiles = home.listFiles().length;    if(numFiles &gt;0) {        ArrayList&lt;FileInfo&gt; fileData = new ArrayList&lt;FileInfo&gt;(numFiles);        for (File file : home.listFiles()) {            FileInfo data = new FileInfo();            data.title = file.getName();            data.desc = file.getAbsolutePath();            fileData.add(data);        }        FileAdapter fileAdapter = new FileAdapter(this, R.layout.file_item, fileData);        setListAdapter(fileAdapter);    }</code></pre><p>The main XML file looks like this: </p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;ListView android:id=""@+id/android:list""        android:layout_width=""match_parent""        android:layout_height=""match_parent""        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:text=""No files found on SD Card.""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And the file_item XML file looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android/com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;TextView android:id=""@+id/file_item_title""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""/&gt;    &lt;TextView android:id=""@+id/file_item_desc""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Any time I run this and it tries to populate the list, it throws an exception and crashes the application, throwing the error </p><pre><code>E/AndroidRuntime( 5320): FATAL EXCEPTION: mainE/AndroidRuntime( 5320): java.lang.RuntimeException: Binary XML file line #6: You must supply a layout_width attribute.E/AndroidRuntime( 5320):    at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)E/AndroidRuntime( 5320):    at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3600)E/AndroidRuntime( 5320):    at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:3680)</code></pre><p>If I add in an additional LinearLayout or something to the file_item XML file, the line that is missing the layout_width will change, which makes me think that it does believe that that first TextView in the file_item XML file is missing a layout_width attribute, but since there's one there already, I have no idea what it wants me to do.</p>","467366","","","","","2011-11-06 17:31:21","When populating ListView, activity crashes due to missing ""layout_width"" attribute","<android>","3","0","","",""
"3868223","1","3870117","","2010-10-05 22:24:19","3","6048","<p>For a while I was trying to get CellID and LAC of near base stations. Unfortunately I did not manage to do that. First option was to use:</p><pre><code>GsmCellLocation xXx = new GsmCellLocation();      CID = xXx.getCid();      LAC = xXx.getLac();      Toast output = Toast.makeText(getApplicationContext(), ""Base station LAC is ""+LAC+""\n""       +""Base station CID is "" +CID, Toast.LENGTH_SHORT);      output.show();</code></pre><p>But in this case I receive -1 value (as I understand that means it is not a GSM, but when i check with isGSM it shows ""true"").Another way I have found surfing the net (i updated it a bit)</p><pre><code>public void GetID(){   List&lt;NeighboringCellInfo&gt;  neighCell = null;  TelephonyManager telManager = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE);  neighCell = telManager.getNeighboringCellInfo();   for (int i = 0; i &lt; neighCell.size(); i++) {   try {     NeighboringCellInfo thisCell = neighCell.get(i);     int thisNeighCID = thisCell.getCid();     int thisNeighRSSI = thisCell.getRssi();     log("" ""+thisNeighCID+"" - ""+thisNeighRSSI);   } catch (NumberFormatException e) {     e.printStackTrace();   NeighboringCellInfo thisCell = neighCell.get(i);     log(neighCell.toString());   }  }  }</code></pre><p>But in this case the application just crashes right after I press the execute button. Eclipse shows no errors. May be someone have any ideas how to fix my problems?</p><blockquote>  <p>Logcat says: 10-05 22:53:27.923: ERROR/dalvikvm(231): Unable to open  stack trace file '/data/anr/traces.txt': Permission denied</p></blockquote><p>Used permissions:</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.CHANGE_NETWORK_STATE"" /&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.SEND_SMS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_UPDATES"" /&gt;</code></pre><p>May be the problem is that i forgot to include:</p><pre><code>TelephonyManager telManager = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE);</code></pre><p>Update. I included row from above, crash is gone but now after I press the button nothing happens.Updated source code.</p>","458024","","1003917","","2013-08-13 12:07:43","2013-11-02 11:43:44","Null Issue with NeighboringCellInfo, CID and LAC","<java><android>","1","4","1","",""
"3868345","1","3868756","","2010-10-05 22:49:41","0","2556","<p>i'm reading the android developer docs on creating custom components and one thing that's unclear, is whether you can define the layout of your component using xml and then reuse that across class libraries. like, say for instance, i want to create a class library called myComponents, and in there i want to have myTehAwesumsWidget or whatever, and i want the layout to be defined in xml, can i include that xml in the referenced class library?</p>","339448","","","","","2010-10-06 00:32:35","Android - Defining Custom Component Layouts in XML","<android><components>","1","1","","",""
"3868402","1","","","2010-10-05 23:02:19","1","1975","<p>this is my very first question:</p><p>I'm trying to configure proximity alerts that will be feed from a Database and webservice provider; but I have a problem configuring a simple proximity alert for testing. I manage to create the alert but it never gets fired, I'm only trying in the emulator for now and don´t know if I need some extra code to trigger the alerts. </p><p>I've read somewhere that the GPS provider to disabled so the network provider can be used in order to trigger the alerts on the emulator.</p><p>My code looks like this:</p><p>Proximity intent declaration  </p><pre><code>private String proximityIntentAction = new String(""gpsdelivery.gpship.getLocation.GPS_PROXIMITY_ALERT"");    </code></pre><p>Inside onStart() where the parameters of the alerts are set   </p><pre><code>IntentFilter intentFilter = new IntentFilter(proximityIntentAction);registerReceiver(new ProximityAlert(), intentFilter);setProximityAlert(45.150344, 9.999815, -1);        </code></pre><p>Proximity alert function where the alerts get created</p><pre><code>private void setProximityAlert(double lat, double lon, int requestCode){    // 100 meter radius    float radius = 100f;    // Expiration is 10 Minutes    long expiration = 600000;    LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    Intent intent = new Intent(proximityIntentAction);    PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);    locManager.addProximityAlert(lat, lon, radius, expiration, pendingIntent);}</code></pre><p>And finally my proximity alert class with the Broadcast receiver</p><pre><code>public class ProximityAlert extends BroadcastReceiver    {        @Override        public void onReceive(Context context, Intent intent)         {            Log.v(""SomeTag"",""Proximity alert received"");        }    }       </code></pre><p>Please let me know what I'm missing or what am I doing wrong. Thanks in advance, any source code would be appreciated.    </p>","465467","","","","","2011-05-30 22:49:20","Android Proximity alert doesn't get fired","<android><gps><alert><proximity>","0","2","","",""
"3868542","1","","","2010-10-05 23:34:27","3","4359","<p>I have seen one other SO question on this and it was not resolved.</p><p>I am using LoadData() with application generated html.</p><p>I noticed when I add a few blank lines after new text the page scrolls and the text takes a moment to magically appear (no scrolling, it just appears as in a fade-in.).</p><p>Watching .getContentHeight() it does not update in the onPageFinshed() event, but it is updated on subsequent additions of text on the page.</p><p>I created a timer event to watch getContentHeight. Even after I found getContentHeight had changed and issued a browser.pageDown(true) the page still did on scroll to the bottom.</p><p>It seems to be working fine when entering the activity for the first time.  My problem only happens with I append a few lines to newInnerHTML.</p><p>Additionally the view involved has a header and footer with the browser in the middle. The webView is NOT behind the footer.</p><p>Is this a bug, or am I missing something?</p><p>TIA,Jim</p><p>this code is within  the onCreate for the activity.</p><pre><code>        final WebView browser = (WebView) findViewById(R.id.webview);        browser.setWebViewClient(new WebViewClient() {              @Override              public void onPageFinished(WebView view, String url) {                super.onPageFinished(browser, url);              //  browser.computeScroll();  //didn't help                Log.d(TAG,""page getContentHeight: "" + browser.getContentHeight());                Log.d(TAG,""page finished"");                browser.pageDown(true);            }          });</code></pre><p>This method is after the onCreate for the activity</p><p>private void UpdateMessageDisplay() {</p><pre><code>     //loadData fires onPageFinished but without the new data     browser.loadData(""&lt;html&gt;&lt;body&gt;"" + newInnerHTML + ""&lt;/body&gt;&lt;/html&gt;"", ""text/html"", ""utf-8"");     //reload() again fires onPageFinished but this time with new data     browser.reload();}</code></pre>","465199","","465199","","2010-10-06 00:55:34","2011-12-08 12:32:27","onPageFinished in WebViewClient doesn't seem to fire correctly","<android><webviewclient>","1","0","","",""
"3868578","1","","","2010-10-05 23:43:03","2","1831","<p>I am trying to work with the Google Docs API in an application for Android. I can find plenty of documentation on the API and how to use it, but I can't seem to figure out how to get the dependencies into Eclipse. I followed the instructions I found here: <a href=""http://code.google.com/p/gdata-java-client-eclipse-plugin/wiki/Installation"" rel=""nofollow"">http://code.google.com/p/gdata-java-client-eclipse-plugin/wiki/Installation</a> and could not get the EMF to install. I got the Google Data Feature to install and can now seem to get resolution to com.google.gdata.data.* and com.google.gdata.util.* , but most of the stuff I need is in com.google.gdata.client.* . Can someone PLEASE help me figure out Eclipse?! I have been searching the web for an answer and beating my head against the wall for a week now! Thanks guys!!!!</p><p>Here's the error I get in Eclipse when trying to install EMF:</p><p>Cannot complete the install because of a conflicting dependency.</p><pre><code>Software being installed: Eclipse Modeling Framework (EMF) - org.eclipse.emf.common 2.3.0.v200706262000 (org.eclipse.emf.common.feature.group 2.3.0.v200706262000)  Software currently installed: Google Plugin for Eclipse 3.5 1.3.3.v201006111302 (com.google.gdt.eclipse.suite.e35.feature.feature.group 1.3.3.v201006111302)  Only one of the following can be installed at once:     EMF Common 2.4.0.v200808251517 (org.eclipse.emf.common 2.4.0.v200808251517)    EMF Common 2.4.0.v200902171115 (org.eclipse.emf.common 2.4.0.v200902171115)    EMF Common 2.5.0.v200906151043 (org.eclipse.emf.common 2.5.0.v200906151043)    EMF Common 2.2.2.v200808252119 (org.eclipse.emf.common 2.2.2.v200808252119)  Cannot satisfy dependency:    From: Google Core Plugin 1.3.3.v201006111302 (com.google.gdt.eclipse.core 1.3.3.v201006111302)    To: bundle org.eclipse.wst.sse.ui 0.0.0  Cannot satisfy dependency:    From: Google Plugin for Eclipse 3.5 1.3.3.v201006111302 (com.google.gdt.eclipse.suite.e35.feature.feature.group 1.3.3.v201006111302)    To: com.google.gdt.eclipse.core [1.3.3.v201006111302]  Cannot satisfy dependency:    From: Eclipse Modeling Framework (EMF) - org.eclipse.emf.common 2.3.0.v200706262000 (org.eclipse.emf.common.feature.group 2.3.0.v200706262000)    To: org.eclipse.emf.common [2.3.0.v200706262000]  Cannot satisfy dependency:    From: Structured Source Editor 1.1.101.v200908261807 (org.eclipse.wst.sse.ui 1.1.101.v200908261807)    To: bundle org.eclipse.emf.common [2.4.0,3.0.0)  Cannot satisfy dependency:    From: Structured Source Editor 1.1.102.v200910200227 (org.eclipse.wst.sse.ui 1.1.102.v200910200227)    To: bundle org.eclipse.emf.common [2.4.0,3.0.0)</code></pre>","452755","","614807","","2012-04-21 11:12:03","2013-07-05 06:59:52","Installing GData API in Eclipse","<android><eclipse><gdata>","2","0","1","",""
"3868621","1","","","2010-10-05 23:53:54","0","303","<p>I am trying to implement MJAndroid. There R.java is getting generated on its own. I want to delete the auto generated one and either create my own or overwrite the existing one. Its not allowing me to do so. What should I do?</p>","446668","","","","","2010-10-06 11:10:56","R.java auto generation problem","<android><eclipse>","1","1","","",""
"3868703","1","","","2010-10-06 00:17:30","11","2814","<p>What is the maximum possible size of the registration_id field used for Android C2DM service?</p>","467428","","469983","","2011-10-27 09:02:13","2012-04-02 17:04:24","Android C2DM Registration_ID max size","<android><android-c2dm>","3","1","3","",""
"3868739","1","3869020","","2010-10-06 00:28:42","1","498","<p>I have an application which has multiple activities associated with it. When the user clicks on the launcher icon I want the last used activity of the application to be shown.</p><p>What's the best way to accomplish this?</p>","80617","","","","","2010-10-06 01:55:40","Application With Multiple Activities and Single Launcher","<android><activity>","1","0","","",""
"3868768","1","3869407","","2010-10-06 00:35:36","7","20541","<p>I am trying to reverse engineer an existing android app and understand how a particular UI is constructed. I've found that I can rename the apk to zip and view some of the compiled source.  The res/layout directory is populated with all the xml files that define the UI, but while they do have the xml extension, they are not in XML format. Is there anyway to convert these files back to text based markup?</p>","343557","","","","","2014-04-19 04:19:52","Extracting Android .apk and reading contents of XML file in res/layout","<java><android>","3","4","4","",""
"3868788","1","","","2010-10-06 00:40:17","0","1337","<p>I am absolutely new to android development and I need help in know how can I invoke a remote servlet which is gonna send me data from a database in the form of xml. I am a beginner and I don't understand jargon. If possible provide me with a link/tutorial for the same.</p><p>Any help is greatly appreciated, Thanks!</p>","467440","","10755","","2010-10-06 04:37:53","2011-06-30 02:06:28","How do I invoke a servlet from my android application?","<android><servlets><invoke>","1","0","","",""
"3868819","1","3869008","","2010-10-06 00:50:28","2","877","<p>My ListActivity is bound to an ArrayAdapter where I have overriden the getView() method.  If I change the visibility of a widget in that method or modify the view's background color, those changes somehow get lost once that modified list item returns after being scrolled off the screen.  In fact, some other view in the list is picking up the changes.  </p><p>How do I get the modified view to look the same when it's redisplayed after scrolling?</p>","467447","","467447","","2010-10-06 01:47:33","2010-10-06 01:51:48","Maintain ListView Item State","<android>","1","1","1","",""
"3868824","1","3868867","","2010-10-06 00:52:30","5","4542","<p>I'm sure this is a stupid question, but I can't find a link anywhere and their wiki just says ""Copy the AdMob Jar file into that libs directory."" but not where to get it.</p>","92259","","","","","2014-04-13 16:29:53","Where do I get the admob jar?","<android><admob>","4","0","2","",""
"3868945","1","","","2010-10-06 01:34:15","2","826","<p>I am writing a syncadapter using google account and app engine. The account appears in account and sync, but when I try to select the account for syncing, I am getting a hard database error. I am trying to figure if this error is on mobile or the app engine. Further, what can be causing this error</p><p>Another error that I am getting is failed to find provider info.</p><p>Thanks for your help!</p>","467465","","467465","","2010-10-06 04:14:35","2010-10-06 04:25:03","Android SyncAdapter","<android><google-app-engine>","1","1","","",""
"3868996","1","3870323","","2010-10-06 01:48:26","0","1139","<p>i'm trying use the MediaPlayer and videoView class to play youtube videos</p><p>but all failed , is that feasible??</p><p>i have seem some app can do that , i'm just thinking how to implement .....= =a?</p>","422405","","","","","2011-10-21 04:17:16","android app play youtube","<android>","1","0","","",""
"3869031","1","","","2010-10-06 01:59:39","0","477","<p>So I am programming an android application and I am getting unusual error. In the code below I am loading the data from an sql file into a sqlite database and updating a progress dialog while I do this. After successfully executing a number of statements I am getting an exception on one execSQL statement. This statement is a perfectly formed sql statement from what I can see. The wierd thing is the exception caught it null. It is not a NullPointerException but rather Exception e = null. I am guessing this is because execSQL calls native_execSQL but does anyone have any idea what this might be?</p><pre><code>String line = null;try {  final File dbsql = new File(dbSyncDumpFilename);  pd.setMax((int) dbsql.length());  open();  DBHelper.onUpgrade(db, 1, 1);  db.beginTransaction();  final BufferedReader file = new BufferedReader(new InputStreamReader(      new FileInputStream(dbsql)));  while ((line = file.readLine()) != null) {    pd.incrementProgressBy(line.length());    db.execSQL(line);  }  db.setTransactionSuccessful();} catch (final Exception e) {  // e is null here} finally {  db.endTransaction();  close();}</code></pre>","467472","","","","","2012-01-18 09:32:05","Android Sqlite ""null"" Exception caught","<java><android><sqlite>","0","2","","",""
"3869063","1","","","2010-10-06 02:09:01","0","5050","<p>I want to have the status of a checkbox be saved into my prefs.</p><p>I set a listener on the checkbox, and if it is checked I do a prefs.putBoolean(""cbstatus"", true), and it is it unchecked i do a prefs.putBoolean(""cbstatus"", false);</p><p>Trouble is, in my onStart() when I get prefs, my Boolean getcbstatus = prefs.getBoolean(""cbstatus"", false); will always return a true, regardless of how my listener should have set that status previously. </p><p>What am I doing wrong? I have working prefs for other things like spinners, textviews, and edit texts, but what should be the simplest type (a boolean) is giving me a hard time.</p><p>I've even tried taking out all code related to listeners and pref setting for this checkbox, so that the only code in the entire activity that deals with the checkbox is in the line</p><pre><code>Boolean getcbstat = prefs.getBoolean(""cbon"", false);    if (getcbstat = true) {        cb1.setChecked(true);    }    else {        cb1.setChecked(false);        format.setVisibility(View.VISIBLE);    }</code></pre><p>Since there is no cbon preference (i deleted them all), it should return false by default and the box should be unchecked since. cb1, of course, is the name of my checkbox.</p><p>Any ideas?</p><p>Update on the code:</p><pre><code>OnClickListener cb = new OnClickListener() {    public void onClick(View v) {        if (cb1.isChecked()) {            prefs.putBoolean(""cbon"", true);        }        else {            prefs.putBoolean(""cbon"", false);        }    }};</code></pre><p>And in the onStart():</p><pre><code>        Boolean getcbstat = prefs.getBoolean(""cbon"", false);        cb1.setChecked(getcbstat);</code></pre>","278220","","278220","","2010-10-06 02:59:01","2010-10-06 07:15:54","Android boolean preference problem","<java><android><boolean><preferences>","1","0","","",""
"3869350","1","","","2010-10-06 03:39:43","1","1003","<p>I'm trying to write an Android application which will allow users to listen to a radio station.</p><p>I have got the start and stop buttons to work and it plays the stream. If I press the home key and start doing other bits and pieces with the phone, the stream continues to play. This is how I want it to work.</p><p>Should I bother creating a service to play the stream, or is the method I already use good enough?  What benefit would having it in a service bring?  A lot of tutorials and examples online seem to use services but it seems to me it's just adding extra complications into the code. Or is it more efficient?</p><p>Regards,David</p>","467538","","","","","2012-01-25 13:37:06","Android, should I make MediaPlayer a service?","<android><media-player>","1","0","","",""
"3869414","1","3869533","","2010-10-06 03:59:22","5","2338","<p>Hii</p><p>I was coding for an application that shows the list of running process and i was using TextView to display the running process in screen.I was trying 2 different method for displaying the TextView.In one method i was declearing the TextView in the code itself</p><pre><code>TextView tv = new TextView(this);this.setContentView(tv);</code></pre><p>In the second method i was declearing the layout in the main.xml file</p><pre><code>setContentView(R.layout.main);TextView tv=(TextView) findViewById(R.id.RunApp);</code></pre><p>For both the methods i am using the setMovementMethod for having the scroll movement for my TextView</p><pre><code>tv.setMovementMethod(new ScrollingMovementMethod()); </code></pre><p>The program is running fine in the emulator.But if i am using the second method then the scrolling is not happening if i am running the application in my mobile. In the emulator its working fine. Why is it behaving differently in my Android 2.1 Samsung Galaxy S??Why the scrolling not happening in the second method??. Scrolling is happening in the first method without any issues in my mobile.</p><p>This is my code..</p><pre><code>public class listRunningApps extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.main);    //TextView tv=(TextView) findViewById(R.id.RunApp);    TextView tv = new TextView(this);    this.setContentView(tv);    tv.setMovementMethod(new ScrollingMovementMethod());     ActivityManager actvityManager = (ActivityManager)               this.getSystemService( ACTIVITY_SERVICE );    List&lt;RunningAppProcessInfo&gt; procInfos = actvityManager.getRunningAppProcesses();    for(int j=0; j &lt; 2; j++) /*I have done iteration 2 times so that we have a long process list     sufficeint enough for scrolling*/        {        for(int i = 0; i &lt; procInfos.size(); i++)            {                tv.setText(tv.getText().toString()+procInfos.get(i).processName+                    "" "" + String.valueOf(procInfos.get(i).processName.length())+""\n"");            }    tv.setText(tv.getText().toString()+""----------------------------""+""\n"");        }     }}</code></pre><p>This is my 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;TextView        android:id=""@+id/jsttxt""          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""Testing TextView Scrolling""/&gt;&lt;TextView    android:id=""@+id/RunApp""    android:layout_marginLeft=""30px""    android:layout_marginRight=""30px""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/jsttxt""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>In the first method the scrolling is coming in my mobile without any issue..Can you guys help me why the scrolling is not happening in my mobile in the second method, where as its working properly in my emulator?? </p>","466474","","","","","2011-01-29 09:52:18","TextView Scrolling Issue","<android><scrolling><textview>","2","0","2","",""
"3869479","1","3869541","","2010-10-06 04:22:19","0","992","<p>I am new to android. I created a data base named as example.db with some tables in SqlLite. It worked fine. It was also created in <code>data/data/com.mypackage.myapp/databases/example.db.</code></p><p>Now, I need to open that database and see the content in the database. How can I do this?</p>","699226","","1977903","","2010-10-06 11:05:05","2011-07-18 12:48:51","How to view tables created in a database","<android>","2","0","","",""
"3869509","1","3869681","","2010-10-06 04:32:23","1","2273","<p>I want to have an image open from a URL to an intent, most likely the browser or maybe a picture previewer like the one built into twidroyd.</p><pre><code>Intent intent = new Intent();Uri uri = Uri.parse(""http://nssdc.gsfc.nasa.gov/image/planetary/earth/gal_new-zealand.jpg"");intent.setDataAndType(uri, ""image/*"");intent.setAction(android.content.Intent.ACTION_GET_CONTENT);startActivity(intent);</code></pre><p>However when I try, I get the following exception:</p><blockquote>  <p>ERROR/AndroidRuntime(232):  android.content.ActivityNotFoundException:  No Activity found to handle Intent {  act=android.intent.action.GET_CONTENT  dat=http://nssdc.gsfc.nasa.gov/image/planetary/earth/gal_new-zealand.jpg  typ=image/* }</p></blockquote><p>I've gotten plain URLs to open to the browser. I just can't figure out what action or category to specify, I've tried:</p><pre><code>intent.addCategory(""CATEGORY_BROWSABLE"");// andintent.addCategory(""CATEGORY_OPENABLE"");</code></pre><p>It also doesn't work if I set the action as:</p><pre><code>android.content.Intent.ACTION_VIEW</code></pre><p>Any Ideas?</p>","109512","","","","","2010-10-06 05:26:10","Android Image Intent from URL to Browser or other activity","<android><android-intent>","1","0","1","",""
"3869550","1","3869579","","2010-10-06 04:43:03","0","278","<p>I am having custom listview(with image, text and check box) and a button(named Done) in my listactivity.</p><p>I am able to check/un check check box upon list item click event by implementing listvw.setOnItemClickListener().</p><p>Now when i click Done button, I want to know how many list items are checked. How to do that?</p>","465751","","244296","","2010-10-12 18:41:13","2010-10-12 18:41:13","Android: GUI: Getting items from listview","<android><gui>","1","0","","",""
"3869674","1","5223800","","2010-10-06 05:24:15","3","12342","<p>I am attempting to connect to a local HTTPS server using the apache DefaultHttpClient on a Android device.</p><pre><code> DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(""http://192.168.1.121:4113/services""); ... header and content filling in ... HttpResponse response = httpclient.execute(httppost);</code></pre><p>I am getting an error of ""javax.net.ssl SSLException: Not trusted server certificate"" when the .execute runs. I want to simply allow any certificate to work, regardless of if it is or is not in the android key chain.</p><p>I have spent about 40 hours researching and trying to figure out a workaround for this issue. I have seen many examples of how to do this but none so far have worked in Android; they seem to only work for JAVA. Does anyone know how to configure, or override the certificate validation used by the Apache HttpClient in Android so that it will just approve all certificates for a DefaultHttpClient connection?</p><p>I thank you for your kind response</p>","467569","","","","","2011-03-07 18:51:24","Android DefaultHttpClient accept all certificates for SSL session help","<android><apache><ssl><httpclient><self-signed>","2","1","1","",""
"3869724","1","","","2010-10-06 05:35:40","0","114","<p>In my application I have written code to make a call to helpline just by clicking on button. When I copy this application to my Android device, if the network is not available it exits the application. I want to display a error message rather than exiting.</p><p>One more issue,I have written code to add a helpline number to contactbook when the application is loaded into device. When i check it on emulator it works, but on device it's not working :(</p>","452331","","23897","","2010-10-06 05:42:03","2010-10-06 06:06:56","Network availability to make a call","<android><networking>","1","1","","",""
"3869768","1","3869803","","2010-10-06 05:45:56","0","580","<p>i have integrated the PayPal in to my Android App.But as i click on the yellow color ""Pal with PayPal"" button a interface in web view openswhere it requres paypal user name and password.But login fails, i tried this with 2-3 paypal ids.I am running the App in PayPal SandBox environment and using the Test AppId for PayPal.Can you please help me by telling how can i log in to the paypal activity in Android</p>","395661","","","","","2012-11-18 05:06:20","Login to PalPal interface in Android in Sand Box environment","<android>","2","0","","",""
"3869771","1","3871091","","2010-10-06 05:46:07","0","922","<p>I'm very confused on how this is supposed to work. I've tried using something like this:</p><pre><code>    con = (HttpURLConnection) url2.openConnection();    con.setReadTimeout(10000);    con.setInstanceFollowRedirects(true);    con.setAllowUserInteraction(true);    con.setDoOutput(true);    con.setDoInput(true);        Authenticator.setDefault(new MyAuthenticator());    con.connect();class MyAuthenticator extends Authenticator {      protected PasswordAuthentication getPasswordAuthentication() {        return new PasswordAuthentication(""myUser"", ""MyPassword"".toCharArray());      }    }</code></pre><p>I'm getting a 401 error returned by this method so obviously I'm missing the point. According to this <a href=""http://oaklandsoftware.com/product_http/compare.html#ntlm"" rel=""nofollow"">chart</a> NTLMv2 should be supported in JRE 6.  My confusion lies in the fact that this is running on Android. In the stack trace from the exception thrown by <code>getOutputStream</code> I see an Apache implementation of <code>HttpURLConnection</code> being referenced. </p><p>From what I have found in my research Apache is unable to include NTLMv2 protocols due to licensing issues. Is this why it does not work on android?</p><p>Either way I'd like to know how this would be done in Java, not just Android.</p>","13688","","","","","2010-10-06 09:23:33","NTLMv2 HTTP Authentication Java","<java><android><ntlmv2>","1","0","","",""
"3869883","1","","","2010-10-06 06:11:47","0","1451","<p>Users of my Android app are reporting that they receive a Forced Close message when an incoming call comes in.</p><p>I have a Service Receiver and a phone state listener class to determine the status of the phone. When the state is ""CALL_STATE_RINGING"", I call upon the method stopAllPlayback() in my main Activity. It is at this point that users report ""Forced Close"" messages.</p><p>Can you help me determine where the problem might be? I'm new to Java so I'm not 100% sure how to troubleshoot based on a stack trace.</p><p>Here's the stack trace:</p><pre><code>java.lang.NullPointerExceptionat com.tdoo.toodoo.DroidGap.stopAllPlayback(DroidGap.java:190)at com.tdoo.toodoo.MyPhoneStateListener.onCallStateChanged(MyPhoneStateListener.java:21)at android.telephony.PhoneStateListener$2.handleMessage(PhoneStateListener.java:319)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><p><strong>UPDATE:</strong> i've just been able to replicate the error myself by putting my phone under a lot of stress (using adb shell monkey), then calling my phone. It seems that this error is occuring on slower phones, but I have the Droid Incredible which is significantly faster.</p><p>Does this give anyone any new ideas?</p><p>Thanks!Lewis</p>","467627","","467627","","2010-10-06 07:29:09","2010-10-06 07:29:09","java.lang.NullPointerException","<java><android>","1","6","","",""
"3869923","1","","","2010-10-06 06:17:36","0","224","<p>I am using a ListView with a thumb image in each cell. But after few seconds application crashes with a ""Force Close"" message. The log shows an OutofMemory Exception. I am trying to cache images on disk and there are approx. 500 images need to be cached. How can I resolve this issue?</p>","278194","","","","","2010-10-06 06:17:36","How to resolve OutofMemory Exception in ListView","<android>","0","2","","",""
"3870110","1","3870556","","2010-10-06 06:59:16","0","161","<pre><code>        private class NameFilter extends Filter    {        @Override        protected FilterResults performFiltering(CharSequence constraint) {            constraint = constraint.toString().toLowerCase();            FilterResults result = new FilterResults();            if(constraint != null &amp;&amp; constraint.toString().length() &gt; 0)            {                ArrayList&lt;Order&gt; filt = new ArrayList&lt;Order&gt;();                ArrayList&lt;Order&gt; lItems = new ArrayList&lt;Order&gt;();                synchronized (this)                {                    lItems.addAll(items);                }                for(int i = 0, l = lItems.size(); i &lt; l; i++)                {                    Order m = lItems.get(i);                    if(m.getOrderTitle().toLowerCase().contains(constraint)                            || m.getOrderTime().toLowerCase().contains(constraint) ||                            m.getOrderPrice().toLowerCase().contains(constraint))                        filt.add(m);                                     }                result.count = filt.size();                result.values = filt;            }            else            {                synchronized(this)                {                    result.values = items;                    result.count = items.size();                }            }            return result;        }        @SuppressWarnings(""unchecked"")        @Override        protected void publishResults(CharSequence constraint, FilterResults results) {            filtered = (ArrayList&lt;Order&gt;)results.values;            adapter.notifyDataSetChanged();            adapter.clear();            if(!constraint.equals("""")){            for(int i = 0; i &lt; filtered.size(); i++){                adapter.add(filtered.get(i));                adapter.setId(i, filtered.get(i).getOrderId());            }            }            else {                if(orders!=null){                 for(int i = 0; i &lt; orders.size(); i++){                adapter.add(orders.get(i));                adapter.setId(i, orders.get(i).getOrderId());                 }                }            }        }    }</code></pre><p>The items in the ListView comes from an AsyncTask. When the AsyncTask is running I want it to stop adding non-matching items. For now, if it had loaded 5 items and I search with a specified String, then when the AsyncTask continues loading items it adds automatically Orders to the ListView, even if there isn't a match.</p><p>How can I fix this?</p><p>Thanks in advance and tell me if the question is unclear!</p>","386562","","","","","2010-10-06 08:21:28","Don't add items if it doesn't match the filter","<android><listview><filter>","1","0","","",""
"3870158","1","","","2010-10-06 07:07:54","1","879","<p>I managed to connect an activity to a service and it runs ok. This is my first activity in the application. However, if i progress (with or without binding to the service in the first activity), the next activity (resides in a tab) will not bind to the service.</p><p>note that if i make the trouble-making activity to be my first in the app, it works fine.</p><p>any hints on what might cause the pb? the code in the 2 activities is the same. might it be because of the tabbing?do i need to setup any particular intent filtering stuff>? (i only have the default intent filtering that comes with the template)</p><p>Thanks.Alex</p>","428433","","","","","2010-10-06 09:52:41","android activity cannot bind to service","<android><service><activity><tabs><bind>","2","0","","",""
"3870182","1","3886765","","2010-10-06 07:12:13","1","781","<p>I have a series of buttons on a main menu. Instead of the standard side by side, or one on top of the other, I'd like them to be aligned around a semi-circle. Since I can't drag and drop the buttons to the place I'd like to in the designer, I was wondering the best way to do this? Can I do it in the XML, or would it be best to do it programatically?</p>","439356","","","","","2010-10-07 23:55:02","Android align Image Buttons on a curve?","<android><gui><button>","1","2","","",""
"3870254","1","3871167","","2010-10-06 07:26:10","1","659","<p>I want to go to homePage of my application on clicking button where i was in inner  page.Can any one tell me how to do that ?</p><p>Thanking you ,</p><p>Srinivas</p>","414777","","","","","2010-10-06 09:35:01","Going Home Screen of app in android?","<android><homepage>","3","0","","",""
"3870336","1","3883418","","2010-10-06 07:38:45","0","772","<p>I have a Networking service that i want to use as a Service. It's a local Service since it's not valid anymore once the application process is dead and no Other applications need to access it.(or should...).</p><p>I was pondering if to use the IBinder interface with local reference to the class and decided not to, for the moment.</p><p>I have the following issues:</p><ol><li>if the service dies, and i know it can during request processing, it's an issue for me, first i've seen it, the process wont die until the net request returns (then the thread dies gracefully), unless kill -9 is used on the process... then i'm not sure what android does with the connections. I'm not sure what's the approach i should take here.(it will be true though even if this was a local thread and not a service...)</li><li>if i want the service to listen on a callback and call it once the network processing is done, i'm in a problem, no instances can be passed on using Intents. So i need some other solutions, all the ones i though of sounds bad to me: A. use IBinder to get instance of the network service class then i can call one of it's methods and pass on an instance, this will work since they all run in the same process, BUT requires me to use Async way to get a Network instance which is not so suitable for me. B. Use static member in the Service i can access, then what to i need the service for ? C. use intent to send parameters only to the service, the service will compose a Request out of it and put it in the queue, then once done will send a response using intent which will encapsulate the response (which might be long!) and will also contain the name of the calling class as a string so all the Receivers will know if it's for them or not - BIG overhead of encapsulating data in Intent and search in all the receivers for the right one to get the response.</li></ol><p>I don't want to use the service as a local running simple thread since i'm afraid if i'll run it in the root activity i will have to use static container so it will be visible in each activity and if the root will be destroyed for some reason it will take all the service with it, even if i start new task and the process is still alive...</p><p>Anyone got some nice ideas on how to approach this thing ?</p>","312288","","","","","2010-10-07 15:47:55","Network Service needs to return a callback","<android><static><instance><threadpool><android-intent>","1","0","","",""
"3870373","1","","","2010-10-06 07:44:02","0","4023","<p>For example I saved time 6:00 and 6:05 then when i Started my service then First Message at 6:00 will sent and Second not .  Here Timer class is not working properly I don't know why? Please help me.Manifest file is correct</p><p>here is my code</p><pre><code>package com.sms;import java.util.Calendar;import java.util.Date;import java.util.Locale;import org.apache.http.impl.cookie.DateUtils;import android.R.string;import android.app.Activity;import android.app.DatePickerDialog;import android.app.Dialog;import android.app.PendingIntent;import android.app.PendingIntent.OnFinished;import android.app.TimePickerDialog;import android.content.BroadcastReceiver;import android.content.ContentResolver;import android.content.ContentUris;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.net.Uri;import android.os.Bundle;import android.os.CountDownTimer;import android.provider.Contacts;import android.provider.Contacts.People;import android.provider.ContactsContract;import android.provider.ContactsContract.CommonDataKinds.Phone;import android.telephony.SmsManager;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.AdapterView;import android.widget.AdapterView.OnItemSelectedListener;import android.widget.Button;import android.widget.DatePicker;import android.widget.EditText;import android.widget.SimpleCursorAdapter;import android.widget.Spinner;import android.widget.TextView;import android.widget.TimePicker;import android.widget.Toast; public class sendtomany extends Activity implements OnClickListener, OnItemSelectedListener { /** Called when the activity is first created. */ EditText settimetomany, setdatetomany,selectno; Intent i; TextView timedisplay; String pername; TextView timetomany, datetomany; static final int DATE_DIALOG_ID = 0; static final int time_dialog_id=1; Spinner spintomany; SimpleCursorAdapter simplecursor; String messagebody; Button oksendtomany; String timehour; String timemin; long datediff; int syear, smonth, sdays; int shour, smin, psec; int chour, cmin, csec; int cyear, cmonth,cdays; long gettime, getdate; String smstable; SQLiteDatabase db=null; private PendingIntent sentPI;//  MyCount counter;  @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.sendtomany);    selectno=(EditText) findViewById(R.id.selectno);    settimetomany=(EditText) findViewById(R.id.settimetomany);    settimetomany.setOnClickListener(this);    setdatetomany=(EditText) findViewById(R.id.setdatetomany);    spintomany=(Spinner) findViewById(R.id.spintomany);    setdatetomany.setOnClickListener(this);    oksendtomany=(Button) findViewById(R.id.oksendtomany);    oksendtomany.setOnClickListener(this);    //timetomany=(TextView) findViewById(R.id.timetomany);   // datetomany=(TextView) findViewById(R.id.datetomany);    timedisplay=(TextView) findViewById(R.id.timedisplay);    Bundle extras=getIntent().getExtras();    if(extras!=null)    {     messagebody=extras.getString(""mesbody"");    }    Cursor cur = getContentResolver().query(         People.CONTENT_URI, null, null, null, null);      startManagingCursor(cur);      String[] columns = new String[] { People.NAME ,People.NUMBER};      int[] names = new int[] {android.R.id.text1};    simplecursor=new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cur, columns,names);  simplecursor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spintomany.setAdapter(simplecursor);    spintomany.setOnItemSelectedListener(this);    db=openOrCreateDatabase(""sms.db"",  SQLiteDatabase.CREATE_IF_NECESSARY, null);     db.setVersion(1);     db.setLocale(Locale.getDefault());     db.setLockingEnabled(true);   smstable=""Create table IF NOT EXISTS smstable"" +     "" ( settime  long,"" +     ""   message  Text,"" +     ""   phonenumber text)"";     db.execSQL(smstable);         // smsservice.setMainActivity(this);      }  public void onClick(View v) { // TODO Auto-generated method stub switch(v.getId()) {   case R.id.setdatetomany:  //i=new Intent(this , datepicker.class); //startActivity(i); showDialog(DATE_DIALOG_ID);  break; case R.id.settimetomany: showDialog(time_dialog_id); break;case R.id.oksendtomany:Calendar c = Calendar.getInstance();cyear = c.get(Calendar.YEAR);cmonth = c.get(Calendar.MONTH);cmonth=cmonth+1;cdays = c.get(Calendar.DAY_OF_MONTH);chour=c.get(Calendar.HOUR_OF_DAY);      cmin=c.get(Calendar.MINUTE);      csec=c.get(Calendar.SECOND);     int ssec=00;   datediff=(new Date(syear,smonth,sdays,shour,smin,ssec)).getTime();//-(new Date(cyear,cmonth,cdays,chour,cmin,csec)).getTime();   //timedisplay.setText("" "" + datediff + "" "");  String phoneNo = selectno.getText().toString();  Toast.makeText(getBaseContext(), ""total second"" + datediff +"" ""+messagebody +"" "" +phoneNo,           Toast.LENGTH_SHORT).show();   String sql=""Insert into smstable values('"" +  datediff +""','"" + messagebody+""','""+phoneNo + "" ')"";  db.execSQL(sql);  db.close();  Toast.makeText(getBaseContext(), ""data successfully added"",             Toast.LENGTH_SHORT).show();  //counter= new MyCount(datediff,1000);  // counter.start(); //Log.d(getClass().getSimpleName(), ""onClick: starting srvice"");  Toast.makeText(getBaseContext(), ""Service started"",              Toast.LENGTH_SHORT).show();// Intent i=new Intent();//i.putExtra(name, value);  startService(new Intent(this, smsservice.class));// smsservice.setMainActivity(this); //finish();   break;   } }@Override   protected Dialog onCreateDialog(int id) {    Calendar c = Calendar.getInstance();    cyear = c.get(Calendar.YEAR);   cmonth = c.get(Calendar.MONTH);  cdays = c.get(Calendar.DAY_OF_MONTH);  switch (id) {   case DATE_DIALOG_ID:  return new DatePickerDialog(this,  mDateSetListener,  cyear, cmonth, cdays); case time_dialog_id:  return new TimePickerDialog(this,mTimeSetListener, 0, 0, false);  }    return null;}     private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {     public void onDateSet(DatePicker view, int year, int monthOfYear,  int dayOfMonth) { // TODO Auto-generated method stub  String date_selected = String.valueOf(monthOfYear+1)+""    /""+String.valueOf(dayOfMonth)+"" /""+String.valueOf(year);    syear=year;  smonth=monthOfYear+1;  sdays=dayOfMonth;   setdatetomany.setText(date_selected +  "" { "" +  smonth +""""+ sdays +""""+ syear);   }  };  private TimePickerDialog.OnTimeSetListener mTimeSetListener =  new TimePickerDialog.OnTimeSetListener() {  public void onTimeSet(TimePicker view, int hourOfDay, int minute) {   // TODO Auto-generated method stub   //Toast.makeText(sendtomany.this, ""Time is=""+hourOfDay+"":""+minute,      Toas0t.LENGTH_SHORT).show();  String time_selected=String.valueOf(hourOfDay+"":""+minute);  shour=hourOfDay;  smin=minute;  settimetomany.setText(time_selected + "" ""+shour+"" ""+smin );   }};   public void onItemSelected(AdapterView&lt;?&gt; parent, View arg1, int arg2,long arg3) {  // TODO Auto-generated method stub    String number=null;           Long get=parent.getSelectedItemId();           String s=""""+ get;           ContentResolver cr = getContentResolver();           Cursor cur = cr.query(People.CONTENT_URI,null, null, null, null);           if (cur.getCount() &gt; 0)           {                   while (cur.moveToNext())                   {                   String id = cur.getString(cur.getColumnIndex(People._ID));                  //String name = cur.getString(cur.getColumnIndex(People.DISPLAY_NAME));                   //String   phn=cur.getString(cur.getColumnIndexOrThrow(Contacts.Phones.NUMBER));                   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                                   if(id.endsWith(s))                                   {                                   number = pCur.getString(pCur.getColumnIndex(Phone.NUMBER));                                   //                                   selectno.setText(number);                                   }                                   }                   }           }  }   public void onNothingSelected(AdapterView&lt;?&gt; arg0) {  // TODO Auto-generated method stub  }  } Service is  smsservice.javapackage com.sms; import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.Timer; import java.util.TimerTask;  import android.app.Activity;  import android.app.AlertDialog;  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.database.Cursor;  import android.database.sqlite.SQLiteDatabase;  import android.os.Binder;  import android.os.CountDownTimer;  import android.os.IBinder;  import android.telephony.SmsManager;  import android.util.Log;  import android.widget.Toast;    public class smsservice extends Service{      SQLiteDatabase db=null;      String smstable;      long currentmillsec;      Calendar c;      String messagebody;      long settime;      String phonenumber;      MyCount counter;      long difftime;      int year, month, days, hour, min, sec; sendtomany myclass;   Timer timer=new Timer();     long UPDATE_INTERVAL = 60*1000;  //default  long DELAY_INTERVAL = 0;   @Override  public IBinder onBind(Intent intent) {   // TODO Auto-generated method stub  return null;  }  @Override  public void onCreate() {      Toast.makeText(getBaseContext(), ""service: Oncreated "",             Toast.LENGTH_SHORT).show();   c = Calendar.getInstance();   db=openOrCreateDatabase(""sms.db"",  SQLiteDatabase.CREATE_IF_NECESSARY, null);    db.setVersion(1);     db.setLocale(Locale.getDefault());     db.setLockingEnabled(true);     year=c.get(Calendar.YEAR);    month=c.get(Calendar.MONTH);    month=month+1;    days=c.get(Calendar.DAY_OF_MONTH);    hour=c.get(Calendar.HOUR_OF_DAY);     min=c.get(Calendar.MINUTE);    sec=c.get(Calendar.SECOND);    currentmillsec=new Date(year,month,days,hour,min,sec).getTime();       String sql=""delete from smstable where settime &lt; "" + currentmillsec;     db.execSQL(sql);     Toast.makeText(this, ""successfully deleted"", Toast.LENGTH_LONG).show();     startactivity();   }   public  void startactivity() {  // TODO Auto-generated method stub  Toast.makeText(this, ""Activity started from startactivity"", Toast.LENGTH_LONG).show();  refreshdata();}   @Override   public void onDestroy() {   if(timer!=null)  {     timer.cancel();     Toast.makeText(this, ""My Service Stopped"", Toast.LENGTH_LONG).show();  } }  public class MyCount extends CountDownTimer {  public MyCount(long millisInFuture, long countDownInterval) {      super(millisInFuture, countDownInterval);   }      public void onFinish() {   // timedisplay.setText(""Done!"");    if (phonenumber.length()&gt;0 &amp;&amp; messagebody.length()&gt;0)        {    String del="","";       String[] user=phonenumber.split(del);       int index=user.length;       for(int i=0;i&lt;index;i++)       {              sendSMS(user[i], messagebody);        }       }          else          {              Toast.makeText(getBaseContext(),                   ""Please enter both phone number and message."",                   Toast.LENGTH_SHORT).show() ;  }    Toast.makeText(getBaseContext(), "" "" + messagebody +"" "" +phonenumber,                Toast.LENGTH_SHORT).show();    //restart your service  //  Context context=null;//  Intent i=new Intent();//  i.setAction(""com.sms.smsservice"");//  context.startActivity(i);     } public void onTick(long millisUntilFinished) {    }  }  private void sendSMS(String phoneNo, String message) {// TODO Auto-generated method stub 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));                //phonenumber=selectno.getText().toString();       SmsManager sms = SmsManager.getDefault();       sms.sendTextMessage(phoneNo, null, message, sentPI, deliveredPI);        }  public void refreshdata()  {   Toast.makeText(getBaseContext(), ""service: Oncreated at referesh data function"",               Toast.LENGTH_SHORT).show(); //c = Calendar.getInstance(); db=openOrCreateDatabase(""sms.db"",  SQLiteDatabase.CREATE_IF_NECESSARY, null);      db.setVersion(1);       db.setLocale(Locale.getDefault());       db.setLockingEnabled(true);   Date(year,month,days,hour,min,sec).getTime();       //  String sql=""delete from smstable where settime &lt; "" + currentmillsec;     //  db.execSQL(sql);     //  Toast.makeText(this, ""successfully deleted"", Toast.LENGTH_LONG).show();       Toast.makeText(getBaseContext(), ""service started "",                Toast.LENGTH_SHORT).show(); Cursor cur=db.rawQuery(""Select * from smstable ORDER BY settime"", null); int row=cur.getCount();  cur.moveToFirst();  int get=cur.getPosition();int settimecount=cur.getColumnIndexOrThrow(""settime"");int messagecount=cur.getColumnIndexOrThrow(""message"");int phonenumbercount=cur.getColumnIndexOrThrow(""phonenumber"");   settime=cur.getLong(settimecount);   messagebody=cur.getString(messagecount);   phonenumber=cur.getString(phonenumbercount);   Toast.makeText(getBaseContext(), "" "" + currentmillsec + settime ,               Toast.LENGTH_SHORT).show();   Toast.makeText(getBaseContext(), "" ""  +messagebody+"" "" +phonenumber ,               Toast.LENGTH_SHORT).show();      difftime=settime-currentmillsec;      Toast.makeText(getBaseContext(), "" ""+ difftime,               Toast.LENGTH_SHORT).show();     counter= new MyCount(difftime,1000);   counter.start();  }        public void checkmessage()  {     if (phonenumber.length()&gt;0 &amp;&amp; messagebody.length()&gt;0)         {     String del="","";        String[] user=phonenumber.split(del);        int index=user.length;        for(int i=0;i&lt;index;i++)        {               sendSMS(user[i], messagebody);         }        }           else           {               Toast.makeText(getBaseContext(),                    ""Please enter both phone number and message."",                    Toast.LENGTH_SHORT).show() ;   }     Toast.makeText(getBaseContext(), "" "" + messagebody +"" "" +phonenumber,                 Toast.LENGTH_SHORT).show();   }     }manifiest file:  &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;!-- &lt;receiver android:name="".smsbrodcast""&gt;   &lt;intent-filter&gt;   &lt;action android:name=""android.intent.action.BOOT_COMPLETED""&gt;&lt;/action&gt;  &lt;/intent-filter&gt;  android:name="".smsservice""  android:enabled=""true""&gt;  &lt;/service&gt;</code></pre>","467660","","2231069","","2013-06-04 09:58:56","2013-09-05 21:48:44","SMS Scheduler use for sms at specific time","<android><sms><scheduler>","1","0","0","",""
"3870638","1","","","2010-10-06 08:22:37","4","19440","<p>Can you help me please? I've tried :</p><pre><code>ImageButton imgbt=(ImageButton)findViewById(R.id.imgbutton);Uri imgUri=Uri.parse(""/data/data/MYFOLDER/myimage.png"");imgbt.setImageUri(imgUri);</code></pre><p>but i didn't see anything, simply a void button.</p><p>Thanks!</p>","462023","","26853","","2011-11-15 14:57:13","2012-08-12 10:57:39","How to use setImageUri() on Android","<android><uri><imagebutton>","3","1","","",""
"3870641","1","3871079","","2010-10-06 08:23:04","3","2713","<p>I've built a widget that uses a LinearLayout and I've put two TextViews in the layout.The gravity of the layout is ""top"".</p><p>The problem is that I get a space between the two TextViews and I can't get rid of it.</p><p></p><pre><code>    &lt;TextView         android:id=""@+id/Text01""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:gravity=""bottom|center_horizontal""         android:text=""blah blah""        android:background=""@android:color/transparent""        android:textColor=""#3e6eb4""        android:textSize=""11sp""        /&gt;            &lt;TextView         android:id=""@+id/text02""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:gravity=""top|center_horizontal""         android:text=""""        android:background=""@android:color/transparent""        android:textColor=""#3e6eb4""        android:textSize=""14sp""        android:padding=""0sp""        android:verticalSpacing=""0sp""        /&gt;</code></pre><p></p><p>As you can see I tried putting padding 0 and verticalSpacing 0 but I still get a space between them.</p><p>How can I fix it?</p><p>Thanks.</p>","445114","","","","","2012-07-17 20:21:35","How to get rid of extra spacing in LinearLayout?","<android><spaces><android-linearlayout>","3","3","1","",""
"3870664","1","3870827","","2010-10-06 08:26:00","1","830","<p>Can anybody tell me how to create a sub folder in asset folder at run time and copy the files from res folder to my assets sub folder?</p>","397901","","147141","","2011-06-24 12:11:17","2011-12-06 12:38:07","create a sub directory in asset directory on run time in android","<android><dir>","2","0","","",""
"3870779","1","3870877","","2010-10-06 08:43:02","0","2073","<p>I want to remove the orange highlight around the EditText. This highlight doesn't match my UI and I really want to get rid of it.</p><p>Any ideas?</p>","386562","","114066","","2010-10-06 09:14:21","2013-12-05 18:48:06","Remove highlight effect from EditText","<android><layout><edittext>","1","0","2","",""
"3870949","1","","","2010-10-06 09:03:17","4","953","<p>I've been searching the interwebs on how to stream media (Audio/Video, only audio at this time) to a server, but the only thing i can find is to do it the other way around  (Server -> Android).</p><p>I've seen some people mentioning that it is possible to stream audio (.mp3) by tailing the outputed file and sending it to the server.</p><p>any suggestions?</p>","467721","","467721","","2010-10-13 07:50:55","2012-10-20 01:42:11","Stream Audio from an android device to a server","<java><android><audio-streaming>","1","4","1","",""
"3871070","1","3871175","","2010-10-06 09:19:30","3","3457","<p>I'm trying to integrate Google Analytics into my Android project using the information on the <a href=""http://code.google.com/mobile/analytics/docs/android/#howItWorks"" rel=""nofollow"">website of the respective SDK</a>. However, there is very little documentation available. My project has 6 different Activities and I noticed that using the method on the website results in a unique visit in Google Analytics for each Activity that is being opened, even if it's still in the same session. Apparently, Google Analytics for Android never reuses a previously used session.</p><p>Their method is to start tracking activity in onCreate and then stop tracking in onDestroy. The problem I have with this is that a session will stay active if a user presses the home button instead of the back button, since the Activity will not be destroyed. Therefore I chose to do it in onResume and onPause instead but that means that new sessions gets opened when a new Activity is opened.</p><p>Does anyone know any way to really track a single session over multiple Activities?</p>","321103","","","","","2011-09-14 21:42:37","Google Analytics for Android using multiple Activities","<android><google-analytics>","3","1","1","",""
"3871112","1","3871164","","2010-10-06 09:27:27","0","370","<p>Is there any way by which i can get the last GPS location my application itself ???? </p><p>Is there any API available which can show me the Lat and Long. of the place from where i have connected GPS last time.</p><p>Any help, much appriciated </p><p>Thank you</p>","1386533","","1386533","","2010-10-06 09:34:35","2010-10-06 09:34:52","Android : Using GPS","<android>","2","0","1","",""
"3871119","1","","","2010-10-06 09:28:14","11","1786","<p>I want to write a service for Android platform that is notified when the current foreground activity changes.Basically the service should do some tasks only when the top activity changes.Is there any way to subscribe  and to be notified when this kind of event occurs ? Or there is no possibility and the service should poll from time to time the list of running activities and to check what is the foreground activity ?Not preferable solution...</p>","467780","","","","","2013-07-06 10:16:14","How to be notified when foreground (top) activity (application) changes","<android><service><activity><foreground>","1","5","2","",""
"3871244","1","","","2010-10-06 09:44:52","0","450","<p>I need to send messages to Android phones through P2P on 3G connection.Sending and receiving works perfectly on lan ip addresses(on wi-fi) but not on 3g or 2g.On 3g I send a message but it never appears on the other end of the line.Can anyone tell me how to make a connection ? What port to use ?</p><p>Thanks,DataSmith</p>","467790","","","","","2011-03-21 01:53:06","Can't send P2P message from real IP","<java><android><p2p>","1","2","","",""
"3871311","1","3871334","","2010-10-06 09:53:45","48","19278","<p>I need to find where the bottlenecks are in my Android app.</p><p>What profiling tools or techniques can I use?</p>","15825","","","","","2013-06-13 23:08:07","How can I profile my Android app?","<android><performance><profiling>","2","5","5","",""
"3871328","1","3871411","","2010-10-06 09:56:08","0","635","<p>I have a RelativeLayout with a tiled background. Is there a way to make a tween animation to fade out the existing image and fade in a new one?</p>","421372","","","","","2010-10-06 10:08:21","Animating a background image","<android><image><relativelayout>","1","0","","",""
"3871366","1","","","2010-10-06 10:03:08","2","3962","<p>I have a hashtable filled with data, but I don't know the keysHow can I loop througth a HashTable keys in android?I'm trying this, but it doesnt work:</p><pre><code>Hashtable output=new Hashtable();output.put(""pos1"",""1"");output.put(""pos2"",""2"");output.put(""pos3"",""3"");ArrayList&lt;String&gt; mykeys=(ArrayList&lt;String&gt;)output.keys();for (int i=0;i&lt; mykeys.size();i++){                txt.append(""\n""+mykeys.get(i));}</code></pre>","467801","","1108213","","2012-03-18 18:43:02","2012-03-18 18:43:02","How can i loop thorugth a HashTable keys in android?","<android>","2","0","","",""
"3871396","1","3880313","","2010-10-06 10:05:55","1","5618","<p>I have a linear layout which has 5 text views. Suppose user click on 3rd text view. I want to expand this 3rd text view on the entire screen i.e. i want to show this 3rd text view as a full screen in the same activity above the other text views.Is it possible in Android ?</p>","462534","","","","","2010-10-07 09:27:08","Expand Android View as a full screen","<android>","2","0","1","",""
"3871434","1","","","2010-10-06 10:11:56","2","600","<p>It will be great if anyone can help me to understand how to use RESTlet API in Android to download any file like image and store it in internal memory.</p><p>Thank you</p>","453951","","","","","2011-02-26 17:38:53","Download file using RESTlet API in Android","<android>","1","0","","",""
"3871457","1","3871723","","2010-10-06 10:15:30","3","1714","<p>Hello I am building an application that is going to execute a block of code at fixed periods of time (e.g. every 30 minutes). I would like that period to be strict,what I mean is that I would like to be guaranteed that the period will be 30 minutes and not 28 minutes or whenever the os whants to execute it.</p><p>I have a Timer object and use it as follows:</p><p><code>timer=new Timer();timer.scheduleAtFixedRate(new GetLastLocation(), 0, this.getInterval());</code>where GetLastLocation is the handler class wich extends TimerTask.This works fine,but I would like to be able to change the interval,what I am currently doing is using timer.scheduleAtFixedRate twice and changing the interval parameter to lets say a newInterval but I think that this is just having two timers execute every interval and newInterval now, am I correct?</p><p>also I have tries cancelling the timer and then using the the method scheduleAtFixedRate() but this throws an exception as stated in the documentation.</p><p>what can I do to fix this? regards maxsap</p>","234898","","","","","2013-02-27 07:19:02","android timer question","<android>","3","0","1","",""
"3871546","1","","","2010-10-06 10:27:26","1","830","<p>Hi I have created an Activityname as ZBC. Where i have created Customized List view I am able to detect on click event using onItemClick() method of OnItemClickListener on list view. I want progress dialog to be displayed on click on ListView. I used the following code but I didnot get ProgressDialog</p><p>How to display progress dialog in onItemClick method</p><pre><code>ProgressDialog.show(ABC.this, """", ""Loading..."", true);</code></pre><p>But I didnot get ProgressDIalog</p><p>how to show progress dialog onitemclick, android</p>","111988","","","","","2011-06-29 12:06:30","how to show progress dialog onitemclick, android","<android><progressdialog>","1","0","","",""
"3871580","1","","","2010-10-06 10:32:53","-2","109","<p>Guys, I need an android application that can be configured by the user. In java, we are using properties file to configure the applications. Any idea about the same in android..</p><p>Thanks in advance</p>","462695","","","","","2010-10-06 12:50:21","configure an android application","<android>","2","3","","",""
"3871596","1","","","2010-10-06 10:35:02","0","1556","<p>I have created an android app. It sends a data message on a port for communicating with the same app on some other phone. While sending the message, i have encoded it into binary data using ISO8859_1 encoding. </p><p><code>byte[] b1=payload.getbytes();</code></p><p>I am able to receive the data message at the receiving end. But the problem is that after receving it in binary format , My app needs to decode the message back to string or human read-able format. But i am not able to do the same.</p><p>I have tried to convert it into String using 'toString()' but string contains binary character . </p><p>pls help.</p>","467827","","","","","2010-10-06 11:17:55","how to convert binary data (ISO-8859-1) to string","<android><messaging><iso-8859-1>","1","0","","",""
"3871625","1","","","2010-10-06 10:40:14","0","1225","<p>I'm developing an app which basically navigates through a xml-feed. When I parse the feed or let's say the list, then each (list)item becomes a model. All the models are wrapped up in an array list. </p><p>Now, when the user clicks on a list item, the underlying model is going to be serialized and sent as IntentExtra to the next Activity (e.g. a deeper sub list). </p><p><em>(Originally I asked here a different question. The solution was not related to Serializable and wouldn't help anybody. However MatteKarla gave an interesting input. Thats why I decided to rewrite this question.)</em></p>","433718","","433718","","2010-10-06 16:11:00","2010-10-06 16:11:00","What's the best practice to pass data between Activities? Should I favor Parceable over Serializable as Intent Extra?","<android><serialization><android-intent>","1","0","","",""
"3871677","1","3886678","","2010-10-06 10:47:19","0","359","<p>friend'd   I need to display image has background and transparent text at particular location of the image text,here my problem is it display well in some devices and not being proper alignment in larger screens,even i used seperate resource file like layout,layout-large,layout-small but in some case it's not working well,i set <pre><code>    android:normalScreens=""true"" android:smallScreens=""true""    android:anyDensity=""false"" /&gt; in my manifest file,![alt text][1]</code></pre><p>here my screenshoti need the black and white colour text being placed exactly on yellow coloured text.here my xml 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_gravity=""center_horizontal"" android:layout_width=""wrap_content""    android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical"" android:background=""@drawable/about_brown""        android:layout_gravity=""center_horizontal"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TextView android:id=""@+id/about_mail_text1""            android:textSize=""12sp"" android:textColor=""@color/black""            android:layout_marginTop=""190dp""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:text=""@string/ab_t1"" android:layout_marginLeft=""135dip"" /&gt;        &lt;TextView android:id=""@+id/about_mail_text2""        android:layout_below=""@id/about_mail_text1""            android:textSize=""12sp"" android:textColor=""@color/black""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_marginLeft=""156dip"" android:text=""@string/ab_t2""             android:layout_marginTop=""2dp""/&gt;        &lt;TextView android:id=""@+id/about_mail_text3""        android:layout_below=""@id/about_mail_text2""            android:textSize=""13sp"" android:layout_marginTop=""73dp""            android:textStyle=""bold"" android:textColor=""@color/white""            android:gravity=""center_horizontal"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:text=""@string/ab_t3"" /&gt;        &lt;TextView android:id=""@+id/about_mail_text4""            android:layout_below=""@id/about_mail_text3""            android:textSize=""13sp"" android:textStyle=""bold"" android:textColor=""@color/white""            android:layout_marginTop=""50dp"" android:gravity=""center_horizontal""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:text=""@string/ab_t4"" /&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>how can i get it,please help me.</p>","393953","","","","","2010-10-07 23:30:37","need help on supporting multiple screens in android","<android>","1","0","","",""
"3871681","1","","","2010-10-06 10:47:42","17","26000","<p>Following situation:I have TabActivity with e.g. three tabs, TabA, TabB, TabC.</p><p>There are a button in activity (Act_C_1) of TabC. So if the user clicks on that button, another activity (Act_C_2) should occur in TabC.</p><p>I thank you in advance for any suggestions / or ideas.</p><p>Mur</p><p><strong>UPD:</strong></p><p>Here is my code</p><p>TabActivity with three Activities:</p><pre><code>public class TabScreen extends TabActivity{    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.tab_menu);        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, SecondActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""tab_1"").setIndicator(""Tab1"",null).setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, ThirdActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""tab_2"").setIndicator(""Tab2"",null).setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, FourthActivity.class);        spec = tabHost.newTabSpec(""tab_3"").setIndicator(""Tab3"",null).setContent(intent);        tabHost.addTab(spec);    }}</code></pre><p>Activity 'Act_C_1' or FourthActivity.java:</p><pre><code>public class FourthActivity extends Activity implements OnClickListener{    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.fourth);        Button BtnWeiter = (Button)findViewById(R.id.BtnWeiter);        BtnWeiter.setOnClickListener(this);    }    @Override    public void onClick(View v)     {                            // I also tried to use LocalActivityManager        // TabActivity parentTabActivity = (TabActivity) getParent();                    // LocalActivityManager manager = parentTabActivity.getLocalActivityManager();        // manager.destroyActivity(""tab_3"", true);        // manager.startActivity(""tab_3"", new Intent(this, FourthActivity.class));        finish();        startActivity(new Intent(this, FourthActivity.class));                }        }</code></pre>","408780","","408780","","2010-10-07 12:27:46","2012-12-01 12:36:12","Android. How to change Activity within a Tab","<android><android-tabhost><tabactivity>","3","1","15","",""
"3871689","1","","","2010-10-06 10:48:42","1","658","<p>I am a newbie to Android Development, and facing this particular problem while changing TabBackground Image.</p><p>As you can see in the attached Image, there is a thin gray line. And I am unable to figure out where is it coming from. Can you please assist me in removing it. </p><p>I have checked there is no padding anywhere, and android:layout_width=""wrap_content"" and             android:layout_height=""wrap_content"".</p><p><img src=""http://i.stack.imgur.com/Fx0px.png"" alt=""alt text""></p><p><strong>Actual Tab Background Image</strong></p><p><img src=""http://i.stack.imgur.com/73XeL.png"" alt=""Actual Tab Background Image""></p>","204501","","","","","2013-03-21 12:25:35","How to properly change Tab Background in Android","<android><user-interface><tabwidget>","1","0","1","",""
"3871824","1","","","2010-10-06 11:09:39","4","10620","<p>I have a service which polls a server at certain intervals. I use an AlarmManager and a BroadcastReceiver to start the service.  My problem is that after a certain duration, even though the Wifi is still enabled, but for some reason, my application can't contact the server. I get an ""Unreachable network"" error. </p><p>Note that I've already acquired a partial wake lock as well as a wifilock.</p><p>Here's my code for the BroadcastReceiver.</p><pre><code>public class ServiceAlarmBroadcastReceiver extends BroadcastReceiver {    public void onReceive(Context context, Intent intent) {        WakeLock wakeLock = null;        WifiLock wifiLock = null;        try {            PowerManager pm = (PowerManager) context                    .getSystemService(Context.POWER_SERVICE);            // acquire a WakeLock to keep the CPU running            wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,                    ""MyWakeLock"");            if(!wakeLock.isHeld()){                wakeLock.acquire();            }            Log.i(""ServiceAlarmBroadcastReceiver"", ""WakeLock acquired!"");            WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);            wifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL , ""MyWifiLock"");            if(!wifiLock.isHeld()){                wifiLock.acquire();            }            Log.i(""ServiceAlarmBroadcastReceiver"", ""WifiLock acquired!"");            context.startService(new Intent(context, ThePollerService.class));        } finally {            // release the WakeLock to allow CPU to sleep            if (wakeLock != null) {                if (wakeLock.isHeld()) {                    wakeLock.release();                    Log.i(""ServiceAlarmBroadcastReceiver"", ""WakeLock released!"");                }            }            // release the WifiLock            if (wifiLock != null) {                if (wifiLock.isHeld()) {                    wifiLock.release();                    Log.i(""ServiceAlarmBroadcastReceiver"", ""WiFi Lock released!"");                }            }        }    }}</code></pre>","456874","","456874","","2010-10-06 15:08:28","2014-03-12 20:48:52","How do I keep Wifi from disconnecting when phone is asleep?","<android>","4","1","1","",""
"3871928","1","","","2010-10-06 11:24:25","0","629","<p>I  have  a  problem  with txt files in my raw folder (android project)Explanation:  I am added a some txt files to a  folder raw/eng   and  I need to get that  files (read) in  class  I made some  if branches and happens that some files I can reference but some not  ""R.raw.ejapan"" cannot  be resolved ???</p><p>This  is  screen shot of  my problem  with samples of  files  content:Problem:   <a href=""http://img709.imageshack.us/i/16295395.jpg/"" rel=""nofollow"">http://img709.imageshack.us/i/16295395.jpg/</a></p><p>Text file OK :  <a href=""http://img155.imageshack.us/i/26320191.jpg/"" rel=""nofollow"">http://img155.imageshack.us/i/26320191.jpg/</a></p><p>Text file BAD <a href=""http://img844.imageshack.us/i/61721888.jpg/"" rel=""nofollow"">http://img844.imageshack.us/i/61721888.jpg/</a></p><p>and  yes  I use UTF8 when I generate those files</p>","365860","","","","","2010-10-06 11:24:25","android text file resource problem","<android><text><file>","0","3","1","",""
"3872063","1","","","2010-10-06 11:46:06","107","69144","<p>I want to launch an installed package from my Android application. I assume that it is possible using intents, but I didn't find a way of doing it.Does anyone have a link, where to find the information?</p>","467895","","546999","","2012-09-23 12:42:23","2014-03-18 19:37:06","Android Launch an application from another application","<android><android-intent>","5","1","48","",""
"3872122","1","3872508","","2010-10-06 11:53:40","8","8596","<p>Can anyone tell me how to make a flexible AppWidgets in Android according to the screen size?I want to make a full screen widget, but when the screen size changes, I want to make it flexible.</p><p>Thanks. </p>","430926","","1248365","","2013-09-25 17:48:30","2013-09-25 17:48:30","Android Widget Size","<android><android-widget>","1","0","1","",""
"3872136","1","","","2010-10-06 11:55:35","1","2032","<p>How to show TextView and ImageView both in a single Gallery View . I want to show Image title for each image just below it.</p>","467911","","","","","2010-10-06 13:30:39","Showing ImageView and TextView in Gallery","<android>","1","0","2","",""
"3872222","1","","","2010-10-06 12:07:43","2","959","<p>Just like Twitter for android used to have (they removed it) - I need to display an animated background drawable.</p><p>How to I show an image that is actually bigger then the given layout dimensions (without the image being shrink).</p><p>What kind of animation do I need to use for the ""moving"" effect?</p><p>thanks.</p>","258429","","","","","2010-10-06 17:10:51","Twitter-Like background animated drawable in android","<android><animation><background><dashboard><drawable>","1","0","1","",""
"3872267","1","3872334","","2010-10-06 12:14:12","2","2261","<p>can anyone tell me the best way to update widget every minute.</p><p>Now i'm using thread inside the AppWidget, but sometimes i get error  FAILED BINDER TRANSACTION !!! After that error, i always got a lot of error like that all the time and i can't change the view in my widget again.</p><p>Thanks</p>","430926","","","","","2013-07-14 19:10:57","How to update widget every minute","<android><android-widget>","2","1","3","",""
"3872275","1","3872295","","2010-10-06 12:15:11","1","726","<p>I am having a bitmap image. Can i show it in a Alert Dialog in android? </p>","436765","","","","","2010-10-06 15:44:25","Alert in android","<android>","3","0","0","",""
"3872516","1","","","2010-10-06 12:41:25","0","535","<p>I need an android application that needs to receive images from a server through GPRS(by http connection) and display it. am having the url of the server </p>","462695","","","","","2010-10-06 20:42:56","Receive images from server through GPRS and display","<android>","2","2","","",""
"3872548","1","3872792","","2010-10-06 12:45:46","2","776","<p>Is there a way to include one resource in another (for example a header design in multiple activities' layouts). I know I can add it at run time, can it be done in the XML?</p>","463304","","","","","2010-10-06 13:13:24","Include a second layout resource in my first one","<android><include><android-layout>","2","0","1","",""
"3872811","1","","","2010-10-06 13:14:49","0","170","<p>In my Project I want to play audio files in mediaplayer and displays progressbar. If I exit the application then also player have to play audio file. If I restart The <code>Activity</code>I have to display progress bar with last activity progress.</p><p>Here I tried using <code>onSaveInstanceState()</code> method. But I cant display progress bar with last progress. when I exit the activity player is playing but when I restart activity it stopped and displayed new view without any progress and saved data.</p>","437612","","119895","","2010-10-06 13:48:09","2011-04-07 23:49:59","how can I display saved data when I restart Activity","<android>","1","0","","",""
"3873094","1","3875085","","2010-10-06 13:45:00","0","167","<p>In my XML I can set textSize=""18sp"". Is it possible to change the scale of the sp unit which would affect all sp sizes but not affect dp sizes?</p>","463304","","","","","2010-10-06 17:07:00","Is it possible to change the scale of the sp unit","<android><android-layout><android-fonts>","1","0","","",""
"3873097","1","5993183","","2010-10-06 13:45:18","6","27409","<p>I'm developing an Android application.</p><p>I have 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:layout_width=""fill_parent""  android:layout_height=""200px""  android:orientation=""vertical""&gt;  &lt;TextView        android:id=""@+id/gameTitle""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:focusable=""false""        android:focusableInTouchMode=""false""        android:gravity=""left""        android:layout_margin=""5px""        android:text=""aaaaa""/&gt;  &lt;TextView        android:id=""@+id/gameDescription""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:focusable=""false""        android:focusableInTouchMode=""false""        android:gravity=""left""        android:layout_margin=""5px""        android:typeface=""sans""        android:textSize=""16sp""        android:textStyle=""bold""        android:text=""dddddd""/&gt;  &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/ButtonsTable""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;        &lt;TableRow            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;Button                android:text=""@string/yes""                android:id=""@+id/playGame""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;            &lt;Button                android:text=""@string/no""                android:id=""@+id/noPlayGame""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I want to put playGame button in the left side of the center, and noPlayGame button in the right side of the center.</p><p>Now, both appear aligned to the left of the TableRow.</p><p>How can I do this?</p><p>Thank you.</p><p><strong>EDIT</strong>: I've added the complete layout and the modifications suggested by <strong>Ashay</strong>.<br/><strong>2nd EDIT</strong>:<BR/> <strong>THE SOLUTION</strong><BR/>I've added to <code>TableLayout</code> the following: <code>android:stretchColumns=""0,1""</code>. Now the buttons are center aligned but they fill their entiry column!!!</p>","68571","","68571","","2010-10-06 14:20:26","2013-07-08 07:16:21","Align buttons inside a TableRow","<android><tablelayout>","5","2","3","",""
"3873142","1","3873328","","2010-10-06 13:50:12","8","3386","<p>What I need:<br>- Send SMS with no GUI interaction (choosing a client to send SMS is out)<br>- SMS has to be visible in a thread queried from ""content://mms-sms/conversations/""+threadId</p><p>Currently I'm using SMSManager:</p><pre><code>SmsManager sms = SmsManager.getDefault();sms.sendTextMessage(phone, null, message, null, null);  </code></pre><p>Is there any ways to do this across all the devices considering each of them has a different SMS app. Thanks in advance.</p>","365714","","","","","2012-07-19 03:32:44","Android send SMS which is visible in SMS thread (no GUI)","<android><sms>","2","0","8","",""
"3873155","1","","","2010-10-06 13:51:05","2","3999","<p>I want to display a <code>TextView</code> just <em>above</em> thumb of the <code>SeekBar</code> that will display the current progress of seek bar. As we move the thumb forward and backward the <code>TextView</code> will also move with thumb (the <code>TextView</code> should also be above the thumb).</p><p>Please provide any clue, code snippet are always welcome.</p>","324225","","1628280","","2014-02-21 09:30:22","2014-02-21 09:30:22","how to customize thumb of seek bar","<android><seekbar>","3","0","1","",""
"3873214","1","3875487","","2010-10-06 13:56:31","1","166","<p>The android content provider has methods for the normal suspects {insert, delete, query, update} but if I want to send control messages there is no obvious mechanism.Suppose one of the tables managed by the needs to be reset, cleared and reloaded.How can this be done?  I have several approaches each of them seems a bit hackish.</p><p>1) create an activity(or service/receiver) to to the job. The activity does a bulk delete and insert.This seems like the least hackish but when the content provider starts the database helper creates the tables and initializes them.<br>It seems inefficient to duplicate the initialization code in the content provider's database helper and in a separate activity.</p><p>2) hijack the content provider api.A dummy table could be created where the insert (or update/query/delete) method would invoke otherwise inaccessible methods.</p><p>3) use multiple inheritance to make the content provider also an service (or activity).This is probably closest to what I want but I don't know how to do this.It feels dangerous, especially if it were an activity.</p><p>4) have a service content-provider pairSimilar to (3) but hopefully without the warts.The service would have aidl for doing all the control kinds of things.Such as, loading lookup tables, clearing tables, purging expired tuples, ...If this were done, the service how would the service be started? by the content provider?</p>","345427","","345427","","2010-10-06 17:47:02","2010-10-06 17:57:54","(best) Ways to deliver control messages to custom content provider","<android><service><activity><content><provider>","1","0","","",""
"3873234","1","","","2010-10-06 13:58:13","0","367","<p>Is there a way to center an image horizontally based on another image? Could be from xml or coded.</p><p>For example one button on top and another button below (i.e. android:layout_below=""@+id/button1""), but centered horizontally based on the first one.</p>","426468","","21234","","2010-10-06 14:49:24","2010-10-07 23:20:48","Android: Center an image horizontally based on another image (not on parent)","<android>","1","3","","",""
"3873464","1","3875006","","2010-10-06 14:19:28","0","659","<p>I’m working with Eclipse and writing an Android application.  I’ve noticed that the load times to the Android emulator can vary significantly.  Recently, I found that manually going back to the main menu of the emulator helps my application load much faster.  This brings up two questions.</p><p>Is there a quicker way (read: automatic way) to exit out of my application rather than hitting the Back button multiple times until I get to the main app menu?</p><p>Secondly, is there something I am doing wrong that factors into the longer load time?</p><p>Thanks.</p>","432209","","","","","2010-10-06 16:57:35","Android emulator application load/start time","<java><android><eclipse><android-emulator>","1","0","","",""
"3873496","1","3873634","","2010-10-06 14:23:40","3","9349","<p>is it possible to get the path of all the images that are stored on the sd card of my android phone? also is it possible to check for other images stored on sd card or in the internal memory? I am currently doing this:</p><pre><code>Cursor cur = this.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null,null);          startManagingCursor(cur);          cur.moveToFirst();        while (cur.moveToNext()) {            String str = cur.getString(cur.getColumnIndex(MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME));            Log.e(""#########"",str);        }</code></pre><p>this seems as if  returns the directories names,also I have seen this code:</p><pre><code>File images = Environment.getDataDirectory();          File[] imagelist = images.listFiles(new FilenameFilter(){          public boolean accept(File dir, String name)          {              return ((name.endsWith("".jpg""))||(name.endsWith("".png"")));          }      });          String []mFiles = new String[imagelist.length];          for(int i= 0 ; i&lt; imagelist.length; i++)          {              mFiles[i] = imagelist[i].getAbsolutePath();          }          Uri[] mUrls = new Uri[mFiles.length];          for(int i=0; i &lt; mFiles.length; i++)          {              mUrls[i] = Uri.parse(mFiles[i]);              Log.e(""###############"",""MURIS: ""+mUrls[i].getEncodedPath());        }     </code></pre><p>but this is throwing a nullpointer  exception .</p><p>regards maxsap</p>","234898","","","","","2010-10-06 14:36:06","How to get image path from images stored on sd card","<android>","1","0","1","",""
"3873515","1","3960199","","2010-10-06 14:25:25","1","4165","<p>I'm working on my new project but I can't figure out how to add a text under my Gallery.</p><p>I have 3 pictures, if I slide on picture 2 I can see under picture 1 and 3 the correct description but it doesn't appear the description under the selected picture (in this case the number 2).</p><p>This is my code:</p><pre><code>public void onClick(View v, int scelta) {    // in base all'intero della scelta ho una voce del menu :)    if (scelta == 1) {        Intent i = new Intent(this, Parco.class);        startActivity(i);    } else if (scelta == 2) {        Intent j = new Intent(this, Servizi.class);        startActivity(j);    } else {        this.startActivity(new Intent(                Intent.ACTION_VIEW,                Uri.parse(""http://maps.google.com/maps?f=d&amp;saddr=37.4,-121.9&amp;daddr=Bellevue, WA&amp;hl=en"")));    }}public class ImageAdapter extends BaseAdapter {    private Context ctx;    private int itemBackground;    public ImageAdapter(Context c) {        ctx = c;        // Style        TypedArray a = obtainStyledAttributes(R.styleable.Gallery01);        itemBackground = a.getResourceId(                R.styleable.Gallery01_android_galleryItemBackground, 0);        a.recycle();    }    @Override    public int getCount() {        return pics.length;    }    @Override    public Object getItem(int arg0) {        return arg0;    }    @Override    public long getItemId(int arg0) {        return arg0;    }    @Override    public View getView(int elemento, View arg1, ViewGroup arg2) {        LinearLayout layout = new LinearLayout(getApplicationContext());        layout.setOrientation(LinearLayout.VERTICAL);        ImageView img = null;        // Riutilizziamo l'eventuale convertView.        if (arg1 == null) {            img = new ImageView(ctx);        } else {            img = (ImageView) arg1;        }        img.setImageResource(pics[elemento]);        img.setScaleType(ImageView.ScaleType.FIT_XY);        img.setLayoutParams(new Gallery.LayoutParams(280, 210));        img.setBackgroundResource(itemBackground);        TextView tv = new TextView(ctx);        String titolo = """";        if (elemento == 0) {            titolo = ""le Grotte"";        } else if (elemento == 1) {            titolo = ""il Parco"";        } else if (elemento == 2) {            titolo = ""i Servizi"";        }        tv.setText(titolo);        tv.setGravity(Gravity.CENTER);        // Utilizzo l'AssetManager per cambiare il font        AssetManager assetManager = getResources().getAssets();        Typeface typeface = Typeface.createFromAsset(assetManager,                ""fonts/CALIFR.TTF"");        tv.setTypeface(typeface);        tv.setTextSize(50);        tv.setPadding(0, 0, 0, 40); // imposto il margine di bottom del                                    // testo        layout.addView(img);        layout.addView(tv);        return layout;    }}@Overridepublic View makeView() {    ImageView iView = new ImageView(this);    iView.setScaleType(ImageView.ScaleType.FIT_CENTER);    iView.setLayoutParams(new ImageSwitcher.LayoutParams(            LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    iView.setBackgroundColor(0xFF000000);    return iView;}</code></pre><p>Thank you!!!Marco</p>","397006","","515455","","2011-09-12 00:25:16","2011-11-23 09:06:34","Add description to Android Gallery - (Pictures and text)","<android><text><gallery>","2","0","1","",""
"3873562","1","3876199","","2010-10-06 14:28:53","2","125","<p>i want to support our app for 2.2 and while being able to run on 1.5 that means minsdkversion = 3</p><p>the problem is that to support all platform i have cut and paste all resorces from mdpi to drawable as 1.5 has different mechanism for choosing resources, now the problemn is that for some resources it says resource not found which i can pin point in drawable folder, any one experienced such thing, thanks</p>","392574","","","","","2010-10-06 19:34:18","android supporting app on 2.2 till 1.5","<android>","2","0","1","",""
"3873659","1","3873943","","2010-10-06 14:39:10","55","80353","<p>Is there a native android way to get a reference to the currently running Activity from a service?</p><p>I have a service running on the background, and I would like to update my current Activity when an event occurs (in the service). Is there a easy way to do that (like the one I suggested above)?</p>","346583","","346583","","2010-10-06 14:51:06","2014-02-21 12:31:14","Android: How can I get the current foreground activity (from a service)?","<android><service><activity>","3","0","28","",""
"3873715","1","","","2010-10-06 14:43:37","1","696","<p>I have a problem with a memory management. I'm downloading some data through mine HTTP client. Next thing I want to display data to the user.The problem is not stable, on some files of the same type it occurs, on some not. Stable thing is, that it is occurring on the same file.</p><p>Here is LogCat input. </p><p>Technically I have no clue what to do next. I tried, starting gc in the specific threads with no effect.</p><p>If you need more data, please let me know. </p><pre><code>10-06 16:23:26.281: DEBUG/pecman(2035): szPath - http://demo.pecman.net/webdav/xbUxVPxnRme17FKS898BTCtEtRJUY/CGxrTVdeRssGWjMlCfEElJmA==/P1000887.JPG10-06 16:23:26.281: DEBUG/pecman(2035): szMime - image/jpeg10-06 16:23:26.422: INFO/ActivityManager(1277): Displayed activity com.verdandsky.pecman/.MediaPlayerActivity: 380 ms (total 380 ms)10-06 16:23:27.023: DEBUG/dalvikvm(2035): GC freed 1962 objects / 388136 bytes in 102ms10-06 16:23:27.023: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 6.314MB for 519160-byte allocation10-06 16:23:27.086: DEBUG/dalvikvm(2035): GC freed 37 objects / 1544 bytes in 64ms10-06 16:23:27.648: DEBUG/dalvikvm(2035): GC freed 38 objects / 259232 bytes in 82ms10-06 16:23:27.750: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 7.022MB for 1052024-byte allocation10-06 16:23:27.844: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 89ms10-06 16:23:28.492: DEBUG/dalvikvm(2035): GC freed 6 objects / 519312 bytes in 103ms10-06 16:23:28.805: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 8.544MB for 2116208-byte allocation10-06 16:23:28.898: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 92ms10-06 16:23:29.063: DEBUG/AudioHardwareMot(1055): AudioMgr:AudioStreamOutMot::standby called10-06 16:23:29.063: DEBUG/AudioHardwareMot(1055): AudioMgr:Output 0xb538 entering standby10-06 16:23:29.071: DEBUG/AudioHardwareMot(1055): AudioMgr:Closing stereo device10-06 16:23:30.351: DEBUG/dalvikvm(2035): GC freed 46 objects / 1054384 bytes in 99ms10-06 16:23:30.390: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 11.585MB for 4242456-byte allocation10-06 16:23:30.453: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 61ms10-06 16:23:32.328: DEBUG/dalvikvm(2035): GC freed 9 objects / 2118544 bytes in 53ms10-06 16:23:32.375: DEBUG/dalvikvm(2035): GC freed 2 objects / 48 bytes in 49ms10-06 16:23:32.390: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 13.019MB for 3622512-byte allocation10-06 16:23:32.469: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 82ms10-06 16:23:32.531: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 60ms10-06 16:23:32.945: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 16.474MB for 3622512-byte allocation10-06 16:23:33.062: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 120ms10-06 16:23:33.062: ERROR/dalvikvm-heap(2035): 14155776-byte external allocation too large for this process.10-06 16:23:33.062: ERROR/(2035): VM won't let us allocate 14155776 bytes10-06 16:23:33.062: DEBUG/skia(2035): --- decoder-&gt;decode returned false10-06 16:23:33.117: DEBUG/dalvikvm(2035): GC freed 6 objects / 7245192 bytes in 50ms10-06 16:23:33.164: DEBUG/dalvikvm(2035): GC freed 2 objects / 48 bytes in 49ms10-06 16:23:33.172: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 13.020MB for 3622512-byte allocation10-06 16:23:33.258: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 80ms10-06 16:23:33.320: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 63ms10-06 16:23:33.328: INFO/dalvikvm-heap(2035): Grow heap (frag case) to 16.474MB for 3622512-byte allocation10-06 16:23:33.422: DEBUG/dalvikvm(2035): GC freed 0 objects / 0 bytes in 91ms10-06 16:23:33.422: ERROR/dalvikvm-heap(2035): 14155776-byte external allocation too large for this process.10-06 16:23:33.422: ERROR/(2035): VM won't let us allocate 14155776 bytes10-06 16:23:33.422: DEBUG/skia(2035): --- decoder-&gt;decode returned false10-06 16:23:33.422: WARN/dalvikvm(2035): threadid=13: thread exiting with uncaught exception (group=0x4001b170)10-06 16:23:33.422: ERROR/AndroidRuntime(2035): Uncaught handler: thread Thread-46 exiting due to uncaught exception10-06 16:23:33.430: ERROR/AndroidRuntime(2035): java.lang.OutOfMemoryError: bitmap size exceeds VM budget10-06 16:23:33.430: ERROR/AndroidRuntime(2035):     at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)10-06 16:23:33.430: ERROR/AndroidRuntime(2035):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:392)10-06 16:23:33.430: ERROR/AndroidRuntime(2035):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:405)10-06 16:23:33.430: ERROR/AndroidRuntime(2035):     at com.verdandsky.pecman.HttpClient.doGetImage(HttpClient.java:309)10-06 16:23:33.430: ERROR/AndroidRuntime(2035):     at com.verdandsky.pecman.ImageCache$1.run(ImageCache.java:79)10-06 16:23:33.430: INFO/Process(1277): Sending signal. PID: 2035 SIG: 310-06 16:23:33.430: INFO/dalvikvm(2035): threadid=7: reacting to signal 310-06 16:23:33.508: INFO/dalvikvm(2035): Wrote stack trace to '/data/anr/traces.txt'</code></pre><p>Thanks for your time in advance.</p>","186268","","251173","","2010-10-06 14:47:15","2010-10-06 14:47:15","Problem with Memory Management in Android image processing with http protocol","<android><http><memory-management><image-processing>","0","2","","",""
"3873960","1","3874006","","2010-10-06 15:08:14","1","6410","<p>As the title says, is deploying/using applications through Java Web Start a viable option? I found a few posts online from years ago saying that the JavaME applications are only available.</p>","269694","","","","","2010-10-06 16:05:42","Java Web Start - Does it work with Android?","<java><android><java-web-start>","3","0","1","",""
"3874051","1","","","2010-10-06 15:16:51","1","1636","<p>If I invalidate() a part of my custom view with a dirty rect parameter, how do I get the dirty rect inside the draw() method? The clipping rect of the canvas is not the same - in my experience, it's typically few times larger.</p>","219159","","","","","2013-07-11 14:27:46","Getting the dirty region inside draw()","<android>","2","0","1","",""
"3874066","1","","","2010-10-06 15:18:22","1","515","<p>I have a java code for contacts app in Android and it needs a package named </p><p>import com.google.android.collect.Maps; </p><p>I am not able to figure out how to include this in eclipse so that I can go ahead working with this app.</p>","468134","","","","","2013-02-11 12:06:21","Android Contacts","<android>","2","0","","",""
"3874079","1","4913782","","2010-10-06 15:20:27","0","439","<p>I want to send a broadcast message with intent within extra data of my custom type which implements Parcelable.</p><p>In more details: I want to create a shortcut on the HSHowever system does not accept object of my custom Command type, error message: <code>android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.solvek.ussdfaster.entities.Command</code>This object will be passed back to my app when user clicks on the shortcut.</p><pre><code>    Intent shortcutIntent = new Intent(this, FormActivity.class);    shortcutIntent.putExtra(""command"", command); // Note - commmand is my custom object    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);    Intent intent = new Intent();    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, command.getTitle());    Parcelable iconResource = Intent        .ShortcutIconResource        .fromContext(this,  R.drawable.ic_launcher);    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);    intent.setAction(""com.android.launcher.action.INSTALL_SHORTCUT"");    sendBroadcast(intent);</code></pre>","120574","","","","","2011-02-06 14:14:19","Custom Parcelable object passed to core","<android><marshalling><parcelable>","1","0","","",""
"3874193","1","3874904","","2010-10-06 15:31:37","2","3246","<p>I access a web service in a POST method. I need to send to the server a json serialized object. In my Android class I have some string fields and a Date field. This Date field gets serialized like this:</p><pre><code>.... TouchDateTime"":""Oct 6, 2010 5:55:29 PM""}""</code></pre><p>but to be compatible with the web service I need to have it like:</p><pre><code>""TouchDateTime"":""\/Date(928138800000+0300)\/""</code></pre><p>I found an interesting article about Deserialization in here: <a href=""http://benjii.me/2010/04/deserializing-json-in-android-using-gson/"" rel=""nofollow"">http://benjii.me/2010/04/deserializing-json-in-android-using-gson/</a> I think I need to do something like this. Could you give me a helping hand ?</p>","379865","","","","","2013-03-10 14:29:56","gson serialization of Date field in MS WCF compatible form","<android><serialization><gson>","2","2","2","",""
"3874206","1","","","2010-10-06 15:32:31","1","771","<p>If I use the query to return some basic columns in table, that is OK. But if I use <code>group by</code>, <code>order by</code> , <code>sum(column)</code> or choose specified columns, the query fails to run. </p><p>I use Cursor query method or rawquery, both the same. If I run the following queries in adb shell, it works without problems.</p><pre><code>select * from table (work)select fielda, fieldb from table (failed)select fielda, sum(fieldb) from table group by fielda (failed)</code></pre><p>The following queries work without problems.</p><pre><code>select * from table where strftime('%m',field)='09'select * from table where strftime('%Y',field)='2010'</code></pre><p>Anyone knows what happened to these query to make them fail?Are there any rules I need to follow?</p><p>My table contains six columns. (categories, item, description, price, time, flag)All queries can be returned in adb shell without problems.</p><p>Here is my finding.1.  based on month and year selected from Spinner, it will show the columns item, price and time in listview. time is in YYYY-MM-DD format. So I use select * from table where strftime('m%',time) ='05', select * from table where strftime('%Y',time)='2010'. It doesn't have problem. then I put cursor result into simplecursoradapter, then I put adapter into listview. It runs without problems</p><ol><li><p>I want to show the view that summarized all the categories with total price for that categories. So I use select categories, sum(price) from table group by categories. I also try to use total(price) but it is still the same, program failed when I execute. I use rawquery or querybuilder but the result is the same.</p></li><li><p>If I don't use group by, order by, having, only include basic column (categories, item, description, price, time, flag) it doesn't have problems. If I use aggregate function, query will fail. </p></li><li><p>I tried to create layout from XML definition or from Java code dynamically. The problem still the same. But all the queries run fine under adb shell without problem.</p></li></ol><p>So I don't know what happened here. Anyone can share your experience in sqlite in Android ?</p>","463451","","19679","","2011-10-06 19:00:22","2011-10-06 19:00:22","SQLite queries failing in Android","<android><sqlite>","0","3","","",""
"3874275","1","","","2010-10-06 15:40:56","1","794","<p>Hey guys,I want to start the gallery via intent and want to get the results in my onActivityResult method.All works fine if i click on one pic.The question ive got now is, how do i get the results, if i choose more than one picture in the gallery?</p><p>If found hcpl´s code, which does it for one picture:</p><pre><code>public class BrowsePicture extends Activity {private static final int SELECT_PICTURE = 1;private String selectedImagePath;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ((Button) findViewById(R.id.Button01))            .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.createChooser(intent,                            ""Select Picture""), SELECT_PICTURE);                }            });}public void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode == RESULT_OK) {        if (requestCode == SELECT_PICTURE) {            Uri selectedImageUri = data.getData();            selectedImagePath = getPath(selectedImageUri);        }    }}public String getPath(Uri uri) {    String[] projection = { MediaStore.Images.Media.DATA };    Cursor cursor = managedQuery(uri, projection, null, null, null);    int column_index = cursor            .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);    cursor.moveToFirst();    return cursor.getString(column_index);}</code></pre><p>Thanks in advance</p>","466962","","750987","","2011-05-28 11:02:58","2013-12-05 10:14:51","How to receive multiple gallery results in onActivityResult","<android><android-intent><gallery><results>","1","0","","",""
"3874277","1","3874301","","2010-10-06 15:41:01","0","1750","<p>Good day all, First of all, maybe i went about this the wrong way in the first place. Situation is, i have a listview that when an item is clicked, it creates an intent and calls startActivityForResult() to another activity, to be able to edit the entries in the row. and that other activity after editing the required values, returns back to the calling activity, when the user clicks on a save button. The activity then uses the row Id to update the item.My problem now is that, if the user presses the BACK button instead, the application crashes. i have been looking around and see solutions like using Shared Preferences or onSavedInstanceState(), but i don't know where exactly i should be putting the code? Any help as usual, will be greatly appreciated. Thank you.</p><p>p.s: when i look at logcat, its gives a NullPointerException for this line in onActivityResult. </p><pre><code>     Bundle result = data.getExtras();</code></pre>","447570","","447570","","2010-10-06 16:14:21","2011-04-22 00:32:21","Application crashes when user presses Back Button","<android>","1","0","","",""
"3874424","1","3875064","","2010-10-06 15:54:18","13","9813","<p>I have the following custom view:</p><p><img src=""http://i.stack.imgur.com/boJS4.png"" alt=""alt text""></p><p>This I have achieved by using the Canvas' drawArc() method. However, with this drawArc() method I cannot limit the arc's inner radius.</p><p>What I'd like to have is something like this:</p><p><img src=""http://i.stack.imgur.com/c1eqe.png"" alt=""alt text""></p><p>where there is only an outer ring left.</p><p>What I need is an drawArc() function where I can set the inner radius of the arc. Anyone an idea how to do that?</p><p>(BTW, overpainting the inner area doesn't work, because it needs to be transparent. Painting an inner circle with Color.TRANSPARENT after painting the red and blue cones doesn't remove the old color. It just puts another layer on top, which is transparent and through which I can still see the red and blue)</p>","184367","","184367","","2010-10-07 09:33:58","2013-12-27 19:38:12","Android: looking for a drawArc() method with inner & outer radius","<android><2d><draw><radius><geometric-arc>","2","1","11","",""
"3874443","1","","","2010-10-06 15:55:46","1","1004","<p>I would like to know if the Android handsets can be configured Over-The-Air; in other words, if they can be configured for settings (such as GPRS , WAP or MMS ...) using OTA. </p><p>If yes, do they support OMA CP provisioning? Is there an XML example that can be used to configure the Android devices?</p><p>thanks!</p>","445548","","","","","2011-01-16 03:34:11","Is OTA configuration supported by Android OS?","<android><configuration><mobile-phones>","1","0","","",""
"3874470","1","","","2010-10-06 15:59:08","3","226","<p>I'm beginning with Android development. I'm aware that there is a lot of Android devices still on OS 1.5 or 1.6 so I'm thinking about require API level 3 as minimum to support them.</p><p>What will I miss from 2.2? </p>","466250","","","","","2010-10-27 17:09:21","Wich are the most important features I will miss targeting Android API 3 (OS 1.5) instead of most recent API?","<java><android><backwards-compatibility>","3","2","0","",""
"3874497","1","","","2010-10-06 16:02:14","0","150","<pre><code>&lt;LinearLayout android:layout_width=""fill_parent""             android:orientation=""horizontal""            android:layout_height=""wrap_content""&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""             android:layout_width=""wrap_content""             android:orientation=""horizontal""            android:gravity=""center_horizontal""            android:layout_height=""wrap_content""&gt;    &lt;TextView android:text=""2""             android:id=""@+id/numberone""             android:layout_width=""wrap_content""             android:textStyle=""bold""            android:textSize=""24px""            android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""x""             android:id=""@+id/operation""             android:textStyle=""bold""            android:textSize=""24px""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""5""             android:id=""@+id/numbertwo""             android:textStyle=""bold""            android:textSize=""24px""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;  &lt;/LinearLayout&gt; &lt;TextView android:text=""5""             android:id=""@+id/numbertwo""             android:textStyle=""bold""            android:textSize=""24px""            android:gravity=""left""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt;</code></pre><p>I try to set the first three Textfields in the center, and the last TextField on the left. But all TextViews are displayed on the right.</p><p>But i set the gravity tag.</p><p>Thanks for your help,Martin</p>","468185","","","","","2010-10-06 17:43:54","Android User Interface xml question","<android><xml><user-interface>","1","0","","",""
"3874506","1","","","2010-10-06 16:02:42","0","462","<p>I've a problem with ListViews.Everytime I try to add an item after it has first been shown,my program FC having following stack frame</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception IllegalStateException))    ListView.layoutChildren() line: 1603    AbsListView$CheckForTap.run() line: 1827    ViewRoot(Handler).handleCallback(Message) line: 587    ViewRoot(Handler).dispatchMessage(Message) line: 92    Looper.loop() line: 123    ActivityThread.main(String[]) line: 4363    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]    Method.invoke(Object, Object...) line: 521    ZygoteInit$MethodAndArgsCaller.run() line: 860    ZygoteInit.main(String[]) line: 618    NativeStart.main(String[]) line: not available [native method]    </code></pre><p>The first time I add items everything works fine but when I add an item to the adapterafter it has first been shown and touch the ListView on the Device it crashes.</p><p>I use the following Adapter</p><pre><code>public class Adapterclass extends BaseAdapter{//Adapter for Chatview...private Context con;private int count = 0;private List&lt;String&gt;messages;@Overridepublic int getCount() {    return count;}@Overridepublic Object getItem(int position) {    return messages.get(position);}@Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    TextView txt = new TextView(con);    txt.setText(Html.fromHtml(messages.get(position)));    return txt;}public void AddItem(String item){    messages.add(item);    count++;}Adapterclass(Context con){    this.con = con;    messages = new ArrayList&lt;String&gt;();}</code></pre><p>}</p><p>(To add an item I call AddItem)Do you have any suggestions? It drives me nuts since many hours =/</p>","466911","","466911","","2010-10-06 16:21:02","2010-10-07 11:48:17","Android ListView problem when refreshing","<android><android-widget>","3","0","0","",""
"3874701","1","3874981","","2010-10-06 16:22:15","2","1170","<p>I am using a DatePicker in a Dialog box to allow the user to chose a date. But I just want them to chose a month and a day. Is there any way I can make the year <strong>not</strong> show up?</p>","348261","","1268895","","2012-04-30 13:40:09","2012-04-30 13:40:09","Customising the DatePicker Dialog Android","<android><datepicker><dialogbox>","1","0","","",""
"3874775","1","3874816","","2010-10-06 16:29:58","25","7722","<p>Is there a way for my app to know the android:versionCode from AndroidManifest.xml or do I have to create a separate constant in one of my classes?</p>","463304","","463304","","2011-08-19 15:44:51","2011-10-27 10:17:31","Detect my app's own android:versionCode at run time","<android><android-manifest>","3","0","2","",""
"3874779","1","","","2010-10-06 16:30:18","4","2045","<p>I am trying to create a button that has a custom background in the default state, but that still uses the colors for the pressed/selected states that are particular to whatever device it is running on.</p><p>From looking at the EditText source code, it appears that there is no such API, and that the pressed/selected colors are simply hard-coded:</p><pre><code>public EditText(/*Context context, AttributeSet attrs, int defStyle*/) {super(/*context, attrs, defStyle*/);        StateListDrawable mStateContainer = new StateListDrawable();        ShapeDrawable pressedDrawable = new ShapeDrawable(new RoundRectShape(10,10));        pressedDrawable.getPaint().setStyle(Paint.FILL);        pressedDrawable.getPaint().setColor(0xEDEFF1);        ShapeDrawable focusedDrawable = new ShapeDrawable(new RoundRectShape(10,10));        focusedDrawable.getPaint().setStyle(Paint.FILL);        focusedDrawable.getPaint().setColor(0x5A8AC1);        ShapeDrawable defaultDrawable = new ShapeDrawable(new RoundRectShape(10,10));        defaultDrawable.getPaint().setStyle(Paint.FILL);        defaultDrawable.getPaint().setColor(Color.GRAY);        mStateContainer.addState(View.PRESSED_STATE_SET, pressedDrawable);        mStateContainer.addState(View.FOCUSED_STATE_SET, focusedDrawable);        mStateContainer.addState(StateSet.WILD_CARD, defaultDrawable);        this.setBackgroundDrawable(mStateContainer);}</code></pre><p>Can anyone verify that it is not possible for an app to know what the pressed/selected colors are on the current device?</p><p>If there is no way for an app to figure out what the pressed/selected colors are, then there is no way to create a Selector for a button that will match the UI across different devices.</p><p>It seems that Android must provide a way to find out what these colors are so that apps can use colors that are consistent with the UI of the device they happen to be running on.</p><p>Thanks!</p><p>-Tom B.</p><p>Follow-up, in response to CaseyB's comment, I tried the following:</p><pre><code>StateListDrawable d = new StateListDrawable();d.addState(android.R.attr.state_enabled, getResources().getDrawable(R.drawable.my_custom_background));myButton.setBackgroundDrawable(d);</code></pre><p>but it causes the button to use the custom background for all states. There doesn't appear to be a way to tell the StateListDrawable to use the default drawables for the pressed/selected states.</p>","462297","","462297","","2010-10-08 18:41:32","2010-10-08 18:41:32","Is there an Android API to get the default button pressed/selected colors?","<android><button><colors>","2","0","","",""
"3874999","1","","","2010-10-06 16:56:17","3","3472","<p>Is alignment working in HTML.fromHtml() in a TextView? </p><p>I tried</p><pre><code>&lt;div align=""center""&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt;</code></pre><p>and some variaties of this, including putting the alignment tabs without parenthesis to the paragraph tag, but none worked. The text is always left.</p><p>Thanks for any help!</p><p>Yours.</p>","447111","","","","","2010-10-06 17:11:40","Alignment in Html.fromHtml()","<android>","1","0","1","",""
"3875184","1","3875204","","2010-10-06 17:18:26","163","132302","<p>What does the following exception mean; how can I fix it?</p><p>This is the code:</p><pre><code>Toast toast = Toast.makeText(mContext, ""Something"", Toast.LENGTH_SHORT);</code></pre><p>This is the exception:</p><pre class=""lang-none prettyprint-override""><code>java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()     at android.os.Handler.&lt;init&gt;(Handler.java:121)     at android.widget.Toast.&lt;init&gt;(Toast.java:68)     at android.widget.Toast.makeText(Toast.java:231)</code></pre>","286802","","110358","","2012-12-12 22:41:28","2014-04-13 16:43:55","Can't create handler inside thread that has not called Looper.prepare()","<android><toast><ui-thread>","6","0","56","",""
"3875354","1","","","2010-10-06 17:40:21","6","7225","<p>Android isn't firing the delivery intent when sending a text message. I'm testing this on Android 2.2 on the HTC EVO 4G.</p><p>This is the current code. I'm seeing ""SMS sent intent received."" in the logs, but not ""SMS delivered intent received."".</p><pre><code>// ConstantsString SENT_ACTION = ""SMS_SENT_ACTION"";String DELIVERED_ACTION = ""SMS_DELIVERED_ACTION"";String CELL_NUMBER = ""0000000000"";String MESSAGE = ""Hello World!"";// SMS sent pending intentPendingIntent sentIntent = PendingIntent.getBroadcast(this, 0,        new Intent(SENT_ACTION), 0);// SMS delivered pending intentPendingIntent deliveredIntent = PendingIntent.getBroadcast(this, 0,        new Intent(DELIVERED_ACTION), 0);// SMS sent receiverregisterReceiver(new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent) {        Log.d(TAG, ""SMS sent intent received."");    }}, new IntentFilter(SENT_ACTION));// SMS delivered receiverregisterReceiver(new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent) {        Log.d(TAG, ""SMS delivered intent received."");    }}, new IntentFilter(DELIVERED_ACTION));// Send the SMS messageSmsManager sms = SmsManager.getDefault();sms.sendTextMessage(CELL_NUMBER, null, MESSAGE, sentIntent, deliveredIntent);</code></pre>","145025","","","","","2012-07-12 14:50:39","Android SMS Message delivery report intent","<android><sms><android-intent><delivery>","1","3","5","",""
"3875391","1","","","2010-10-06 17:46:04","2","6581","<p>I try to play a sound from R.raw. inside a Thread/RunnableBut I can't get this to work.</p><pre>new Runnable(){   public void run() {      //this is giving me a NullPointerException, because getBaseContext is null      MediaPlayer mp = MediaPlayer.create( getBaseContext(), R.raw.soundfile);      while (true) {        if (something)            play something      }    }</pre><p>How can I get the real Context inside the run method? It is null no matter what I try. Or is there a better way to do this?</p>","468265","","468265","","2010-10-06 18:02:55","2014-01-18 22:19:30","Context inside a Runnable","<android><multithreading><context><media-player><runnable>","4","0","","",""
"3875395","1","3875589","","2010-10-06 17:46:52","1","3177","<p>Is it possible to have multiple separate <a href=""http://developer.android.com/reference/android/graphics/Canvas.html"" rel=""nofollow"">Canvas</a> layers, which I can merge to one? Similar to what I'd do in photoshop?</p><hr><p><strong>Update:</strong></p><p>Some explanation why I'd like to have something like that:<code>Layer1</code> might hold something that has been created by a complex and CPU expensive algorithm while the other layer, <code>Layer2</code>, is something that just goes on top of that, but changes regularly, e.g. when a user touches the interface. For that I don't want to go through the whole process of drawing the underlaying <code>Layer1</code> again, but just make the changes to <code>Layer2</code> and then ""merge"" them.</p>","184367","","184367","","2010-10-07 09:30:51","2010-10-07 09:30:51","Android: is it possible to have multiple separate Canvas layers, which I can merge to one?","<android><canvas><layer>","1","0","2","",""
"3875566","1","3875814","","2010-10-06 18:10:08","0","437","<p>I have application working with SQLite DB(table with two rows) I need to recieve _ID row of the selected listview Item, but don't know how to do it. So, main activity</p><pre><code>public class Main extends ListActivity {private RecipesData recipes;private static int[] TO={0,R.id.row_text_id};private static String[] FROM={ _ID, CATEGORY_NAME, };/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    recipes=new RecipesData(this);    try{        Cursor cursor=getCategories();        showCategories(cursor);    }finally{        recipes.close();    }    final ListView lv=getListView();    lv.setOnItemClickListener(new OnItemClickListener(){        public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id){             AlertDialog.Builder adb=new AlertDialog.Builder(Main.this);                  adb.setTitle(""LVSelectedItemExample"");                 adb.setMessage(""Selected Item is = ""+((TextView)v).getText());                  adb.setPositiveButton(""Ok"", null);                  adb.show();        }    });}@Overrideprotected void onPause(){    recipes.close();    super.onPause();}@Overrideprotected void onStop(){    recipes.close();    super.onStop();}@Overridepublic boolean onCreateOptionsMenu(Menu menu){    super.onCreateOptionsMenu(menu);    MenuInflater inflater=getMenuInflater();    inflater.inflate(R.menu.menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId()){    case R.id.add_category_item:         return true;    }    return false;}private void showCategories(Cursor cursor){    SimpleCursorAdapter adapter=new SimpleCursorAdapter(this,R.layout.item,cursor,FROM,TO);    setListAdapter(adapter);}private Cursor getCategories(){    SQLiteDatabase db=recipes.getReadableDatabase();    Cursor cursor=db.query(CATEGORY_TABLE, FROM, null, null, null, null, null);    startManagingCursor(cursor);    return cursor;}}</code></pre>","468311","","","","","2010-10-06 18:39:46","Android SQLite database","<android><database><database-design><sqlite>","1","0","","",""
"3875586","1","3875856","","2010-10-06 18:13:15","0","638","<p>I have an IntentService which makes some web service calls.  Before making these calls I check to make sure the device has network connectivity.  I am doing so like this:</p><pre><code> private boolean isOnline() {  ConnectivityManager connec =  (ConnectivityManager)getSystemService(getApplicationContext().CONNECTIVITY_SERVICE);  return connec.getNetworkInfo(0).isConnectedOrConnecting(); }</code></pre><p>Unfortunately, when I'm debugging on my Android device, this returns false when I have both a network and a wireless connection.</p><p>Some interesting tidbits about connec.getNetworkInfo(0):</p><pre><code>mIsAvailable = truemNetworkType = 0mTypeName = ""mobile""mState.name = ""DISCONNECTED""</code></pre><p>Clearly this code is not sufficient (perhaps it would only return true if I sent some bit over the network and turned the radio on?).  Moreover, since I'm not well versed in the ConnectivityManager, I'm assuming I should probably be scanning all networks (ie: getNetworkInfo(0 through N)).</p><p>How can I properly accomplish what I'm wanting here?</p>","406790","","","","","2010-10-06 18:44:39","Problem checking for network connectivity","<android><networking><connectivity>","1","0","1","",""
"3875634","1","3875736","","2010-10-06 18:18:34","2","5809","<p>i have broadcast receiver class for receiving sms, but i dont know how to delete the received sms <strong>before reaching to the inbox</strong> as well as the notification</p><pre><code>public void onReceive(Context context, Intent intent) {             Bundle pudsBundle = intent.getExtras();             Object[] pdus = (Object[]) pudsBundle.get(""pdus"");        SmsMessage messages =SmsMessage.createFromPdu((byte[]) pdus[0]);                Log.i(TAG,  messages.getMessageBody());}</code></pre>","221169","","2656811","","2014-04-02 11:33:40","2014-04-02 11:33:40","Deleting SMS Using BroadCastReceiver - Android","<android>","2","2","3","",""
"3875775","1","","","2010-10-06 18:35:59","1","205","<p>I want to create two tables in DB, how do I do it using SQLiteOpenHelper descendant and overriding onCreate metod? Will the below code be ok? Seems I'm doing it wrong.</p><pre><code>public void onCreate(SQLiteDatabase db){      db.execSQL(""CREATE TABLE ""+CATEGORY_TABLE+"" (""+_ID+"" INTEGER PRIMARY KEY AUTOINCREMENT, ""+              CATEGORY_NAME+"" TEXT NOT NULL);"");          db.execSQL(""CREATE TABLE ""+RECIPES_TABLE+"" (""+_ID+"" INTEGER PRIMARY KEY AUTOINCREMENT, ""+              RECIPE_NAME+"" TEXT NOT NULL, ""+CATEGORY_ID+"" INTEGER, ""+ RECIPE+"" TEXT NOT NULL);"");  }</code></pre>","468311","","468311","","2010-10-06 19:16:51","2011-01-28 22:52:29","Yet another Android SQLite database question","<android><database><sqlite>","2","3","0","",""
"3875827","1","3876302","","2010-10-06 18:41:48","1","225","<p>I know many developers ask about the <em>best</em> Android phone for development, but my question is almost opposite: What is the <em>least expensive</em> Android phone that I can get away with TTS (text-to-speech) and ASR (automated-speech-recognition) software development?</p><p>To further clarify my question:</p><ol><li>Do <strong>all</strong> Android phones supportTTS <em>and</em> ASR?</li><li>Do <strong>all</strong> Android OS versionssupport TTS <em>and</em> ASR?</li><li>If the answer to either of the aboveis 'No', then which brand/model willprovide me with TTS <em>and</em> ASR functionalitywhile minimizing out-of-pocketexpense?</li></ol><p>Thanks.</p>","418055","","168868","","2012-01-01 21:34:47","2012-01-01 21:34:47","Least Expensive Android Phone for TTS SW Development?","<android><speech-recognition><text-to-speech>","1","0","","",""
"3875880","1","3876375","","2010-10-06 18:47:30","1","933","<p>I've built an application which uses an IntentService for manipulating the application's database and calling web services.</p><p>Example:</p><p>I have an Activity which is a list of items.  This list is populated by a CursorAdapter.  Each item has a checkbox and the list is ordered by checked (unchecked items on top and checked items on bottom).  When an item's checkbox is checked, I send an Intent to my IntentService telling it to flag the checked column in the database table for that item, then a message is Broadcasted, the Activity sees it and re-queries the Cursor.</p><p>When I'm using a mobile device and start rapidly checking checkboxes, the app essentially hangs.  The UI doesn't hang, but the IntentService in the background does.  I can tell because the Cursor on screen isn't getting refreshed.</p><p>It is my understanding that Intents passed to IntentServices are not processed asynchronously.  Is that correct?  It's behaving almost like I need to be using semaphores, but I can't understand why if Intents are queued and processed individually.</p><p><strong>Suppose I check 3 checkboxes; so there are 3 Intents queued.  After the first one I broadcast a message, which the Activity receives, telling it to requery it's cursor.  Could a potential problem be because I'm requerying the Cursor at the same time I'm processing the second Intent (updating another row in the table)?  Querying the Cursor happens on the UI thread.</strong></p><p>^ I think this is my problem.  What should I use to synchronize this?  Semaphores?  Can someone point me to some documentation/examples?</p><p>Another potential issue is what if my Activity manages a Cursor on a table; also my IntentService queries a Cursor from the same table.  I have instances where this happens as my IntentService is going through each row in the Cursor to find items to send to the web service.  Though I wouldn't think this would be a problem so long as the Cursors don't query at the same time?</p><p>Does anyone have any other ideas?</p>","406790","","406790","","2010-10-06 19:11:58","2010-10-06 20:00:33","IntentService getting wedged","<android><service><android-intent>","1","2","2","",""
"3875898","1","3876431","","2010-10-06 18:49:59","5","6337","<p>I am trying to show an animation on a canvas when user touches to the screen.I know basics and how to draw a bitmap on to canvas but i couldn't find anything good on drawing or showing animation on canvas.i will use frame by frame animation and it will appear at the same position user touched that is why i can't use ImageView.</p>","458678","","","","","2010-10-06 20:07:55","How to draw animation on a canvas ?(android)","<android><animation><canvas>","1","0","2","",""
"3875966","1","","","2010-10-06 18:57:58","2","267","<p>I have some code which streams audio from a server. It seems to work as expected for exactly 90 seconds and thereafter stops with the following three lines in the logcat - </p><p>D/AudioHardwareMot( 1052): AudioMgr:AudioStreamOutMot::standby calledD/AudioHardwareMot( 1052): AudioMgr:Output 0xb538 entering standbyD/AudioHardwareMot( 1052): AudioMgr:Closing stereo device</p><p>Do you know why the AudioMgr would automatically call standby for no reason?</p>","303347","","","","","2010-10-06 18:57:58","android audiomgr standby gets called","<android>","0","1","1","",""
"3875986","1","3876007","","2010-10-06 18:59:50","0","679","<p>I have been polishing my Java lately, and I am really starting to dig into the Android SDK. I am looking forward to attending Google's I/O conference next year, and I am nervous that I am going to miss the sign up period. Historically, when has the conference registration opened up? For those of you who went last year, do you remember when registration opened up?</p>","429069","","321731","","2014-01-16 09:35:50","2014-01-16 09:35:50","When does Google I/O registration open up usually?","<android>","3","0","1","",""
"3876015","1","3877185","","2010-10-06 19:04:30","1","1122","<p>I'm trying to create an activity which gets input in the following form:</p><pre><code>() Option 1  (a RadioButton)() Option 2  (a RadioButton)() Custom    (a RadioButton)[     ]      (a EditText)</code></pre><p>The idea is that the user can either choose one of the two predefined values, or enter a custom value. In order for him to enter a custom value, he must activate the ""() Custom"" RadioButton.</p><pre><code>&lt;EditText   android:id=""@+id/CustomValue""  android:text=""""   android:enabled=""false""  android:inputType=""phone""  android:digits=""0123456789."" /&gt;</code></pre><p>The problem is the following</p><p>When this code is executed, before the ""() Custom"" RadioButton is checked, the EditText appears in a shaded color (unlike the ones which do not have enable=false). However, if the TextView is clicked, the input keyboard is displayed and it accepts input.</p><p>Does anyone know how to solve this? Thanks.</p>","425749","","","","","2010-10-06 21:54:34","Problem temporarily disabling a EditText field","<android><edittext>","2","0","","",""
"3876222","1","3876504","","2010-10-06 19:36:14","8","560","<p>I was looking through the documentation and source code, because I wanted to be certain that values() would always return an array in the order in which the Enum values are declared.  Turns out, it's not <a href=""http://developer.android.com/reference/java/lang/Enum.html"">in the documentation</a> as far as I can tell.</p><p>I checked the source code for the Enum class, and no luck (<a href=""http://www.docjar.com/html/api/java/lang/Enum.java.html"">there is a related, private ""getValues"" method</a>).</p><p>So I'm guessing that some compiler/interpreter-foo is already going on to create a class that extends Enum out of a declaration like:</p><pre><code>public static enum MyEnum</code></pre><p>So is values() also statically translated into a hardcoded array during compilation?  Or is it actually a method called at runtime, and if so, where is it defined?</p>","205192","","","","","2010-10-06 21:02:37","From whence cometh Enum.values()?","<java><android><enums>","4","3","0","",""
"3876228","1","","","2010-10-06 19:36:46","3","733","<p>I have a long text message followed by a link and have put this inside a TextView. It's simply 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=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/details"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:padding=""10dp""            android:text=""@string/message"" android:textSize=""16sp"" android:autoLink=""web""/&gt;    &lt;/LinearLayout&gt;![alt text][1]&lt;/ScrollView&gt;</code></pre><p>The problem is when I select the link the whole text becomes highlighted. How can this be prevented ?</p><p><img src=""http://i.stack.imgur.com/FLSrV.png"" alt=""alt text""></p>","109603","","","","","2011-12-02 03:37:17","TextView getting highlighted after using linkify or autolink","<android><textview><linkify>","1","4","1","",""
"3876592","1","3877068","","2010-10-06 20:28:27","1","3914","<p>I've just started developing for Android. So far it's been surprisingly smooth sailing, but now I've run into some problems implementing an SQLite database. My code is based on Google's Notepad example (which runs perfectly well), but I keep getting Null Pointer Exceptions thrown at me and it seems to be related to the getWritableDatabase()-method.</p><p>The offending class is QuizDbAdapter:</p><pre><code>package com.mypackage.myapp;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class QuizDbAdapter {   public static final String KEY_ROWID =         ""_id"";   public static final String KEY_QUESTION =      ""question"";   public static final String KEY_ANSWER1 =      ""answer1"";   public static final String KEY_ANSWER2 =      ""answer2"";   public static final String KEY_ANSWER3 =      ""answer3"";   public static final String KEY_ANSWER4 =      ""answer4"";   public static final String KEY_CORRECT_ANSWER =   ""correct_answer"";   public static final String KEY_IMAGE =         ""image"";   public static final String KEY_CATEGORIES =      ""categories"";   public static final String KEY_IMAGEQUESTION =   ""image_question"";   public static final String KEY_EXPLANATION =   ""explanation"";   private static final String TAG = ""QuizDbAdapter"";   private DatabaseHelper databaseHelper;   private SQLiteDatabase database;   private static final String DATABASE_CREATE =      ""create table questions (_id integer primary key autoincrement, ""        + ""question text not null, answer1 text not null, answer2 text not null,""
        + ""answer3 text not null, answer4 text not null, correct_answer integer not null,""
        + ""image text not null, categories text not null, image_question boolean not null,""
        + ""explanation text not null);""        + ""create table roadsigns (_id integer primary key autoincrement, ""        + "");"";   private static final String DATABASE_NAME = ""mydb.sqlite"";   private static final int DATABASE_VERSION = 1;   private static final String TABLE_QUESTIONS = ""questions"";   private final Context context;   private static class DatabaseHelper extends SQLiteOpenHelper {      DatabaseHelper(Context c) {         super(c, DATABASE_NAME, null, DATABASE_VERSION);      }      @Override      public void onCreate(SQLiteDatabase db) {         db.execSQL(DATABASE_CREATE);      }      @Override      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {         db.execSQL(""DROP TABLE IF EXISTS questions"");            onCreate(db);      }   }   public QuizDbAdapter(Context c) {      this.context = c;   }   public QuizDbAdapter open() throws SQLException {      databaseHelper = new DatabaseHelper(context);      database = databaseHelper.getWritableDatabase();      return this;   }   public void close() {      databaseHelper.close();   }   public Cursor fetchAllQuestions() {      return database.query(TABLE_QUESTIONS, new String[] { KEY_ROWID, KEY_QUESTION,            KEY_ANSWER1, KEY_ANSWER2, KEY_ANSWER3, KEY_ANSWER4, KEY_CORRECT_ANSWER,            KEY_IMAGE, KEY_CATEGORIES, KEY_IMAGEQUESTION, KEY_EXPLANATION },            null, null, null, null, null);   }   public Cursor fetchQuestion(long rowId) throws SQLException {      Cursor cursor = database.query(true, TABLE_QUESTIONS, new String[] { KEY_ROWID,            KEY_QUESTION, KEY_ANSWER1, KEY_ANSWER2, KEY_ANSWER3, KEY_ANSWER4,            KEY_CORRECT_ANSWER, KEY_IMAGE, KEY_CATEGORIES, KEY_IMAGEQUESTION,            KEY_EXPLANATION }, KEY_ROWID + ""="" + rowId, null, null, null, null, null);      if (cursor != null)         cursor.moveToFirst();      return cursor;   }}</code></pre><p>Whenever I try to open the database using</p><pre><code>QuizDbHelper databaseHelper = new QuizDbHelper(this);databaseHelper.open(); // &lt;-- X(</code></pre><p>the application chokes and serves up a Null Pointer Exception indicating the call to open().</p><p>Stack trace:</p><pre><code>10-06 23:24:02.104: ERROR/AndroidRuntime(369): FATAL EXCEPTION: main10-06 23:24:02.104: ERROR/AndroidRuntime(369): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackage.myapp/com.mypackage.myapp.QuestionActivity}: java.lang.NullPointerException10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.os.Handler.dispatchMessage(Handler.java:99)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.os.Looper.loop(Looper.java:123)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at java.lang.reflect.Method.invokeNative(Native Method)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at java.lang.reflect.Method.invoke(Method.java:521)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at dalvik.system.NativeStart.main(Native Method)10-06 23:24:02.104: ERROR/AndroidRuntime(369): Caused by: java.lang.NullPointerException10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at com.mypackage.myapp.Quiz.newQuiz(Quiz.java:88)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at com.mypackage.myapp.QuestionActivity.onCreate(QuestionActivity.java:21)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)10-06 23:24:02.104: ERROR/AndroidRuntime(369):     ... 11 more</code></pre>","468425","","216074","","2010-10-06 21:29:58","2013-07-01 13:48:58","Android SQLiteDatabase Null Pointer Exception","<android><sqlite>","2","2","1","",""
"3876680","1","3877242","","2010-10-06 20:40:34","29","39173","<p>If not, is there any workaround? I have an array list of objects that have a name and an icon pointer. I do not want to use a database. </p>","398148","","","","","2014-03-18 11:40:36","Is it possible to add an array or object to SharedPreferences on Android","<android><android-preferences><sharedpreferences>","6","0","22","",""
"3876985","1","","","2010-10-06 21:19:17","0","115","<p>I want to draw in a view/layout, but I don't want to have to inherit from Layout, ( in order to have the onDispatch(Canvas canvas) method).I want to draw bitmap over my main application, but without losing focus (so i cant run an activity to draw on screen).I had a solution that was working but I had to inherit from LinearLayout and customize my onDispatch methode. Can I acces to the canvas of a view, I did not see any function that allows that.</p>","468488","","265570","","2011-07-02 07:29:11","2011-07-02 08:09:14","Android : access to Canvas without inheritance","<android><layout><transparency>","1","0","","",""
"3877040","1","","","2010-10-06 21:28:23","128","52307","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3240331/horizontal-listview-in-android"">Horizontal ListView in Android?</a>  </p></blockquote><p>Like many things in Android, you wouldn't think this would be such a hard problem but ohhh, by golly, would you be wrong.  And, like many things in Android, the API doesn't even provide a reasonably extensible starting point.  I'll be damned if I'm going to roll my own ListView, when all I want is to take the thing and turn it on its side.  \rant</p><p>Okay, now that I'm done fuming, let's talk about the problem itself.  What I need is basically something exactly like the <code>Gallery</code>, but without the center-locking feature.  I don't really need <code>ListView</code>'s listSelector but it's a nice-to-have.  Mostly, I could do what I want with a <code>LinearLayout</code> inside a <code>ScrollView</code>, but I need the child views to come from a <code>ListAdapter</code> and I would really like to have a view recycler.  And I <em>really</em> don't want to write any layout code.</p><p>I peeked into the source code for some of these classes...</p><p><em>Gallery:</em> It looks like I could use the Gallery if I override most of the 'onXyz' methods, copy all their source code, but refrain from calling <code>scrollIntoSlots()</code>.  But I'm sure that if I do that I'll run into some member field that's inaccessible or some other unforeseen consequence.</p><p><em>AbsSpinner:</em> Since the <code>mRecycler</code> field is package-private I doubt I'll be able to extend this class.</p><p><em>AbsListView:</em> It looks like this class is only meant for vertical scrolling, so no help there.</p><p><em>AdapterView:</em> I've never had to extend this class directly.  If you tell me it's easy to do, and that it's easy to roll my own <code>RecycleBin</code>, I'll be very skeptical but I'll give it a shot.</p><p>I suppose I could possibly copy <em>both</em> <code>AbsSpinner</code> and <code>Gallery</code> to get what I want... hopefully those classes aren't using some package-private variable I can't access.  Do y'all think that's a good practice?  Does anyone have any tutorials or third-party solutions that might put me in the right direction?</p><p><strong>Update:</strong><br>The only solution I've found so far is to do it all myself.  Since asking this question, I have overridden <code>AdapterView</code> and implemented my own ""HorizontalListView"" from scratch.  The only way to truly override the Gallery's center-locking feature is to override the private <code>scrollIntoSlots</code> method, which I believe would require generating a subclass at runtime.  If you're bold enough to do that, it's arguably the best solution, but I don't want to rely on undocumented methods that could change.</p><p>Swathi EP below suggested that I give the <code>Gallery</code> an <code>OnTouchListener</code> and override the scroll functionality.  If you don't care about having fling support in your list, or if it's okay for the views to snap to the center at the end of the fling animation, then this <em>will</em> work for you!  However, in the end it still proves impossible to remove the center-locking feature without removing fling support.  And I ask you, what kind of list doesn't fling?</p><p>So, alas, this did not work for me. :-(  But if you're interested in this approach, read on...</p><p>I also had to make some additions to Swathi's code to get what I wanted.  In <code>GestureListener.onTouch</code>, in addition to delegating to the gesture detector, I also had to return true for <code>ACTION_UP</code> and <code>ACTION_CANCEL</code> events.  That successfully disabled the center-locking feature, but it also disabled flinging.  I was able to re-enable fling by having my own GestureListener delegate to the Gallery's <code>onFling</code> method.  If you want to try it out, go into your ApiDemos sample code and replace the Gallery1.java class with the following code:</p><pre><code>import com.example.android.apis.R;import android.app.Activity;import android.content.Context;import android.content.res.TypedArray;import android.os.Bundle;import android.view.ContextMenu;import android.view.GestureDetector;import android.view.MenuItem;import android.view.MotionEvent;import android.view.View;import android.view.ViewGroup;import android.view.ContextMenu.ContextMenuInfo;import android.view.GestureDetector.SimpleOnGestureListener;import android.view.View.OnTouchListener;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.Gallery;import android.widget.ImageView;import android.widget.Toast;import android.widget.AdapterView.AdapterContextMenuInfo;import android.widget.AdapterView.OnItemClickListener;public class Gallery1 extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.gallery_1);        // Reference the Gallery view        final Gallery g = (Gallery) findViewById(R.id.gallery);        // Set the adapter to our custom adapter (below)        g.setAdapter(new ImageAdapter(this));        // Set a item click listener, and just Toast the clicked position        g.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView parent, View v, int position, long id) {                Toast.makeText(Gallery1.this, """" + position, Toast.LENGTH_SHORT).show();            }        });        // Gesture detection        final GestureDetector gestureDetector = new GestureDetector(new MyGestureDetector(g));        OnTouchListener gestureListener = new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                boolean retVal = gestureDetector.onTouchEvent(event);                int action = event.getAction();                if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {                    retVal = true;                    onUp();                }                return retVal;            }            public void onUp() {                // Here I am merely copying the Gallery's onUp() method.                for (int i = g.getChildCount() - 1; i &gt;= 0; i--) {                    g.getChildAt(i).setPressed(false);                }                g.setPressed(false);            }        };        g.setOnTouchListener(gestureListener);        // We also want to show context menu for longpressed items in the gallery        registerForContextMenu(g);    }    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {        menu.add(R.string.gallery_2_text);    }    @Override    public boolean onContextItemSelected(MenuItem item) {        AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        Toast.makeText(this, ""Longpress: "" + info.position, Toast.LENGTH_SHORT).show();        return true;    }    public class ImageAdapter extends BaseAdapter {        int mGalleryItemBackground;        public ImageAdapter(Context c) {            mContext = c;            // See res/values/attrs.xml for the &lt;declare-styleable&gt; that defines            // Gallery1.            TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);            mGalleryItemBackground = a.getResourceId(                    R.styleable.Gallery1_android_galleryItemBackground, 0);            a.recycle();        }        public int getCount() {            return mImageIds.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.setImageResource(mImageIds[position]);            i.setScaleType(ImageView.ScaleType.FIT_XY);            i.setLayoutParams(new Gallery.LayoutParams(136, 88));            // The preferred Gallery item background            i.setBackgroundResource(mGalleryItemBackground);            return i;        }        private Context mContext;        private Integer[] mImageIds = {                R.drawable.gallery_photo_1,                R.drawable.gallery_photo_2,                R.drawable.gallery_photo_3,                R.drawable.gallery_photo_4,                R.drawable.gallery_photo_5,                R.drawable.gallery_photo_6,                R.drawable.gallery_photo_7,                R.drawable.gallery_photo_8        };    }    public class MyGestureDetector extends SimpleOnGestureListener {        private Gallery gallery;        public MyGestureDetector(Gallery gallery) {            this.gallery = gallery;        }        @Override        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,                 float velocityY) {            return gallery.onFling(e1, e2, velocityX, velocityY);        }    }}</code></pre>","213525","","213525","","2010-11-14 00:55:13","2012-01-22 11:19:32","How can I make a horizontal ListView in Android?","<android><listview><gallery>","8","1","46","2012-08-30 00:52:51",""
"3877062","1","","","2010-10-06 21:31:07","3","939","<p>I've been looking for a way to only show my game to ""fast enough"" phones in the Market but I can't find any good answer.</p><p>Some people suggest to target by SDK, but that has nothing to do with the speed.</p><p>I've seen some to target by screen size, but some Acer phones and the HTC Legend are fast enough for my game but have the same screen than the HTC Hero which is pretty slow.</p><p>I also saw some people filtering by OpenGL ES version but I can't find any sort of database that tells me which phones have OpenGL ES 2. Android 2.0 is supposed to support it, but I don't know if phones like the HTC Magic, after being updated to 2.0 will support it or they will be stuck in 1.1.</p><p>What would be the best way?</p><p>Thanks</p>","63764","","","","","2011-04-29 14:44:22","Target only fast Android devices in the Market","<android><opengl-es><google-play>","3","4","","",""
"3877074","1","","","2010-10-06 21:33:29","0","545","<p>I am trying to model an app based on <a href=""http://code.google.com/p/jumpnote/"" rel=""nofollow"">http://code.google.com/p/jumpnote/</a></p><pre><code>authBundle = am.getAuthToken(account, APPENGINE_SERVICE_NAME,                        needAuthAction == NEED_AUTH_NOTIFICATION, null, null).getResult();authToken = authBundle.getString(AccountManager.KEY_AUTHTOKEN);</code></pre><p>authToken is returned null in this case.</p><p>What can be possible causes for this?</p>","467465","","","","","2010-10-06 22:38:11","getting authToken of a Google Account in Android","<android><google-app-engine><cloud-hosting>","1","0","","",""
"3877103","1","3877125","","2010-10-06 21:38:44","1","1510","<p>in my Android app I've got two activities, lets say A and B. A is the main activity, and it calls Activity B like so:</p><pre><code>Intent myIntent = new Intent(getBaseContext(), B.class);A.this.startActivity(myIntent);</code></pre><p>And this works fine. The back button on the phone works to return to activity A, but I want to put a button on the UI as well. So I have a ""Cancel"" button in Activity B's layout file, and I have the following code in Activity B's java.</p><pre><code>public void onClick(View arg0) {    if (arg0.getId() == R.id.btn_cancel) {        B.this.finish();    }}</code></pre><p>However, clicking the button doesn't cause anything to happen at all. Any insight? Thanks a ton!</p>","468498","","","","","2010-10-06 21:42:54","finish() not finishing my activity","<android><activity>","2","1","","",""
"3877119","1","","","2010-10-06 21:41:48","17","4652","<p>I can play the videos fine back to back by implementing the <em>OnCompletionListener</em> to set the data source to a different file. No problems there. I call <em>reset()</em> and <em>prepare()</em> just fine.</p><p>What I haven't been able to figure out, is how to get rid of the 1-2 second gap screen flicker between the data source change and the new video starting. The gap shows a black screen, and I haven't found any way to get around it.</p><p>I've tried setting the background of the parent view to an image, but it manages to bypass that. Even if the <em>SurfaceView</em> is transparent (which it is by default.) I've also tried to have the multiple video files played at the same time, and switching mediaplayer's display when one ends and the other is supposed to start. </p><p>The last thing I tried, was to have a second view in the background that I show temporarily while the video is ""preparing"" and removing it when the video is ready to start. That also wasn't very seamless. </p><p>Is there any way to get rid of that gap. Running a video in a loop works wonderfully and does exactly what I want with the exception that it's looking through the same video instead of playing a different one that I pick.</p><p><strong>main.xml</strong></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:background=""@drawable/background""    android:layout_height=""fill_parent""&gt;    &lt;SurfaceView        android:id=""@+id/surface""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_gravity=""center""&gt;    &lt;/SurfaceView&gt;&lt;/FrameLayout&gt;</code></pre><p><strong>Player.java</strong></p><pre><code>public class Player extends Activity implements        OnCompletionListener, MediaPlayer.OnPreparedListener, SurfaceHolder.Callback {        private MediaPlayer player;    private SurfaceView surface;    private SurfaceHolder holder;    public void onCreate(Bundle b) {        super.onCreate(b);        setContentView(R.layout.main);        surface = (SurfaceView)findViewById(R.id.surface);        holder = surface.getHolder();        holder.addCallback(this);        holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        }    public void onCompletion(MediaPlayer arg0) {        File clip = new File(Environment.getExternalStorageDirectory(),""file2.mp4"");        playVideo(clip.getAbsolutePath());    }    public void onPrepared(MediaPlayer mediaplayer) {        holder.setFixedSize(player.getVideoWidth(), player.getVideoHeight());        player.start();    }    private void playVideo(String url) {        try {            File clip = new File(Environment.getExternalStorageDirectory(),""file1.mp4"");            if (player == null) {                player = new MediaPlayer();                player.setScreenOnWhilePlaying(true);            }            else {                player.stop();                player.reset();            }            player.setDataSource(url);            player.setDisplay(holder);            player.setOnPreparedListener(this);            player.prepare();            player.setOnCompletionListener(this);        }        catch (Throwable t) {            Log.e(""ERROR"", ""Exception Error"", t);        }    }</code></pre>","103215","","","","","2012-06-21 21:11:24","Android: MediaPlayer gapless or seamless Video Playing","<android><video><media-player>","6","1","15","",""
"3877232","1","3877548","","2010-10-06 22:01:10","1","1074","<p>I tried to scale an high-resolution image to the desired size of my android and then set it as wallpaper, but as result I have a scaled image with 'annoying alternate rows' that make the picture NOT attractive. </p><pre><code>int newWidth = wallpaperManager.getDesiredMinimumWidth();int newHeight = wallpaperManager.getDesiredMinimumHeight();Bitmap resizedBitmap = Bitmap.createScaledBitmap(bitmapOrg, newWidth, newHeight, true);</code></pre>","468502","","","","","2010-10-06 23:05:29","Scaling image in Android","<android><image>","1","5","2","",""
"3877273","1","","","2010-10-06 22:08:45","0","385","<p>Is there some way where I can just link the images from the phone to my sqlite database? At first I thought of storing them in the phone memory in a new database but I am thinking that will blow away the space. Can anyone plzz help.</p>","375504","","","","","2010-10-06 22:13:16","How can I link image on android phone to database","<android><database><image>","1","0","","",""
"3877295","1","3877364","","2010-10-06 22:11:49","0","175","<p>I was wandering whether there is a way to perform animations between activities like you see when you press the search in google maps (it slides down from the top).From my research I have gathered it us only possible been views. Am I missing something? </p>","407133","","","","","2010-10-06 22:23:51","Is there a way to perform animations between activities?","<android>","1","0","","",""
"3877323","1","3877401","","2010-10-06 22:16:26","3","5782","<p>Am I missing something here?</p><p>I follow the instructions exactly on this page (and some of the other tutorials) but they always seem to be missing some key information as they don't work out of the box.</p><p>I added a bunch of packages that seemed like were missing, but now I'm stuck.</p><p><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><strong>Description   Resource    Path    Location    TypeConversion to Dalvik format failed with error 1 HelloGrid       Unknown Android Packaging Problem</strong></p><p>And a whole bunch of these for each of the drawable.sample_* references</p><p><strong>Description   Resource    Path    Location    TypeR.drawable.sample_0 cannot be resolved  ImageAdapter.java   /HelloGrid/src/com/example/ImageAdapter line 51 Java Problem</strong></p><pre><code>package com.example.HelloGrid;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.GridView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;import com.example.ImageAdapter.ImageAdapter;public class HelloGrid 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(HelloGrid.this, """" + position, Toast.LENGTH_SHORT).show();            }        });    }}package com.example.ImageAdapter;import android.R;import android.R.drawable;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 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><strong>As you can see I have all the images loaded in the /drawable directory</strong><img src=""http://i.stack.imgur.com/HTT3Y.png"" alt=""alt text""></p>","177389","","1228","","2013-08-14 15:55:11","2013-08-14 15:55:11","Why doesn't the code from the Android SDK tutorials work out of the box?","<android><sdk>","6","6","1","",""
"3877332","1","3877462","","2010-10-06 22:17:42","1","578","<p>I'm trying to create a simple Android UI that consists of a EditText and Button widget. However I'm having some problems with setting the layout properties. The UI is supposed to look like this:</p><p>¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦  ¦¦  </p><p>Left is the EditText and right is the Button. The Button (ImageButton) has a widths of approximately 50x50 which I would like to be fixed. The TextBox however should span the entire free space up to the button but I am not able to get this working. I would like to have this work dynamically so I don't have to specify a different layout for different screen sizes or orientation (if this is possible at all).</p><p>This is my first Android app so I appreciate any suggestions on how to best build the UI for an application.</p><p>Thanks,<br>  b3n</p>","395377","","","","","2010-10-06 22:48:35","Dynamically expanding widgets on Android UI","<android><android-widget><android-ui>","1","0","","",""
"3877540","1","4210397","","2010-10-06 23:05:13","1","1307","<p>I have a layout xml file with a linear layout. One of the children is again a ViewGroup Relative layout. In my java code i want to change the width of this child Viewgroup for my requirements. I tried this</p><pre><code>enter code here    ViewGroup childViewGroup = (LinearLayout)findViewById(childViewGroup);    LayoutParams l = childViewGroup.getLayoutParams();    l.width = 360;     childViewGroup .setLayoutParams(l);</code></pre><p>I couldn't do this because findViewById(childViewGroup) doesn't fetch ViewGroups it does only for Views. </p><p><strong>Note</strong>: I cant define a whole new layout.xml for this minor requirement since it is huge layout file and might cause performance overhead. I wanted to just change the width of the child view group in my java activity code.</p><p>Thanks in advance for your help.</p>","324446","","","","","2012-11-21 23:13:01","How to change Nested layout's child viewgroup's width in java code?","<android><android-linearlayout><relativelayout>","2","2","","",""
"3877619","1","3877838","","2010-10-06 23:24:44","0","1031","<p>Anyone know how facebook did this:<br /><br /><br /><br /><img src=""http://i.stack.imgur.com/2pJkn.jpg"" alt=""alt text""></p><p><br /><br />From what I know we cannot change the height of tabhost. I'm guessing that they laid the ""Frank Cho"" view over the tabhost to give it the appearance of being shorter but I may be wrong. Anyone know what's going on?</p>","392178","","","","","2010-10-07 00:22:14","TabHost on Facebook for Android","<android><height><customization><android-tabhost>","2","0","2","",""
"3877664","1","3877672","","2010-10-06 23:37:46","4","1693","<p>I see a ton of results when searching for how to open the camera, and get the returned image. What about simply opening the camera app without any return at all? I just want the camera to function as normal.</p>","92259","","","","","2010-10-06 23:45:44","Open android camera","<android><camera>","1","0","","",""
"3877677","1","","","2010-10-06 23:40:59","1","2147","<p>Basically what I want to do is when the preference is switched from the default to whatever to load up a new set of parallax backgrounds. With the code now which is probably over complicated and maybe completely off When I switch my preferences nothing changes. You can definitely tell I'm a novice but, your help would greatly be appreciated and I would gladly credit you in the app when I post it. Also if you need more of the code just ask.</p><pre><code>package quotesandothers.livewallpaper.quotesandothers;import org.anddev.andengine.engine.camera.Camera;import org.anddev.andengine.engine.options.EngineOptions;import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;import org.anddev.andengine.engine.options.resolutionpolicy.FillResolutionPolicy;import org.anddev.andengine.entity.scene.Scene;import org.anddev.andengine.entity.scene.background.AutoParallaxBackground;import org.anddev.andengine.entity.scene.background.ParallaxBackground.ParallaxEntity;import org.anddev.andengine.entity.sprite.Sprite;import org.anddev.andengine.extension.ui.livewallpaper.BaseLiveWallpaperService;import org.anddev.andengine.opengl.texture.Texture;import org.anddev.andengine.opengl.texture.TextureOptions;import org.anddev.andengine.opengl.texture.region.TextureRegion;import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;import android.content.SharedPreferences;public class livewallpaper extends BaseLiveWallpaperService implements    SharedPreferences.OnSharedPreferenceChangeListener {// ===========================================================// Constants// ===========================================================public static final String SHARED_PREFS_NAME =""Settings""; private String mTheme= ""inspiration"";// Camera Constantsprivate static final int CAMERA_WIDTH = 480;private static final int CAMERA_HEIGHT = 854;// ===========================================================// Fields// ===========================================================// Shared Preferencesprivate Texture mTexture;private Texture mAutoParallaxInspirationalTexture;private TextureRegion mParallaxLayerMid1;private TextureRegion mParallaxLayerTop;private TextureRegion mParallaxLayerTop2;private TextureRegion mParallaxLayerMid2;private TextureRegion mParallaxLayerLow1;private TextureRegion mParallaxLayerLow2;private TextureRegion mParallaxLayerInspired;private Texture mAutoParallaxBackgroundTexture;// ===========================================================// Constructors// ===========================================================// ===========================================================// Getter &amp; Setter// ===========================================================// ===========================================================// Methods for/from SuperClass/Interfaces// ===========================================================@Overridepublic org.anddev.andengine.engine.Engine onLoadEngine() {    Camera mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);    return new org.anddev.andengine.engine.Engine(            new EngineOptions(true, ScreenOrientation.PORTRAIT,                    new FillResolutionPolicy(), mCamera));}@Overridepublic void onSharedPreferenceChanged(SharedPreferences prefs, String key) {    mTheme = prefs.getString(""cube2_shape"", ""inspiration"");    readTheme();}private void readTheme(){    final Scene scene = new Scene(1);    final AutoParallaxBackground autoParallaxBackground = new AutoParallaxBackground(            0, 0, 0, 5);    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(2.7f,            new Sprite(0, 0, this.mParallaxLayerInspired)));    scene.setBackground(autoParallaxBackground);}@Overridepublic void onLoadResources() {    this.mTexture = new Texture(2048, 2048, TextureOptions.DEFAULT);    this.mAutoParallaxBackgroundTexture = new Texture(2048, 2048,            TextureOptions.DEFAULT);    this.mParallaxLayerMid1 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxBackgroundTexture, this,      ""gfx/middle1.png"",0, 320);    this.mParallaxLayerTop = TextureRegionFactory.createFromAsset(            this.mAutoParallaxBackgroundTexture, this, ""gfx/top.png"", 0, 0);    this.mParallaxLayerTop2 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxBackgroundTexture, this, ""gfx/top2.png"", 0, 173);    this.mParallaxLayerMid2 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxBackgroundTexture, this, ""gfx/middle2.png"",0, 450);    this.mParallaxLayerLow1 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxBackgroundTexture, this, ""gfx/lower1.png"", 200,574);    this.mParallaxLayerLow2 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxBackgroundTexture, this, ""gfx/lower2.png"", 0,740);    this.mEngine.getTextureManager().loadTextures(this.mTexture,            this.mAutoParallaxBackgroundTexture);     this.mAutoParallaxInspirationalTexture = new Texture(2048, 2048,                TextureOptions.DEFAULT);     this.mParallaxLayerInspired = TextureRegionFactory.createFromAsset(                this.mAutoParallaxInspirationalTexture, this, ""gfx/topinspired.png"", 0, 0);     this.mEngine.getTextureManager().loadTextures(this.mTexture,                this.mAutoParallaxInspirationalTexture);}@Overridepublic Scene onLoadScene() {    final Scene scene = new Scene(1);    final AutoParallaxBackground autoParallaxBackground = new AutoParallaxBackground(            0, 0, 0, 5);    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(2.7f,            new Sprite(0, 0, this.mParallaxLayerTop)));    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(2.9f,            new Sprite(0, 173, this.mParallaxLayerTop2)));    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(2.4f,            new Sprite(0, 320, this.mParallaxLayerMid1)));    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(-1.4f,            new Sprite(0, 450, this.mParallaxLayerMid2)));    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(2.3f,            new Sprite(200, 574, this.mParallaxLayerLow1)));    autoParallaxBackground.addParallaxEntity(new ParallaxEntity(-4.1f,            new Sprite(0, 740, this.mParallaxLayerLow2)));    scene.setBackground(autoParallaxBackground);    return scene;     }private float setHeight(int i) {    // TODO Auto-generated method stub    return 0;}@Overridepublic void onLoadComplete() {}@Overrideprotected void onTap(final int pX, final int pY) {} }</code></pre>","435285","","","","","2010-11-02 14:30:56","Help with Preferences and Android Live Wallpaper","<java><android><android-preferences><sharedpreferences>","1","0","1","",""
"3877756","1","5358033","","2010-10-06 23:56:01","0","855","<p>Does anyone have an idea of an alternative to using the new (as of api level 8) Dialog.setOnShowListener.  I would like to adjust some things in the calling activity based on the measured height of the dialog, but in order for that to work, I need access to the measured height of the dialog.  It works fine in an OnShowListener() callback, but I'd like to find a solution that will work on api level 7.</p>","104918","","","","","2011-03-18 21:30:15","Alternative to Dialog.setOnShowListener in Android api level 7","<android>","1","2","","",""
"3877814","1","3897098","","2010-10-07 00:08:47","5","1383","<p>I have an ExpandableListView (ELV) with the groups having LinearLayout. I have set the height of the group to some value (38dip in this case, equivalent to two lines of text). If the group heading is long and would take more than 2 lines, it is not shown properly in the ELV item - some part of the view gets scrolled. On the other hand, if I change android:layout_height to ""wrap_content"" in the LinearLayout, the groups always show all the lines. But the line widths are variable, i.e., short titles show up with only 1 line and long titles show up with 2, 3 or 4 lines. That looks ugly. I would like to implement the height to be something like max(""38dip"", ""wrap_content""). Is there a way to do this?</p><p>Even programmatically, I do not seem to be getting the actual height of the group if I set android:layout_height to ""wrap_content"". Any suggestions there?</p>","194742","","","","","2012-10-02 08:54:54","Dynamically adjust the height of group headers in an ExpandableListView","<android><expandablelistview>","1","0","","",""
"3877823","1","3880584","","2010-10-07 00:11:10","8","3099","<p>Does anyone know how to make a View reversed, I have a horizontal ProgressBar and I want it to right to left instead of left to right</p>","346485","","346485","","2010-10-07 00:32:25","2013-08-17 10:29:19","Right to Left ProgressBar?","<android><view><progress-bar>","4","4","3","",""
"3878294","1","3939652","","2010-10-07 02:38:31","7","13037","<p>I am trying to write an app that requires the LED flash to go into torch mode.  The problem is, Android 2.1 does not support this mode and therefore I cannot support the platform yet.  Wouldn't be an issue, but I am writing it for my fiance and her Epic 4G only has 2.1 right now.  I found some code samples that use some undocumented API calls and therefore work on the Motorola Droid and such, but they do not work on the Epic.  Does anyone have some suggestions on where to look to find code that should help me get this working?</p>","462175","","162671","","2013-03-26 17:44:26","2013-03-26 17:46:32","Camera.Parameters.FLASH_MODE_TORCH replacement for Android 2.1","<android><android-sdk-2.1><led>","2","0","6","",""
"3878445","1","3887112","","2010-10-07 03:24:54","29","20103","<p>I see a lot of posts about writing to the SD card, but I believe my problem is different.  I am unable to create the SD card during the process of building an AVD.</p><p>I initially tried to use the Android SDK and AVD Manager to do this, selecting<br><strong>Name</strong>: my_avd<br><strong>Target</strong>: Android 2.2 - API Level 8<br><strong>SD Card</strong>: Size: 1024 MiB<br><strong>Skin</strong>: Built-In: Default (HVGA)<br><strong>Hardware</strong>: Property: Abstracted LCD Density, Value: 160</p><p>This pops up a window with the message:<br>""Result of creating AVD 'my_avd':<br>Error: Failed to create the SD card.""</p><p>I tried to repeat the process from the command line, receiving a similar error:</p><pre><code>alex@alex-desktop:~$ android create avd -n my_avd -t 1 -c 1024MAndroid 2.2 is a basic Android platform.Do you wish to create a custom hardware profile [no]noError: Failed to create the SD card.</code></pre><p>Attempting to follow instructions for using mksdcard was equally unproductive; I think my basic lack of linux experience may be causing me a problem here. When I try to use mksdcard, it just reports that it cannot find the file or directory. Is the mksdcard tool available for use this way in linux?</p><pre><code>alex@alex-desktop:~$ mksdcard 1024M ./sdcard.isobash: /home/alex/android-sdk-linux_x86/tools/mksdcard: No such file or directoryalex@alex-desktop:~$ sudo android create avd -n my_avd -t 1 -c 1024M</code></pre><p>I've added the android tools directory to my PATH variable, but I feel like there is obviously something else I'm missing. Perhaps some kind of access rights?</p><p>Attempting to run the android command with sudo did not seem to help either:</p><pre><code>alex@alex-desktop:~/android-sdk-linux_x86/tools$ sudo ./android create avd -n my_avd -t 1 -c 1024MAndroid 2.2 is a basic Android platform.Do you wish to create a custom hardware profile [no]noError: Failed to create the SD card.</code></pre><p>I even tried installing Eclipse and the ADT plugin and running the manager from there to no avail. Any tips would be most appreciated. Advanced warning that I am somewhat of a novice Linux user, so even if it seems like a no-brainer obvious thing to check, I could still have missed it.</p><p>Thanks!</p>","468661","","","","","2013-12-26 09:52:54","Ubuntu - Error: Failed to create the SD card","<android><linux><ubuntu>","10","7","10","",""
"3878446","1","3878821","","2010-10-07 03:25:17","0","657","<p>Other than using listeners, is there any way by which i can get index of an item in the list?</p>","456936","","","","","2010-10-07 05:06:23","Getting list item index","<android>","2","0","","",""
"3878689","1","","","2010-10-07 04:31:07","0","3163","<p>How can we turn on/off GPS programatically without going on setting screen in android?</p>","468695","","","","","2010-10-07 12:06:40","How can we turn on/off GPS programatically without going on setting screen in android?","<android>","2","0","","",""
"3878695","1","4438047","","2010-10-07 04:32:40","2","595","<p>When i am using below url for drawing route on map on android:</p><pre><code>StringBuilder urlString = new StringBuilder();      urlString.append(""http://maps.google.com/maps?f=d&amp;hl=en"");     urlString.append(""&amp;saddr="");     urlString.append(src);     urlString.append(""&amp;daddr="");// to     urlString.append(dest);     urlString.append(""&amp;ie=UTF8&amp;0&amp;om=0&amp;output=kml"");</code></pre><p>Its throwing exception when urlConnection.getInputStream is called.</p><pre><code>HttpURLConnection urlConnection=(HttpURLConnection)url.openConnection();      urlConnection.setRequestMethod(""GET"");      urlConnection.setDoOutput(true);      urlConnection.setDoInput(true);      urlConnection.connect();       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();      DocumentBuilder db = dbf.newDocumentBuilder();      doc = db.parse(urlConnection.getInputStream()); </code></pre><p>New Code:</p><pre><code>Document doc=null;        try        {             String url = getUrl(p, q);            DocumentBuilderFactory dbfAdd = DocumentBuilderFactory.newInstance();            DocumentBuilder dbAdd = dbfAdd.newDocumentBuilder();            doc = dbAdd.parse(url.toString()); </code></pre>","443075","","443075","","2010-12-17 04:03:51","2010-12-17 04:03:51","Unable to open the stream comming from google map api in android?","<android><api>","1","2","1","",""
"3878817","1","5164779","","2010-10-07 04:58:59","1","4294","<p>If I set my ImageView to be both clickable and focusable, it works, but I have no way to tell which image is focused.  What's the best way to get it to draw an orange border around the view so the user knows it's currently in focus?</p><p>I tried dropping it in a LinearLayout and setting that to be focusable and clickable instead, but didn't have any luck.  Even when I put a margin on it, there's nothing to indicate that it was selected.</p>","465442","","","","","2013-09-18 18:23:00","Android layout - ImageView focused, but doesn't show anything on screen (no highlight)","<android><focus><imageview><clickable><focusable>","3","0","1","",""
"3878830","1","","","2010-10-07 05:01:26","0","3007","<p>Ok, so I have Java and plugins enabled. Can anyone explain why I can play many online flash videos in my webview, but nothing on m.youtube.com works?</p><p>I would be more than satisfied with a workaround that passes the video to the youtube app.</p>","468707","","","","","2010-10-07 20:01:32","Playing m.youtube content in webview","<android>","2","0","1","",""
"3878904","1","3879132","","2010-10-07 05:22:59","0","142","<p>I need to programmatically adjust the sizes of views in my UI.  Say I want to adjust the height of a child view to be the height of the parent view minus 60, I would do this:</p><pre><code>child.getLayoutParams().height = parent.getMeasuredHeight() - 60;child.requestLayout();</code></pre><p>(obviously, this is simpler than what I really need to do)</p><p>This works great when it is done in response to, say, clicking a button or the like....the child view will adjust its size as requested, and all is well.</p><p>Now I need to also have the sizing done when the activity starts, and when the orientation changes.  Preferably without seeing anything jump around.  I tried adding it to the activity's onStart(), but that doesn't work, as the parent's height measures as zero.  I also tried using getHeight() rather than getMeasuredHeight(), and got the same incorrect behavior.</p><p>Where do I put this code, or what do I need to do, to programmatically size the views?</p>","226507","","226507","","2010-10-07 05:37:07","2010-10-07 07:18:37","programmatically sizing views","<android>","1","0","","",""
"3879000","1","","","2010-10-07 05:41:59","2","8034","<p>Is there any way to access the micro phone in a android phones similar to accessing the <strong><em>android.hardware.Camera</em></strong>?. I know we can use <strong>MediaRecorder</strong> to record audio from android application into a file as shown in this <a href=""http://developer.android.com/guide/topics/media/index.html"" rel=""nofollow"">link</a> .   </p><p>Let me explain what I want to do. I'm accessing Camera from android program to capture video and get each captured frame using Camera.Preview callback function. After decoding the frame I'll upload to say a streaming server (haven't tried practically yet :) ) These frames will contain only image information how can I get audio along with frames? </p><p>Can any one suggest me technique for implementing the above idea?</p><p>I'm still a beginer for android dev so I may sound stupid :)</p><p>Thanks in Advance</p>","154206","","","","","2012-10-29 03:39:05","Accessing Microphone in Android SDK","<android>","1","2","1","",""
"3879091","1","","","2010-10-07 06:02:24","0","88","<p>i have an android application to display the images downloaded from the server. downloading of the image is one thread and displaying that image in main class. on compiling the emulator shows an error alert that application is stopped unexcpectedly. Is the main application(class that extends Activity) a Thread?? Please help me</p><p>Thanks in advance</p>","462695","","","","","2010-10-07 06:09:30","android thread issue","<android>","2","0","","",""
"3879159","1","4439963","","2010-10-07 06:20:11","1","11064","<p>I am having trouble with the Hello Map Views tutorial from the Android Developer website: <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a></p><p>My first problem was that upon clicking the overlay item, the application would crash.  This problem was solved by making sure to pass the context to the ItemizedOverlay class that I created...</p><p>After I fixed this problem, the icon for the overlay does not display in the map.  I am able to click on the map where the overlay is located and the dialog box displays.  Unfortunately, I cannot see the icon.  I have made sure that the image that I reference is an object located in the R.java resources file.  In fact my exact problem is asked by the poster of the following thread after going through the same issues.  Unfortunately his second question was never answered. <a href=""http://stackoverflow.com/questions/3531964/context-null-pointer"">http://stackoverflow.com/questions/3531964/context-null-pointer</a></p><p>Here is my MapView class:</p><pre><code>package com.mapsExample;import java.util.List;import android.content.Context;import android.graphics.drawable.Drawable;import android.os.Bundle;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;public class HelloMaps 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);        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);        HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);        GeoPoint point = new GeoPoint(19240000,-99120000);        OverlayItem overlayitem = new OverlayItem(point, ""Hola, Mundo!"", ""I'm in Mexico City!"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);    }    @Override    protected boolean isRouteDisplayed() {        return false;    }}</code></pre><p>And my ItemizedOverlay class:</p><pre><code>package com.mapsExample;import java.util.ArrayList;import android.app.AlertDialog;import android.content.Context;import android.graphics.drawable.Drawable;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;(); Context mContext; public HelloItemizedOverlay(Drawable defaultMarker) {   super(boundCenterBottom(defaultMarker)); } public HelloItemizedOverlay(Drawable defaultMarker, Context context) {  super(defaultMarker);  mContext = context; } public void addOverlay(OverlayItem overlay) {     mOverlays.add(overlay);     populate(); } @Override protected OverlayItem createItem(int i) {   return mOverlays.get(i); } @Override public int size() {   return mOverlays.size(); } @Override protected boolean onTap(int index) {   OverlayItem item = mOverlays.get(index);   AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);   dialog.setTitle(item.getTitle());   dialog.setMessage(item.getSnippet());   dialog.show();   return true; }}</code></pre><p>Again, If I do not pass 'this' to the ItemizedOverlay constructor, the icon displays but cannot be clicked.  Any help is much appreciated.  Thanks in advance!</p>","468665","","1228","","2013-08-14 15:55:13","2013-08-14 15:55:13","ItemizedOverlay Issues (HelloMapView Tutorial)","<android><google-maps>","2","1","","",""
"3879196","1","3879351","","2010-10-07 06:27:47","0","164","<p>Hi i am displaying the alert dialog box using below code</p><p>final CharSequence[] items = {""Email"", ""Phone""};AlertDialog.Builder builder = new AlertDialog.Builder(this);</p><p>But I want to display the icons with that names.For x in above code i am taking email and phone.emailIcon comes with email name.For this what can i do give me some suggestions.Thanks in advance</p>","699226","","","","","2010-10-07 07:17:13","Display icons along with the strings in alertdialogbox","<android>","1","0","","",""
"3879261","1","4332246","","2010-10-07 06:38:16","0","2001","<p>I'm trying to use the camera in an Android app using the 1.5 API. I want the camera to flash for every picture. However, when I looked at the API for camera.parameters, the setFlashMode() method is only supported for 2.0 and higher. Yet my Cliq XT, which runs 1.5, has a flash that I can set in the menu - I take this to mean there is a way to do this for the 1.5 API, though I was unable to find it. </p><p>Does anyone know how to set the flash mode using the 1.5 API? </p>","399741","","","","","2010-12-02 06:17:19","set flash mode camera.parameters android 1.5","<android><flash><camera><android-1.5-cupcake>","2","0","2","",""
"3879290","1","3946170","","2010-10-07 06:45:13","2","2733","<p>I'm trying to limit my program to take location updates every 10 seconds instead of constant updates in order to reduce battery drain. This works fine when i'm debugging indoors and the signal is weak (i.e. the GPS icon flashes), but if the phone gets a proper fix (i.e. the GPS icon is static) the update interval increases to roughly a second.</p><p>I know that the code <code>mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, updateInterval*1000, 0, this);</code> will not force the GPS to take updates exactly at the given interval, but in my opinion it shouldn't depend on the strength of the signal and fluctuate that much.</p><p>Any ideas?</p><p>UPDATE: see comment</p>","416022","","416022","","2010-10-15 12:58:10","2010-10-15 21:11:15","GPS update interval is faster with good signal?","<android><gps><locationmanager>","2","1","","",""
"3879388","1","","","2010-10-07 07:06:30","1","1042","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3092424/parsing-ksoap2-response"">Parsing ksoap2 response</a>  </p></blockquote><p>I have seen many forum questions about this, but i haven't found a solution that works for me. THis is my code: </p><pre><code>String serviceURL = ""http://www.mywebsite.com/WebService.asmx"";                 String serviceNamespace = ""http://tempuri.org/"";                 String serviceMethod = ""getUser"";                 String SoapAction = ""http://tempuri.org/getUser"";                 SoapObject SoapObj = new SoapObject(serviceNamespace,serviceMethod);                    SoapObj.newInstance ();                    SoapObj.addProperty (""uname"", ""Evv"");                   // SoapObj.addProperty (""uposy"", ""333"");                    //SoapObj.addProperty (""uposx"", ""333"");                                     SoapSerializationEnvelope envelope = new                        SoapSerializationEnvelope(SoapEnvelope.VER11);                 envelope.bodyOut = SoapObj;                 envelope.dotNet = true;                 envelope.implicitTypes = true;                 envelope.encodingStyle = ""utf-8"";                 envelope.enc = SoapSerializationEnvelope.ENC2001;                 envelope.xsd = SoapEnvelope.XSD;                 envelope.xsi = SoapEnvelope.XSI;                 AndroidHttpTransport ht = new AndroidHttpTransport(serviceURL);                 //Initiate Connection                 try                   {                  ht.debug = true;                  ht.call (SoapAction, envelope);                   SoapObject response=(SoapObject)envelope.getResponse();                      tv.setText(response);</code></pre><p>}</p><p>Is the anyType{uposx=222; uposy=222;} a JSON-response? I can see it written out in the textview, but i want to parse it. </p><p>I have tried with JSON Object, but not gotten it to work:</p><pre><code> JSONObject JSONObj;                  JSONArray JSONArr;                   SoapObject res = (SoapObject)envelope.getResponse();                   gets our result in JSON String                  String ResultObject = response.getProperty(0).toString();                  if (ResultObject.startsWith(""anyType{"")) { // if JSON string is an object                      JSONObj = new JSONObject(ResultObject);   Iterator&lt;String&gt; itr = JSONObj.keys();                      while (itr.hasNext()) {                          String Key = (String) itr.next();                          String Value = JSONObj.getString(Key);                          bundleResult.putString(Key, Value);                          tv.setText(bundleResult.getString(Key));                      }                  } else if (ResultObject.startsWith(""anyType{"")) { // if JSON string is an array                      JSONArr = new JSONArray(ResultObject);                      tv.setText(""length"" + JSONArr.length());                      for (int i = 0; i &lt; JSONArr.length(); i++) {                          JSONObj = (JSONObject) JSONArr.get(i);                          bundleResult.putString(String.valueOf(i), JSONObj.toString());                          // System.out.println(bundleResult.getString(i));                      }                   }</code></pre><p>Thanks for any help! </p>","455479","","","","","2012-04-17 07:32:51","How can I parse anyType {----} response with ksoap2","<android><json><service><xml-parsing>","0","1","","2012-04-17 08:30:42",""
"3879419","1","3879569","","2010-10-07 07:11:31","1","260","<p>Hi friends          I am using custom list view .I have trying to get user clicked   row value can anybody tell how to get the value?</p><p>Thanks </p>","426344","","","","","2010-10-07 07:35:50","list view problem in android","<android>","1","1","","",""
"3879429","1","3879567","","2010-10-07 07:13:22","0","549","<p>Here I am posting my Json Response below: </p><pre><code>{""ResultSet"":    {""Result"":[        {""Phone"":""(650) 473-9999"",         ""Distance"":""2.59"",         ""MapUrl"":""http://maps.yahoo.com/maps_result?q1=441+Emerson+St+Palo+Alto+CAgid1=28734629"",         ""Categories"":            {""Category"":[                {""content"":""Salad Restaurants"",                 ""id"":""96926225""},                {""content"":""Vegetarian Restaurants"",                 ""id"":""96926239""},                {""content"":""Pizza"",                 ""id"":""96926243""},                {""content"":""Wine"",                 ""id"":""96926864""},                {""content"":""Alcoholic Beverages"",                 ""id"":""96929810""}]},         ""City"":""Palo Alto"",         ""Title"":""Patxi's Chicago Pizza"",         ""State"":""CA"",         ""Rating"":            {""LastReviewDate"":""1241373758"",             ""LastReviewIntro"":""My husband brought me a slice of their pizza after I had heard glowing reviews from the Sarah and Vinnie morning show on Alice radio (they get theirs from the SF location). Anyway I had been very interested in trying what sounded like very special pizza. My husband and son went during a time when you can buy slices so waiting for the food wasnt an issue. I usually dont like pizza cold but by the time they got it home to me it was very luke warm. NOT A PROBLEM! I was amazed at how yummy it was and was having the hardest time NOT eating it while standing in the kitchen leaning over the pizza-to-go box! Im not sure of what the name of the slice was except that it did have sausage and possibly spinach in it. This was a week ago and Ive been craving it ever since. When we do go back we will either order ahead to save on the wait or go during pizza slice hours. Ive heard they also do NY style for those of you thin crust fans! Check it out!!"",             ""TotalReviews"":""27"",             ""TotalRatings"":""27"",             ""AverageRating"":""4.5""},         ""Address"":""441 Emerson St"",         ""Latitude"":""37.445242"",         ""Longitude"":""-122.163427""}]}}</code></pre><p>Noe I want to have the following data Parsed ""Phone"", ""Distance"", ""City"", ""Title"", ""State"" and only ""AverageRating"" from the Tag ""Rating"".</p><p>Can anybody please help in sorting this particularly.</p><p>Thanks,David</p>","422859","","180784","","2010-10-07 08:50:01","2012-11-07 06:47:59","parsing the Json Data","<android><json><parsing>","1","2","","",""
"3879478","1","","","2010-10-07 07:21:04","2","2010","<p>I'd like to write an app like talking carl / talking tom cat but was wondering how they are developed?</p><ul><li><p>Are they animated on the fly using 3d?  The general actions dont seem to be, they look like a series of movies being played?</p></li><li><p>If this is the case, how is the movement of the mouth animation done?</p></li></ul>","113911","","","","","2010-10-07 08:09:36","How are the android apps like talking carl and talking tom cat developed?","<android>","1","0","","",""
"3879717","1","3879776","","2010-10-07 07:59:05","3","3680","<p>What is meant by System.img in Android? What is the purpose of using it?Can anyone help me regarding this issue?</p><p>Thanks in Advace.</p>","429501","","","","","2010-10-07 08:18:22","What is purpose of using System.img in Android?","<android>","2","0","","",""
"3879887","1","3879919","","2010-10-07 08:29:22","0","245","<p>friend's   I  need help on running an application in 3G,the application works well in wifi,but also i need to work it on 3G also,what i have to do work in 3G.is there anything i need to add in manifest file for 3G?</p><p>help me.</p><p>Thanks in advance.</p>","393953","","","","","2010-10-07 08:34:20","how to run an application using 3g","<android>","1","1","","",""
"3879992","1","3880018","","2010-10-07 08:43:41","21","44887","<p>how to get bitmap object from an Uri (suppose, if i succeed to store it in <code>/data/data/MYFOLDER/myimage.png</code> or <code>file///data/data/MYFOLDER/myimage.png</code> i used both paths) to use it in my application</p><p>but i am failing to get this back. Does anyone have an idea on how to accomplish this ?</p>","462023","","1484739","","2013-01-30 09:19:55","2014-02-28 11:22:29","Get Bitmap from an Uri [android]","<android><bitmap><uri><android-image>","4","1","14","",""
"3880059","1","","","2010-10-07 08:51:40","1","12477","<p>I am facing problem to establish a socket connection from android device to PC's a specific port like 8080. I just want to create a socket which will connect to the specific port and also write some data stream on that port.</p><p>I have written some code for this purpose but the code is giving me an exception asTCP Error:java.net.ConnectException:/127.0.0.1:8080-connection refused</p><p>i am giving my code as below:</p><p>private static TextView txtSendStatus;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    initControls();    String sentence = ""TCP Test #1n"";    String modifiedSentence;    try {        Socket clientSocket = new Socket(""192.168.18.116"", 8080);        DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());        BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));        printScr(""TCP Connected."");        outToServer.writeBytes(sentence + 'n');        modifiedSentence = inFromServer.readLine();        printScr(modifiedSentence);        printScr(""TCP Success !!!"");        clientSocket.close();    } catch (Exception e) {       printScr(""TCP Error: "" + e.toString());    }} private void initControls(){      txtSendStatus = (TextView)findViewById(R.id.txtSendStatus);}public static void printScr(String message){       txtSendStatus.append( ""n"" + message );}</code></pre><p>Is there anyone who can tell me the answer? I am waiting for the right answer.</p><p>Best Regards,gsmaker</p>","424854","","","","","2011-03-13 18:36:52","Android device to PC's socket connection","<android>","4","1","3","",""
"3880078","1","3922563","","2010-10-07 08:54:22","0","113","<p><img src=""http://i.stack.imgur.com/qG9Oh.jpg"" alt=""alt text""></p><p>Hello, this is the second time that I ask a question about this:(I think a photo may better explain to you what I want. Since the last time I asked the question, I have tried several tutorials, but I didn't manage to set up a menu as the photo shows. In fact, I don't understand very well the use of getView(). One guy told me just to rewrite this method, but I can't really figure it out. I really appreciate your help! Thanks a lot! </p>","453676","","","","","2010-10-13 10:09:21","Custom menu as the photo","<android><user-interface>","1","2","","",""
"3880098","1","3880190","","2010-10-07 08:56:10","-1","1987","<p>How to implement tabs in Android. <br>I am having a context. In that I want 3 tabs named Free,TOP,Paid.Clicking on each of the tab should open separate activity.</p><p>Thanks in Advance,</p>","429501","","","","","2010-10-07 09:08:32","How to implement tabs in Android","<android>","2","1","0","",""
"3880350","1","","","2010-10-07 09:33:17","22","31217","<p>I have an android project that uses ant to build, is it possible to import this ant project in eclipse IDE?</p><p>update : There is an option to create project using ant build.xml in eclipse File->New->Project->Java->Java project from existing ant Buildfile. and if the build.xml file is selected it show error ""Specified buildfile does not contain a javac task""</p><p>I guess javac is declared in this task</p><pre><code>&lt;taskdef name=""setup""classname=""com.android.ant.SetupTask""classpathref=""android.antlibs""/&gt;</code></pre>","110024","","110024","","2010-10-07 09:46:43","2012-12-21 12:05:39","importing ant build.xml in eclipse","<java><android><eclipse><ant>","3","4","5","",""
"3880427","1","3889220","","2010-10-07 09:45:10","0","67","<p>I have 2 lists, one on the left of the screen, the other list, on the right of the screen which gets dynamically populated based on the selected item on left list.</p><p>I move to the right list by pressing ""Right"" key from the left list.</p><p>Issue: Whenever I press right key from left list, the item that is currently selected is the item of the right list that is currently aligned with the left item. I dont want this to happen. I always want my 1st item of the right list to be selected. Can anyone help how to go about this?</p>","456936","","","","","2010-10-08 09:20:01","doubt in list view","<android>","1","0","","",""
"3880613","1","","","2010-10-07 10:10:32","0","969","<p>I have this layout.</p><p></p><pre><code>&lt;ImageView  android:id=""@+id/icon""  android:layout_gravity=""left""  android:layout_marginLeft=""5px""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:src=""@drawable/icon""/&gt;  &lt;ImageView  android:id=""@+id/header_avatar""  android:layout_gravity=""left""  android:layout_marginLeft=""5px""  android:layout_width=""?????""  android:layout_height=""?????""/&gt;</code></pre><p></p><p>I want the second ImageView to have the very same size of the first ImageView so that it resizes the pictures I set in the second view (header_avatar) to the same of the first view (@drawable/icon).Is this posible or do I have to do it programmatically? Cannot I reference the first view's width and length on the second view?</p><p>Thanks in advance.</p>","468917","","","","","2010-10-07 11:15:05","How can I set the width and height of an ImageView to another ImageView's width and height on the XML?","<android><layout>","2","0","","",""
"3880623","1","4143694","","2010-10-07 10:12:02","11","14314","<p>I dont get the point, why I have to code so much for it. Like, I dont want to care about... </p><ul><li>the position of the balloon (I just want to assign a geopoint)</li><li>the layout of a basic balloon (Later on I might want to implement a xml based layout)</li><li>the number of shownballoons (only display one at a time)</li><li>the open/closebehaviour of the balloon (close, when an other bollon is tabbed)</li></ul><p><strong>Update</strong></p><p>Solved it! See my answer below...</p>","433718","","246246","","2012-05-13 07:28:39","2012-10-12 12:39:48","How to show a balloon above a marker in a MapActivity? Isn't there a widget?","<android><google-maps><android-maps>","1","4","6","",""
"3880846","1","3884886","","2010-10-07 10:44:38","0","243","<p><strong>I m making an application using SOAP in android. Actually i want to do login functionality by calling web service on click of login button.</strong> In this i want the user to log in into application by checking that the user is registered or not(Webservice is sending successfull or failed respose). can anybody tell me the procedure or any nice tutorial or some sample code. it will b very helpfull.</p><p>Thanks in advance.</p>","383597","","","","","2014-04-17 05:13:08","Android SOAP problem","<android>","2","0","","",""
"3880860","1","","","2010-10-07 10:46:26","0","1012","<p>I am using Android 1.6. I want to integrate a Twitter button to share songs on my web-based application to my Twitter followers. For that, I integrated the jtwitter.jar file into my application.</p><p>But it is not accepting the username and password that I provide.</p><p>I am using the following statement to check the authentication:</p><pre><code>twitter = new Twitter(username, password);</code></pre>","468952","","496830","","2011-09-21 17:40:20","2011-09-21 17:40:20","How can I put a Twitter share button in my Android application?","<android><twitter><jtwitter>","1","0","","",""
"3880864","1","","","2010-10-07 10:47:01","0","253","<p>My app downloads .png files to the sd card for later use. I kept getting OutOfMemoryErrors (if anyone could explain this too, that'd be great!) and so I took a look at the sizes of the images saved to the sd card, and they seem to be roughly double what they are on the server. Why is this, and how can I make them smaller?</p><pre><code>public void onCreate(Bundle saved) {    setContentView(R.layout.namedrxnscreen);    TextView t1 = (TextView)findViewById(R.id.rxn_text1);    TextView t2 = (TextView)findViewById(R.id.rxn_text2);    TextView t3 = (TextView)findViewById(R.id.rxn_text3);    TextView t4 = (TextView)findViewById(R.id.rxn_text4);    iv = (ImageView) findViewById(R.id.rxn_image);    pb = (ProgressBar) findViewById(R.id.rxn_loading);    vs = (ViewSwitcher) findViewById(R.id.rxn_switch);    try {        super.onCreate(saved);        [ boring stuff here ]        BitmapDrawable image = getImage(c.getString(5));        if (image != null) {            iv.setImageDrawable(getImage(c.getString(5)));            iv.setBackgroundColor(Color.WHITE);            vs.setDisplayedChild(1);        }        else {            new DownloadTask().execute(c.getString(5));        }    }    catch (ArrayIndexOutOfBoundsException ea) {        error = ""bah!"";        showDialog(1);    }    catch (Exception ex) {        error = ex.getMessage();        showDialog(1);    }}protected class DownloadTask extends AsyncTask&lt;String, Integer, Bitmap&gt; {    @Override    protected Bitmap doInBackground(String... string) {        Bitmap d = null;        try {            DefaultHttpClient dhc = new DefaultHttpClient();            HttpGet request = new HttpGet(HTTP_BASE + string[0] + "".png"");            HttpResponse response = dhc.execute(request);            BufferedInputStream webstream = new BufferedInputStream(response.getEntity().getContent());            d = writeToSd(string[0], webstream, d);        }        catch (Exception ex) { errorCatch(ex.getMessage()); }        return d;    }    private Bitmap writeToSd(String string, BufferedInputStream webstream, Bitmap d) {        try {            webstream.mark(3);            webstream.reset();            File f = new File(Environment.getExternalStorageDirectory() + SD_DIR);            f.mkdirs();            File f2 = new File(f, string + "".png"");            f2.createNewFile();            BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(f2));            int len;            byte[] buffer = new byte[1024];            while ((len = webstream.read(buffer)) &gt; 0) {                fos.write(buffer, 0, len);            }            webstream.close();            //fos.flush();            fos.close();            FileInputStream fis = new FileInputStream(new File(f, string + "".png""));            d = BitmapFactory.decodeStream(fis);            return d;        }        catch (Exception ex) {            errorCatch(ex.getMessage());            return null;        }    }    protected void onPostExecute(Bitmap result) {        if (result != null) {            iv.setImageBitmap(result);            iv.setBackgroundColor(Color.WHITE);            vs.setDisplayedChild(1);        }    }}protected BitmapDrawable getImage(String name) {    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {        try {            //Gets the SD card file, whacks it in a stream            File f = new File(Environment.getExternalStorageDirectory() + SD_DIR, name + "".png"");            if (f.exists()) {                InputStream s = new FileInputStream(f);                try {                    //Return the decoded bitmap                    BitmapDrawable d = new BitmapDrawable(getResources(),                             BitmapFactory.decodeStream(s)); //gives an OutOfMemoryError if png &gt; ~30KB                    return d;                } catch (OutOfMemoryError ex) {                    Toast.makeText(this, ""An OutOfMemoryError occured and"" +                            "" the image was loaded at a lower quality."", Toast.LENGTH_SHORT).show();                    BitmapFactory.Options mOptions = new BitmapFactory.Options();                    mOptions.inSampleSize = 4;                    BitmapDrawable d = new BitmapDrawable(getResources(),                             BitmapFactory.decodeStream(s, null, mOptions));                    return d;                }            }            else return null;        }        catch (Exception ex) {            return null;        }    }    else {        Toast.makeText(this, ""External storage not available. Downloading from internet."",                Toast.LENGTH_SHORT).show();        return null;    }}</code></pre>","428665","","","","","2010-10-07 13:54:11","png downloaded size different to server size?","<android><png><out-of-memory><fileoutputstream>","1","0","","",""
"3880985","1","3881819","","2010-10-07 11:05:07","0","148","<p>I am continuously capturing images with my camera at interval of 1 min.It is working without any problem.But when i got incoming call,my camera activity goes to background and not capturing any images.When call finishes m able to see my activity and images are captured without any problem.</p><p>What to do so that when incoming call,still camera should capture images.</p><p>Thanks and Regards.</p><p>Rohan Wagh</p>","466848","","","","","2010-10-07 12:55:34","Not able to capture images when there is an incoming call?","<android>","1","0","","",""
"3881014","1","","","2010-10-07 11:09:07","0","1300","<p>I want to show wml page on android. I have designed small wml page. I am using Apache  server to deploy the pages. But the page is not displaying. It is displaying just like xml page. I have added some line to mime.types which is given in following site <a href=""http://e-articles.info/e/a/title/How-To-Configure-Apache-or-IIS-Web-Server-to-Work-with-WML-~-Openwave-SDK/"" rel=""nofollow"">http://e-articles.info/e/a/title/How-To-Configure-Apache-or-IIS-Web-Server-to-Work-with-WML-~-Openwave-SDK/</a> </p><p>Still it is not working on android emulator...  any idea??</p>","323062","","","","","2012-11-05 22:58:32","How to show wml pages on android phone","<android>","3","0","","",""
"3881175","1","3881241","","2010-10-07 11:30:26","2","562","<p>How can I reuse code AND resources in several applications? I have a fairly large code base <em>(including resources)</em> that I want to reuse i several applications. How can I do that?</p><p>I did try to use the Android Library concept (http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject) but never got it to work in Android 1.x</p><p>I'm amazed by the lack of information on the subject. It seems like Google has aimed Android development at pet projects and not real development. Variant handling should have been solved ages ago.</p>","469012","","","","","2010-10-07 11:38:58","How can I reuse code AND resources in several applications?","<android><resources><reusability>","1","0","","",""
"3881183","1","","","2010-10-07 11:31:32","1","63","<p>helloI got a project that I need to add one or more layout to my existent layout.The problem is that I can see only my last layout .I am using overlay's vector and i'm asure that is not the way to solve this problemI will be glad if some one will give me some clue how to solve this problemthank you  </p>","469013","","464988","","2011-03-31 13:54:58","2011-03-31 13:54:58","how to see two or more layout with android?","<android><layout><itemizedoverlay>","1","0","","",""
"3881187","1","","","2010-10-07 11:31:50","6","8728","<p>I wanted to create an gallery with images.The images within the gallery should be zoomable and pannable. I could able to pinch-zoom an image but could not able to set zoom limits and prevent the image from being panned off the screen.I used the following code to zoom an image:<a href=""http://code.google.com/p/4chan-image-browser/source/browse/src/se/robertfoss/MultiTouch/TouchImageView.java?spec=svnd3e623ddeb6f9e97d9eba2c7aaa7c4567a3822b5&amp;r=d3e623ddeb6f9e97d9eba2c7aaa7c4567a3822b5"" rel=""nofollow"">http://code.google.com/p/4chan-image-browser/source/browse/src/se/robertfoss/MultiTouch/TouchImageView.java?spec=svnd3e623ddeb6f9e97d9eba2c7aaa7c4567a3822b5&amp;r=d3e623ddeb6f9e97d9eba2c7aaa7c4567a3822b5</a></p><p>First approach : I used TouchImageView to supply images to gallery, this allows me to pinch zoom butcan't scroll the gallery. i.e I cant differentiate between 'single tab event' and 'tab to scroll event'.</p><p>Second approach :Used ImageView to supply images to gallery, and if user click on any of the gallery item display the selected image in TouchImageView, where user can Pinch-Zoom an image. But this also prevent me from scrolling the gallery view. And also how to set zoom limits and pan bounds on selected image?</p>","460641","","168175","","2011-09-18 07:42:06","2013-12-30 15:42:19","ImageView Pinch-zoom Scale Limits and pan bounds","<android>","4","0","5","",""
"3881197","1","6446544","","2010-10-07 11:32:21","39","17678","<p>As <a href=""http://stackoverflow.com/questions/2093594/opengl-extensions-available-on-different-android-devices"">this page</a> for OpenGL ES 1.x, I collect OpenGL ES 2.x Extensions for Android Devices on this page. The listing can be found with my benchmark tool <a href=""http://www.ellismarkov.com/new-android-app-released-gpubench-1-0-0"">gpubench</a>. This information can help many game developpers.</p><p>Thanks for your help,</p>","412012","","367180","","2012-09-19 07:20:27","2012-09-19 07:20:27","OpenGL ES 2.0 Extensions on Android Devices","<android><opengl-es><android-ndk>","22","4","29","2012-09-19 09:04:59",""
"3881251","1","3882435","","2010-10-07 11:40:55","0","5576","<p>Sorry, the question is not programming related but I have nowhere else to ask, I asked in android help center and support without any responses.</p><p>What do I need to open a company account in Android Market? I want my company to be seen as seller. How will they authenticate the company, what documents do I need to supply to the market?</p><p>Thanks</p>","191198","","","","","2012-03-10 05:20:17","Company Registration in Android Market","<android><google-play>","3","0","2","",""
"3881256","1","3882611","","2010-10-07 11:42:15","29","3015","<p>The Dell Streak has been discovered to have an FM radio which has very crude controls. 'Scanning' is unavailable by default, so my question is does anyone know how, using Java on Android, one might 'listen' to the FM radio as we iterate up through the frequency range detecting white noise (or a good signal) so as to act much like a normal radio's seek function?</p>","129372","","","","","2010-10-08 18:10:19","Can you programmatically detect white noise?","<java><android>","9","1","7","",""
"3881514","1","","","2010-10-07 12:16:39","2","1306","<p>I have an application that's offered in and outside of the MarketPlace.</p><p>Is there a way of determining from within the code where the application came from?</p><p>I've got a few indirect methods ...</p><p>1) I could simply infer from whether they have ""Allow installation of non-Market applications"" ticked ...</p><p><a href=""http://developer.android.com/reference/android/provider/Settings.html#ACTION_MANAGE_APPLICATIONS_SETTINGS"" rel=""nofollow"">http://developer.android.com/reference/android/provider/Settings.html#ACTION_MANAGE_APPLICATIONS_SETTINGS</a></p><p>2) Or I could just make separate builds and make it explicit in the code.</p>","469045","","","","","2010-10-07 14:50:07","Programmatically determine if application is the MarketPlace version","<android><marketplace>","3","0","3","",""
"3881553","1","4752292","","2010-10-07 12:21:46","19","11701","<p>I was wondering if there is an easy way to strike text within an app widget in Android. In a normal activity, it is pretty easy, using textview flags:</p><pre><code>textView.setPaintFlags(textView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);</code></pre><p>But since in an app widget, I can use only remoteviews... I do not know if this is possible</p><p>Anyone know something about this?</p><p>Thanks!</p>","316477","","","","","2012-07-31 15:50:51","Is there an easy way to strike through text in an app widget?","<android><widget><textview><strikethrough>","5","0","6","",""
"3881652","1","4291108","","2010-10-07 12:33:28","1","3234","<pre><code>     I use the following send mail application  in android from           </code></pre><p><a href=""http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-ap/2033124#2033124"">http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-ap/2033124#2033124</a></p><pre><code>    and got the  warning     10-07 17:58:22.762: INFO/SSLSocketFactory(925):     Using factory org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl@4007ed70   10-07 17:58:23.063: DEBUG/NativeCrypto(925): SSL_OP_NO_SSLv3 is set    10-07 17:58:23.573: INFO/global(925): Default buffer size used in            BufferedOutputStream constructor. It would be better to be explicit if an 8k      buffer     is required.   10-07 17:58:23.573: INFO/global(925): Default buffer size used in     BufferedInputStream constructor. It would be better to be explicit if an 8k      buffer  is required.   10-07 17:58:24.172: INFO/global(925): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.</code></pre><p>please Help me to find solution</p>","461503","","","","","2013-02-15 18:50:48","Android Send mail Application","<android>","1","0","1","",""
"3881793","1","","","2010-10-07 12:52:24","2","150","<p>Is there any way by which we can get the current view by specifying the position of the view?</p><p>I have the view position with me and I need to get View. Is there any way?</p>","456936","","","","","2011-02-02 09:38:15","Question related to current View","<android>","1","2","1","",""
"3881854","1","","","2010-10-07 12:57:54","0","2470","<p>i have incoming call broadcast receiver and phone state listener class  , how to block or reject incoming call and the ringing notification  </p><p><strong>BroadCastReceiver</strong> </p><pre><code>public class PhoneCallReceiver extends BroadcastReceiver{    private static final String TAG = ""Phone call"";    @Override    public void onReceive(Context context, Intent intent) {            Log.v(TAG, ""Receving...."");            TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);            SamplePhoneStateListener customPhoneListener = new SamplePhoneStateListener();            telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);                }}</code></pre><p>Phone Listener</p><pre><code>public class SamplePhoneStateListener extends PhoneStateListener {    private static final String TAG = ""Phone Listner"";@Overridepublic void onCallStateChanged(int state, String incomingNumber) {      Log.v(TAG, ""Current State is - ""+state);      Log.v(TAG, incomingNumber);      switch(state){              case TelephonyManager.CALL_STATE_RINGING:                      Log.d(TAG, ""Phone Ringigg"");                      break;      }         super.onCallStateChanged(state, incomingNumber);}}</code></pre>","221169","","","","","2013-03-25 19:24:47","blocking Incoming call - Android","<android>","2","0","","",""
"3881945","1","3927103","","2010-10-07 13:09:03","4","778","<p>I am recently getting into Android programming and want to make a simple game using 2D canvas drawing.  I have checked out the Lunar Lander example and read up on some gestures, but it looks like I can only detect if a gesture occurred.   I am looking to do a little more complicated detection on a swipe:</p><p>I want to make a simple game where a user can drag their finger through one or more objects on the screen and I want to be able to detect the objects that they went over in their path.  They may start going vertically, then horizontally, then vertically again, such that at the end of a contiguous swipe they have selected 4 elements.  </p><p>1) Are there APIs that expose the functionality of getting the full path of a swipe like this?2) Since I am drawing on a Canvas, I don't think I will be able to access things like ""onMouseOver"" for the items in my game.  I will have to instead detect if the swipe was within the bounding box of my sprites.  Am I thinking about this correctly?</p><p>If I have overlooked an obvious post, I apologize.  Thank you in advance!</p>","469106","","244296","","2010-11-03 15:00:19","2011-05-08 20:32:53","Android - Detect Path of Complex Drag","<android><gestures>","1","0","1","",""
"3881955","1","3882137","","2010-10-07 13:10:52","0","493","<p>HI Folks,</p><p>I have a strange problem for Voice recognition on Google Nexus one phone whichhave Firmware:2.2.1.Voice recognition gives multiple interpretationsof the spoken word When I speak ""Hello"" to the voice recognition,the results received is ""hello, hotels, photos, fomdem, honda""which is expected to come only ""hello""The same things works fine on Firmware 2.1 which give satisfactory result.</p><p>Whats has to be done to avoid this issue.Any Suggestions are helpful</p><p>Best Regards,Vinayak</p>","28557","","31161","","2011-08-05 11:15:22","2011-08-05 11:15:22","Android 2.2.1 Nexus one : Voice recognition problem","<android><speech-recognition><voice-recognition><android-2.2-froyo>","1","0","","",""
"3881975","1","3886089","","2010-10-07 13:13:16","6","5878","<p><strong>Question</strong> If I have the following:</p><pre><code>&lt;ScrollView android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""?"" android:orientation=""vertical""&gt;        &lt;EditText android:layout_width=""fill_parent"" android:layout_height=""?"" android:hint=""Subject"" android:id=""@+id/subject"" /&gt;        &lt;EditText android:layout_width=""fill_parent"" android:layout_height=""?"" android:id=""@+id/body"" /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>How can I get the body (second EditText) to fill the rest of the screen, but still have the scrollview kick in when the contents of the body are too long? Like a <code>height=""wrap_content""</code> and <code>minHeight=""fill_parent""</code></p><p><code>layout_height=""fill_parent""</code> seems to not do anything if you put them in a scrollview</p><p><strong>A working example of what I want is the email app compose window</strong></p><p><strong>I tried this</strong> and the EditText elements act like they are wrap_content and no filling is happening. Just scrolling if you type enough</p><pre><code>&lt;ScrollView 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;EditText android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" layout_weight=""1"" android:hint=""Subject"" android:id=""@+id/subject"" /&gt;        &lt;EditText android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" layout_weight=""1"" android:id=""@+id/body"" /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","463304","","463304","","2010-10-07 17:12:38","2013-01-07 17:08:04","min height fill_parent and height wrap_content in ScrollView? (or just the email app compose layout's code)","<android><android-layout>","3","0","4","",""
"3882021","1","3882903","","2010-10-07 13:17:26","1","821","<p>Hey all,    I'm writing a little 3D engine for android to better learn the platform and opengl.  I hope to eventually use it as a base for little 3D games.  </p><p>I'm trying to implement lighting right now, and generally following the NeHe opengl android port tutorials.  I have a simple spinning cube and 1 light that should not change position.  Upon rendering my scene on a device the light appears to ""dim"" and re-lighten as cube rotates.</p><p>This is a swf video of the behavior:<a href=""http://drop.io/obzfq4g"" rel=""nofollow"">http://drop.io/obzfq4g</a></p><p>The code for my ""engine"" is located here: <a href=""http://github.com/mlasky/Smashout-Android-3D-Engine/"" rel=""nofollow"">http://github.com/mlasky/Smashout-Android-3D-Engine/</a></p><p>The relevant bits are:</p><p><a href=""http://github.com/mlasky/Smashout-Android-3D-Engine/blob/master/src/com/supernovamobile/smashout/SmashoutGLRenderer.java"" rel=""nofollow"">http://github.com/mlasky/Smashout-Android-3D-Engine/blob/master/src/com/supernovamobile/smashout/SmashoutGLRenderer.java</a><br>this is where I'm initializing opengl and setting up my scene.</p><p>and</p><p><a href=""http://github.com/mlasky/Smashout-Android-3D-Engine/blob/master/src/com/supernovamobile/smashout/SMMesh.java"" rel=""nofollow"">http://github.com/mlasky/Smashout-Android-3D-Engine/blob/master/src/com/supernovamobile/smashout/SMMesh.java</a>this is the code for actually rotating / drawing the cube mesh.</p><p>I wish I could formulate a better question; but I'm very stuck/confused and can't even think of an intelligent question to ask besides ""does anyone know what might cause the kind of behavior I'm seeing?""  </p><p>Thanks for any help you can provide.  </p><p>Edit: Also the slowness / choppyness of the animation in the video is a result of the screencap software.  It's smooth throughout the whole rotation on the emu.  </p>","1742702","","44729","","2010-10-07 14:31:39","2012-02-09 16:25:00","Issue with Android OpenGLES lighting","<android><3d><opengl-es><lighting>","2","2","","",""
"3882064","1","","","2010-10-07 13:24:09","24","68951","<p>I am working on Android Application. I want to have 4 buttons to be placed horizontally at the bottom of the screen. In these 4 buttons 2 buttons are having images on them. The border of the buttons should be black color and the border should be as thin as possible. When I click the button, I want the background of the button should be changed to blue color without the color of border to be changed and should be remained in that color for some time. How can I achieve this scenario in Android?</p>","429501","","1341006","","2012-11-20 11:05:33","2014-04-16 12:14:50","How to Change color of Button in Android when Clicked?","<android>","5","0","9","",""
"3882353","1","3883400","","2010-10-07 13:55:57","1","738","<p>I have a ListView where each item represents a podcast that can run up to 90 minutes.  Selecting an item will display a SeekBar and start streaming in the audio from a URL using MediaPlayer.</p><p>I could use some pointers on how to handle maintaining the state of the SeekBar after it scrolls off the page and then scrolled back into view.  I know that views are recycled and I've read that caching views in the adapter is a bad idea so I'm just wondering what other options there are.</p>","460887","","460887","","2010-10-07 15:46:15","2010-10-07 15:46:15","Updating SeekBar in ListView","<android>","1","0","","",""
"3882549","1","3883069","","2010-10-07 14:17:56","0","144","<p>I'm fairly new to object-oriented programming, and I'm really interested in learning it correctly. My problem is this:</p><p>I am trying to create a <code>TabActivity</code> which plots the user's data over time in each tab's content. Then only thing the tabs are going to control is the timespan of the graph. (i.e. one tab for 'past year', one for 'past month', one for 'all time', etc). As you can see, the layout used for each tab will be identical. The code used for each tab will only differ by a couple lines... (the starting and ending date of the x-axis).</p><p>I'm not sure how I can pull this off in a well-designed, object-o fashion. Any ideas?</p>","382252","","","","","2010-10-07 15:07:50","Using Android's TabActivity in an Object-oriented manner","<android><oop>","1","1","","",""
"3882562","1","3900279","","2010-10-07 14:19:16","0","418","<p>I have a my main.xml as a ViewFlipper which imports 5 views for my program. If I wrap the whole main.xml in GestureoverlayView I can detect gestures just fine with my listener, however, it displays the gesture on the screen.</p><p>I don't want the gestures shown i just want them detected so I tried applying the touch listener to the ViewFlipper but it simply doens't detect the gestures.</p><p>Is this because the ViewFlipper is hidden behind the 5 imported layouts that are displayed?</p><p>how do I apply the gesture detection to my app without having the OverlayView show the gestures on the screen?</p><p>Thanks</p>","353674","","","","","2010-10-10 12:28:40","Android gesture detect problem","<android><xml><view><gesture>","1","1","0","",""
"3882737","1","","","2010-10-07 14:34:05","1","651","<p>I'm aware that the home key cannot be caught, and I'm worried that a long-press on the Search key is another ""Android-OS protected"" key press.  Just for testing, I tried to catch all keys with this code within my Activity, but it does not stop the Google Voice Search dialog from being triggered.</p><pre><code>@Overridepublic boolean dispatchKeyEvent(KeyEvent event){    return true;}</code></pre><p><br><strong>Edit: I tested this code on the Nexus One, and it successfully blocks the key event on that phone, but I still have this problem on the Droid 2.  Both are running Froyo 2.2</strong></p>","411500","","411500","","2010-10-07 14:42:20","2010-11-10 23:45:19","Is there a way to catch the Search key so that the Google Voice Search dialog doesn't appear?","<android><keypress>","1","0","2","",""
"3882826","1","3883428","","2010-10-07 14:44:06","9","9454","<p>I'm using an xml defined animation to slide a view off the screen. The problem is, as soon as the animation completes it resets to its original position. I need to know how to fix this. Here's the xml:</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_interpolator""&gt;   &lt;translate android:fromXDelta=""0"" android:toXDelta=""-100%p"" android:duration=""500""/&gt;&lt;/set&gt;</code></pre><p>Here's the Java that I use to call it:</p><pre><code>    homeScrn = (View)findViewById(R.id.homescreen);    slideLeftOut = AnimationUtils.loadAnimation(this, R.anim.slide_left_out);    //Set Click Listeners For Menu    btnHelp.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            LayoutInflater.from(getApplicationContext()).inflate(R.layout.help, (ViewGroup)findViewById(R.id.subpage), true);            homeScrn.startAnimation(slideLeftOut);        }    });</code></pre><p>So basically what happens is I inflate a view underneath one. Then I animate the view on top off to the left. As soon as it gets off screen and the animation is finished it resets its position back.</p>","469219","","","","","2013-07-17 21:17:48","Android: Animation Position Resets After Complete","<android>","6","0","6","",""
"3882841","1","3887917","","2010-10-07 14:45:19","3","847","<p>I would like to run a custom shell script upon clicking <code>Build Project</code> in Eclipse. I tried modifying the ""compile"" section in build.xml, but my script is not getting run. Invoking <code>ant debug</code> on the commandline works, however.</p>","440093","","","","","2013-09-23 14:39:00","Android: How to hook into Eclipse Build Project?","<android><eclipse>","3","0","1","",""
"3882897","1","4479742","","2010-10-07 14:49:17","1","2289","<p>I need a fix for this strange problem appearing in android. Sometimes I notice that even I have full cellular network, data network is lost.(Not able to connect to internet although have all set properly). This possibly occurs after I leave wifi. A quick fix to make it working is toggle 2G/3G option in settings --> Mobile Networks, which probably clears the network stack and makes it all working.But for my application, which requires always to be connected to internet, I need a fix programatically. I cannot toggle that from code ? Or can I ?</p><p>I read and tried a fix by rewriting APN settings, but that do not solve the issue entirely, as we move out from wifi connectivity. Do anyone have any fix for this from code ?</p>","315619","","","","","2011-08-02 17:30:50","How to resolve mobile data connection(2G/3G/EDGE/GPRS) lost in android after coming out from wifi programatically?","<android>","2","1","","",""
"3882914","1","4177378","","2010-10-07 14:52:13","3","1250","<p>Hello I would like to get the cid from my cell phone , I am currently using this code to do that :</p><pre><code>GsmCellLocation gsmLocation = (GsmCellLocation)telephonyManager.getCellLocation();                 int Cid = gsmLocation.getCid();                 Log.e(""#############"",""current cid is: ""+Cid);                 int lac = gsmLocation.getLac();                 Log.e(""#############"",""current lac is: ""+lac);</code></pre><p>this returns something like 301 or 6061.</p><p>I was browsing some example codes and found this :</p><pre><code>/** * Seems that cid and lac shall be in hex. Cid should be padded with zero's * to 8 numbers if UMTS (3G) cell, otherwise to 4 numbers. Mcc padded to 3 * numbers. Mnc padded to 2 numbers. */try { // Update the current location updateLocation(getPaddedHex(cid, cellPadding), getPaddedHex(lac, 4),   getPaddedInt(mnc, 2), getPaddedInt(mcc, 3)); strResult = ""Position updated!"";} catch (IOException e) { strResult = ""Error!\n"" + e.getMessage();}// Show an info Toast with the results of the updateLocation// call.Toast t = Toast.makeText(getApplicationContext(), strResult,  Toast.LENGTH_LONG);t.setGravity(Gravity.CENTER_VERTICAL, 0, 0);t.show();}});}/** * Convert an int to an hex String and pad with 0's up to minLen. */String getPaddedHex(int nr, int minLen) {  String str = Integer.toHexString(nr);  if (str != null) {   while (str.length() &lt; minLen) {    str = ""0"" + str;   }  }  return str; } /**  * Convert an int to String and pad with 0's up to minLen.  */ String getPaddedInt(int nr, int minLen) {  String str = Integer.toString(nr);  if (str != null) {   while (str.length() &lt; minLen) {    str = ""0"" + str;   }  }  return str; }</code></pre><p>Isn't the number from the GsmCellLocation correct or I need to alter the results as shown in the example?what is the difference? I know from the documentation that the cid could be -1 (unknown) or  0xffff max value, the 0xffff is for 2g or 3g networks? </p><p>regards maxsap.</p>","234898","","47527","","2010-11-16 17:00:12","2010-11-16 17:00:12","android cell id question","<android>","1","0","2","",""
"3882918","1","3885559","","2010-10-07 14:52:48","7","9381","<p>I'm totally new to Android.</p><p>I would like to put in a textbox where user can enter an IP address ... but how do I limit the user to only enter numbers? ... and how do I validate?</p><p>Is there a ready-made-ip-address-textbox ""out there"" I can use?</p><p>Thanks!</p><p>Mojo</p>","469230","","","","","2013-03-06 23:08:17","IP address textbox in Android?","<android>","5","0","2","",""
"3882992","1","","","2010-10-07 14:59:52","0","2771","<p>Currently I am attempting to change the drawable image of the Thumb of a seekbar in android.  In the onCreate() method I am able to effectively change the thumb using the following </p><pre><code>mSeekBar.setThumb(myDrawable);</code></pre><p>However, after the onCreate method is called, I attempt to change it again using a different drawable with the same method and the thumb disappears.  The api description is 'Sets the thumb that will be drawn at the end of the progress meter within the SeekBar.'  Does this mean that the image will be drawn off screen (if i 'fill_parent' with my seekbar)?  I have tried changing the offset with no avail, has anyone else run into this issue?  Or know how to change the thumb image while the progress is changing?</p><p>I also should mention that I am setting my background drawable for the seekbar to a blank xml file (i.e. to not have a background image).</p>","251849","","","","","2011-10-12 08:18:43","How can I change the Android SeekBar Thumb drawable after 'onCreate' method?","<android><seekbar><thumb>","1","1","","",""
"3883091","1","3883172","","2010-10-07 15:11:34","2","538","<p>Is their a way to put a POJO inside the intent.putExtra?</p><p>I have looked into the API's and it only seems to support of type string, int, double, boolean etc but not a actual POJO/regular java object.</p>","444668","","881229","","2013-11-04 06:40:44","2013-11-04 06:40:44","Send an android Intent with an POJO as an Intent extra?","<java><android>","2","0","","",""
"3883211","1","4336013","","2010-10-07 15:25:26","11","7104","<p>I have some large files (images and video) which I need to store in a content provider.The android documentation indicates...</p><blockquote>  <p>If you are exposing byte data that's  too big to put in the table itself —  such as a large bitmap file — the  field that exposes the data to clients  should actually contain a content: URI  string. This is the field that gives  clients access to the data file. The  record should also have another field,  named ""_data"" that lists the exact  file path on the device for that file.  This field is not intended to be read  by the client, but by the  ContentResolver. The client will call  ContentResolver.openInputStream() on  the user-facing field holding the URI  for the item. The ContentResolver will  request the ""_data"" field for that  record, and because it has higher  permissions than a client, it should  be able to access that file directly  and return a read wrapper for the file  to the client.  --  <a href=""http://developer.android.com/guide/topics/providers/content-providers.html#creating"">http://developer.android.com/guide/topics/providers/content-providers.html#creating</a></p></blockquote><p>I am having some difficulty finding an example.In particular I wish to use the bitmap in the context an ImageView.Consider the following code quasi-code (it doesn't work)...</p><pre><code>ImageView iv = ....String iconUri = cursor.getString(cursor.getColumnIndex(Table.ICON));iv.setImageURI(Uri.parse(iconUri));</code></pre><p>Observations/Problems...</p><ol><li>How can the stored/recovered uri be reconstructed correctly? (it is text in the table)</li><li><p>The setImageURI implementation makes use of the content resolve openInputStream so this should work. </p><pre><code>String scheme = mUri.getScheme();...} else if (ContentResolver.SCHEME_CONTENT.equals(scheme)        || ContentResolver.SCHEME_FILE.equals(scheme)) {  try {    d = Drawable.createFromStream(            mContext.getContentResolver().openInputStream(mUri),            null);</code></pre><p>--frameworks/base/core/java/android/widget/ImageView.java</p></li></ol><p>I got it working.I took a hint from the MediaStore and MediaProvider.The files which contain the data are named based on the content provider (directory), the column name, the row id and the media type.The content resolver then acquires the file descriptor like so...</p><pre><code>Uri iconUri = Uri.withAppendedPath(Table.getUri(cursor), Table.ICON);ib.setImageURI(iconUri);</code></pre><p>...and the content provider responds in kind...</p><pre><code>@Overridepublic ParcelFileDescriptor openFile (Uri uri, String mode) {int imode = 0;if (mode.contains(""w"")) imode |= ParcelFileDescriptor.MODE_WRITE_ONLY;if (mode.contains(""r"")) imode |= ParcelFileDescriptor.MODE_READ_ONLY;if (mode.contains(""+"")) imode |= ParcelFileDescriptor.MODE_APPEND;List&lt;String&gt; pseg = uri.getPathSegments();if (pseg.size() &lt; 3) return null;try {    File filePath = filePathFromRecord(pseg.get(2), pseg.get(1));    return ParcelFileDescriptor.open(filePath, imode);} catch (FileNotFoundException e) {    e.printStackTrace();}return null;}</code></pre>","345427","","56338","","2010-11-13 04:32:44","2013-02-17 10:05:52","How to store large blobs in an android content provider?","<android><inputstream><android-contentprovider><android-contentresolver>","3","1","9","",""
"3883246","1","3883369","","2010-10-07 15:29:31","3","3247","<p>i'm currently working on an app for the android os that requires to fetch data from a remote server from time to time.</p><p>as this ""update"" should be carried out even when the actual frontend app is not running, i implemented a remote service that is started on system boot. now i need to schedule a timer to start the update.</p><p>is the ""Timer""-class the right one for this job? and if ""yes"": what is the difference between a ""normal"" Timer() and one started as a ""daemon"" by Timer(true)?</p><p><a href=""http://developer.android.com/reference/java/util/Timer.html"" rel=""nofollow"">http://developer.android.com/reference/java/util/Timer.html</a> isn't very helpful with this :(</p><p>EDIT:</p><p>ok - i see there are much more methods to do this than i expected. to clarify:</p><ul><li>i want to execute some code at a time that is specified.</li><li>this timer is used to trigger the execution of code 7 days in the future. (i.e., every week at a given weekday and time)</li><li>the code should run WITHOUT waking the phone up if it is ""sleeping"" (screen dimmed).</li><li>when running the code, no activity should be started. i.e. no app pops up on the screen.</li><li>the code that is executed should fetch some data from the internet. if at this time no internet connection is available, the timer should be set to sth like 30 minutes and then try again.</li><li>after completing the code execution, the timer will be set for the next interval which will be 7 days later.</li><li>the timer should be started at system boot, e.g., if i reboot the phone, the timer should determine the next date to execute the code and schedule the timer. this has to work without ANY user interaction!</li><li><p>when ""sleeping"", the thread/service/timer/whatsoever should not consume any system resources if possible...</p></li><li><p>what i need is pretty much a simple unix cronjob.</p></li></ul><p>i think anyone here knows ""newsrob"" for android? what i want to realize is pretty much the same as the newsrob-updateservice.</p>","370969","","370969","","2010-10-07 17:13:43","2010-10-07 17:13:43","how to schedule some code execution in android or: what exactly are daemon threads in android?","<java><android><service><timer><daemon>","2","1","3","",""
"3883391","1","4048386","","2010-10-07 15:45:05","0","307","<p>Processing has Android support and it seems to be pretty awesome from my 10 minutes of playing with it.  But I would like to make a regular (nongraphics) application like a twitter feed reader or something.  So is there something like Processing that can do regular apps?  Besides Titanium...</p><p>Basically I am looking for anything that will make coding for android easier, processing was so easy to get working that I was very happy with it, but it is for graphics only.  Titanium didn't give me the same wow factor and it isn't open so that kind of takes away from it.  What other tools are out there?</p>","22763","","22763","","2010-10-07 18:53:03","2010-10-29 01:37:14","Processing for Android and regular input apps","<java><android><processing>","2","4","","",""
"3883454","1","3884286","","2010-10-07 15:53:19","0","1316","<p>I have a ListView that I'm binding to an adapter.  The adapter is a protected member of my main class.  I have a listener thread that receives data and updates the source list for my adapter.  When I call the adapter's notifyDataSetChanged() method, an exception is thrown:</p><p>Runtime Exception: PhoneLayoutInflater(LayoutInflater).inflate(int, ViewGroup, boolean) line: 322</p><p>I've read that the notifyDataSetChanged() method has to be called on the UI thread, and I'm doing that.  In fact, just to be sure, I even update the ListView's data source on the UI thread.  All I do in my listener thread is update a protected member that houses the data.  Here's an example of what I'm doing (note that I don't have the part of the code that calls the AsyncTask, but it's fired from a listener):</p><pre><code>public class main extends Activity() { protected LinkedList&lt;HashMap&lt;String, String&gt;&gt; adapterDataList = new LinkedList&lt;HashMap&lt;String, String&gt;&gt;(); protected MyDataObject dataObject; protected SimpleAdapter dataAdapter; @Override public void onCreate(Bundle savedInstanceState) {     //call parent oncreate     super.onCreate(savedInstanceState);  //display the main form  setContentView(R.layout.main);  //get a handle on the score list view elements  ListView dataList = (ListView)(findViewById(R.id.datalist));  //link the adapter and the data source  dataAdapter = new SimpleAdapter(this, adapterDataList, R.layout.row, new String[]{""name"",""address""}, new int[]{R.id.username,R.id.address});  dataList.setAdapter(dataAdapter); } protected void refreshData() {  adapterDataList.clear();  Iterator&lt;MyData&gt; iter = MyDataObject.iterator();  while(iter.hasNext()) {   HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;()   item.put(""name"", iter.name);   item.put(""address"", iter.address);   adapterDataList.add(item);  }  dataAdapter.notifyDataSetChanged(); } private class DataTask extends AsyncTask&lt;Data, Void, Data&gt; {  protected void onPostExecute(Data data) {   dataObject = data;   runOnUiThread (new Runnable() { public void run() {    refreshScores();   }});  } } ...}</code></pre><p>Does anyone have any pointers or ideas as to why I'm getting this exception?  Any help is much appreciated.</p><p><strong>edit</strong> Here are the layout files, as requested: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""    xmlns:ptl=""http://schemas.android.com/apk/res/com.mod0.pubtrivialive""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:id=""@+id/datalistcontainer""&gt;    &lt;ListView android:id=""@+id/datalist""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>row.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""horizontal""  android:paddingBottom=""6dip""  android:paddingTop=""4dip""&gt;  &lt;TextView android:id=""@+id/name""  android:layout_width=""80dip""  android:layout_height=""wrap_content"" /&gt;  &lt;TextView android:id=""@+id/address""  android:layout_height=""wrap_content""  android:layout_weight=""1"" /&gt;&lt;/LinearLayout&gt;</code></pre>","443862","","443862","","2010-10-07 17:54:59","2010-10-07 17:54:59","Calling notifyDataSetChanged() throws exception","<java><android><adapter>","1","3","","",""
"3883564","1","3883601","","2010-10-07 16:04:29","2","1191","<p>I would like to create a zip file from files located on the sd card, I have managed to do that using java but I think that the result is too slow, so I thought of going native using the android NDK.</p><p>My questions are: </p><p>Does anyone know any C/C++ library to zip unzip files that will work on android?</p><p>How to know if the library will work on android?</p><p>will this make any difference on performance?</p><p>reagrds maxsap</p>","234898","","","","","2010-10-08 05:19:17","android how to make native zip application","<android>","3","1","","",""
"3883793","1","3883969","","2010-10-07 16:36:03","1","991","<p>I have follow an example of an opengl application and I don't know why is this thing happening...</p><p>I have a GLSurfaceView with it's corresponding renderer drawing a triangle. But, instead of getting the whole view on screen, I have just the upper half, and it's also duplicated as you can see on the picture. I'm using a Nexus One<img src=""http://i.stack.imgur.com/fQnJm.png"" alt=""alt text""></p><p>the xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.forgottenprojects.geoturista.DrawingLayer     xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/drawing""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""/&gt; </code></pre><p>The activity has this in the manifest:</p><pre><code>android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""</code></pre><p>The DrawingLayer class:</p><pre><code>public class DrawingLayer extends GLSurfaceView {private TriangleRenderer renderer;private Context context;public DrawingLayer(Context context, AttributeSet attrs) {    super(context, attrs);    init(context);}public DrawingLayer(Context context) {    super(context);    init(context);}private void init(Context c){    this.context = c;    setEGLConfigChooser(false);    this.renderer = new TriangleRenderer(c);    setRenderer(renderer);    setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);    getHolder().setFormat(PixelFormat.TRANSLUCENT);}}</code></pre><p>The triangle renderer (most of it from Apress Pro Android 2 book)</p><pre><code>public class TriangleRenderer implements Renderer {private final static int VERTS = 3;private FloatBuffer mFVertexBuffer;private ShortBuffer mIndexBuffer;  TriangleRenderer(Context context)  {      ByteBuffer vbb = ByteBuffer.allocateDirect(VERTS * 3 * 4);      vbb.order(ByteOrder.nativeOrder());      mFVertexBuffer = vbb.asFloatBuffer();      ByteBuffer ibb = ByteBuffer.allocateDirect(VERTS * 2);      ibb.order(ByteOrder.nativeOrder());      mIndexBuffer = ibb.asShortBuffer();      float[] coords = {      -0.5f, -0.5f, 0, // (x1,y1,z1)      0.5f, -0.5f, 0,      0.0f, 0.5f, 0      };      for (int i = 0; i &lt; VERTS; i++) {          for(int j = 0; j &lt; 3; j++) {              mFVertexBuffer.put(coords[i*3+j]);          }      }      short[] myIndecesArray = {0,1,2};      for (int i=0;i&lt;3;i++)      {          mIndexBuffer.put(myIndecesArray[i]);      }      mFVertexBuffer.position(0);      mIndexBuffer.position(0);  }  protected void draw(GL10 gl)  {      gl.glColor4f(1.0f, 0, 0, 0.5f);      gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFVertexBuffer);      gl.glDrawElements(GL10.GL_TRIANGLES, VERTS,      GL10.GL_UNSIGNED_SHORT, mIndexBuffer);  } @Overridepublic void onSurfaceCreated(GL10 gl, EGLConfig config) {     gl.glDisable(GL10.GL_DITHER);     gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);     gl.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);     gl.glShadeModel(GL10.GL_SMOOTH);     gl.glEnable(GL10.GL_DEPTH_TEST);}@Overridepublic void onDrawFrame(GL10 gl) {    gl.glDisable(GL10.GL_DITHER);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glClearColor(1.0f, 0.5f, 0.7f, 1.0f);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glLoadIdentity();    GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1f, 0f);    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    draw(gl);}@Overridepublic void onSurfaceChanged(GL10 gl, int width, int height) {    gl.glViewport(0, 0, width, height);    gl.glMatrixMode(GL10.GL_PROJECTION);    float ratio = (float)width / (float)height;    gl.glLoadIdentity();    gl.glFrustumf(-ratio, ratio, -1, 1, 3, 7);}}</code></pre><p>Thanks in advance!</p>","366253","","125389","","2013-01-02 22:21:02","2014-01-06 06:52:29","Android OpenGL only renders half the screen","<android><opengl-es><glsurfaceview><nexus-one>","3","0","","",""
"3883968","1","","","2010-10-07 16:57:46","-1","277","<p>Is it possible to initiate an outgoing call without having the phone invoke it's default dialing screen?  The point is to be able to make a call without someone knowing I'm making a call.</p>","467085","","","","","2011-02-26 21:44:19","Suppressing/hiding/overriding Android call UI","<android>","1","2","","",""
"3883980","1","","","2010-10-07 16:59:03","0","1914","<p>the app i am currently building needs to perform a login with username and password. I am using the DefaultHttpClient to execute the request and setting the username and password as credentials.the server expects a htacces-login.The Result i get is not the Logintoken i hoped for. Instead it returns an Errormessage.Can anybody tell me where i went wrong in my Code?Thank you so much for your help!pr</p><pre><code>private String httpLoginRequest() {    String loginToken = null;    String loginUrl = ""https://somedomain.com/login"";    DefaultHttpClient client = new DefaultHttpClient();    client.getCredentialsProvider().setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT), new UsernamePasswordCredentials(""username"", ""password""));    HttpResponse httpResponse;    HttpEntity entity;    try{        httpResponse = client.execute(request);        entity = httpResponse.getEntity();        if (entity != null) {            InputStream instream = entity.getContent();            loginToken = convertInputStreamToString(instream);        }    } catch (ClientProtocolException e) {        client.getConnectionManager().shutdown();        e.printStackTrace();    } catch (IOException e) {        client.getConnectionManager().shutdown();        e.printStackTrace();    }    return loginToken;}</code></pre><p>Thank you guys so much for your help. I finally figured it out. It was a mix of different things:1. what you cant see in the code above (because i removed it by accident) is that the request is post. our api expects a get request though i was told otherwise2. i put the credentials in the wrong place. they have to be set in the HttpGet-Object as in the Exampe given by CommonsWare3. i actually do have to encode the credentials with base64 mentioned by you</p><p>here is the code that finally worked for me:</p><pre><code>public String httpLoginRequest() {    String loginToken = null;    String loginUrl = ""https://somedomain.com/login"";    //    DefaultHttpClient client = new DefaultHttpClient();    HttpResponse httpResponse;    HttpEntity entity;    HttpGet request = new HttpGet(loginUrl);    request.addHeader(""Authorization"", ""Basic "" + Base64.encodeCredentials(""username"", ""password""));    try{        httpResponse = client.execute(request);        entity = httpResponse.getEntity();        if (entity != null) {            InputStream instream = entity.getContent();            loginToken = convertInputStreamToString(instream);            Log.d(LOG_TAG, ""Login Token: "" + loginToken);        }    } catch (ClientProtocolException e) {        client.getConnectionManager().shutdown();        e.printStackTrace();    } catch (IOException e) {        client.getConnectionManager().shutdown();        e.printStackTrace();    }    return loginToken;}</code></pre><p>When i find the time i will try the example given in the answer as i looks a lot more like what i will need for some other requests in my project.</p>","457378","","457378","","2010-10-08 10:06:07","2010-10-08 10:06:07","Login with HTTPS to htaccess protected directory","<java><android><authentication><.htaccess><https>","1","2","","",""
"3883983","1","3884007","","2010-10-07 16:59:35","1","1714","<p>I tried to retrieve Cid and Lac for currently connected cell, but using</p><pre><code>public void GetCid(){  int CID;  int LAC;  GsmCellLocation xXx = new GsmCellLocation();  CID = xXx.getCid();  LAC = xXx.getLac();  Toast output = Toast.makeText(getApplicationContext(), ""Base station LAC is ""+LAC+""\n""   +""Base station CID is "" +CID, Toast.LENGTH_SHORT);  output.show();}</code></pre><p>The only thing I get is -1 value for both parameters (I am on 2G). May be I do something wrong or there is another way to get Cid and Lac of current cell?</p>","458024","","","","","2012-04-12 12:02:21","Can not retrieve CellID and LAC for the current cell","<java><android><cellid>","1","0","","",""
"3883989","1","","","2010-10-07 17:00:44","0","771","<p>I am working on Android. I try inside a terminal executejava -jar hierarchyviewer.java </p><p>And I have this error</p><p>11:46:48 E/adb: Failed to get the adb version: Cannot run program ""adb"": CreateProcess error=2, the system cannot find the file specified</p><p>I can run the hierarchyviewer.jar from /tools/lib (double click) I can see the graphic interface but it does not show anything, I cannot see the tree and stuff. I am using Windows 7, 64 bit and I am executing the emulator and/or the device before running hierarchyviewer.</p><p><a href=""http://developer.android.com/guide/developing/tools/hierarchy-viewer.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/hierarchy-viewer.html</a></p>","469370","","201078","","2011-07-01 14:51:30","2011-07-01 14:51:30","Run Hierarchy Viewer on W7(doesn't work)","<android>","1","0","","",""
"3884082","1","3884508","","2010-10-07 17:12:33","0","1627","<p>I have <a href=""http://developer.android.com/reference/android/widget/PopupWindow.html"" rel=""nofollow"">PopupWindow</a>, which I'd like to place in the center of the screen. However, I only have access to the <a href=""http://developer.android.com/reference/android/inputmethodservice/KeyboardView.html"" rel=""nofollow"">KeyboardView</a> (since I'm implementing an <a href=""http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html"" rel=""nofollow"">IME</a>) at the bottom of the screen and whenever I center my <code>PopupWindow</code> by using the <code>KeyboardView</code> and <code>Gravity.CENTER</code> it is of course only centered above the keyboard, but not in the whole screen.</p><p>Is there a way to get the whole screen as an anchor view?</p>","184367","","","","","2010-10-07 18:06:28","Android: PopupWindow.showAtLocation(anchorView) -> how to get the whole screen as a anchorView?","<android><popupwindow>","1","0","","",""
"3884362","1","3884395","","2010-10-07 17:51:10","13","14123","<p>I'm trying to use multi-touch in an Android 2.0 app.  How can I simulate this with an emulator using Eclipse?  I can only seem to get the mouse to do one touch at a time.</p>","321594","","31671","","2012-08-09 07:06:49","2012-09-26 08:47:24","How to test multi-touch in Android Emulator","<android><multi-touch>","4","0","2","2013-02-28 15:43:28",""
"3884575","1","","","2010-10-07 18:14:01","0","274","<p>i am doing a debug key and i can't. Im stuck here:</p><p>""Once you have located the keystore, use this Keytool command to get the MD5 fingerprint of the debug certificate:</p><p>$ keytool -list -alias androiddebugkey \-keystore .keystore \-storepass android -keypass android""</p><p>i located my keystore, but i dont know how to put that order.... i think that order is for linux, and i am using windows XP Professional</p><p>can someone help me plz?</p>","462055","","245205","","2010-10-07 18:48:22","2011-05-08 14:47:05","Googlemaps API: problems getting my key","<android><api><google-maps>","1","0","","",""
"3884580","1","3896901","","2010-10-07 18:15:30","0","787","<p>                                                                                  </p><pre><code>&lt;item android:state_focused=""true"" &gt;     &lt;shape&gt;         &lt;gradient             android:endColor=""#FF9900""             android:startColor=""#FF9966""             android:angle=""270"" /&gt;         &lt;stroke             android:width=""3dp""             android:color=""#CCCCCC"" /&gt;         &lt;corners             android:radius=""3dp"" /&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=""#FFFFFF""             android:startColor=""#FFFFFF""             android:angle=""270"" /&gt;         &lt;stroke             android:width=""1dp""             android:color=""#666666"" /&gt;         &lt;corners             android:radius=""1dp"" /&gt;         &lt;padding             android:left=""3dp""             android:top=""3dp""             android:right=""3dp""             android:bottom=""3dp"" /&gt;     &lt;/shape&gt; &lt;/item&gt; </code></pre><p> The above is the code I have written for filling borders of Button with black color.The same code I was using for 3 buttons by setting as background.Now, when I click button1, red color appears and goes when I  releases. But I want Red color to be visible, until I press next button. Though I release Button1 after press, Red color should be visible. But Red color should only disappear when I press any other button.<br>  Can anyone help me in solving this  issue?<br>Please anyone help me in sorting out this issue? <br>Thanks  in Advance,</p>","429501","","429501","","2010-10-08 08:31:52","2010-10-09 16:40:03","Button color should not change when I release the button in Android","<android>","2","1","","",""
"3884671","1","","","2010-10-07 18:28:07","0","978","<p>I'm developing an android app using Eclipse.  I export the app using the Export Android App function.  I sign and align the resulting apk file.  I then copy this apk to a webserver and try to install it on my phone.  It goes though the installation steps, and when I test the app it does not contain my latest changes.  It seems to install one of my previous builds.</p><p>Is the problem in:- the way I create the apk?- a cache on the phone that has not been cleared?</p><p>How do I get Eclispe to make a current apk, and how do I get my phone to install it?</p><p>How can I verify which version of my code is in a particular apk file?</p><p>Thanks,Gerry</p>","321594","","","","","2010-10-08 05:10:19","why won't apk file update","<android><apk><android-install-apk>","2","1","","",""
"3884757","1","3884838","","2010-10-07 18:38:01","1","347","<p>I wish to have a single class which all of my <code>Activity</code> classes extend.  I have <code>ListActivities</code>, <code>Activities</code>, <code>MapActivities</code>, <code>TabActivities</code>, etc in my App.</p><p>I have many of these different activities in my app, ~12 activities.  I want each of them to have the methods which are in the parent class.</p><p>Right now, i have created 4 parent activity classes which are extended from a certain activity depending on their type(<code>ListActivity</code>, <code>Activity</code>, <code>MapActivity</code>, <code>TabActivity</code>)</p><p>I am creating a lot of redundant code - each of the 4 parent activities has almost identical code, in exception for what class activity it extends.</p><p>Here is an example that may clarify what my problem is:</p><ul><li>I have an <code>Activity</code>: <code>MenuScreen</code> which extends <code>BaseListActivity</code>  </li><li><code>BaseListActivity</code> extends <code>ListActivity</code></li><li><p><code>BaseListActivity</code> contains methods and fields which i want all my activities to have access to</p></li><li><p>I have another <code>Activity</code>: <code>HomeScreen</code> which extends <code>BaseActivity</code></p></li><li><code>BaseActivity</code> extends <code>Activity</code></li><li><code>BaseActivity</code> contains the same methods and fields which are in my other <code>Base[&lt;type&gt;]Activity</code> classes(such as <code>BaseListActivity</code>)</li></ul><p>these methods/fields are copy-pasted to all my <code>Base[&lt;type&gt;]Activity</code>, and seems awfully redundant to me.</p><p>Can i create a master activity class which all types of Activity classes can use as its parent?  if not, am i stuck with copy and pasting this code and feeling gross/dirty about it?</p>","416412","","115145","","2010-10-07 18:47:53","2010-10-07 18:49:29","Can I create a single class which can be the parent for every type of Activity?","<java><android><inheritance>","2","0","","",""
"3884890","1","3888099","","2010-10-07 18:55:23","0","761","<p>I need to create a screen(scrollable) exactly similar to the screenshot shown<a href=""http://www.4shared.com/dir/ItI2F9kx/sharing.html"" rel=""nofollow"">here</a>  . I have no idea regarding the kind of layout patterns that I should resort to or the widgets that I should use.</p><p>The data including thumbnail links, is available dynamically.</p><p>Experts, kindly help with your valuable suggestions, advices and help.</p><p>Looking forward,Regards,Rony</p>","264953","","","","","2010-10-08 17:28:15","Help needed for creating an Android Activity Layout - Screenshot given","<android><android-widget><android-layout><android-listview><android-lazyloading>","4","0","","",""
"3884918","1","3885706","","2010-10-07 18:58:18","1","1564","<p>I have class for showing custom dialog</p><pre><code>public class Add_Category_Dialog {public  String inputed_value;private Context context;public Add_Category_Dialog(Context context){    this.context=context;}public void showDialog(){       AlertDialog.Builder alert = new AlertDialog.Builder(context);         alert.setTitle(""Title"");         alert.setMessage(""Message"");         final EditText input = new EditText(context);         alert.setView(input);         alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {         public void onClick(DialogInterface dialog, int whichButton) {         inputed_value = input.getText().toString();           }         });         alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {         public void onClick(DialogInterface dialog, int whichButton) {             return;         }        });        alert.show();  }</code></pre><p>}</p><p>Calling from main activity:</p><pre><code> @Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId()){    case R.id.add_category_item:        Add_Category_Dialog add_dialog=new Add_Category_Dialog(getBaseContext());        add_dialog.showDialog();        addCategory(add_dialog.inputed_value);        return true;    }    return false;}</code></pre><p>When running in emulator runtime error occures, LogCat:</p><p>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</p><p><strong>UPD</strong> Now I have sqlite error code 19, constraint failed</p><pre><code> private void addCategory(String string){    SQLiteDatabase db=recipes.getWritableDatabase();    ContentValues values=new ContentValues();    values.put(CATEGORY_NAME, string);    db.insertOrThrow(CATEGORY_TABLE, null, values);}</code></pre>","468311","","468311","","2010-10-08 14:58:18","2010-10-08 14:58:18","Android input dialog","<android><sqlite><input><dialog>","1","0","","",""
"3885074","1","3885181","","2010-10-07 19:15:41","0","1078","<p>When clicking an email address from a browser or contacts app...</p><p>Is there any way for my app to show a mail client in the intent list?</p>","463304","","463304","","2010-10-07 20:15:27","2010-10-07 20:56:48","Make my activity one of the mail apps shown in the intent chooser","<android><android-intent>","2","2","0","",""
"3885077","1","3886424","","2010-10-07 19:15:55","3","8788","<p>I'm having trouble finding exactly the syntax I need to use to set the paramters on child views of a relative layout. I have a root relative layout that I want to set 2 child textviews next to each other like this</p><pre>---------- ---------| Second | | First |---------- ---------</pre><p>So I have </p><pre><code>public class RL extends RelativeLayout{    public RL(context){        TextView first = new TextView(this);        TextView second = new TextView(this);        first.setText('First');        first.setId(1);        second.setText('Second');        second.setId(2);        addView(first, new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,    LayoutParams.WRAP_CONTENT,     LayoutParams.ALLIGN_PARENT_RIGHT ???);        addView(first, new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,    LayoutParams.WRAP_CONTENT,     LayoutParams.ALLIGN_RIGHT_OF(first.getId()) ???);    }}</code></pre><p>How do I set the relative alignments?</p>","375874","","29995","","2012-05-05 15:32:46","2012-05-05 15:32:46","Setting parameters on child views of a RelativeLayout","<android><android-layout><relativelayout>","2","0","2","",""
"3885100","1","3885492","","2010-10-07 19:19:05","1","1711","<p>I attempted to use a SeekBar for the first time, and I was disappointed with the results. I have an app that needs to use a slider to cover 80 spots. I want the user to be able to move in .5 increments (i.e. 10.5, 11.0). My max range is 40, which is why I doubled it to 80 to account for the decimals.</p><p>Everything worked, but when I put it on my Droid, the performance was terrible in my opinion. When trying to stop on 21.5, the slider usually stopped at 22.0 or 22.5, and I had to take extra time to try and inch it over. Other times I would try to select the slider and it was unresponsive. I'm not as concerned about the unresponsiveness, but I can not put the SeekBar in my app if it requires the user to have exact precision to hit a certain spot.</p><p>Is there anything that I can do to adjust the SeekBar so that it is easy to hit the number you are trying to land on without difficulty? I'm not sure if the problem is occurring because my SeekBar contains a large amount of possible values, and with screen size limited this forces the numbers to be smashed closer together? Or if this is just the way it behaves in general. </p><p>If there isn't a good way to adjust the sensitivity, is there a good alternative that I can use that provides similar functionality?</p>","449070","","","","","2012-02-04 19:15:26","How Can I Adjust Android SeekBar Sensitivity","<android><seekbar>","2","0","","",""
"3885152","1","","","2010-10-07 19:24:13","2","4986","<p>Question:I have found that java.net.URI has a create(String uri) option but the android.net.uri does not. </p><p>More Specific:I am trying to grab the output of RingtoneManager's RingtonePicker and set it as the default ringtone with SetActualDefaultRingtoneUri;</p><p>Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_RINGTONE); intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TITLE, ""Select Tone For Rainy Days""); startActivityForResult(intent, 0);</p><p>RingtoneManager.setActualDefaultRingtoneUri(this,RingtoneManager.TYPE_RINGTONE,RingtoneManager.EXTRA_RINGTONE_PICKED_URI);</p><p>Problem being that ,RingtoneManager.EXTRA_RINGTONE_PICKED_URI returns a string not a uri.There might be a better way than to convert the string to a Uri. I cannot find a reason why java.net.URI can do it and android.net.Uri can't.</p><p>Any suggestions would be appreciated! </p><p>Thanks</p>","469506","","","","","2011-09-01 23:15:27","How to convert a String to an android.net.Uri","<android><string><uri>","2","1","","",""
"3885164","1","3885343","","2010-10-07 19:25:18","11","9649","<p>I am trying to consistently use the same dimension in all the views in my android app (e.g., a left margin of 20dp). If I were using HTML, I would simply use a CSS file, but I am at a loss of how to do this on Android.</p><p>Is there a way I can store this value in a xml file inside res/values and then use it in layouts?</p><p>e.g., I thought of storing them in strings.xml like</p><pre><code>&lt;string name=""app_wide_left_padding""&gt;20dp&lt;/string&gt;</code></pre><p>and then using the following text in layout.xml</p><pre><code>android:paddingLeft=""@string/app_wide_left_padding""</code></pre><p>but I am not sure it will work. Am I on the right track?</p><p>Thanks in advance for your answers.</p>","20386","","","","","2010-10-08 09:04:42","Storing dimensions in xml file in Android","<android><css><xml><layout>","2","0","1","",""
"3885244","1","3885813","","2010-10-07 19:37:22","0","5689","<p>I'm looking to make an ImageButton that contains an animation drawable, more precisely the repetitive tweened animation of a progressbar spinner (like the view/widget that exists for this).</p><p>In xml I specified this for the ImageButton in the activity's layout:</p><pre><code>&lt;ImageButton android:id=""@+id/i_back_cover"" android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" android:scaleType=""centerInside""     android:gravity=""center"" android:layout_weight=""1"" android:adjustViewBounds=""true""     android:src=""@anim/progress_large""&gt; &lt;/ImageButton&gt;</code></pre><p>The ""progress_large"" animation is in res/anim/:</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""    android:interpolator=""@android:anim/linear_interpolator""&gt;    &lt;rotate        android:drawable=""@drawable/spinner_black_76""        android:pivotX=""50%""        android:pivotY=""50%""        android:fromDegrees=""0""        android:toDegrees=""350""        android:duration=""1200"" /&gt;&lt;/set&gt;</code></pre><p>I set <code>toDegrees</code> to 350 for now, to make sure it would rotate. <code>spinner_black_76</code> is just an image.</p><p>When I open the activity having this layout, the app crashes before displaying. </p><p>Weird, there's no actual stacktrace in the log, just a killed VM if I'm right (I hardly can believe this myself):</p><pre><code>10-07 21:16:18.467: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.EDIT dat=content://net.lp.collectionista.products/items/book/1 cmp=net.lp.collectionista/.ui.activities.items.book.BookItemEditWindow }10-07 21:16:18.687: DEBUG/AndroidRuntime(636): Shutting down VM10-07 21:16:18.687: WARN/dalvikvm(636): threadid=1: thread exiting with uncaught exception (group=0x4001d800)10-07 21:16:18.687: DEBUG/FlurryAgent(636): Ending session10-07 21:16:18.977: DEBUG/dalvikvm(636): GC_FOR_MALLOC freed 3876 objects / 597200 bytes in 98ms10-07 21:16:19.007: WARN/ActivityManager(59):   Force finishing activity net.lp.collectionista/.ui.activities.items.book.BookItemEditWindow10-07 21:16:19.016: WARN/ActivityManager(59):   Force finishing activity net.lp.collectionista/.ui.activities.collections.book.BookCollectionViewWindow10-07 21:16:19.507: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{43fec528 net.lp.collectionista/.ui.activities.items.book.BookItemEditWindow}10-07 21:16:21.437: INFO/Process(636): Sending signal. PID: 636 SIG: 910-07 21:16:21.487: INFO/ActivityManager(59): Process net.lp.collectionista (pid 636) has died.10-07 21:16:21.517: INFO/WindowManager(59): WIN DEATH: Window{4400f330 net.lp.collectionista/net.lp.collectionista.ui.activities.CollectionsListWindow paused=false}10-07 21:16:21.517: INFO/WindowManager(59): WIN DEATH: Window{43fc89d0 net.lp.collectionista/net.lp.collectionista.ui.activities.collections.book.BookCollectionViewWindow paused=true}10-07 21:16:21.667: INFO/UsageStats(59): Unexpected resume of com.android.launcher while already resumed in net.lp.collectionista10-07 21:16:21.727: WARN/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 636 uid 1003410-07 21:16:27.237: DEBUG/dalvikvm(278): GC_EXPLICIT freed 32 objects / 1616 bytes in 81ms10-07 21:18:14.047: DEBUG/AndroidRuntime(654): &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;</code></pre><p>What am I doing wrong in this case? Or what would be a better way to get a progressbar round spinner on top of a button?</p>","458813","","458813","","2010-10-07 20:29:33","2012-02-09 09:56:51","android UI: ImageButton with animation","<android><user-interface><animation><spinner><imagebutton>","2","3","","",""
"3885476","1","3886277","","2010-10-07 20:07:34","0","277","<p>I'm reading the android docs on custom component development and i'm a little confused. If you're creating an activity, you can add add a hierarchy of views via setContent. however, if you're creating a custom component, you have to handle everything in the draw() overload.</p><p>if i want to build a custom component that relies on a view hierarchy, is the model simply to create a hierarchy internally and then in draw call myViewHierarchy.Draw() or something?</p>","339448","","","","","2010-10-07 22:18:47","Android: Control Hierarchy in Custom Components","<android><custom-component>","1","0","","",""
"3885490","1","3894110","","2010-10-07 20:09:51","0","1401","<p>I've spent over a week trying to figure out a way to do a Limited Multi Selection Preference list. Nothing I've tried works. I'm ready to give up on Android if something seemingly simple is so hard. I've been programming a long time and don't remember being beaten up this badly by something like this. I have to assume I am not understanding something basic. I hope someone can point me in the right direction. </p><p>Here is the simplest code I can think off that should work. It does not clear the checkbox even when setting it to false, I've tried true as well. Why doesn't that work? If that will not work, what will?</p><p>Any help would be most appreciated.</p><pre><code>    @Override    protected void onPrepareDialogBuilder(Builder builder)     {     CharSequence[] entries = getEntries();     CharSequence[] entryValues = getEntryValues();        if (entries == null || entryValues == null || entries.length != entryValues.length ) {            throw new IllegalStateException(                    ""ListPreference requires an entries array and an entryValues array which are both the same length"");        }        // Added by WJT since we are loading the entries values after instantiation         // we need the clicked indexes to be setup now, they would not have been        // set up in the constructor        if ((mClickedDialogEntryIndices == null) || (mClickedDialogEntryIndices.length == 0))         mClickedDialogEntryIndices = new boolean[getEntries().length];        restoreCheckedEntries();        builder.setMultiChoiceItems(entries, mClickedDialogEntryIndices,                 new DialogInterface.OnMultiChoiceClickListener()         {   public void onClick(DialogInterface dialog, int which, boolean val)    {    mDlg = (AlertDialog)getDialog();                mListView = (ListView)mDlg.getListView();    if (val)             {              if (mSelectedCount &lt; mLimit)                 {               mClickedDialogEntryIndices[which] = val;                  mSelectedCount++;                 }              else                 {                  mListView.setItemChecked(which, false);               Toast.makeText(getContext(),              R.string.newsLimitExceededMessage,              Toast.LENGTH_LONG).show();                 }  // (mSelectedCount &lt; mLimit)             }             else             {              mClickedDialogEntryIndices[which] = val;              mSelectedCount--;             }  // (val)   }  // void onClick(DialogInterface dialog, int which, boolean val)        });  //  DialogInterface.OnMultiChoiceClickListener()     }  // void onPrepareDialogBuilder(Builder builder) </code></pre><p>Thanks,</p><p>\ ^ / i l l </p>","214020","","","","","2011-01-08 01:12:24","Android: onPrepareDialogBuilder, onClick & setItemChecked","<android><android-preferences>","1","3","","",""
"3885510","1","","","2010-10-07 20:12:25","0","260","<p>If I have a view, such as a button, that I want to change the background animation that occurs on longPress how do I do that. By default on stock android it fades out from orange. I assumed it's just an alpha transition so I thought that by changing the background of the component I would get this affect for free. For example, I assumed if I changed the background to a selector with the color blue for states of pressed and selected and transparent for all other states, it would fade from blue to whatever is the window color. However as soon as I set a custom selector as the background, there is no such fade affect at all for a long click.</p><p>Does anyone know how to change the background of a widget and still attain this affect to signify a long press is possible?</p>","307990","","307990","","2010-10-08 03:03:41","2010-10-08 03:03:41","Android: How do you make a custom onLongPress Animation?","<android>","0","2","","",""
"3885603","1","3885665","","2010-10-07 20:26:44","0","170","<p>This should be easy but for some reason it isn't working.  I wanted to figure out how to do custom views, so I started by doing one that simply overrides Button, but adds no functionality, just to make sure it works.</p><p>Java (file FooButton.java):</p><pre><code>package com.foo.bar;import android.content.Context;import android.widget.Button;public class FooButton extends Button {     public FooButton(Context context) {        super(context);    }}</code></pre><p>XML (within main.xml):</p><pre><code>&lt;view class=""com.foo.bar.FooButton""android:text=""blah"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:id=""@+id/buttonFoo"" android:textSize=""24px"" android:paddingLeft=""16px""android:width=""100px"" android:textStyle=""bold"" /&gt;</code></pre><p>If I replace ""com.foo.bar.FooButton"" with ""Button"", all is well, and I get my button.  If I run it as above, it crashes on startup and in logcat I get: </p><p>E/AndroidRuntime( 1411): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.foo.bar.FooButton</p><p>Something simple I'm doing wrong?</p>","226507","","","","","2010-10-07 20:35:23","super simple custom view","<android>","1","0","","",""
"3885649","1","3885693","","2010-10-07 20:33:01","0","456","<p>I am wondering if it is possible to intercept an open application call, for any(most of the) installed application. Or at least for opening the Activity having the intent-filter's action set to Main (if it exists for an app).</p>","429587","","","","","2010-10-07 20:39:17","Is it possible in Android to open other App than the one you clicked on?","<android><intentfilter>","1","0","","",""
"3885886","1","4197710","","2010-10-07 21:06:28","1","1380","<p>After designing layouts in Android for a while now, I still cannot get the hang of it. Often the results are unpredictable. </p><p>I think part of this boils down to some layout options not working well together. I.e. if you are using one way of specifying your layout, you're not meant to use some other way.</p><p>Notably, for me, changing <code>layout_width</code> from <code>fill_parent</code> to <code>wrap_content</code> usually changes the world. Let me give you another specific example:</p><p>Part of my activity's layout is a LinearLayout:</p><pre><code>    &lt;LinearLayout android:id=""@+id/ll2"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:orientation=""horizontal""&gt;        &lt;LinearLayout android:id=""@+id/ll2a"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:orientation=""vertical"" android:layout_weight=""1""&gt;            &lt;TextView android:id=""@+id/l_cover"" android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:text=""@string/book_item_l_cover""&gt;            &lt;/TextView&gt;            &lt;ImageButton android:id=""@+id/i_cover""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:scaleType=""centerInside"" android:gravity=""center""                android:layout_weight=""1"" android:adjustViewBounds=""true""                android:src=""@drawable/spinner_black_76"" android:minWidth=""400dip""&gt;            &lt;/ImageButton&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout android:id=""@+id/ll2b"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:orientation=""vertical"" android:layout_weight=""1""&gt;            &lt;TextView android:id=""@+id/l_back_cover"" android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:text=""@string/book_item_l_back_cover""&gt;            &lt;/TextView&gt;            &lt;ImageButton android:id=""@+id/i_back_cover""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:scaleType=""centerInside"" android:gravity=""center""                android:layout_weight=""1"" android:adjustViewBounds=""true""                android:src=""@drawable/spinner_black_76""&gt;            &lt;/ImageButton&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;</code></pre><p>To get 2 columns of left-aligning label-button combinations next to eachother I had to use the <code>layout_weight</code> attributes. The ImageButtons shrink around their images due to the <code>adjustViewBounds</code> attributes. This gets me a pretty good result. </p><p>Now what I finally also wanted was to have buttons of a certain minimum size so a finger can always easily press them, even when they do not contain any image (and they will shrink to only a few millimeters). I experimented with setting <code>android:minWidth=""400dip""</code> as you can see. I expected the button to fill up the entire half of the screen in width (400 is quite a large value), but I'm not seeing any difference.</p><p>I guess one of the other attributes above is preventing <code>minWidth</code> from having any impact. And I could probably go experiment and disable some others to see what it gives me. But my question here is: <strong>does anybody have any (logical) information on which attribute prevents or counter-intuitively influences whichother?</strong> I'd like to get this sorted once and for all. Is this documented somewhere?</p>","458813","","","","","2010-11-16 18:37:13","Android UI: what kind of layout options are mutually exclusive?","<android><user-interface><layout><attributes><css>","1","0","1","",""
"3885970","1","3886320","","2010-10-07 21:21:35","4","6025","<p>My issue is that I have a main screen, and I would like to dynamically spawn a view under it with a button click, then slide the main view off the screen revealing the view below it. I've accomplished this, but I feel like there's got to be a better way. The way I've done it is very limited in that you can't just spawn views over and over again under the main.</p><p>My main 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:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;  &lt;RelativeLayout    android:id=""@+id/subpage""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;  &lt;/RelativeLayout&gt;  &lt;RelativeLayout    android:id=""@+id/homescreen""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""@drawable/homebg""        &gt;    &lt;/RelativeLayout&gt;  &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I've deleted some unnecessary stuff. This is what's important. Notice the first child of the main layout is a relative layout with the id ""subpage."" As it is I use java to inflate another layout into the subpage layout when a button is clicked then I animate the ""homescreen"" layout off the screen. It seems like I shouldn't have to have the subpage declared in advance though. I guess my question is, is there a way to dynamically declare a new child layout underneath an existing layout?</p><p>=======================================================================</p><p>Edit: Part 2 of question</p><p>I'm trying to use addView and the app crashes. This is the code I use to try to add a view and inflate my xml into it. In the code below subview is a ViewGroup because as I understand it you can only inflate into ViewGroups, not regular views. Also 'activity' is defined at the top of the class as 'private Activity activity = this'. Any ideas what could be causing the crash?</p><pre><code>btnHelp.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            subView = (ViewGroup)new View(getApplicationContext());            mainScreen.addView(subView,1);            LayoutInflater inflater = activity.getLayoutInflater();            inflater.inflate(R.layout.help, subView);        }    });</code></pre><p>=======================================================================</p><p>Edit: Part 3 of question</p><p>So one more issue. Everything works great as far as inflating and sliding off. However, the view that is inflated has a button in it. I'm trying to assign a listener to that button, but it doesn't seem to work. I'm doing it by adding the listener to the button after the layout inflater is called in the btnHelp I've been working on. Here's the code:</p><pre><code>btnHelp.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            LayoutInflater inflater = activity.getLayoutInflater();            mainScreen.addView(inflater.inflate(R.layout.help, null),0);            homeScrn.startAnimation(slideLeftOut);            btnBackHome = (ImageView)findViewById(R.id.backMenuBtn);            btnBackHome.setOnClickListener(goHome);        }    });</code></pre><p>goHome is a handler I've defined below this as such:</p><pre><code>private OnClickListener goHome = new OnClickListener(){    public void onClick(View v) {        Log.d(""ClickEvent: "",""btnBackHome Clicked"");        homeScrn.startAnimation(slideRightIn);    }};</code></pre><p>When I click the button referenced by btnBackHome it doesn't do anything. I'm just not sure if it's because the listener isn't actually being assigned, something is keeping the button from actually being clicked, or something else.</p>","469219","","469219","","2010-10-09 03:50:57","2011-07-06 02:35:20","Android: Inflate View under a View then slide top view off","<android>","2","0","0","",""
"3886001","1","3886067","","2010-10-07 21:25:51","1","279","<p>Let's say i have an android device that has some extra buttons on it, can i register one of those buttons to launch my app? is there a configuration file on the device that controls hardware keys behavior?</p>","339448","","","","","2010-10-07 21:36:19","What's the Android OS model for handling custom hardware keys?","<android>","1","0","","",""
"3886016","1","3929371","","2010-10-07 21:28:37","0","982","<p>I am queuing up a bunch of runnables into a thread via a Handler.post(). I would like the ability to send a note to that thread that it should pause.</p><p>By pause I mean, finish the runnable or message you are currently working on, but don't go to the next message or runnable in your message queue until I tell you to continue.</p>","445348","","","","","2010-10-14 01:18:12","How to pause a Thread's Message Queue in Android?","<java><android><multithreading><message-queue>","2","3","1","",""
"3886118","1","3886485","","2010-10-07 21:44:53","4","20916","<p>I've got a class</p><pre><code>public class Preferences extends PreferenceActivity implements OnSharedPreferenceChangeListener</code></pre><p>out of this I try to call a method from another class. This method contains:</p><pre><code>mFoo.setTextColor(getResources().getColor(R.color.orange))</code></pre><p>But it doesn't work. It tells me <code>getResources</code> isn't static... how can I change this?</p>","395135","","1542891","","2014-02-26 11:20:57","2014-02-26 11:20:57","Android - getResources() and static","<android><static>","1","0","0","",""
"3886133","1","3886501","","2010-10-07 21:48:32","0","641","<p>I've been looking at examples of CursorAdapter implementations to make sure I'm doing everything right.</p><p>One thing I've noticed that I'm not doing is calling changeCursor(null) on my CursorAdapter in the Activity's onStop() handler.</p><pre><code>mAdapter.changeCursor(null);</code></pre><p>What is the purpose of this?  I'm willing to do it if there's a good reason, but I hate navigating to another Activity, backing up to this Activity, and seeing a blank screen for a second until a new Cursor is queried.</p>","406790","","","","","2010-10-07 22:57:05","Why change ListView cursor to null on stop?","<android><cursor><activity-lifecycle>","1","1","","",""
"3886209","1","3886525","","2010-10-07 22:06:05","2","547","<p>I'm attempting to override an Android View class to tweak the functionality just slightly.  But I need to modify a field that does not have a setter method.  I've placed the subclass in a package called <code>android.widget</code>.  Why can't I access any of the package-private member fields?  I notice that the compiler says they ""cannot be resolved,"" rather than not being accessible.  Does this have something to do with how Android.jar is built?</p>","213525","","","","","2010-10-07 23:17:22","Why can't I access package-private fields in the android.widget package?","<java><android><access-modifiers><package-private>","2","0","","",""
"3886213","1","","","2010-10-07 22:06:31","0","735","<p>I am to start writing my first Android application starting next week here at work. I am curious about the video and results of it found here: <a href=""http://www.youtube.com/watch?v=It8xPqkKxis"" rel=""nofollow"">http://www.youtube.com/watch?v=It8xPqkKxis</a></p><p>The submitter indicates that c++/c# runs faster than Java on the Android platform though this was on Android 1.5.</p><p>At any rate, can anyone confirm that there is indeed a increase in performance using c++ or c# on 2.2? Our application will need as much speed and batterylife it can get.</p><p>Thanks in advance!</p><p>Edit: Per Woot4Moo's comment, yes, which implementation runs the best? Take all factors into account including runtimes, frameworks, compilers ... There is a obvious difference and I want to know if anyone has experience with writing c++/c# on android</p>","360785","","360785","","2010-10-08 03:44:16","2010-10-08 03:44:16","Android - Java / c# /c++ Speed","<c#><java><c++><android>","1","3","","",""
"3886234","1","3886505","","2010-10-07 22:10:17","0","3024","<p>I have a form with several Views on it, the last one is a Spinner that is bound to an adapter to get it's data from a Web Server via a POST request, at the end I append an additional entry for ""Other..."". If this option is selected on the spinner, a new EditText View at the bottom where the user enters a custom value, I've managed to get the EditText View to show on the screen, but it's positioned at the very top, over my other Views and I can't seem to find the way to make it appear at the bottom, below the Spinner as I want it to, here is the code I have so far:</p><pre><code>EditText suggestCarrierField = new EditText(getBaseContext());suggestCarrierField.setLayoutParams(new ViewGroup.LayoutParams(                                ViewGroup.LayoutParams.FILL_PARENT,                                ViewGroup.LayoutParams.WRAP_CONTENT));                        suggestCarrierField.setHint(""Suggest your carrier"");((AbsoluteLayout) findViewById(R.id.createAccountView)).addView(suggestCarrierField);((AbsoluteLayout) findViewById(R.id.createAccountView)).invalidate();</code></pre>","389234","","","","","2010-10-07 22:57:57","Android - How to add a View progamatically to an Activity's Absolute Layoute setting it's possition?","<android>","2","0","","",""
"3886526","1","3887831","","2010-10-07 23:02:26","3","3321","<p>I am developing my first Android App. I have an application already running on emulator (Eclipse + Android dev. tools) on Ubuntu 10.04 LTS - the Lucid Lynx - released in April 2010. I have already tryied the <a href=""http://developer.android.com/guide/developing/device.html"" rel=""nofollow"">steps provided on Android Developers Portal</a> on this link, but whenever I try to list my already connected device using ./adb devices I get the following: </p><pre><code>mmaia@mmaia-desktop:~/tools/android-sdk-linux_86/tools$ ./adb devicesList of devices attached ????????????    no permissions</code></pre><p>I have checked and when I run the virtual emulator the same command returns: </p><pre><code>List of devices attached ????????????    no permissionsemulator-5554   device</code></pre><p>Also when I ask eclipse to run the emulator it finds the device(galaxy 5), see image below, but can't find serial, probably because of some permission, than I am only able to choose the virtual emulator.</p><p><img src=""http://i.stack.imgur.com/POphE.png"" alt=""alt text""></p><p>How do I configure permission to use Galaxy 5 as a device while developing for Android under Ubuntu 10.04? </p><p>[]s</p>","442041","","","","","2012-09-03 18:25:14","How to develop Android Apps using a Samsumg Galaxy 5 device?","<android><linux><ubuntu><device>","7","2","3","",""
"3886605","1","3886633","","2010-10-07 23:16:27","1","405","<p>I was putting the finishing touches on my app today. I created a layout-large main.xml, and a drawable-hdpi for a few of my app's images. That was all working fine, on both the WVGA and HVGA emulators. Then I added a ""Help"" button, with no associated code, into my menu-key menu. That was also working. I can't remember changing anything else, but now when attempting to load the main activity of my app I get a force close error, and this in my logcat:</p><blockquote>  <p>10-07 18:17:08.812: ERROR/AndroidRuntime(325): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nickavv.quickchange/com.nickavv.quickchange.QuickChange}: java.lang.NullPointerException  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.os.Handler.dispatchMessage(Handler.java:99)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.os.Looper.loop(Looper.java:123)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.main(ActivityThread.java:4627)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at java.lang.reflect.Method.invokeNative(Native Method)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at java.lang.reflect.Method.invoke(Method.java:521)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at dalvik.system.NativeStart.main(Native Method)  10-07 18:17:08.812: ERROR/AndroidRuntime(325): Caused by: java.lang.NullPointerException  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at com.nickavv.quickchange.QuickChange.onCreate(QuickChange.java:155)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  10-07 18:17:08.812: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)</p></blockquote><p>Thanks for the help, if you need to know anything else just ask.</p>","468498","","","","","2010-10-07 23:21:23","Android App began crashing, I can't explain it","<android><eclipse><nullpointerexception>","1","0","","",""
"3886617","1","3886863","","2010-10-07 23:18:24","3","18263","<p>I have a listView of contacts that I got from the Android ContactManager sample.  This list is showing up fine, but I can't figure out how to get info from the selected item, like ""name"" and ""phone number"".</p><p>I can get the selected position, but the result of the mContactList.getItemAtPosition(position) is a ContentResolver$CursorWrapperInner and that doesn't really make any sense to me. I can't get heads or tails from that.</p><p>Anyone know how I can get the name/id/phone number from the selected item in the listView? </p><p>Here is my code.    </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    Log.v(TAG, ""Activity State: onCreate()"");    super.onCreate(savedInstanceState);    setContentView(R.layout.choose_contact);    // Obtain handles to UI objects    mAddAccountButton = (Button) findViewById(R.id.addContactButton);    mContactList = (ListView) findViewById(R.id.contactList);    mShowInvisibleControl = (CheckBox) findViewById(R.id.showInvisible);    // Initialize class properties    mShowInvisible = false;    mShowInvisibleControl.setChecked(mShowInvisible);    mContactList.setOnItemClickListener(new OnItemClickListener()    {      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id)      {       addContactAt(position);      }    });    mShowInvisibleControl.setOnCheckedChangeListener(new OnCheckedChangeListener() {        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {            Log.d(TAG, ""mShowInvisibleControl changed: "" + isChecked);            mShowInvisible = isChecked;            populateContactList();        }    });    // Populate the contact list    populateContactList();}/** * Populate the contact list based on account currently selected in the account spinner. */private SimpleCursorAdapter adapter;private void populateContactList() {    // Build adapter with contact entries    Cursor cursor = getContacts();    String[] fields = new String[] {            ContactsContract.Data.DISPLAY_NAME    };    adapter = new SimpleCursorAdapter(this, R.layout.contact_entry, cursor,            fields, new int[] {R.id.contactEntryText});    mContactList.setAdapter(adapter);}/** * Obtains the contact list for the currently selected account. * * @return A cursor for for accessing the contact list. */private Cursor getContacts(){    // Run query    Uri uri = ContactsContract.Contacts.CONTENT_URI;    String[] projection = new String[] {            ContactsContract.Contacts._ID,            ContactsContract.Contacts.DISPLAY_NAME    };    String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '"" +            (mShowInvisible ? ""0"" : ""1"") + ""'"";    String[] selectionArgs = null;    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";    return managedQuery(uri, projection, selection, selectionArgs, sortOrder);}private void addContactAt(int position){ Object o = mContactList.getItemAtPosition(position);}</code></pre><p>}`</p>","469682","","","","","2012-03-06 15:00:13","getItemAtPosition() How to get readable data from the selected item in a ListView","<android><listview><selecteditem>","3","0","1","",""
"3886623","1","3938419","","2010-10-07 23:19:25","2","2359","<p>I created a separate project and activity that downloads an image from a URL, converts it to a Bitmap, and then uses a FileOutputStream to save that file to the SD card. When in the separate project and free-standing activity, this worked fine, and I could see that the image is stored on the SD card.</p><pre><code>public class PictureDownload extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        downloadFromUrl(""http://www.coutblog.com/prism/uploads/0030.jpg"", ""newpic.jpg"");        displayPic(""newpic.jpg"");    }    // Place to download the file    private final String PATH = ""/sdcard/"";    public void displayPic(String filename) {        ImageView image = (ImageView)findViewById(R.id.image);        Bitmap bMap = BitmapFactory.decodeFile(PATH + filename);        image.setImageBitmap(bMap);    }    /**     * Downloads the picture from the URL to the SD card     * @param imageURL: the URL to download it from (absolute web URL)     * @param fileName: the name of the file you want to save the picture to     */    public void downloadFromUrl(String imageURL, String fileName) {        try {                // Connect to the URL                URL myImageURL = new URL(imageURL);                HttpURLConnection connection = (HttpURLConnection)myImageURL.openConnection();                connection.setDoInput(true);                connection.connect();                InputStream input = connection.getInputStream();                // Get the bitmap                Bitmap myBitmap = BitmapFactory.decodeStream(input);                // Save the bitmap to the file                String path = Environment.getExternalStorageDirectory().toString();                OutputStream fOut = null;                File file = new File(path, fileName);                fOut = new FileOutputStream(file);                myBitmap.compress(Bitmap.CompressFormat.JPEG, 85, fOut);                fOut.flush();                fOut.close();            } catch (IOException e) {}    }</code></pre><p>}</p><p>But, whenever I tried to port the code to an existing project, it fails. In this setting, I am running the code from a service. The code is the exact same - but for some reason it won't download any files. Would this have to do with the fact that it is running on a service instead of an activity? Or maybe for some reason the file output stream gets messed up.</p><p>In BGService:</p><pre><code>String name = remote_resource.getValue().substring(38);                downloadFromUrl(remote_resource.getValue(), name); /** * Downloads the picture from the URL to the SD card * @param imageURL: the URL to download it from (absolute web URL) * @param fileName: the name of the file you want to save the picture to */public void downloadFromUrl(String imageURL, String fileName) {    try {            // Connect to the URL            URL myImageURL = new URL(imageURL);            HttpURLConnection connection = (HttpURLConnection)myImageURL.openConnection();            connection.setDoInput(true);            connection.connect();            InputStream input = connection.getInputStream();            // Get the bitmap            Bitmap myBitmap = BitmapFactory.decodeStream(input);            // Save the bitmap to the file            String path = Environment.getExternalStorageDirectory().toString();            OutputStream fOut = null;            File file = new File(path, fileName);            Log.i(""help"", file.getAbsolutePath());            Log.i(""help"", file.toString());            Log.i(""help"", file.length() + """");            System.out.println(""THIS IS A TEST OF SYSTEM.OUT.PRINTLN()"");            fOut = new FileOutputStream(file);            myBitmap.compress(Bitmap.CompressFormat.JPEG, 85, fOut);            fOut.flush();            fOut.close();            System.out.println(""file Path: "" + file.getAbsolutePath());            Log.i(""help2"", file.getAbsolutePath());            Log.i(""help2"", file.toString());            Log.i(""help2"", file.length() + """");        } catch (IOException e) {}}</code></pre><p>Another interesting thing is that of the ""Log.i"" calls below, only the second one (below the fOut.flush()) gets printed. So somewhere in the bitmap compression or the FileOutputStream IO something weird is happening. But no exceptions are thrown.</p><p>Thanks a lot for your help!</p>","469698","","","","","2011-08-22 04:57:21","Downloading Image to SD Card in Service fails (Android)","<java><android><image><stream><sd-card>","2","3","3","",""
"3886677","1","","","2010-10-07 23:30:20","2","1639","<p>I cannot see the imeoptions like done and like on HTC devices while same code works fine with Motorola.</p><p>Here is the code </p><pre><code>&lt;TableRow&gt;            &lt;EditText android:hint=""Name""             android:id=""@+id/name""            android:background=""@drawable/chegg_topcorner_rounded""             android:layout_width = ""50dp""            android:layout_height=""wrap_content""            android:gravity =""left""            android:paddingLeft = ""10dp""            android:paddingTop = ""9dp""            android:paddingBottom = ""9dp""            android:imeOptions=""actionNext""            android:textSize=""14dp""            &gt;            &lt;/EditText&gt;        &lt;/TableRow&gt;</code></pre><p>Can anyone help. </p><p>Thanks in advance </p>","441730","","115145","","2010-10-08 00:40:27","2010-10-08 00:41:20","imeoptions on HTC devices","<android>","1","0","","",""
"3886691","1","3902224","","2010-10-07 23:33:35","3","1482","<p>I want to use <code>addIntentOptions</code> to drive my menus when ever possible. This seems the cleanest way to provide them. Rather than explicitly detailing activities, simply ask for a menu listing all the activities which are available for my data item.</p><p>So I'm trying to put together a context menu for a <code>ListView</code>. It works great. Only problem is that I have an activity that has two intents that consume my data type, and only the first shows up.</p><p>The activity in question in <code>AndroidManifest.xml</code></p><pre><code>&lt;activity android:name="".ui.MyActivity"" android:label=""The title""&gt;    &lt;intent-filter android:label=""First context label""&gt;        &lt;action android:name=""com.sample.action.FIRST_ACTION"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;category android:name=""android.intent.category.ALTERNATIVE"" /&gt;        &lt;category android:name=""android.intent.category.SELECTED_ALTERNATIVE"" /&gt;        &lt;data android:scheme=""myscheme"" /&gt;    &lt;/intent-filter&gt;    &lt;intent-filter android:label=""Second context label""&gt;        &lt;action android:name=""com.sample.action.SECOND_ACTION"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;category android:name=""android.intent.category.ALTERNATIVE"" /&gt;        &lt;category android:name=""android.intent.category.SELECTED_ALTERNATIVE"" /&gt;        &lt;data android:scheme=""myscheme"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt; </code></pre><p>The code to generate the context menu</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View view,         ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, view, menuInfo);    Uri uri = Uri.fromParts(""myscheme"", getOpaqueUriOfSelectedItem(view), null)    Intent intent = new Intent(null, uri);    intent.addCategory(Intent.CATEGORY_SELECTED_ALTERNATIVE);    // Search and populate the menu with acceptable offering applications.    menu.addIntentOptions(            0, // Menu group to which new items will be added            0, // Unique item ID (none)            0, // Order for the items (none)            this.getComponentName(), // The current Activity name            null, // Specific items to place first (none)            intent, // Intent created above that describes our requirements            0, // Additional flags to control items (none)            null); // Array of MenuItems that correlate to specific items                    // (none)}</code></pre><p>As I say, the first intent of the activity shows up in the context menu and behaves like a dream. But I don't see the second intent, and I see no good reason it shouldn't show up. If Android only allows one intent with a particular category per activity, that's a pretty lame restriction.</p><p>I can see myself building a dummy activity that simply hands off to <code>MyActivity</code>. But that's clumsy and I'd like to avoid it if possible.</p><p><strong>EDIT</strong>: Looking at the intent that is passed through to an activity from a context menu (or option menu, presumably), even if both intents showed up in the menu, the activity wouldn't have enough information to tell which intent was selected, as within the activity <code>getIntent().getAction()</code> is null. </p><p>This seems like an unfortunate oversight. Surely it isn't that unusual to have an activity that can consume a type of data in more than one way?</p><p>Unless one of you kind folk know something I've missed, it looks like I'm going to be creating my dummy activities.</p><p><strong>EDIT</strong>: As CommonsWare suggested, I tried using <code>queryIntentActivityOptions</code>. I added in this code before <code>menu.addIntentOptions</code> in my code above.</p><pre><code>PackageManager pm = getPackageManager();final List&lt;ResolveInfo&gt; available =     pm.queryIntentActivityOptions(this.getComponentName(), null, intent, 0);</code></pre><p>And in the debugger I found that <code>available</code> didn't include both of the available intents for <code>MyActivity</code>. So the issue isn't within <code>addIntentOptions</code>, it's deeper, within <code>queryIntentActivityOptions</code> somewhere.</p>","372926","","372926","","2010-10-10 21:36:11","2010-10-27 04:54:44","Add to menu using addIntentOptions providing multiple intents for a single activity","<java><android><android-intent><android-manifest><intentfilter>","1","13","2","",""
"3886873","1","3887039","","2010-10-08 00:22:48","5","1072","<p>Does anybody know where I can find documentation on the asterisk? It appears to override the protection of 'private' variables in subclass android.R.drawable.</p>","463304","","","","","2010-10-08 01:13:09","""@android:drawable/ic_"" vs ""@*android:drawable/ic_""","<android><resources>","1","2","1","",""
"3886948","1","3887182","","2010-10-08 00:44:25","0","189","<p>I have a class Scores.java I need to know whats the correct way to create these. I get ""The constructor Scores is not defined. Do I have to extend off everything in Android??</p><pre><code>package com.threeuglymen.android.stuff;import android.app.Application;import android.app.Service;import android.content.Context;import android.content.Intent;import android.content.SharedPreferences;import android.content.SharedPreferences.Editor;import android.preference.PreferenceManager;import android.util.Log;public class Scores {    private Context mycontext;    public Scores (Context context) {        // TODO Auto-generated method stub        this.mycontext = context;    }    public void resetScores(){        try {        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mycontext);         Editor edit = pref.edit();        edit.putInt(""correct"", 0);        edit.putInt(""incorrect"", 0);        edit.commit();        } catch (Exception e) {            Log.d(""Scores"", ""Exception:"" + e.toString());        }        return;    }}</code></pre><p>Thx for any guidance</p><p>Eric</p>","469730","","469730","","2010-10-08 01:22:35","2010-10-08 01:55:19","Non-Extended Classes in android","<java><android>","3","1","","",""
"3887191","1","3888277","","2010-10-08 01:57:46","0","955","<p>First of all I'm new to Anroid. So it might be a very simple question but I couldn't find the answer by myself.</p><p>I have two Activity, I'm filling the first one with the user names and the other data I receive from the remote request and the second one is being used to display the details of the selected user.</p><p>So in some way I need to associate those User records with the ListView items, so I can pass some of these information the the second Activity using an Intent. I'm not sure if it's right or wrong but I found that I need to create a custom ArrayAdapter. So I've created a User class:</p><pre><code>class User {   public String id;   public String name;}</code></pre><p>and I guess now I need to write something like:</p><pre><code>class UserAdapter extends ArrayAdapter&lt;User&gt; {   ...}</code></pre><p>Basically in the first view I want to display:</p><pre><code>John DoeMike Brown...</code></pre><p>Second one will make another request based on User.id and display some information about the user like:</p><pre><code>John Doe, 45, San Francisco</code></pre><p>I couldn't find a similar example so I'm not very sure about how can I do that. Any reference would also be helpful.</p><p>Thanks.</p>","304796","","304796","","2010-10-08 14:23:13","2010-10-08 17:10:12","Storing data on ListView item","<java><android><listview><listviewitem>","3","0","","",""
"3887203","1","3889320","","2010-10-08 01:59:49","0","624","<p>i get the data from the Internet and show in the listview,i want to  make it come true that when i slide the screen with my finger and if the listview is to slide to the bottom ,i will get more data from the Internet and update the adapter of the listview.But how can i monitor the listview to slide to the bottom,there seems no functions in the SDK api.</p>","445611","","445611","","2010-10-08 02:39:41","2010-10-08 09:34:01","monitoring the listview to slide to the bottom","<android>","1","0","","",""
"3887581","1","5521699","","2010-10-08 03:54:26","-1","6235","<p>How to connect android phone to wifi network setup on macbook pro?</p>","434708","","","","","2011-04-02 06:52:44","Wifi connection between Android Phone and Macbook","<android><macbook><wifimanager>","1","2","","",""
"3887618","1","","","2010-10-08 04:07:55","0","382","<p>I have a situation here. I want to put turn by turn navigation using mapview in my android app, just like google maps provides us. I was not able to find any kind of turning info in th kml file returned by google, so I wonder is it possible or not ??</p><p>Thanks in advance.</p>","240737","","","","","2010-10-08 06:22:47","Is there any way I can put turn by turn navigation using mapview in android?","<android><google-maps><navigation>","1","0","","",""
"3887753","1","","","2010-10-08 04:41:00","3","864","<p>any good recommendation of a physical android device for testing purpose?</p><p>I am looking for a device like iPod touch in Apple camp that help iOS developer to test their stuff. I know there is Nexus One, but that thing is pretty expensive and i don't really care about the phone stuff, but something that can let developers test  accelerometer, touch screen, orientation etc.</p><p>any idea?</p>","469846","","","","","2013-05-12 15:26:30","what physical android device you use for testing purpose?","<android>","5","0","1","",""
"3887810","1","","","2010-10-08 04:58:05","2","2083","<p>I have searched a lot on this but could not find anything on google or stack overflow.</p>","469853","","2660","","2011-09-09 13:06:11","2011-09-09 13:06:11","How to set up a new Access Point in Android phone, programmatically?","<android>","1","0","","",""
"3888001","1","3888238","","2010-10-08 05:46:02","0","761","<p>I have a widget that launches an activity, but when the activity finishes using the finish() I don't know how my widget can know about it since I can't override onActivityResult() which seems like the only way to listen when an activity closes... </p><p>Anyone know of another way to listen for when an Activity closes when it is a widget that launches the Activity?</p><p>In case it helps, here is the code I'm using in my widget to launch the Activity</p><pre><code> @Override public void onUpdate(Context context,     AppWidgetManager appWidgetManager, int[] appWidgetIds) { Intent i = new Intent(context, ChooseContact.class); PendingIntent pendingIntent = PendingIntent.getActivity(context,0,i,0); RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.main); updateViews.setOnClickPendingIntent(R.id.button, pendingIntent); appWidgetManager.updateAppWidget(appWidgetIds, updateViews);   // Not really necessary, just a habit  super.onUpdate(context, appWidgetManager, appWidgetIds);  }</code></pre>","469682","","","","","2014-04-01 20:59:04","How to listen to a closed activity from a widget? (onActivityResult is only in Activity)","<android><activity><android-widget><widget>","2","0","0","",""
"3888015","1","3888402","","2010-10-08 05:49:57","4","24643","<p>An activity has a Button and a ListView.Initially, only the Button is visible. When the button is pressed, the ListView is displayed. When displayed, is it possible for me to show one particular item as selected/focussed?</p><p>A use case could be that suppose it is a list of language settings and when the list opens, the currently selected language must be shown as highlighted.</p><p>If I know the index of the item, how to set it as focused on display?</p><p>-Kiki</p>","454660","","","","","2013-10-22 15:13:07","Android:To set an item as selected when the ListView opens?","<android><listview><focus><listviewitem>","3","0","","",""
"3888079","1","4868920","","2010-10-08 06:05:51","1","1163","<p>I want to create a dialog with a string that I build at runtime.  It looks like API level 8 allows you to call showDialog with a bundle, but I have to write an app that will run on the older OSs.</p><p>How do I create a dialog with something like a simple error string and make sure it doesn't die when I rotate the screen.</p><p>I realize if I override onCreateDialog, it will do it for me.  The problem is, this just takes the int constant.  I need to pass a string to it so it knows what to put in the dialog.</p><p>If I build my dialog myself and then call .show() on it, it won't live through a screen orientation change.</p>","465442","","","","","2011-02-01 22:56:20","Android Dialog with dynamic text (API level < 8) killed on rotation","<android><dialog><orientation><rotation>","2","0","","",""
"3888149","1","","","2010-10-08 06:20:46","0","5473","<p>I have an Android application that I need to install on diffferent devices with different configurations. I kept it in the <code>res/raw</code> folder, with data stored in <code>key=value</code> format. Can I access the value by passing the key? Can I change the <code>.properties</code> file from outside the application? Any suggestions?</p>","462695","","707111","","2012-07-13 18:26:09","2012-12-13 07:29:47","Configure an Android application using property file","<android>","2","0","","",""
"3888217","1","3892717","","2010-10-08 06:32:12","0","1200","<p>I am new to the Android Development, Please tell me how to read contacts from Phone and how to add new Contact to the Phone.</p>","440541","","","","","2010-10-08 16:59:31","Android Contacts Sync","<android>","1","0","2","",""
"3888230","1","","","2010-10-08 06:35:22","1","2395","<p>How can I use .net web services using android?</p><p>My code is like this...</p><pre><code>package Webservices.pck;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.HttpTransportSE;import android.widget.TextView;import android.app.Activity;import android.os.Bundle;public class Webservices extends Activity {   private static final String SOAP_ACTION = ""http://tempuri.org/HelloWorld""; private static final String METHOD_NAME = ""HelloWorld""; private static final String NAMESPACE = ""http://tempuri.org/""; private static final String URL = ""http://ipaddress/Service1.asmx""; //private Object resultRequestSOAP = null;    @Override   public void onCreate(Bundle savedInstanceState)   {       super.onCreate(savedInstanceState);       TextView tv = new TextView(this);       try       {            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);              SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);            envelope.setOutputSoapObject(request);             HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);            androidHttpTransport.debug = true;            envelope.dotNet = true;            androidHttpTransport.call(SOAP_ACTION, envelope);            SoapObject resultRequestSOAP =  (SoapObject)envelope.bodyIn;            String result = (String)resultRequestSOAP.getProperty(0).toString();            tv.setText(result);            this.setContentView(tv);       }       catch (Exception aE)       {            tv.setText(aE.toString());            this.setContentView(tv);       }    }}</code></pre><p>In this code I am using.</p><pre><code>String URL = ""http://ipaddress/Service1.asmx""; </code></pre><p>then error :--  <code>org.xmlpull.v1.xmlPullParserException: expected:START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope(position:START_TAG&lt;html&gt;@1:6 in java.io.InputStreamReader@4375fda8)</code></p>","713104","","141661","","2010-10-08 06:45:43","2011-06-30 17:52:50","Access C# .net web service in android","<c#><android><web-services>","1","0","2","",""
"3888234","1","3889290","","2010-10-08 06:35:48","3","1440","<p>I have a list view. In that list view, I have to grey out and disable some items, and enable the rest list items with seperate color. How to do this?</p>","456936","","","","","2010-10-08 09:28:17","disabling and greying out list items","<android>","1","1","1","",""
"3888252","1","3888636","","2010-10-08 06:39:49","3","3334","<p>I am completely new to bluetooth app development. what exactly is a bluetooth profile? is it a hardware specification for the device? can an android mobile phone with bluetooth act as sender and receiver in A2DP profile?</p>","170705","","","","","2010-10-08 07:51:37","Bluetooth A2DP profile","<android><bluetooth>","1","0","1","",""
"3888308","1","","","2010-10-08 06:53:53","5","5448","<p>I am having a problem with Android looper. I have a class that has extended AsynTask. Inside doInBackground() method i have Looper.prepare() and some code below. </p><p>It runs well and good for the first time but after that it gives an exception "" Only one Looper may be created per thread"" .</p><p>There seems some solution to use Looper.quit() but i am unable to implement it.</p><p>Any help will be appreciated.</p>","405521","","","","","2013-01-15 18:29:16","Android: Only one Looper may be created per thread","<android><looper>","3","3","","",""
"3888310","1","3888349","","2010-10-08 06:55:02","0","3775","<p>I am having application in which i am using menu , on tap on menu item i am redirecting to specified activity.</p><p>I want to make sure that when i am redirected to another menu item my current all activity should be finished to reduce the stackflow of the activity and better performance.</p><p>So when i tap on back from my tapped activity from the selected menu activity i should be redirected to another activity and finish current activity.</p><p>So i am wondering is there any way by which i can finish another activity from my current activity. Or should i override the OnKeyDown Method..</p><p>Any help on this</p><p>Thanks in advance </p>","1386533","","","","","2011-02-11 02:07:44","Android : Finish Activity from other Activity","<android>","1","0","","",""
"3888383","1","","","2010-10-08 07:09:54","0","324","<p>I am following <a href=""http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf"" rel=""nofollow"">http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf</a> for developing a widget. I am unable to launch a widget on to the home screen.When running the application I am getting the errors like No Launcher activity found andThe launch will only sync the application package on the device!Looking for an answer.</p>","414523","","","","","2010-10-14 18:46:42","launching android widget","<android><widget>","1","0","","",""
"3888396","1","10017445","","2010-10-08 07:12:07","65","41154","<p>I need to scan a barcode using phonegap in Android and iPhone.Is there a way to do this? If yes, please share links.</p>","435813","","23897","","2010-10-08 07:17:52","2013-09-20 05:44:13","how to scan barcode using phonegap","<iphone><android><phonegap><barcode-scanner>","5","0","42","",""
"3888602","1","3889196","","2010-10-08 07:47:25","2","5158","<p>I try to start an android service from the service's class.The reason to do this is to achieve some platform independence.</p><p>Doing this I get a NullPointerException at android.content.ContextWrapper.startService(ContextWrapper.java:326). The platform target is 2.1-update1, any suggestions? </p><p>See the code below (I left the imports out to save some space)</p><pre><code>/* GUI: HelloAndroid.java */package com.example.helloandroid;public class HelloAndroid extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // that works!        startService(new Intent(""com.example.helloandroid.UnusualService""));        // stop the service works of course, too        stopService(new Intent(""com.example.helloandroid.UnusualService""));        // unusual start does not work:        UnusualService myService = new UnusualService();        myService.startService();    }}/* Service: UnusualService.java */package com.example.helloandroid;public class UnusualService extends Service {        @Override    public void onCreate() {        Toast.makeText(this, R.string.service_started, Toast.LENGTH_SHORT).show();    }    @Override    public void onDestroy() {        Toast.makeText(this, R.string.service_stopped, Toast.LENGTH_SHORT).show();    }    @Override    public IBinder onBind(Intent intent) {        return null; // make something here when the rest works     }    public void startService() {        // folowing line will cause the NullPointerException        startService(new Intent(""com.example.helloandroid.UnusualService""));    }    public void stopService() {        stopSelf();    }}</code></pre>","469069","","","","","2013-08-01 08:56:34","startService() from the service class itself","<android>","3","0","0","",""
"3888659","1","","","2010-10-08 07:54:47","0","1223","<p>I would like to know if we can get Incoming call data to the application in Android.</p><p>I will be using this incoming call data to record the call or for the purpose of call streaming from my application.</p><p>I read Audio manager and Telephony manager class provided by Android , but I could get an API which can give the data of incoming call.</p><p>Any help in this regard will be highly appreciated.</p><p>Thanks and Regards Pavan </p>","383347","","","","","2010-10-08 09:14:48","Is it possible to get incoming call data to application in Android","<android><audio><call><record><incoming>","2","0","","",""
"3888775","1","","","2010-10-08 08:11:13","1","3298","<p>I need to find a way to measure the current signal strength of Android phone, without the need to register a PhoneStateListener that God knows when it returns the actual asu.</p><p>something like: </p><pre><code>int signal = getPhoneSignal();</code></pre><p>any help plz?</p><p>thanks!</p>","445548","","1534123","","2012-11-07 14:42:53","2013-07-13 18:52:32","Instant signal strength","<android><signal-strength>","3","1","","",""
"3889014","1","7147712","","2010-10-08 08:51:15","1","254","<p>I'm currently working on an app for the Android OS that displays some data. To ensure this data is up-to-date, it is required that the app fetches updates from a remote server from time to time.As the data does not change very often, this update should be carried out once per week. I want to give the user the ability to choose the weekday and daytime of the update (and optionally disable this feature completely).</p><p>The thing is: this update should be carried out even when the user is not using the phone at this moment, even when the phone is currently sleeping and even when the phone has been rebooted recently and the app hasn't been started yet.</p><p>The first thing I thought of was a remote service that starts at system boot, determines the time when to run the update, sets a timer and then waits/sleeps for the timer to fire.</p><p>Now, I was told I should rather use alarm timers or some kind of handlers... the more I read about this topic, the more ways to do this seem to exist.</p><p>Now, I'm a bit lost which method is the best for me... so here is what I need:</p><p><li>I want to execute some code at a time that is specified.<li>This timer is used to trigger the execution of code 7 days in the future. (i.e., every week at a given weekday and time)<li>The code should run WITHOUT waking the phone up if it is ""sleeping"" (screen dimmed).<li>When running the code, no activity should be started. i.e. no app pops up on the screen.<li>The code that is executed should fetch some data from the internet. If at this time no internet connection is available, the timer should be set to sleep 30 minutes and then try again.<li>After completing the code execution, the timer will be set for the next interval, which will be 7 days later.<li>The timer should be started at system boot, e.g., if I reboot the phone, the timer should determine the next date to execute the code and schedule the timer. This has to work without ANY user interaction! (i.e. without the app being started itself)<li> When ""sleeping"", the thread/service/timer/whatsoever should not consume any system resources if possible...<li> What i need is pretty much a simple unix cronjob.</p><p>I think anyone here knows ""newsrob"" for android? What I want to realize is pretty much the same as the newsrob-updateservice.</p>","370969","","1210260","","2012-02-28 05:06:35","2012-02-28 05:06:35","How to Realize an Update Service is Running in the Background?","<java><android><service><cron><daemon>","1","0","2","",""
"3889015","1","","","2010-10-08 08:51:18","0","120","<p>I'm considering how to identify server(s) to an app on a mobile device that utilises a wcf/web service.</p><p>(1) I anticipate all going well that I will need to migrate the server between hosts from time to time to handle load. I'd like to be able to do this without service disruption.</p><p>(2) I also anticipate that all going well I will want to improve scalability by seperating website hosting and wcf/web service hosting requiring an addressing change on the client. Until the app proves to get traction the server deployment will be shared on the same domain.</p><p>Rereleasing the client for this purpose at a glance seems complicated as you can't force updates on consumers and it's non trivial to distinguish between no data connection/server down and a server that's moved.</p><p>I was thinking this would be a solved problem, so thought to bounce it off the community for better ideas.</p><p>What I've come up with so far is as follows.</p><ol><li><p>Client needs a primary and secondary URL to reference the wcf/web service. This caters for host provider changes. The old host can continue to run the service during the handover period. When succesfully deployed to the new host, the secondary/old host can be disabled. The wcf/web service is essentially stateless, so that simplifies matters somewhat.</p></li><li><p>At periodic intervals the client will initiate a service to request the primary and secondary URLs be supplied and then caches these. This future proofs the client to be able to (for a period of time) be instructed by the service behind the secondary URL to accept a new URL for future use while the primary URL services requests at the new URL. Once the secondary service has pointed to a new primary, the following periodic update requested from the primary will update the cached secondary URL.</p></li></ol><p>What have I missed? Perhaps it can be simpler?</p>","424723","","424723","","2010-10-08 11:05:38","2010-10-08 11:16:51","Improve on this pattern for handling how a mobile app knows how to find it's server","<iphone><android><wcf><web-services><mobile>","1","0","","",""
"3889146","1","","","2010-10-08 09:10:31","0","485","<p>HII am intereseted in developing an application, which will track user's activities on phonelike1.calls2.messages3.Packet data4.GPS Usages5.Media Usage6.Apps usagePlease let me know if there is a way to achieve these.</p>","470064","","","","","2012-10-26 06:37:16","Tracking user's activity","<android><activity><user>","2","0","","",""
"3889153","1","3889888","","2010-10-08 09:11:15","0","102","<p>The problem I have is that whenever I export my appto an apk, and then install on device, or debug in eclipse, 2 instances of my app is installed(?). 2 icons are added to my menu.</p><p>How do I stop that from happening?</p>","469076","","1081897","","2013-01-21 17:11:59","2013-09-20 19:40:49","Android installer installs 2 instances?","<android><eclipse><debugging><icons><apk>","1","0","","",""
"3889160","1","","","2010-10-08 09:12:09","0","1163","<p>I am trying to access flickr services from android ,</p><p>to get the full permissions , </p><p>first of all i fetched forbs using flickr.auth.getFrob method by integrating &amp; converting in MD5 </p><blockquote>  <p>secret + 'api_key' + [api_key] +  'method' + 'flickr.auth.getFrob'</p></blockquote><p>i successfully got the frob , but the problem came when i request a authorized token by integrating &amp; converting in MD5</p><blockquote>  <p>secret + 'api_key' + [api_key] +  'frob' + [frob] + 'method' +  'flickr.auth.getToken'</p></blockquote><p>but unfortunately i am getting invalid frob , i don't why whats the problem.</p>","405383","","405383","","2010-10-08 11:59:43","2011-04-14 02:00:18","unable to get auth token in flickr","<android><flickr><flickr-api>","1","0","","",""
"3889241","1","3890276","","2010-10-08 09:22:45","1","4095","<p>i am checking networking connection using the below code:</p><pre><code>public static boolean haveInternet(Context ctx) {    NetworkInfo info = (NetworkInfo) ((ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();   if (info == null || !info.isConnected()) {          return false;  // no connection   }  return true;   // true if having connection}       </code></pre><p>Now, on ""no connection"" , i am launching ""Wireless settings"" dialog using the below code:</p><pre><code>    context.startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));</code></pre><p>Here, user is being able to ""on/off"" the wireless, <strong>now how do i come to know whether the user has made ""on"" the wi-fi or not? i.e. what result is returned by the above intent on the successful wireless connection. how do i check it ?</strong></p><p>I think i need to call startActivityForResult method, but dont know how do i do it ?</p><p><strong>Update:</strong></p><p>I want to do same way as <a href=""http://groups.google.is/group/android-developers/msg/6874a5e4675dffdb"" rel=""nofollow"">http://groups.google.is/group/android-developers/msg/6874a5e4675dffdb</a></p>","379693","","379693","","2010-10-08 11:08:52","2010-10-08 12:04:03","Wireless settings dialog","<android><internet><android-intent><internet-connection><android-wireless>","1","1","2","",""
"3889388","1","","","2010-10-08 09:44:16","4","2100","<p>The title explains it all. I have a class that extends AsyncTask. I call it directly in main thread using new classname.execute().</p><p>Now in the doInBackground(params) i have Looper.prepare.Since i am getting an error ""Only one Looper may be created per thread"", i need to use Looper.quit() inside it. But i am not able to find it inside Looper class when i write Looper.quit();</p><p>So how to use this quit function </p>","405521","","","","","2011-09-05 19:32:21","Android: not abe to find Looper.quit()","<android><loops>","1","4","","",""
"3889457","1","","","2010-10-08 09:54:58","-1","737","<p>error:</p><p>The project was not built due to ""Resource already exists on disk: '/Project/bin/default.properties'."". Fix the problem, then try refreshing this project and building it since it may be inconsistent Project  Unknown Java Problem</p>","479352","","","","","2010-10-08 10:12:28","Error in my existing android project","<android>","1","2","","",""
"3889526","1","","","2010-10-08 10:05:23","2","1367","<p>My target: I am trying to play a video when tapping on one of the item on the screen while still staying on that screen.</p><p>So I resort to PopupWindow but somehow VideoView doesn't show up in the popup.</p><p>I can display popup just fine but the VideoView doesn't(in fact, it's not invisible but rather freeze that section of the screen). If you look at the second and third screen, you will see that the invisible area isn't exactly rectangular. That's because I am animating the popupwindow.</p><p>I checked the VideoView itself inside another Activity and it plays nicely. I tested this with Nexus One and Galaxy S, both display the same result.</p><p>Quick search on StackOverflow shows this question : <a href=""http://stackoverflow.com/questions/2184364/android-video-hear-sound-but-no-video"">http://stackoverflow.com/questions/2184364/android-video-hear-sound-but-no-video</a>which leads to<a href=""http://stackoverflow.com/questions/2167608/android-not-playing-video-mp4"">http://stackoverflow.com/questions/2167608/android-not-playing-video-mp4</a>and both doesn't work for me.</p><p>Also, as you can see on the third screen, the MediaController doesn't exactly attach itself to the video or popupwindow but the Activity instead.</p><p>Here's the screens,</p><p><img src=""http://i.stack.imgur.com/Bfpka.png"" alt=""Normal screen""><img src=""http://i.stack.imgur.com/le9Gk.png"" alt=""Popup""></p><p><img src=""http://i.stack.imgur.com/4BWKx.png"" alt=""control""></p>","271736","","","","","2012-11-29 13:51:08","VideoView invisible in Popupwindow?","<android><popupwindow><videoview>","0","5","1","",""
"3889546","1","3889629","","2010-10-08 10:08:50","0","380","<p>Is it a good idea to put a <code>WebView</code> into each item of a <code>ListView</code> on Android?Or should I just use the <code>TextView</code> with <code>Spannd</code>?</p><p>I tried the <code>Html.fromHtml()</code> with <code>ImageGetter</code> to get the <code>Spanned</code>, but it does lots of parsing works for you and hard to customize it. And also it's different from what you see on a <code>WebView</code>.</p><p>Any idea would be helpful. Thanks.</p>","428022","","","","","2010-10-08 10:22:26","Is it a good idea to put a WebView into each item of a ListView on Android?","<android><listview><webview>","1","3","","",""
"3889549","1","3889605","","2010-10-08 10:09:12","4","3392","<p>I use this code in my getView:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.listrow, null);    }    Order o = items.get(position);    if (o != null) {        TextView tt = (TextView) v.findViewById(R.id.toptext);        ImageView thumb = (ImageView) v.findViewById(R.id.icon);        if (o.getOrderDrawable() != null) {            thumb.setImageDrawable(o.getOrderDrawable());        } else {            tt.setText(o.getOrderTitle());        }    }    return v;}</code></pre><p>The problem is when scrolling; sometimes the correct image shows, but sometimes when scrolling back/forward, the images shows randomly and that is not associated with the row.</p><p>The images are downloaded from the web.</p><p>How should I solve this problem?</p>","386562","","1659009","","2013-03-22 02:45:09","2013-03-22 02:45:09","Wrong image show up in my ListView rows","<android><listview>","3","0","2","",""
"3889641","1","3891296","","2010-10-08 10:24:43","0","704","<p>HiI am trying to fetch this xml response</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;desc c=""¥99""/&gt;</code></pre><p>but on my Android each time I get <strong>Â¥99</strong> ,after parsing the xml, instead of correct data(i.e.<strong>¥99</strong>).Is there any way to parse this Currency data correctly.Please correct me if I am missing something.EDIT:Here is the code that is used to get xml</p><pre><code>docBuilder = docBuilderFactory.newDocumentBuilder ();    InputSource is = new InputSource ();    is.setEncoding (""UTF-8"");    Document doc = null;        is.setCharacterStream (new StringReader (xmlStr));        doc = docBuilder.parse (is);    if (doc != null)    {            doc.getDocumentElement ().normalize ();            NodeList detail = doc.getElementsByTagName (""desc"");            String c = detail.item (0).getAttributes ().getNamedItem (""c"").getNodeValue ();    }</code></pre>","437703","","437703","","2010-10-08 14:31:18","2010-10-08 14:31:18","android:Resolved:Unable to parse Currency data text obtained from UTF-8 data","<android><xml><utf-8><currency>","5","0","","",""
"3889667","1","","","2010-10-08 10:30:10","2","7447","<p>I have an Android application to display an image on another image, such that second image's white colour is transparent. To do this, I have used two <code>ImageView</code>s, with the original image to be overlaid as <code>bitmap1</code> and the image to be made transparent as <code>bitmap2</code>. When I run this, I get some exceptions at the <code>setPixel</code> method.</p><p>Here's my code:</p><pre><code>Bitmap bitmap2 = null;int width = imViewOverLay.getWidth();int height = imViewOverLay.getHeight();for(int x = 0; x &lt; width; x++){    for(int y = 0; y &lt; height; y++)    {        if(bitMap1.getPixel(x, y) == Color.WHITE)        {            bitmap2.setPixel(x, y, Color.TRANSPARENT);        }        else        {            bitmap2.setPixel(x, y, bitMap1.getPixel(x, y));        }    }}</code></pre><p><code>imViewOverLay</code> is the <code>ImageView</code> of the overlay image. Any idea what might be going wrong in the above code?</p>","462695","","707111","","2012-07-13 19:08:58","2013-01-17 12:44:23","Making specific color in bitmap transparent","<android>","2","3","","",""
"3889704","1","3890217","","2010-10-08 10:35:38","0","95","<p>I want to create an sports application that contains the following.</p><ul><li>TabHost with three main categories. (News, Tables, live score)</li><li>The news category will have 2 sub categories. (Team news, league news)</li><li>Tables will have 3 sub categories. (Table, Stats, Schedule)</li><li>Live score will just Be a ListActivity.</li></ul><p>How should I design this?Should all main categories be separate activities?Should my sub categories be activities or just views?</p><p>If my sub categories are views i guess i would have to keep track of which view is the current to update/display the proper information.</p><p>Also how do i switch between views? Lets say i want to go from view 1 to 3?Using ViewFlipper i can only go to the next one step at the time.</p><p>Thanks!</p>","446413","","","","","2012-03-09 23:19:28","Application design help","<android>","1","0","","",""
"3889708","1","3890230","","2010-10-08 10:36:05","-1","725","<p>I was able get the value of ""quantity"" in my list when I use on click using this code:</p><blockquote>  <p>public void onItemClick(AdapterView  parent, View view, int position, long  id)<br>  {</p>    <blockquote><pre><code>         Object o = list.get(position);            HashMap&lt;?, ?&gt; fullObject = (HashMap&lt;?, ?&gt;)o;            String a = (String) fullObject.get(""quantity"");  </code></pre>        <p>}</p>  </blockquote></blockquote><p>now I want to change the value of ""quantity"" then update it in my list. any help? thanks a lot</p>","470153","","","","","2010-10-08 11:57:34","Need help editing values in Hashmap to be loaded in a listview","<android>","1","3","","",""
"3889712","1","3890193","","2010-10-08 10:36:41","-1","1061","<p>can anybody tell how to create a  xml file and write in android and where to put the file for aceess again is it possible to put into raw folder ?</p>","426344","","","","","2010-10-08 11:51:54","how to create a xml file and write in android and put into raw folder","<android>","1","0","","",""
"3889735","1","3894563","","2010-10-08 10:39:57","3","1219","<p>i have a image view which is drag able and zoom able but now i also need to put setOnLongClickListner on my image view. i have done that but it is not working. but when i disabled the ontouch event it started working. can anybody tell me please how to fix that.here is my code</p><pre><code>    image.layout(0, 30, screenWidth, screenHeight - 30);    image.setScaleType(ImageView.ScaleType.FIT_XY);    params = new RelativeLayout.LayoutParams(screenWidth, screenHeight - 30);    params.leftMargin = 0;    params.topMargin = 30;    layout.addView(image, params);    image.setOnLongClickListener(new View.OnLongClickListener() {        public boolean onLongClick(View v) {            Log.i(""its working"", ""its working"");            return true;                    }    });    image.setOnTouchListener(this);</code></pre><p>i,ll be very thankful.</p><p>thanks a lot.</p>","397901","","397901","","2010-10-08 10:59:36","2013-09-17 12:12:53","android setOnLongClickListner does not work with onTouch event","<android><imageview>","4","1","","",""
"3889772","1","3898616","","2010-10-08 10:47:25","1","1225","<p>I'm trying custom the theme of Media Volume Controller (I don't know what it's called, just try to name it). It's something like a Toast with ""Media Volume"" title which appears when we press volume buttons (+ and -) in games. But I don't know which View it's, or it's a Toast, a Dialog. So far as I try, I could not find anything which refers it. Only <strong>Activity.setVolumeControlStream(AudioManager.STREAM_MUSIC)</strong>to enable it in your Activity, and nothing more >_&lt;If someone know how to custom it, or just it's name, please help me!Thanks.</p>","470160","","","","","2010-10-10 01:30:29","Custom theme for Media Volume Controller (whatever it's called) of Android?","<android><media><volume>","2","0","1","",""
"3889862","1","3889881","","2010-10-08 11:04:06","0","2425","<p>I have just started android.</p><p>I just want to know that how can i call activity class from other java class.</p><p>i just want to pass class object to activity class.</p><p>anyhelp please.</p><pre><code>public class GsonParser extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    MagazineThread thread=new MagazineThread();    thread.start();}public GsonParser(JsonMagazineParser Obj){}</code></pre><p>}</p><p>and i am just doing like from other class.GsonParser obj=new GsonParser(this);passing obj to activity class.how can i achieve that.</p><p>can u please tell me.</p>","411359","","411359","","2010-10-08 11:33:29","2010-10-08 11:33:29","how can i call activity class from other java class?","<android>","1","1","1","",""
"3889872","1","3905176","","2010-10-08 11:05:21","1","759","<p>I'm developing an Android app which will target 2.1/2.2 devices, so I have my project set up to use the 2.2 SDK (API level 8), but allow for installation on devices with at least API level 7.</p><p>The problem is that during my daily development, I'm not always paying close attention to which API level of the methods/classes/constants that I'm using, which makes it very easy to break code on older devices.  I have got dynamic classloading working, and as much as I dislike having a ton of extra factory classes and interfaces in my project, I'm willing to deal with that solution.  Currently, the only way I have to check an older API level is to set my project's settings to the given level, rebuild, see what breaks, and then refactor.  It's quite a pain.</p><p>What I would really like is the ability to scan my code and check compatibility for a given API level without changing my global project build settings.  Is there some easy way to do this?</p>","14302","","","","","2011-06-27 07:35:26","Is there a way to check the API compatibility of my app for lower levels?","<android>","2","3","1","",""
"3889882","1","3890330","","2010-10-08 11:07:13","40","27494","<p>Does Android support SVG? any example?</p>","461972","","127880","","2012-10-05 15:05:24","2013-11-03 00:04:31","Svg support on Android","<android><svg>","8","2","12","",""
"3889884","1","","","2010-10-08 11:07:15","4","13790","<p>I have an image with a fixed size, ex. 300 x 300 ; it was a background image of my view. But my view  size was dynamic, so I need an image which can stretch, according to desired size.</p><ul><li>Can any one tell me how to make it ?</li><li>I know we have to use nine patch drawable ?</li><li>I don't know how to use the tool given with android sdk ?</li></ul><p>How to make image to png ?</p>","414777","","569101","","2012-11-25 12:40:01","2013-04-09 22:07:02","How to create nine patch png image in android?","<android><drawable><nine-patch>","1","5","1","2013-04-10 13:46:19",""
"3889915","1","4157588","","2010-10-08 11:12:03","4","9609","<p>I'm about to release a free app to the Android Market, and am unsure about the ""correct"" way to communicate that users shouldn't hold me liable if the app behaves incorrectly or produces wrong output. </p><p>A ""typical"" EULA seemed overkill for this sort of thing. I really don't care if the app is copied/redistributed/reverse-engineered. </p><p>I was thinking of having a simple dialog called ""Disclaimer"" that pops up at first-time startup and states that there are no warranties.</p><p>Would this be fine? Or are there reasons for going the EULA way?</p>","322934","","","","","2013-05-09 17:51:54","EULA vs simple disclaimer for Android App","<android><eula><disclaimer>","2","1","2","",""
"3889984","1","6668428","","2010-10-08 11:22:18","0","353","<p>I was wondering if anyone knows how the scrolling in TweetDeck can be done. In particular how they did it so that the last item can be scrolled up to the top of the listview.</p><p>I think this is kinda awesome and would like to use such a behavior in my app too.</p>","381899","","","","","2011-07-12 17:28:53","Scrolling ListView like in TweetDeck","<android><listview><scroll><adapter>","1","0","4","",""
"3889991","1","3890080","","2010-10-08 11:23:30","0","477","<p>i am trying to make facebook asynchronous non blocking thread in android. due to which our UI is run separate thread but i am unable to do that can any one tell me how to do that.and If possible pleade give me one example. Thanks.........  </p>","343678","","","","","2010-10-08 11:37:06","How to make Asynchronous nonblocking thread FACEBOOK in Android","<android><facebook>","1","1","","",""
"3889994","1","","","2010-10-08 11:24:10","2","15405","<p>i have a list view with 15 items. when i click on any item i want to change the screen(Intent). how can  i change the activity on item selected in android?any tutorial or source code?</p><p>thanks in advance.</p>","383597","","","","","2013-02-07 08:40:22","Android list view on click","<android>","3","2","","",""
"3890012","1","","","2010-10-08 11:27:04","0","1780","<p>I have a application 'A' and application 'B'. </p><p>Say, I have a string resource in the application 'A'</p><pre><code>&lt;\string name=""abc""&gt;ABCDEF&lt;\/string&gt;</code></pre><p>How do I access the value of abc from the Activity in 'B'.</p><p>I tried the following method.</p><pre><code>try {    PackageManager pm = getPackageManager();    ComponentName component = new ComponentName(        ""com.android.myhome"",        ""com.android.myhome.WebPortalActivity"");    ActivityInfo activityInfo = pm.getActivityInfo(component, 0);    Resources res = pm.getResourcesForApplication(activityInfo.applicationInfo);    int resId = res.getIdentifier(""abc"", ""string"", null);}catch(NameNotFoundException e){}</code></pre><p>Always resId is returned 0 always.. Can anyone please let me know if I could access string abc from the application 'B'</p><p>Regards,SANAT</p>","466535","","302328","","2011-03-23 07:18:05","2013-12-11 03:48:40","How to access String resource from another application","<android>","3","0","1","",""
"3890018","1","3890791","","2010-10-08 11:27:41","1","607","<p>I have a PNG file that is 32x32 pixels.  I use 8 of these as drawables in a row for my app.  These drawables are not in the hdpi, mdpi, or ldpi folders.  I’ve found that when starting any of the 3 standard size emulators, the screen view with all 8 drawables looks pretty much the same.</p><p>I note that the ldpi emulator I’m using (QVGA) has a resolution of 240x320.  8 x 32 = 256, so since I can see all my drawables (and space in-between) I’m betting something is changing their size.</p><p>I’ve read the <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">Supporting Multiple Screens</a> document at the Android developers page, but I still don’t understand what is actually happening.  Could you put your own words to explain what is happening to the size of my drawables and how the SDK knows to automatically modify them? </p>","432209","","","","","2010-10-08 13:09:35","How are PNG files defined as drawable objects resized based on the resolution of the Android phone?","<java><android><eclipse><image><drawable>","1","0","","",""
"3890021","1","","","2010-10-08 11:28:26","2","2592","<p>How to draw chart like the following image in android<img src=""http://i.stack.imgur.com/mgxNy.jpg"" alt=""alt text"">what is the tool can we use?</p>","461972","","","","","2012-10-30 19:14:23","Drawing stock chart in android","<android>","0","0","1","",""
"3890031","1","3970606","","2010-10-08 11:30:48","3","1796","<p>I've got an app which I would like to distribute through the market place and also from my own site.  How do I, using only one build and one key, check to see if the app was downloaded from the market place or not?</p><p><a href=""http://stackoverflow.com/questions/986627/detect-if-app-was-downloaded-from-android-market"">This question</a> is answered by having the code signed with different keys, but we ideally want a single build.</p>","264276","","","","","2011-10-21 18:02:49","android: Detect if App was downloaded from market","<android><download><google-play>","5","2","4","",""
"3890033","1","3890177","","2010-10-08 11:30:59","19","55292","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup"">Stop EditText from gaining focus at Activity startup?</a>  </p></blockquote><p>In my application I have a single EditText together with some TextViews, button and a spinner. My EditText receives focus since it is the only focusable view in this activity, I believe. My EditText shows with an orange border and cursor on the field.<br>Now I would like to remove the focus from this field (I don't want the cursor and border to show). Is there a way to do this?<br> I have been able to focus on the button by doing button.seFocusableInTouchMode() and button.requestFocus(). But this highlights the button and is obviously not what I want.</p>","462754","","","","","2012-09-21 12:17:17","How to remove focus from single editText","<android>","4","0","","2012-09-22 09:22:01",""
"3890098","1","4673388","","2010-10-08 11:40:33","3","2868","<p>I installed the add-on <a href=""http://innovator.samsungmobile.com/galaxyTab.do"" rel=""nofollow"">provided by Samsung</a> so I could create an AVD that would emulate a Galaxy Tab, but unfortunately my most important project uses the Google API (for using the Maps external library) which is not supported by the single additional target that the add-on provides. Does anyone know of any way to have an AVD for the Tab <em>with</em> support for the Google API?</p>","321103","","","","","2012-08-28 22:21:02","Samsung Galaxy Tab AVD with Google API?","<android><tabs>","3","0","5","",""
"3890151","1","","","2010-10-08 11:46:54","1","2909","<p>The below is the piece of code that i have written for transferring the focus from one edit text to another, but the problem that i got with this implementation is, the focus moves to the particular edit text, and suddenly moves to the next edit text.So, i could not able to enter anything , since the focus is not at all staying that particular edit text ..</p> <pre>//some code comes here// gun_pistolNotes and gun_pistolModel are two diff. editText............    gun_pistolNotes.setOnEditorActionListener(new OnEditorActionListener(){    @Override    public boolean onEditorAction(TextView view,int actionId, KeyEvent event){    if(actionId == EditorInfo.IME_ACTION_UNSPECIFIED){        gun_pistolModel.requestFocus(); // moves to this edittext and suddenly moves to another editext         return true;    }    return false;    }  });............//some code comes here</pre><p>Any Help  is Appreciated.</p><p>Thanks in advance.</p>","384193","","","","","2014-03-14 15:43:35","problem with Android requestFocus()","<android><edittext>","3","0","","","2010-10-08 11:47:12"
"3890218","1","3892336","","2010-10-08 11:56:17","0","280","<p>I've created a few applications that have been targetted against 2.2</p><p>I'm thinking to invest in a cheap handset to try these out (thus far only used emulator). The handset I want is running verion 2.1 of Android.</p><p><strong>From a code point of a view, is there any major changes between 2.1 and 2.2 that could potentially cause me an issue?</strong></p><p>I understand there would be issues if I was trying to deploy to a 1.x handset (such as People/ContractsContact etc) but I can't see anything to say a 2.2 app would fail on a 2.1 environment</p><p>(I could try to change emulator target, but curious to know from others with actual handsets)</p><p>Thanks</p>","155695","","","","","2010-10-08 17:18:48","Android; are there any changes between 2.1 and 2.2 that developers need to be aware of with backwards compatability?","<android><android-emulator><android-2.2-froyo><android-hardware>","3","0","","",""
"3890325","1","3962213","","2010-10-08 12:12:01","7","1210","<p><br/>what's the best way to mask a EditText on Android? <br/>I Would like my EditText to behave like this decimal number input <a href=""http://www.meiocodigo.com/projects/meiomask/#mm_demos"" rel=""nofollow"">here</a>.Is there a easy way to do this? </p>","181915","","168868","","2012-01-06 17:27:34","2012-01-06 17:27:34","what's the best way to apply a mask to an EditText on Android?","<java><android>","2","0","1","",""
"3890381","1","3964460","","2010-10-08 12:20:13","15","20984","<p>I have included the camera functionality in my application. I have also launched the app in the market. I got an error message from one of the users that he is getting an error while opening the camera.</p><p>I have tested the app on the device on 2.1. The error I got from the user is using nexus one which will mostly run 2.2...Here's the logcat error that I've received...</p><pre><code>java.lang.RuntimeException: setParameters failedat android.hardware.Camera.native_setParameters(Native Method)at android.hardware.Camera.setParameters(Camera.java:647)at com.CameraApp.Preview.surfaceChanged(Preview.java:67)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.ViewGroup.drawChild(ViewGroup.java:1638)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)at android.view.View.draw(View.java:6743)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:6743)at android.widget.FrameLayout.draw(FrameLayout.java:352)at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)at android.view.ViewRoot.draw(ViewRoot.java:1407)at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4627)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I ran the app on 2.2 emulator also to check it. But it worked fine. Can anyone please tell me why the error is occurring?</p><p>Here is the class which I mentioned in the comments:</p><pre><code>class Preview extends SurfaceView implements SurfaceHolder.Callback {    private static final String TAG = ""Preview"";    SurfaceHolder mHolder;    public Camera camera;    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);    }    public void surfaceCreated(SurfaceHolder holder)     {        // The Surface has been created, acquire the camera and tell it where        // to draw.         camera = Camera.open();        try {        camera.setPreviewDisplay(holder);        } catch (IOException exception) {        camera.release();        camera = null;            // TODO: add more exception handling logic here        }    }    public void surfaceDestroyed(SurfaceHolder holder)     {        // Surface will be destroyed when we return, so stop the preview.        // Because the CameraDevice object is not a shared resource, it's very        // important to release it when the activity is paused.        camera.stopPreview();        camera.release();        camera = 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 = camera.getParameters();        parameters.setPreviewSize(w, h);        camera.setParameters(parameters);        camera.startPreview();    }    @Override    public void draw(Canvas canvas)     {        super.draw(canvas);        Paint p= new Paint(Color.RED);        Log.d(TAG,""draw"");        canvas.drawText(""PREVIEW"", canvas.getWidth()/2, canvas.getHeight()/2, p );    }}</code></pre>","400942","","708312","","2012-01-20 03:47:25","2014-02-14 18:42:26","camera.setParameters failed in android","<android>","1","2","8","",""
"3890384","1","","","2010-10-08 12:21:34","0","1139","<p>My android app sends a Data sms. All the phones are able to receive that message except my android.I have added a broadcast receiver in the manifest:</p><p><code>&lt;receiver android:name="".SMSReceiver""&gt;        &lt;intent-filter android:priority=""10""&gt;        &lt;action android:name=""android.intent.action.DATA_SMS_RECEIVED"" /&gt;            &lt;data android:scheme=""sms"" /&gt;            &lt;data android:port=""5009"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></p><p>The application does not give any response when data sms is received, although the msg reaches the inbox. Help.</p>","467827","","","","","2011-04-25 19:11:23","android receive Data_Sms","<android><data><sms><broadcastreceiver>","1","0","","",""
"3890417","1","3890542","","2010-10-08 12:25:51","0","199","<p>I am very new to android.</p><p>Also very new to java, so please feel free to give me any advice, I would very appreciate it.</p><p>the question is in lunarlander.java </p><pre><code>/** A handle to the thread that's actually running the animation. */private LunarThread mLunarThread;/** A handle to the View in which the game is running. */private LunarView mLunarView;</code></pre><p>but in lunarview.java</p><pre><code>class LunarView extends SurfaceView implements SurfaceHolder.Callback {/** Handle to the application context, used to e.g. fetch Drawables. */private Context mContext;/** Pointer to the text view to display ""Paused.."" etc. */private TextView mStatusText;class LunarThread extends Thread</code></pre><p>I have only learned C and C++</p><p>so i can't figure it out why can I call a inner class??</p>","408278","","","","","2010-10-08 12:41:29","about Lunar lander in Android (inner class)","<android>","1","0","","",""
"3890453","1","3890926","","2010-10-08 12:29:34","1","3637","<p>I'm working on a simple android app in which I want to, once the user has clicked a button on the main screen, display the streetview of known coordinates.</p><p>I can create display a map like so:</p><pre><code>    mapView = (MapView) findViewById(R.id.mapView);    mapView.setBuiltInZoomControls(true);    mapController = mapView.getController();    mapController.setZoom(6); // Zoom 1 is world view    GeoPoint point = new GeoPoint(...);    mapController.setCenter(point);    mapController.animateTo(point);</code></pre><p>Through this method, I could easily add my own buttons, overlays, etc over the map which my user could press to do certain actions based on their current location on the map.</p><p>I want to, instead of displaying a map, display a streetview with my own custom buttons displayed on top of it (along with the standard google ones). The only way I've found of displaying a streetview is as follows:</p><pre><code>String uri = ""google.streetview:cbll=""+ latitude+"",""+longitude+""&amp;cbp=1,99.56,,1,-5.27&amp;mz=21"";Intent streetView = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(uri));startActivity(streetView);</code></pre><p>Is there any way to start a streetview in a way through which it could be embedded into my application so that I could put buttons on top of the streetview which would allow my user to do certain actions based on their current location?</p><p>Many thanks in advance,</p><p>r3mo</p>","421636","","","","","2012-10-28 11:15:20","Android: using StreetView without starting an intent","<android><google-street-view>","1","1","1","",""
"3890473","1","","","2010-10-08 12:32:04","0","1024","<p>I have some problem with android application in my application i have to use sql lite as a database but i have the data in XML format. so i am facing problems in inserting the data into database.</p>","470223","","21234","","2010-10-08 12:33:21","2011-05-11 10:53:12","how to insert xml file into sql lite database","<android><xml><xml-parsing><xml-database>","1","3","","",""
"3890727","1","","","2010-10-08 13:03:35","1","3057","<p>I'm trying to query the Contacts content provider outside an Activity. But managedQuery is a method of Activity. Is there any other class/method that I can use instead of managedQuery?</p><p>Here's my code:</p><pre><code>class MyActivity extends Activity {  private Cursor getContacts() { Uri uri = ContactsContract.Contacts.CONTENT_URI; String[] projection = new String[] { ContactsContract.Contacts._ID,   ContactsContract.Contacts.DISPLAY_NAME,   ContactsContract.Contacts.HAS_PHONE_NUMBER }; String where = null; String[] whereArgs = null; String sortOrder = ContactsContract.Contacts.DISPLAY_NAME   + "" COLLATE LOCALIZED ASC""; return context.managedQuery(uri, projection, where, whereArgs, sortOrder);  } }</code></pre>","456874","","","","","2010-10-08 13:51:55","How can i query the contacts content provider outside an activity?","<android><android-contentprovider>","1","0","1","",""
"3890752","1","6286505","","2010-10-08 13:06:23","5","4655","<p>I'm adding AdMob ads (say that five times fast) to my finished, published Android app. I added the code from the PDF included with AdMob, following their instructions to a tee. The test ads show up fine on my emulators and specified test devices. They just don't appear in the published marketplace app when you download and run it. I still get impressions on my AdMob page however. Any ideas?</p>","468498","","468498","","2010-10-08 14:41:14","2011-06-17 17:07:54","AdMob Ads not displaying","<android><admob>","4","0","","",""
"3890857","1","3893028","","2010-10-08 13:16:49","2","1447","<p>In last days I'v got very often many error messages because of database leak in my application, so now I open Database, get query results from it and close DB again.</p><p>But I use also a cursoradapter for my autocompletetextview.</p><p>Should I also do it on that way there: open DB, get cursor, close DB?!</p><p>I mean, I haven't got any problems because of not doing that, but ...</p><p>So I need tips from experts, tips from you</p>","408780","","127880","","2013-01-19 17:00:18","2013-01-19 17:00:18","To close or not to close?","<android><sqlite><cursor>","3","2","0","",""
"3890948","1","3891313","","2010-10-08 13:24:44","1","712","<p>In an effort to reduce duplication, I have my app's workspace split into 3 projects:</p><ul><li>Main (A library project, where all of the common code lives)</li><li>Free (To make the free version)</li><li>Paid (To make the paid version)</li></ul><p>Behavior in the free version and the paid version must differ sometimes.  How can I ""call into"" the final projects from the library project?</p><p>Here is some sample psuedo-code to illustrate my question:</p><h2>In the Main project:</h2><pre><code>private void makeADecision() {    if (AppCode.isPaid()) {        // do one thing    } else {        // do something else    }}</code></pre><h2>In the Free project:</h2><pre><code>public class AppCode {    public static bool isPaid() {        return false;    }}</code></pre><h2>In the Paid project:</h2><pre><code>public class AppCode {    public static bool isPaid() {        return true;    }}</code></pre><p>That is basically what I have tried, but it won't compile because the Main project doesn't know about the AppCode class.</p><p>Bear in mind that this is only an example, so try not to focus on how an app can tell if it is the paid version or not. :) So far the best solution I have found is to put a string in the resources of all three projects and then make a decision based on its value but I don't like that method. Besides being ugly, I would prefer to keep functionality where it belongs.  That way I can prevent ""paid-only"" functionality from being compiled into the free version at all and I can avoid having to include any ""free-only"" code in the paid version.</p>","19476","","","","","2012-01-08 14:16:34","How can a code in a library project call code in the application project?","<android>","5","0","1","",""
"3890991","1","3891502","","2010-10-08 13:29:42","0","233","<p>i have a image view and on top of it i have a button. now what i want is when i click on the button i should get a list of images on same Activity.actually i am trying to make a list in button,s onClick event. event gets fired but it does not show the list. anybody can have any idea how shall i achieve this i am also making my layout programmatically.</p><p>thanks alot</p>","397901","","","","","2011-07-14 09:00:01","get a small list when clicked on a button","<android><listview>","1","0","","",""
"3891018","1","","","2010-10-08 13:32:12","2","1701","<p>I have an HTC buzz, which has a smaller screen (QVGA) than most android phones. Now there is an application (hyves) which is in the market but when I scan their QR code or try it via appbrain it keeps saying Not Found. A frien of mine (who now is in belgium) has a G1 and I've copied the APK when he installed hyves. The app itself works fine just the icons are a little to large, but that is not annoying. </p><p>Now the problem, there is an update, and I cannot install it via the normal way. Is there a way to get the download URL of an APK in the market (via cyrket or so)? I can try to sniff my network when the phone trys to get an app but I'm not sure how to do that and if that would work...</p>","470278","","","","","2010-10-08 14:01:40","How do I get the .apk url of an android app in the market?","<android><download><apk>","2","1","1","",""
"3891141","1","","","2010-10-08 13:44:58","10","7932","<p>Is there any API for drawing financial chart in android?</p>","461972","","127880","","2012-10-05 15:02:05","2013-01-04 05:42:00","Api for drawing chart in android","<android>","5","0","1","",""
"3891206","1","3891620","","2010-10-08 13:50:27","0","3420","<p>I want to display List of Contact Names with the respective phone numbers</p><p>like</p><hr><p><strong>Vikas Patidar       &lt;9999999999></strong></p><hr><p><strong>Rahul Patidar       &lt;9999999999></strong></p><hr><p>using AutoCompleteTextView when a user type text in the mobile number field.</p><p>In default style I can only display the list of names.</p><p>Can anyone please tell me how can I implement this so that when a user select any item in list and I can display number of that in Mobile number field.</p>","457982","","457982","","2011-01-10 06:55:20","2011-01-10 06:55:20","Custom AutoComplete in Android","<android><autocomplete><autocompletetextview>","1","0","","",""
"3891287","1","3891391","","2010-10-08 13:59:11","1","1481","<p>I have a ViewFlipper defined that contains 3 views...</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/flipper"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;  &lt;include android:id=""@+id/first"" layout=""@layout/first_view"" /&gt;  &lt;include android:id=""@+id/second"" layout=""@layout/second_view"" /&gt;  &lt;include android:id=""@+id/third"" layout=""@layout/third_view"" /&gt;&lt;/ViewFlipper&gt;</code></pre><p>I also have a custom View defined within my Activity...</p><pre><code>private class CompassView extends View {   @Override   protected void onDraw(Canvas canvas) {  ...  }}</code></pre><p>Some how, I need these linked together so that the 'third_view' defined in the XML layout file needs to be a CompassView, or have a CompassView added to it.</p><p>What I can do is drop the 'third_view' from the layout and then add in the CompassView manually..</p><pre><code>viewFlipper = (ViewFlipper)findViewById(R.id.flipper);viewFlipper.addView(new CompassView(this));</code></pre><p>But then I lose the ability to define other view controls within the layout file.</p><p>Can I add CompassView to 'third_view' declaratively?</p>","417479","","","","","2010-10-11 09:19:48","How do I add a custom view to ViewFlipper","<android>","1","0","","",""
"3891367","1","3891590","","2010-10-08 14:07:30","0","1233","<p>I want to get a code of content provider which a database is created. I am using the tool which located here tools/sqllite3.exe to check if the database is created.</p><p>Please let me know the step by step procedure for this thing ...</p><p>Thanks,-D</p>","418965","","","","","2013-04-03 13:39:35","Android Content provider","<android><android-manifest><android-contentprovider>","2","0","1","",""
"3891445","1","3895367","","2010-10-08 14:15:27","0","1258","<p>I'm trying to write a Service which sits and waits for SMS messages (using a BroadcastReceiver which the server registers) and will take some action depending on the details of the SMS message.  I use an Activity to startService() and stopService() for the Service.  After I close the Activity, the Service continues to sit there with its state kept and its BroadcastReceiver waiting, as it should...  However, I find that over time, randomly, the Service will restart itself.  That is, onCreate() and onStartCommand() will be called even when the Service has already been started.  This happens sometimes when my phone sits idle overnight...</p><p>Can anyone provide insight on why this is (phone requests resources and kills a service?), what I can do to prevent it, or what I can do to prevent the state of the service from being lost?</p><p>Thanks in advance.</p>","387052","","387052","","2010-10-09 00:51:53","2012-07-27 12:49:03","Android Service restarts randomly","<android>","3","0","","",""
"3891446","1","","","2010-10-08 14:15:42","0","216","<p>I have some common actions fired in <code>onPause()</code> and <code>onResume()</code> methods. (Like registering and unregistering <code>BroadcatsReceivers</code>)</p><p>Now I put them in abstract classes and extend Activity classes.</p><p>After creating some abstract classes with common actions I end up with situation when I can't extend Activity because of Java's lack of multiple inheritance. </p><p>How you deal with such things? Do you duplicate code or do something smarter?</p><p>I'm wondering if it's wider problem - not only concerning Android, but Java language.</p>","296427","","296427","","2010-10-14 21:45:12","2013-04-16 10:01:27","Common tasks in Activities methods - how to organize them?","<android><inheritance><activity>","1","2","1","",""
"3891538","1","","","2010-10-08 14:25:38","0","116","<p>I am getting the value from web server .I am getting the value as string can anybody tell how to convert to string to  xml file and where to store the xml file in android  and how to access the file  parse the value can any body give example </p><p>any help would be appreciated</p><p>Thanks in advance   </p>","426344","","390989","","2010-10-08 14:28:16","2010-10-08 17:27:04","parser problem in android","<android>","2","0","","",""
"3891554","1","","","2010-10-08 14:27:59","0","516","<p>My initial activiy is basically a splash screen while preforming initialization and login in to network server.  To save memory I want to finish() the splash activity once it starts the main menu activity.  I still want the remote service to operate.  Testing shows it does.  But am I going to get into trouble doing this?</p><p>I know I can restart the remote from the main menu activity but I am trying to save overhead by not starting it twice.  The remote service is required by the splash activity.</p>","465199","","","","","2010-10-08 15:49:39","Activity starts Remote service, Starts another activity and finish() initial activity. Is this a problem?","<android>","1","0","","",""
"3891568","1","3891585","","2010-10-08 14:29:29","2","160","<p>The code is like this:</p><pre><code>private DatabaseHelper mOpenHelper;@Overridepublic boolean onCreate() {  mOpenHelper = new DatabaseHelper(getContext());  System.out.println(""done"");  return true;}</code></pre><p>Now Eclipse is showing me an <strike>error</strike> warning on the first line of this code ""private DatabaseHelper mOpenHelper"", that the object mOpenHelper is not used anywhere, whereas in the very next lines of code, I am initializing it. Please tell me why is this happening?</p><p>Thanks,<br>-D</p>","418965","","1977903","","2011-11-02 08:51:55","2011-11-02 08:51:55","Android/Java - Issue","<java><android>","2","2","1","",""
"3891629","1","3891703","","2010-10-08 14:38:25","1","361","<p>I'm new to Android and I'm porting an iPhone app I did. I've been reading up on Android services and they look very useful for the network component of my app. I assume there is a common pattern for what I'm trying to do, so here are the details:</p><ol><li>User1 and User2 agree to enter a virtual room.</li><li>They send messages to each other and get notified when they receive a messages.</li></ol><p>I'm using a remote server to handle the communication. So basically, I need three methods. One to add the users to a room, one to send messages and one to get messages. Nothing special.</p><p>What I'd like to do is have one service that accepts a few paramaters. One being which web service method to call, the rest being the parameters that need to be passed to the respective web services. I'd prefer this approach to having a different service for each method call. Any suggestions on the best approach? I'm not clear on how to pass parameters to services.</p><p>Btw, this is not a question about polling, callbacks or broadcasting. I'm aware of those. I really want to know if it's feasible to pass a variable amount of parameters to a service, or it there is perhaps something else I should look into.</p>","462440","","","","","2010-10-08 14:48:40","Android service architecture question","<android><service>","1","0","1","",""
"3891679","1","","","2010-10-08 14:44:46","0","234","<p>We are trying to determine the best way to patch InputDevice.java tocorrect a sensor issue. The touchscreen is detecting the locationopposite of the pressure. For instance, to unlock the device, I haveto put my finger in the exact spot on the left side of the screen forit to register on the right side. The same thing happens for buttons,press right to touch the left button, and vice versa. We thought itmight be possible to half the absolute value, but that may not work asthe absX range is 0-4095. From debug:</p><p>Left SideD/InputDevice( 1062): reportData[j + MotionEvent.SAMPLE_X] = 3708.0D/InputDevice( 1062): absX.minValue  = 0D/InputDevice( 1062): absX.range  = 4095D/InputDevice( 1062): w  = 799D/InputDevice( 1062): reportData[j + MotionEvent.SAMPLE_X] = 3711.0D/InputDevice( 1062): absX.minValue  = 0D/InputDevice( 1062): absX.range  = 4095D/InputDevice( 1062): w  = 799</p><p>Right Side/InputDevice( 1062): reportData[j + MotionEvent.SAMPLE_X] = 256.0D/InputDevice( 1062): absX.minValue  = 0D/InputDevice( 1062): absX.range  = 4095D/InputDevice( 1062): w  = 799</p><p>Would adjusting currentmove be the place? or is there a better way tocorrect this issue in Froyo?</p>","470344","","","","","2011-05-11 19:34:06","X Axis Sensor Correction - Flipped Sensor Detection - Froyo","<android>","1","0","","",""
"3891744","1","","","2010-10-08 14:53:48","1","388","<p>The datepicker runs without problem. But if the datepicker is under tabwidget, it failed. Anyone has experience on that ??? and how to solve it ??</p><pre><code>public class TestActivity extends Activity implements OnClickListener{    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);    layout = new LinearLayout(this);          layout.setOrientation(LinearLayout.VERTICAL);        date = new Button(this);        date.setText(""Choose Date"");        layout.addView(date,                new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,                                              LinearLayout.LayoutParams.WRAP_CONTENT));        date.setOnClickListener(this);        incomehelper = new FinanceHelper(this);        chosenDate = incomehelper.getToday();        setContentView(layout);    }    public void onClick(View v)     {      showDialog(DATE_ID);    }    protected Dialog onCreateDialog(int id)     {        Calendar cal = Calendar.getInstance();        int calyear = cal.get(Calendar.YEAR);        int calmonth = cal.get(Calendar.MONTH);        int calday = cal.get(Calendar.DAY_OF_MONTH);        switch (id)         {            case DATE_ID:               return new DatePickerDialog(this,  mDateSetListener,  calyear, calmonth, calday);        }            return null;    }    private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener()     {        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth)         {           chosenDate = incomehelper.getSelectedDate(dayOfMonth,monthOfYear,year);           Toast.makeText(TestActivity.this, ""Date Selected is =""+chosenDate, Toast.LENGTH_SHORT).show();        }    };}   </code></pre>","463451","","21234","","2010-10-08 15:01:59","2010-10-08 15:01:59","Datepicker problem using tabs (Tabwidget)","<android><datepicker><tabwidget>","0","3","","",""
"3891747","1","","","2010-10-08 14:53:54","1","396","<p>I have build a sort of split view for one of my android applications. I have made an activity which is a container of a listview and a framelayout. I use the listview for a menu and in my framelayout, I load views of different activities. I have read the source code of the <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/TabHost.java"" rel=""nofollow"">TabHost</a> for building this system.</p><p>Activities that I load in my framelayout could contain a webview.</p><p>The system work pretty well but I have a big issue. When I click on a field in a webview, the soft keyboard doesn't appear and typing on the physical keyboard has no affect.</p><p>I have made many many researches and I found nothing :'( I really appreciate if somebody could give me an idea for solving this issue.</p>","470263","","","","","2010-10-12 09:22:46","Impossible to write something on a field","<android>","2","0","1","",""
"3891992","1","3893179","","2010-10-08 15:25:02","3","6045","<p>I have an XML layout with some custom tabs, a heading, and a <code>ProgressBar</code>(<code>main.xml</code>).  I wish to add another XML layout(<code>home.xml</code>) to the <code>main.xml</code> layout, as i wish to keep <code>main.xml</code> re-usable for other activity's layouts and simply add things to it as necessary. </p><p><code>home.xml</code> contains a <code>ScrollView</code> and a <code>TextView</code>.  I am currently using my Activity's <code>LayoutInflator</code> to add <code>home.xml</code> to <code>main.xml</code>:</p><pre><code>LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);inflater.inflate(R.layout.home, rootLayout);</code></pre><p><code>rootLayout</code> is the root layout of <code>main.xml</code> and is a <code>RelativeLayout</code></p><p>The problem: after inflating <code>R.layout.home</code> into <code>rootLayout</code>, it seems as though the <code>ProgressBar</code> contained in <code>rootLayout</code> is hidden underneath the content of <code>home.xml</code></p><p>Is there a way to tell certain views(via XML) to float above other views when the layout is constructed in this way?</p><p>if not, am i forced to use methods such as <code>progressBar.bringToFront()</code> to raise targeted views to the top?</p><p>what alternatives do i have in z-ordering views when some layouts are constructed using inflation?</p><p>edit: it seems as though the <code>bringToFront()</code> method is not doing what i expect - i call it on one of my <code>Button</code> views and it still appears to be ordered below all other views(which were inflated) and remains unclickable</p>","416412","","416412","","2010-10-08 15:32:37","2012-08-31 17:16:52","Add view to XML layout programmatically and make its z order below an existing view","<android>","2","0","1","",""
"3892006","1","3892311","","2010-10-08 15:26:24","0","751","<p>I have an <a href=""http://developer.android.com/intl/fr/reference/android/widget/ExpandableListView.html"" rel=""nofollow"">ExpandableListView</a> that I want to populate with my custom views of type <code>NoteView</code>.  <code>NoteView</code> extends LinearLayout and contains two buttons and a checkbox.  I have almost everything working, the <code>NoteView</code>'s are being populated with backing data, the lists are getting filled, and the buttons are clickable and perform the required tasks.  </p><p>The problem is the <a href=""http://developer.android.com/intl/fr/reference/android/widget/ExpandableListView.html"" rel=""nofollow"">ExpandableListView</a> no longer responds to click/longclick/keypress events at all (other than selecting list items with trackball/DPAD).</p><p>I replaced my custom view with a standard TextView and the touch events flowed normally again, so it is almost certainly something I am doing wrong with my custom view or some obscure ListView setting I am overlooking.</p><p>Here is my NoteView code and XML Layout.  What am I missing?</p><pre><code>//Custom Note Viewpublic class NoteView extends LinearLayout{    private CheckBox mCheckBox;    private TextView mTitleTextView;    private TextView mDetailsTextView;    private TextView mDetailsRightTextView;    private LinearLayout mButtonLayout;    private Button mDeleteButton;    private Button mEditButton;    //data storage    private long mNoteId = -1;    private boolean mStretched = false;    private CharSequence mDetails = """";    private CharSequence mStretchedDetails = """";    private CharSequence mDetailsRight = """";    private CharSequence mStretchedDetailsRight = """";           private NoteView.OnNoteButtonClickedListener mEditNoteListener;    private NoteView.OnNoteButtonClickedListener mDeleteNoteListener;    private NoteView.OnNoteCheckBoxClickedListener mCheckboxListener;    public NoteView(Context context) {        super(context);        init(context);    }    public NoteView(Context context, AttributeSet attrs) {        super(context, attrs);        init(context);    }    private void init(Context context) {        this.setPadding(0, 0, 5, 0);        this.setOrientation(LinearLayout.VERTICAL);        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.noteview_layout, this);//returns the noteview itself, since is parent        //get views        mCheckBox = (CheckBox) findViewById(R.id.noteViewCB);        mTitleTextView = (TextView) findViewById(R.id.noteViewTitle);        mDetailsRightTextView = (TextView) findViewById(R.id.noteViewDetailsRight);        mDetailsTextView =  (TextView) findViewById(R.id.noteViewDetails);        mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {            @Override            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {                if(mCheckboxListener != null)                {                    mCheckboxListener.onNoteCheckBoxClicked(mNoteId, isChecked);                }            }        });        //prepare button layout        mButtonLayout = (LinearLayout) findViewById(R.id.noteViewButtonLayout);        mEditButton = (Button) findViewById(R.id.noteViewEditButton);        mDeleteButton = (Button) findViewById(R.id.noteViewDeleteButton);        mEditButton.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                if(mEditNoteListener != null)                {                    mEditNoteListener.onNoteButtonClicked(mNoteId);                }            }        });        mDeleteButton.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                if(mDeleteNoteListener != null)                {                    mDeleteNoteListener.onNoteButtonClicked(mNoteId);                }            }        });    }    public void setOnEditClickedListener(NoteView.OnNoteButtonClickedListener listener)    {        mEditNoteListener = listener;    }    public void setOnDeleteClickedListener(NoteView.OnNoteButtonClickedListener listener)    {        mDeleteNoteListener = listener;    }    public void setOnCheckboxClickedListener(NoteView.OnNoteCheckBoxClickedListener listener)    {        mCheckboxListener = listener;    }    static abstract class OnNoteButtonClickedListener    {        public abstract void onNoteButtonClicked(long noteId);    }    static abstract class OnNoteCheckBoxClickedListener    {        public abstract void onNoteCheckBoxClicked(long noteId, boolean checked);    }    public void setNoteId(long noteId)    {        mNoteId = noteId;       }    public long getNoteId()    {        return mNoteId;    }    public void setTitle(CharSequence title)    {        mTitleTextView.setText(title);    }    public void setChecked(boolean checked)    {        mCheckBox.setChecked(checked);    }    public boolean isChecked()    {        return mCheckBox.isChecked();    }    public void setDetails(CharSequence details, CharSequence stretchedDetails)    {        if(details == null || details.length() == 0)        {            mDetails = """";        }else        {            mDetails = details;        }        if(stretchedDetails == null)        {            mStretchedDetails = """";        }        else        {            mStretchedDetails = stretchedDetails;        }        refreshStretched();    }    public void setDetailsRight(CharSequence detailsRight, CharSequence expandedDetailsRight)    {        if(detailsRight == null || detailsRight.length() == 0)        {            mDetailsRight = """";        }else        {            mDetailsRight = detailsRight;        }        if(expandedDetailsRight == null)        {            mStretchedDetailsRight = """";        }        else        {            mStretchedDetailsRight = expandedDetailsRight;        }        refreshStretched();    }    public void setStretched(boolean expanded)    {        mStretched = expanded;        refreshStretched();    }    public boolean getStretched()    {        return mStretched;    }    public boolean toggleStretched()    {        setStretched(!getStretched());        return mStretched;    }    public void showButtons() {        if(mButtonLayout.getVisibility() != VISIBLE )        {            Animation slideIn = AnimationUtils.loadAnimation(this.getContext(), R.anim.slideonfromright);            mButtonLayout.setAnimation(slideIn);            mButtonLayout.setVisibility(VISIBLE);            mButtonLayout.startAnimation(slideIn);        }           }    public void hideButtons() {        if(mButtonLayout != null &amp;&amp; mButtonLayout.getVisibility() == VISIBLE )        {            Animation slideOut = AnimationUtils.loadAnimation(this.getContext(), R.anim.slideofftoright);            slideOut.setAnimationListener(new AnimationListener()            {                @Override                public void onAnimationEnd(Animation animation) {                    mButtonLayout.setVisibility(GONE);                }                @Override                public void onAnimationRepeat(Animation animation) {}                @Override                public void onAnimationStart(Animation animation) { }            });            mButtonLayout.startAnimation(slideOut);        }    }    public void hideButtons(boolean noAnimation) {        mButtonLayout.setVisibility(GONE);    }    public void refreshStretched() {        if(mStretched)        {            mDetailsRightTextView.setText(mStretchedDetailsRight);            mDetailsTextView.setText(mStretchedDetails);        }else        {            mDetailsRightTextView.setText(mDetailsRight);            mDetailsTextView.setText(mDetails);        }        if(mDetailsRightTextView.length() == 0)        {            mDetailsRightTextView.setVisibility(GONE);        }else        {            mDetailsRightTextView.setVisibility(VISIBLE);        }        if(mDetailsTextView.length() == 0)        {            mDetailsTextView.setVisibility(GONE);        }else        {            mDetailsTextView.setVisibility(VISIBLE);        }    }}</code></pre><p>noteview_layout.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;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""    android:paddingRight=""5dip""&gt;        &lt;CheckBox android:id=""@+id/noteViewCB""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;        &lt;TextView android:id=""@+id/noteViewTitle""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:gravity=""center_vertical""        android:text=""Title""/&gt;        &lt;LinearLayout                android:id=""@+id/noteViewButtonLayout""                android:orientation=""horizontal""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:padding=""5dip""                android:visibility=""gone""                android:layout_gravity=""center_vertical""&gt;            &lt;Button android:id=""@+id/noteViewEditButton""                    android:layout_width=""80dp""                    android:layout_height=""fill_parent""                    android:background=""@drawable/drawngreenbutton""                    android:textStyle=""bold""                    android:text=""Edit""/&gt;            &lt;Button android:id=""@+id/noteViewDeleteButton""                    android:layout_width=""80dp""                    android:layout_height=""fill_parent""                    android:background=""@drawable/drawnredbutton""                    android:textStyle=""bold""                    android:text=""Delete""/&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout  android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/noteViewDetails""    android:layout_width=""0dip""    android:layout_height=""wrap_content""    android:layout_weight=""2""    android:layout_marginRight=""10dip""    android:visibility=""gone""    android:focusable=""false""    android:bufferType=""spannable""/&gt;    &lt;TextView     android:id=""@+id/noteViewDetailsRight""    android:layout_width=""0dip""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:visibility=""gone""    android:focusable=""false""    android:bufferType=""spannable""    android:gravity=""right""/&gt;&lt;/LinearLayout&gt;&lt;/merge&gt;</code></pre>","131871","","","","","2010-10-08 16:05:35","How to implement a custom listview row with buttons?","<android><listview><event-handling>","1","0","","",""
"3892049","1","3893565","","2010-10-08 15:31:46","1","1451","<p>I have edittext and a button below edittext.edittext has width as fill_parent and height as wrap_content.</p><p>My messages covers full screen, due to this my button is not visible it hides below virtual keyboard</p><p>can any one sort this problem.Thanks.</p><p><img src=""http://i.stack.imgur.com/asKK9.png"" alt=""alt text""> <img src=""http://i.stack.imgur.com/lnYGH.png"" alt=""alt text""></p>","435025","","","","","2010-10-08 19:08:33","EditText in Android","<android>","3","1","1","",""
"3892293","1","","","2010-10-08 16:02:26","3","1178","<p>Which one should I go after/learn? In terms of market share, prospect, market penetration, opportunity, learning curve etc.</p><p>I am a .NET programmer myself. I really hope that Microsoft can do better this time. I hope I can make use of my little knowledge in Microsoft platform to achieve something in mobile apps.</p><p>I am opened to any comments. Thanks!</p>","470310","","","","","2012-02-22 03:11:36","IPhone / Android / WP7 app?","<.net><iphone><android><windows-phone-7>","6","3","1","","2010-10-08 16:11:25"
"3892494","1","","","2010-10-08 16:28:52","2","148","<p>Is it possible to share a Java application across several mobile platforms (Android, BlackBerry, Symbian, etc) regarding of Android is a Java SE (almost compliant), BlackBerry is JavaME, etc?</p><p>Thanks in advance.</p><p>EDIT:</p><p>I'm not talking about GUI which it won't be possible.</p><p>There is another things which do I have to take care ?, i.e Vector instead of List.</p><p>Threads?</p><p>Memory management?</p><p>Storage management?</p><p>Items referred above is where my interest particularly is focused on.</p><p>Thanks all for your answers.</p>","470322","","470322","","2010-10-08 23:51:01","2010-10-08 23:51:01","Sharing code across mobile plataforms","<java><android><blackberry><symbian><mobile-phones>","1","1","0","",""
"3892495","1","7472129","","2010-10-08 16:28:54","4","3542","<p>I am creating a program for Android mobiles which will query, retrieve and then process OData from an OData provider via a webservice.</p><p>Please can you tell me which toolkit is best for this? I have seen these:</p><ul><li><a href=""http://code.google.com/p/odata4j/"" rel=""nofollow"">odata4j</a></li><li><a href=""http://www.restlet.org/downloads/"" rel=""nofollow"">restlet</a></li></ul><p>Thanks.</p>","2699","","","","","2012-01-12 21:26:35","OData Consumer for Android - which OData tookit/framework should I use?","<android><frameworks><odata><toolkit>","2","2","3","",""
"3892604","1","","","2010-10-08 16:46:35","1","455","<p>I am trying to develop small application for reset Logging on Phone.Can some one throw some Lights on how to achieve logging in AndriodRunTimeInit whenever there is exception? I want to write into file whenever there is RunTime exception.</p>","470455","","","","","2010-10-08 17:20:31","Logging inside Framework?","<android><logging>","1","0","","",""
"3892855","1","","","2010-10-08 17:23:50","3","182","<p>I want to pass a huge object (e.g. <code>Bitmap</code>) from one activity to another inside one process. If I put it into the <code>Bundle</code> as <code>Parcelable</code>, will Android really serialize the object or pass it by reference?</p>","170842","","170842","","2011-07-21 07:29:25","2012-03-13 17:13:02","Efficiency of Parcelable for inproc communication","<android><activity><parcelable>","1","0","","",""
"3892863","1","3892929","","2010-10-08 17:25:05","2","141","<p>So after a lot of hard (and fun) work in development I’ve finally gotten fairly close to the end of my application development..or so I thought.  I’m developing a game for Android (but that’s irrelevant to this post).  Up until now, the images/drawables I was using were placeholders that took 5 minutes in MSPaint to create.  So, now that I have a working game, I started trying to create a visually stimulating game interface.  In doing so, I have come to realize that it is really tough, especially since I have virtually zero experience in image design.  Ultimately, I’m now questioning the ability of my game to be successful without a polished game interface that I feel most users would expect nowadays.</p><p>Are there individuals willing to collaborate on an application?  Is there a community of designers that are content to do work and in return receive only their name attached to an application?  Am I sunk unless I want to fork over a pretty penny to a designer?  What options do I have and where can I go to put the “illustrations in my book” so to speak?</p><p>Thanks.</p>","432209","","","","","2010-10-08 18:04:48","Is there an image design community that collaborates with developers to create applications with a better and more polished look and feel?","<java><android><eclipse><user-interface>","2","0","1","",""
"3892927","1","","","2010-10-08 17:35:53","0","163","<p>As of the FroYo update, none of the ""standard"" intents for invoking the Calendar seem to work on the Droid X.  I'm hoping that someone out there has figured out the right App/Activity pair to pull up the calendar, ideally in Agenda view.</p><p>You don't need to tell me that this is outside of the official Android API, and thus not an appropriate action to take.  I know this, and I'll gladly use the documented API as soon as one exists.  In the meantime I'm interested in providing my users the capabilities they need, even if that means going with expedience over official correctness.</p>","470476","","","","","2010-10-08 17:56:03","Invoking Calendar on Droid X (FroYo)","<android>","1","2","","",""
"3892983","1","","","2010-10-08 17:44:54","1","558","<p>I am trying to render vertices stored in a big file (approx 50Mb). The file layout is optimized so i can take a slice and give it to opengl to render a triangel strip directly. </p><p>This works in the emulator, but when I run the same code in my magic (android 1.5) it crashes with a SIGBUS in libhgl.so. Sounds like a driver issue?</p><p>I have tried to manually copy the vertices to a local buffer (non mem mapped), works but it takes eons of time, 300-600 ms.</p><p>Anyone have any experience?</p>","192927","","44729","","2010-10-08 17:57:31","2010-10-08 17:57:31","Android memory mapped file with vertices","<android><opengl-es><memory-mapped-files>","0","5","","",""
"3892988","1","3894467","","2010-10-08 17:45:23","0","3668","<p>I have managed to create a menu using the xml and a class that extends PreferenceActivity and implements OnSharedPreferenceChangeListener, now I would like to be notified everytime the user changes a value from preferences (e.g. when a user changes the username). To do that I have registered my class using the method registerOnSharedPreferenceChangeListener.</p><p>and implemented onSharedPreferenceChanged method.</p><p>this enable my application to be notified for a change but how can I actually change the value? </p><p>is there any good tutorial about this because I haven't found any.</p>","234898","","759866","","2014-02-15 16:35:38","2014-02-15 16:35:38","Android onSharedPreferenceChanged","<android>","1","2","","",""
"3892996","1","","","2010-10-08 17:47:09","0","1795","<p>I made an aplication that shows actual wifi conection information.</p><pre><code>      cont = act.getApplicationContext();        wifiManager = (WifiManager)cont.getSystemService(Context.WIFI_SERVICE);  display.setText(cadena + ""\n Rssi:"" + wifiManager.getConnectionInfo().getRssi()     + ""\n BSSID: "" +    wifiManager.getConnectionInfo().getBSSID()    + ""\n wifiState: "" +    wifiManager.getWifiState()    + ""\n SSID: "" +    wifiManager.getConnectionInfo().getSSID()    + ""\n LinkSpeed: "" +    wifiManager.getConnectionInfo().getLinkSpeed()    + ""\n NetworkId: "" +    wifiManager.getConnectionInfo().getNetworkId());</code></pre><p>The app shows the values correctly exept for the Rssi, i shows -200, no matter if i'm conected to a wifi net or not.</p><p>I don´t have a phone to test it, but i have a pc with Android for pc.</p><p>The Android SDK emulator doesn't conect via wifi but  getRssi() still return -200.</p><p>Is -200 some kind of ""error value""?</p>","470498","","91299","","2010-10-08 17:53:46","2012-05-02 18:53:46","Why WifiInfo.getRssi() always return -200?","<android><wifi>","2","0","","",""
"3893136","1","3894221","","2010-10-08 18:08:19","0","2411","<p>In my XML values strings code, I have a string with some text that I want to have only a few of the words in color. I also want to have a new line for some of the text.  </p><p>I can do things like: &lt; b> my bold text &lt; /b> and that works (leading space added for this post).  </p><p>I try to tag the text with color but no color shows up and there are no errors.  </p><pre><code>name=""dogs""    &gt;Red Dog, &lt;color foreground=""#FFFF0000""&gt; Sammy&lt;/color&gt;&lt;/string&gt;</code></pre><p>I also try adding a new line - I've tried things like:<br>&lt; LF> some text, space at beginning only for this post &lt; /LF><br>&lt; CR> this didn't work either &lt; /CR><br>&lt; p> some text, space at beginning only for this post &lt; p>  </p><p>But, no new paragraph / new line, carriage rtn happens.</p><p>What am I doing wrong? Or, more correctly put, <strong>How do I accomplish this?</strong><br>Thanks</p>","382200","","317491","","2010-10-08 18:10:54","2010-10-08 20:50:21","Android - XML Syntax For Strings","<android><xml><android-xml>","1","3","","",""
"3893322","1","3893629","","2010-10-08 18:34:06","0","1515","<p>Is there anyway to display a progress while downloading a file from ftp in order to show the download progress status ?</p><p>Thank you.</p>","348175","","","","","2010-10-08 19:18:51","Progress Bar for ftp downloading","<android><ftp><progress-bar><file-download>","1","0","","",""
"3893342","1","3893391","","2010-10-08 18:36:05","35","40179","<p>I want to change my web page CSS for web browsers running on cell phones, like the iPhone and Android. I've tried something like this in the CSS file:</p><pre><code>@media handheld {  body {    color: red;    }  }</code></pre><p>But it doesn't seem to have any effect, at least on the iPhone. How can I write my CSS to work differently on the iPhone etc, ideally without using javascript?</p>","13500","","","","","2013-10-02 09:20:14","Do iPhone / Android browsers support CSS @media handheld?","<iphone><android><css><media>","3","1","14","",""
"3893347","1","3893477","","2010-10-08 18:36:28","1","1153","<p>New to Android development and have decided to use NetBeans 6.9.1 as my IDE.  So far the process has been somewhat painful, but I'm getting things rolling.  However, I am creating an ImageView subclass for my first custom View and I can't figure out how to add my Box.png file to the project.  Drag and Drop doesn't work, there are no right-click options to add a file to the Resources folder, no dropdown menus to add images, no way to add the image to a package.  Could use some insight, thanks!</p>","318928","","","","","2010-10-08 19:47:50","NetBeans and Android image","<android><resources><netbeans-6.9>","1","2","","",""
"3893626","1","3893691","","2010-10-08 19:18:46","10","26363","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4591878/updating-progress-dialog-in-activity-from-asynctask"">Updating progress dialog in Activity from AsyncTask</a>  </p></blockquote><p>I am developing my first Android App and I need a ProgressDialog to be showed while a background task, in this case just a http call on the server, happens.I did a bit of studying on this and also have already checked other threads related to this subject.  </p><p><a href=""http://developer.android.com/reference/android/os/AsyncTask.html"">http://developer.android.com/reference/android/os/AsyncTask.html</a></p><p><a href=""http://stackoverflow.com/questions/3160205/android-show-progressdialog-until-activity-ui-finished-loading"">Android show ProgressDialog until activity UI finished loading</a></p><p><a href=""http://stackoverflow.com/questions/1979524/android-splashscreen"">Android SplashScreen</a></p><p><a href=""http://android-developers.blogspot.com/2009/05/painless-threading.html"">http://android-developers.blogspot.com/2009/05/painless-threading.html</a></p><p>Among others.</p><p>Than I got to write a bit of code: </p><p>1) In My Activity I declare a variable to be of type ProgressDialog</p><pre><code>public class LoginActivity extends Activity {    public static final String TAG = ""LoginActivity"";    protected ProgressDialog progressDialog; ...</code></pre><p>2) I have also written an inner class to extend AsyncTask as required, here in the doInBackGround is where I call a static method which actually do the POST http request to the server, in the server side I have  blocked the server response 20s to validate the progress dialog.</p><pre><code>class EfetuaLogin extends AsyncTask&lt;Object, Void, String&gt; {        private final static String TAG = ""LoginActivity.EfetuaLogin"";        @Override        protected void onPreExecute()        {            Log.d(TAG, ""Executando onPreExecute de EfetuaLogin"");        }        @SuppressWarnings(""unchecked"")        @Override        protected String doInBackground(Object... parametros) {            Log.d(TAG, ""Executando doInBackground de EfetuaLogin"");            Object[] params = parametros;            HttpClient httpClient = (HttpClient) params[0];            List&lt;NameValuePair&gt; listaParametros = (List&lt;NameValuePair&gt;) params[1];            String result = null;            try{            result = HttpProxy.httpPost(AnototudoMetadata.URL_AUTENTICACAO, httpClient, listaParametros);            }catch (IOException e) {                Log.e(TAG, ""IOException, Sem conectividade com o servidor do Anototudo! "" + e.getMessage());                e.printStackTrace();                return result;            }            return result;        }        @Override        protected void onPostExecute(String result)        {            progressDialog.dismiss();        }    } </code></pre><p>3) When the button is pressed I than build the ProgressDialog anc call the AsyncTask I have created: </p><pre><code>    OnClickListener loginListener = new OnClickListener() {      public void onClick(View v) {//next line should start progress dialog in main thread ?????   progressDialog = ProgressDialog.show(LoginActivity.this, ""Login in"", ""Wait a moment please"", true, false);   //next couple of lines should do an ascyn call to server   EfetuaLogin efetuaLogin = new EfetuaLogin();   efetuaLogin.execute(params);   try {    //recover the server response and sets time out to be 25seconds    sResposta = efetuaLogin.get(25, TimeUnit.SECONDS);</code></pre><p>Well, this is it, I believe this was suppose to show a progress dialog while the AsyncTask would query the server in background, but what I get is NO progress bar until server response arrives and than for a fraction of time(less than 1 second) the progress shows and the next Activity is called.</p><p>As I mentioned I have re-checked this code and simply can't find where I got it wrong. Any suggestions?</p><p>Thank you in advance.</p><p>Hi, as suggested by Charlie Sheen(???) in the first answer for this thread I have tryied changing a bit of my code and now it is like(Unfortunatelly it is not working as expected so far): </p><pre><code>OnClickListener loginListener = new OnClickListener() {        public void onClick(View v) {                //async call????????        new EfetuaLogin().execute(params);...</code></pre><p>And than do all the work to deal with response in the AsyncTask: </p><pre><code>class EfetuaLogin extends AsyncTask&lt;Object, Void, String&gt; {        private final static String TAG = ""LoginActivity.EfetuaLogin"";        @Override        protected void onPreExecute()        {            super.onPreExecute();            Log.d(TAG, ""Executando onPreExecute de EfetuaLogin"");            //inicia diálogo de progresso, mostranto processamento com servidor.            progressDialog = ProgressDialog.show(LoginActivity.this, ""Autenticando"", ""Contactando o servidor, por favor, aguarde alguns instantes."", true, false);        }        @SuppressWarnings(""unchecked"")        @Override        protected String doInBackground(Object... parametros) {            Log.d(TAG, ""Executando doInBackground de EfetuaLogin"");            Object[] params = parametros;            HttpClient httpClient = (HttpClient) params[0];            List&lt;NameValuePair&gt; listaParametros = (List&lt;NameValuePair&gt;) params[1];            String result = null;            try{            result = HttpProxy.httpPost(AnototudoMetadata.URL_AUTENTICACAO, httpClient, listaParametros);            }catch (IOException e) {                Log.e(TAG, ""IOException, Sem conectividade com o servidor do Anototudo! "" + e.getMessage());                e.printStackTrace();                return result;            }            return result;        }        @Override        protected void onPostExecute(String result)        {            super.onPostExecute(result);            if (result == null || result.equals("""")) {                progressDialog.dismiss();                Alerta                        .popupAlertaComBotaoOK(                                ""Dados incorretos"",                                ""Os dados informados não foram encontrados no Sistema! Informe novamente ou cadastre-se antes pela internet."",                                LoginActivity.this);                return;            }            Log.d(TAG, ""Login passou persistindo info de login local no device"");            ContentValues contentValues = new ContentValues();            contentValues.put(AnototudoMetadata.LOGIN_EMAIL, sLogin);            contentValues.put(AnototudoMetadata.LOGIN_SENHA, sSenha);            contentValues.put(AnototudoMetadata.LOGIN_SENHA_GERADA, result);            LoginDB loginDB = new LoginDB();            loginDB.addLogin(LoginActivity.this, contentValues);            Log.d(TAG, ""Persistiu info de login no device, redirecionando para menu principal do Anototudo"");            Log.d(TAG, ""O retorno da chamada foi ==&gt;&gt; "" + result);            // tudo ok chama menu principal            Log.d(TAG, ""Device foi corretametne autenticado, chamando tela do menu principal do Anototudo."");            String actionName = ""br.com.anototudo.intent.action.MainMenuView"";            Intent intent = new Intent(actionName);            LoginActivity.this.startActivity(intent);            progressDialog.dismiss();        }    } </code></pre><p>Complete OnClickListener: </p><pre><code>OnClickListener loginListener = new OnClickListener() {    public void onClick(View v) {        Log.d(TAG, ""Usuario logado, chamando menu principal"");        TextView tLogin = (TextView) findViewById(R.id.loginText);        TextView tSenha = (TextView) findViewById(R.id.senhaText);        String sLogin = tLogin.getText().toString();        String sSenha = tSenha.getText().toString();        if (sLogin.equals("""") | sSenha.equals("""")) {            Alerta.popupAlertaComBotaoOK(""Campos Obrigatórios"",                    ""Os campos Login e Senha são obrigatórios para autenticação do Anototudo."", LoginActivity.this);            return;        } else {            Pattern regEx = Pattern.compile("".+@.+\\.[a-z]+"");            Matcher matcher = regEx.matcher(sLogin);            if (!matcher.matches()) {                Alerta.popupAlertaComBotaoOK(""Formato e-mail inválido"", ""O formato do campo e-mail está inválido"",                        LoginActivity.this);                return;            }        }        List&lt;NameValuePair&gt; listaParametros = new ArrayList&lt;NameValuePair&gt;();        listaParametros.add(new BasicNameValuePair(""login"", sLogin));        listaParametros.add(new BasicNameValuePair(""senha"", sSenha));        Log.d(TAG, ""valores recuperados dos campos de login e senha: "" + sLogin + "" | "" + sSenha);        // Reutiliza cliente HttpClient disponibilizado pela Aplicação.        AnototudoApp atapp = (AnototudoApp) LoginActivity.this.getApplication();        HttpClient httpClient = atapp.getHttpClient();        //prepara lista de parametros para fazer chamada asíncrona no servidor para autenticar.        Object[] params = new Object[2];        params[0] = httpClient;        params[1] = listaParametros;        //faz chamada assincrona        new EfetuaLogin().execute(params);    }};</code></pre>","442041","","442041","","2010-10-08 20:40:20","2012-01-23 14:07:56","How to use AsyncTask to show a ProgressDialog while doing background work in Android?","<android><android-asynctask><progressdialog>","2","0","7","2013-01-23 05:48:29",""
"3893633","1","3894404","","2010-10-08 19:19:14","3","2124","<p>I'm working on an RPG for Android, using the LunarLander API demo. I've already made a game using this demo (Porcupine Assassin, check it out!) so I've got a good grasp of the Canvas class and things of that nature.</p><p>My problem is, in RPGs you need a way to access inventory, stats, etc. So I've set the BACK button to start the class Inventory.java. I'm running into problems when I finish() the Inventory activity and try to return to the game (the SurfaceView).</p><p>This is the SurfaceCreated() callback:</p><pre><code>public void surfaceCreated(SurfaceHolder holder) {    thread.setRunning(true);    thread.start();}</code></pre><p>I was getting an FC caused by ""IllegalThreadStateException: thread already started"" so I put a try/catch in the SurfaceCreated() callback. With the try/catch, no FC happens, but I return to a black screen.</p><p>I tried taking the try/catch out and adding a check in the beginning: if(!thread.isAlive()). That way, if the thread was already started, it wouldn't do anything. Oddly enough, I got the same FC ""thread already started"" so thread.isAlive() must've returned false.. ??</p><p>I also have the onWindowFocusChanged() method from the API:</p><pre><code>@Overridepublic void onWindowFocusChanged(boolean hasWindowFocus) {    if (!hasWindowFocus) thread.pause();    else thread.setState(STATE_RUNNING);}</code></pre><p>I'm pretty keen on the gaming side of this, I've got most of the groundwork for my RPG laid out. But it's all this Android/Java stuff that goes over my head. Can anyone point me in the right direction?</p>","408178","","","","","2010-10-08 21:22:15","Returning to SurfaceView after another Acitivity has taken focus","<android><thread-safety><surfaceview>","1","0","1","",""
"3893669","1","3893821","","2010-10-08 19:24:32","1","2643","<p>I have a layout defined in an XML file(<code>base_layout.xml</code>) which may contain 20+ <code>ViewStub</code> definitions in addition to 3-5 other views such an <code>ImageView</code> and a <code>LinearLayout</code> containing 3-5 <code>ImageButton</code> views.</p><p>Should i be concerned about how many <code>ViewStub</code> views i place in this layout file?</p><p>I read on the developer.android site: </p><blockquote>  <p>A ViewStub is a dumb and lightweight  view. It has no dimension, it does not  draw anything and does not participate  in the layout in any way. This means  that a ViewStub is very cheap to  inflate and very cheap to keep in a  view hierarchy</p></blockquote><p>is it cheap enough to have 20+ of them? not all being inflated of course, just 1-2 at a time.</p><p>when i say <code>cheap enough</code> or talk of being <code>concerned</code>, i am regarding performance of the UI</p><p><strong>edit:</strong>what i am trying to accomplish:create a layout XML file which can be the skeleton for all my of activities.  in each <code>Activity</code>, i will inflate the correct <code>ViewStub</code> with the activity's layout.  Since i have so many activities requiring the same skeleton, i wish to re-use as much as possible</p><p>I have an <code>Activity</code> class which is the parent of almost all of my activities.  this parent class calls <code>setContentView(R.layout.base_layout);</code>.  for each child activity, all i am doing is inflating the corresponding <code>ViewStub</code> inside <code>base_layout.xml</code>.  doing this allows me to have a very customized UI with the same skeleton view used on all of my activity layouts</p>","416412","","416412","","2010-10-08 20:03:08","2010-10-08 20:48:45","How many ViewStubs is too many for a single layout XML file?","<android><viewstub>","1","0","1","",""
"3893786","1","3893819","","2010-10-08 19:39:55","5","11908","<p>When my android activity pops up a progress dialog, what is the right way to handle when user clicks the back button?</p><p>Thank you.</p>","286802","","","","","2013-04-15 10:42:15","How to handle the 'back button' on android when I have a progress dialog pops up","<android>","4","0","3","",""
"3893800","1","3894379","","2010-10-08 19:43:26","13","11189","<p>I want to start with a consistent test environment so I need to reset/clear my preferences.  Here's the SetUp for test I have so far.  It's not reporting any errors, and my tests pass, but the preferences are not being cleared.</p><p>I'm testing the ""MainMenu"" activity, but I temporarily switch to the OptionScreen activity (which extends Android's PreferenceActivity class.)  I do see the test correctly open the OptionScreen during the run.</p><pre><code> public class MyTest extends ActivityInstrumentationTestCase2&lt;MainMenu&gt; {</code></pre><p>...</p><pre><code>    @Override    protected void setUp() throws Exception {    super.setUp();    Instrumentation instrumentation = getInstrumentation();    Instrumentation.ActivityMonitor monitor = instrumentation.addMonitor(OptionScreen.class.getName(), null, false);    StartNewActivity(); // See next paragraph for what this does, probably mostly irrelevant.    activity = getActivity();    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(activity);    settings.edit().clear();    settings.edit().commit(); // I am pretty sure this is not necessary but not harmful either.</code></pre><p>StartNewActivity Code:</p><pre><code>    Intent intent = new Intent(Intent.ACTION_MAIN);    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    intent.setClassName(instrumentation.getTargetContext(),            OptionScreen.class.getName());    instrumentation.startActivitySync(intent);    Activity currentActivity = getInstrumentation()            .waitForMonitorWithTimeout(monitor, 5);    assertTrue(currentActivity != null);</code></pre><p>Thanks!</p>","403455","","","","","2012-03-01 20:43:18","Android: How do I reset/clear application preferences during unit testing?","<android><unit-testing><activity><preferences><android-preferences>","2","0","4","",""
"3893991","1","3894061","","2010-10-08 20:14:53","6","3152","<p>We have a desktop/web java application and also getting into Android development.</p><p>Ideally we would like one app that runs both on desktop and android.</p><p>From what we can tell, it's not much possible to run normal java apps on android.  But wondering if it can do it the other way?  That is, run android apps easily on the desktop (without the user install the sdk or android emulator)?</p><p>In a prefect world we'd like one app for both platforms.  Realistically though it seems like we're going to have to have one app with two front ends?</p>","444641","","119159","","2010-10-08 20:44:09","2013-10-13 06:12:31","Cross platform Java? Android and desktop","<java><android>","7","0","1","",""
"3894486","1","3989651","","2010-10-08 21:36:59","0","3564","<p>I'm trying to stream video to an android phone via rtsp.  I think my SDP isn't quite right and there's something in it that the phone doesn't like.  Below is the trace from the phone.  Any idea what's wrong with the SDP that causes the player to give up?</p><pre><code>10-08 14:11:22.657 I/RTSPEngine( 5031): RTSP Server response: 10-08 14:11:22.657 I/RTSPEngine( 5031): RTSP/1.0 200 OK10-08 14:11:22.657 I/RTSPEngine( 5031): CSeq: 010-08 14:11:22.657 I/RTSPEngine( 5031): Date: Fri, 8 Oct 2010 21:11:24 GMT10-08 14:11:22.657 I/RTSPEngine( 5031): Expires: Fri, 8 Oct 2010 21:11:24 GMT10-08 14:11:22.657 I/RTSPEngine( 5031): Last-Modified: Fri, 8 Oct 2010 21:11:24 GMT10-08 14:11:22.657 I/RTSPEngine( 5031): Session: 12345610-08 14:11:22.657 I/RTSPEngine( 5031): Content-Type: application/sdp10-08 14:11:22.657 I/RTSPEngine( 5031): Content-Length: 20710-08 14:11:22.657 I/RTSPEngine( 5031): 10-08 14:11:22.657 I/RTSPEngine( 5031): v=010-08 14:11:22.657 I/RTSPEngine( 5031): o=- 21070 3 IN IP4 0.0.0.010-08 14:11:22.657 I/RTSPEngine( 5031): c=IN IP4 0.0.0.010-08 14:11:22.657 I/RTSPEngine( 5031): s=xxxxx H.263 video stream10-08 14:11:22.657 I/RTSPEngine( 5031): i=Video stream10-08 14:11:22.657 I/RTSPEngine( 5031): t=0 010-08 14:11:22.657 I/RTSPEngine( 5031): m=video 0 RTP/AVP 10310-08 14:11:22.657 I/RTSPEngine( 5031): a=rtpmap:103 H263-1998/9000010-08 14:11:22.657 I/RTSPEngine( 5031): a=fmtp:103 profile=0; level=4010-08 14:11:22.657 I/RTSPEngine( 5031): b=TIAS:204800010-08 14:11:22.667 E/PlayerDriver( 5031): Command PLAYER_INIT completed with an error or info PVMFErrNotSupported10-08 14:11:22.667 E/MediaPlayer(13821): error (1, -4)</code></pre><p>Thanks in advance for your help</p><p>Regards</p><p>Phil</p>","405814","","","","","2011-03-21 17:52:19","Streaming video to Android via RTSP","<android><video><video-streaming><rtsp>","2","2","1","",""
"3894489","1","3894793","","2010-10-08 21:38:31","1","1168","<p>I'm writing an application that should both have the ability to place widgets on the home screen, and to show these widgets in the application itself. I figure that the best way to do this is through the use of an AppWidgetHost for the application part.</p><p>I've been looking around, but I cannot find any good examples on how to write AppWidgetHosts. Have any of you done this, and are willing to share? Or do you know of any tutorials that I've missed?</p>","340145","","340145","","2013-10-17 07:59:36","2013-10-18 07:40:52","Any AppWidgetHost-tutorials out there?","<android><appwidget>","2","0","","",""
"3894502","1","","","2010-10-08 21:40:31","0","1064","<p>I am trying to make/draw a calendar. I am currently using canvas to draw it but I was wondering if anyone knew of a better way? I just want to display a month view of a calendar. I have .ics files on an SD card. The only difficulty I am having is how to draw the actual calendar. I also am trying to to make it so when the user clicks on a day a dialog pops up telling the user what events they have scheduled for that day. Any tips? I am looking at GridView as an alternative to drawing it using Canvas and Paint.</p><p>Thanks,-G</p>","470684","","","","","2010-10-26 00:55:15","How to draw or make a calendar?","<java><android><eclipse><user-interface>","1","0","","",""
"3894668","1","","","2010-10-08 22:09:15","7","539","<p>I'm looking for some critique on my approach for storing the state of a bitmap editor for  Android and iPhone mobile phones. Even a ""Looks fine to me!"" response would be great!</p><p>In the application, the current user document contains several bitmap layers (each maybe 1024 by 768 pixels) that can each be painted on. The basic requirements for the application  are:</p><ol><li><p>I need to be able to save and restore the document state.</p></li><li><p>When the user quits the application or gets a phone call, I need to be able to save the document state quickly (within about 2 seconds).</p></li><li><p>If the application crashes, I need to be able to restore the document state (it's OK if the user loses maybe 30 seconds of work though).</p></li></ol><p>For 1, I cannot find any open file formats that support layers. I was going to go with the following file structure for storing my document:</p><pre><code>document_folder/  layer1.png  layer2.png  ...  metadata.xml</code></pre><p>The layers are just stored as .png files and the .xml file contains data such as which layers are currently visible. The document folder can either be opened as is by the application or the folder can be stored in a .zip file. This seems like a nice simple format for other applications to work with too.  </p><p>In addition to .png files, I will also allow layers to be saved in a custom .raw file format which contain unprocessed raw pixel data from bitmaps. I can save these very quickly on the phone (&lt;0.5s) whereas .png files take a second or two.</p><p>My plan for quick-saving the document was, on start-up, to create a folder called /autosave, and save .raw versions of all the layers there. After a few editing commands on one layer, I would then update the .raw file for that layer in a background thread. For robustness when saving, I would save the layer as e.g. layer1_tmp.raw and when I've confirmed the file has been fully written, replace layer1.raw with this file.</p><p>Should the application crash during use, I would just reopen the /autosave folder. When the application is closed or the user gets a phone call, I just have to update the last modified layer to autosave. When the user wants to save, I just convert all the .raw files to .png files and then zip the folder.</p><p>What do you think? Are there any obvious flaws? Is there a simpler way? Am I reinventing the wheel somehow? Thanks.</p>","461841","","461841","","2010-10-08 22:41:16","2011-06-13 07:23:02","Saving/loading document state quickly and robustly for image editor","<java><iphone><android><serialization><image-processing>","2","9","","",""
"3894729","1","","","2010-10-08 22:23:51","1","1205","<p>Once again I'm trying to get into openGL, but as usual I choke when passing around vertices/vertixes/whatever and every little detail can lead to disaster (wrong format, initialization not properly set up, where memory are saved, etc.).</p><p>My main goal is to use openGL for 2D graphics to speed up performance compared to regular cpu drawing.</p><p>Anyways, my openGL Renderer looks like this:</p><pre><code>package com.derp.testopengl;import java.nio.Buffer;import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.FloatBuffer;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.opengl.GLU;import android.opengl.GLSurfaceView.Renderer;public class OpenGLRenderer implements Renderer {    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        // Set the background color to black ( rgba ).        gl.glClearColor(1.0f, 0.0f, 0.0f, 0.5f);  // OpenGL docs.        // Enable Smooth Shading, default not really needed.        gl.glShadeModel(GL10.GL_SMOOTH);// OpenGL docs.        // Depth buffer setup.        gl.glClearDepthf(1.0f);// OpenGL docs.        // Enables depth testing.        gl.glEnable(GL10.GL_DEPTH_TEST);// OpenGL docs.        // The type of depth testing to do.        gl.glDepthFunc(GL10.GL_LEQUAL);// OpenGL docs.        // Really nice perspective calculations.        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, // OpenGL docs.                          GL10.GL_NICEST);    }    public void onDrawFrame(GL10 gl) {        // Clears the screen and depth buffer.        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | // OpenGL docs.                           GL10.GL_DEPTH_BUFFER_BIT);        // Define the points of my triangle        float floatbuff[] = {                1.0f,0.0f,0.0f,                0.0f,1.0f,0.0f,                -1.0f,0.0f,0.0f                };        // Create memory on the heap        ByteBuffer vbb = ByteBuffer.allocateDirect(3 * 3 * 4);        vbb.order(ByteOrder.nativeOrder());        FloatBuffer vertices = vbb.asFloatBuffer();        // Insert points into floatbuffer        vertices.put(floatbuff);        // Reset position        vertices.position(0);        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        // Change color to green        gl.glColor4f(0.0f, 1.0f, 0.0f, 1.0f);        // Pass vertices to openGL        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertices);        // Draw 'em        gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    }    public void onSurfaceChanged(GL10 gl, int width, int height) {        // Sets the current view port to the new size.        gl.glViewport(0, 0, width, height);// OpenGL docs.        // Select the projection matrix        gl.glMatrixMode(GL10.GL_PROJECTION);// OpenGL docs.        // Reset the projection matrix        gl.glLoadIdentity();// OpenGL docs.        // Should give a 2D coordinate system that responds to the screen        gl.glOrthof(0.0f, width, 0.0f, height, 0, 200.0f);        gl.glMatrixMode(GL10.GL_MODELVIEW);         gl.glLoadIdentity();// OpenGL docs.    }}</code></pre><p>It currently crash on the line:</p><pre><code>gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);</code></pre><p>With an IndexOutOfBoundsException, but I'm sure there are more problems with the code.</p><p>Thankful for any help!</p>","242348","","44729","","2010-10-11 02:14:35","2011-06-06 03:49:22","Why does my android openGL ES test renderer crash","<java><android><opengl-es>","3","0","","",""
"3894771","1","3894813","","2010-10-08 22:34:17","0","1727","<p>Consider a regex for testing port numbers.</p><pre><code>(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3})</code></pre><p>This is not valid in Android.</p><p>Any idea what a port number regex should look like in Android?</p>","469230","","23199","","2010-10-08 22:47:06","2010-10-08 22:53:12","Regex for port numbers in Android?","<android><regex>","2","1","","",""
"3894827","1","3895830","","2010-10-08 22:47:59","3","3432","<p>Here are two images of the same android phone, once in Portrait mode, once in Landscape mode.</p><p><img src=""http://i.stack.imgur.com/BnyFW.jpg"" alt=""alt text""><img src=""http://i.stack.imgur.com/Q55Zm.jpg"" alt=""alt text""></p><p>Shouldn't one resolution be the opposite of the other? I.e. if one is 800x1360, the other should be 1360x800? What's going on here? If I try the same thing on my ipod touch, it reports the same resolution regardless of orientation. Also, on the android phone, the resolution appears to change as you zoom in and out or scroll around the page.</p><p>I'm trying to figure out how to handle the ""reported"" resolution of an android phone in CSS, which I can't do until I know exactly which resolution it reports. :(</p>","13500","","13500","","2010-10-08 22:54:43","2010-10-09 05:24:16","What's the deal with Android web browser resolution?","<android><browser><resolution>","2","5","","",""
"3894978","1","","","2010-10-08 23:32:01","0","305","<p>I continue getting connection errors when I try to connect my Huawei U8100 to the Blocks Editor in AppInventor.</p><p>My phone shows usb debugging as well as usb connected when plugged into my pc.</p><p>I'm running Windows 7.</p><p>Any help on this question is greatly appreciated.</p>","470744","","31899","","2010-11-02 17:52:53","2010-12-03 16:39:37","Huawei U8100 connection error to Blocks Editor in AppInventor","<android><adb><app-inventor>","1","0","","",""
"3895066","1","","","2010-10-08 23:57:31","1","1706","<p>I have created a map to a location following this tutorial <a href=""http://mobiforge.com/developing/story/using-google-maps-android"" rel=""nofollow"">Here</a></p><p>But no matter what I do I cannot add the push pin, when I get to here ""To add a marker to the map, you first need to define a class that extends the Overlay class:""</p><p>I get stuck, I have tried to add a MapOverlay following the HelloGoogleMaps tutorial on android developers to add the overlay but I get errors all over the place, can anyone point in the right direction or suggest a tutrorial or provide a link to source code that might help, my code is below;</p><pre><code>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.MapView.LayoutParams;import android.os.Bundle;import android.view.View;import android.widget.LinearLayout;public class GoogleMaps extends MapActivity {        MapView mapView;     MapController mc;    GeoPoint p;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mapView = (MapView) findViewById(R.id.mapView);        LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);          View zoomView = mapView.getZoomControls();         zoomLayout.addView(zoomView,             new LinearLayout.LayoutParams(                LayoutParams.WRAP_CONTENT,                 LayoutParams.WRAP_CONTENT));         mapView.displayZoomControls(true);        mc = mapView.getController();        String coordinates[] = {"" 53.804224"", ""-1.759057""};        double lat = Double.parseDouble(coordinates[0]);        double lng = Double.parseDouble(coordinates[1]);        p = new GeoPoint(            (int) (lat * 1E6),             (int) (lng * 1E6));        mc.animateTo(p);        mc.setZoom(17);         mapView.invalidate();        mapView.setSatellite(true);    }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }}</code></pre><p>At this point when I try to add a mapoverlay as in the HelloGoogleMaps tutorial it either crashes or I get errors.</p><p>Thanks in advance</p>","445174","","390989","","2010-10-09 00:02:17","2010-10-09 00:02:17","How Do I Add A Push Pin","<java><android><eclipse><google-maps>","0","1","","",""
"3895242","1","","","2010-10-09 00:55:32","0","487","<p>I see a ANR dialog in my android application. Can you please tell me if it is possible that my application uses up a lot of memory and GC takes over and uses a lot of time? Or it is something else? </p>","286802","","","","","2010-10-09 00:59:47","ANR dialog in my android application","<android>","1","0","","",""
"3895276","1","3895311","","2010-10-09 01:08:50","1","786","<p>I'm using a lazy image loader for my ListView with the following code inside <code>getView()</code>:</p><pre><code>Bitmap cachedImage = asyncImageLoader.loadBitmap(item.getImage(), wallpaperNumber, new ImageCallback(){    public void imageLoaded(Bitmap bitmapImage, String wallpaperNumber)    {        ImageView imageViewByTag = (ImageView) listView.findViewWithTag(wallpaperNumber);        imageViewByTag.setImageBitmap(bitmapImage);    }});</code></pre><p>And the following inside the <code>AsyncImageLoader</code> class:</p><pre><code>public Bitmap loadBitmap(final byte[] image, final String wallpaperNumber, final ImageCallback imageCallback) {    if (imageCache.containsKey(wallpaperNumber))     {        SoftReference&lt;Bitmap&gt; softReference = imageCache.get(wallpaperNumber);        Bitmap Bitmap = softReference.get();        if (Bitmap != null)         {            return Bitmap;        }    }    final Handler handler = new Handler()     {        @Override        public void handleMessage(Message message)         {            try            {                if (message.obj != null)                {                                           imageCallback.imageLoaded((Bitmap) message.obj, wallpaperNumber);                }                else                {                    Bitmap bitmapImage = loadImage(image);                    imageCache.put(wallpaperNumber, new SoftReference&lt;Bitmap&gt;(bitmapImage));                    imageCallback.imageLoaded(bitmapImage, wallpaperNumber);                }            }             catch (Exception e)             {                MiscFunctions.logStackTrace(e);            }        }    };    new Thread()     {        @Override        public void run()         {            Bitmap bitmapImage = loadImage(image);            imageCache.put(wallpaperNumber, new SoftReference&lt;Bitmap&gt;(bitmapImage));            Message message = handler.obtainMessage(0, bitmapImage);            handler.sendMessage(message);        }    }.start();    return null;}private static Bitmap loadImage(byte[] image) {    Bitmap bitmapImage = BitmapFactory.decodeByteArray(image, 0, image.length);    bitmapImage = Bitmap.createScaledBitmap(bitmapImage, imageWidth, imageHeight, true);    return bitmapImage;}public interface ImageCallback {    public void imageLoaded(Bitmap imageBitmap, String wallpaperNumber);}</code></pre><p>For an unknown reason to me, after to switched from using the common <code>SQLiteOpenHelper</code> to a custom one which allows me to store my database on the SD card, every 6th or 7th image that is loaded throws a NullPointer at:</p><p><code>imageCallback.imageLoaded((Bitmap) message.obj, wallpaperNumber);</code></p><p>I've checked everything and don't actually know what variable is actually null.</p><p>Any help?</p>","149166","","","","","2010-10-09 01:24:36","Unknown why the NullPointerException is thrown","<java><android><listview><nullpointerexception>","1","0","","",""
"3895371","1","8184067","","2010-10-09 01:54:58","4","1068","<p>I've implemented the <code>TextToSpeech</code> integration exactly as mentioned in <a href=""http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html"" rel=""nofollow"">this blog post</a>. After I've added it to my program it's now interfering with my other <code>intent</code>s.</p><p>For example:</p><ol><li>List item</li><li>User starts app</li><li>User invokes load activity</li><li>User picks a file to load, and activity returns fileanme to load in the intent</li><li>Main activity starts, and realizes it needs to load a filename so it starts doing so</li><li>The check for TTS needs to be done so I launch the <code>ACTION_CHECK_TTS_DATA</code> intent</li><li>This pauses the main activity <em>again</em> and the loading process gets interrupted</li><li>When the TTS check returns, the loading never happened.</li></ol><p>When do I need this TTS check? Can I just do it once on application start up? It's causing my application to load slowly. I would like this load to be performed in a separate thread if possible.</p>","418957","","312124","","2012-07-18 22:05:03","2012-07-18 22:05:03","SpeechToText and running the ACTION_CHECK_TTS_DATA intent","<android><text-to-speech>","1","0","","",""
"3895440","1","","","2010-10-09 02:22:27","0","360","<p>I'm trying to create an Android app based on camera.I want to split my screen into 2 or 4 views. (when 2 views are show, one will be above and one will be below. And when 4 views, 2 will be on top (side by side) and 2 will be at bottom (side by side))I want to show the what camera is seeing in all the views.I mean all the views must render according to camera.Is it possible? HOw?</p>","265341","","","","","2011-12-23 21:38:47","Android - How can I show camera in 2 or more views","<android><camera>","3","0","","",""
"3895479","1","3898851","","2010-10-09 02:38:12","1","1031","<p>I've been following the post:<a href=""http://tut7.com/2010/06/15/quick-tip-enabling-the-android-%E2%80%9Cmove-to-sd-card%E2%80%9D-feature/comment-page-1/#comment-6766"" rel=""nofollow"">http://tut7.com/2010/06/15/quick-tip-enabling-the-android-%E2%80%9Cmove-to-sd-card%E2%80%9D-feature/comment-page-1/#comment-6766</a>(even tried to post a comment but it's been awaiting moderation forever)...</p><p>I'm trying to target Android 1.6-2.2 OSs and after applying your Build Target I get the following warnings:</p><blockquote>  <p>Attribute minSdkVersion (4) is lower than the project target API level (8) AndroidManifest.xml /CueBrain line 1 Android ADT Problem</p></blockquote><p>And also, trying to launch my app in the 1.6 emulator it just ignores it and runs the 2.2 emulator. </p><p>What am I missing?</p>","418957","","23897","","2010-10-09 02:41:04","2010-10-10 15:38:07","Move to SD Card","<android><sd-card>","1","1","","",""
"3895486","1","4970337","","2010-10-09 02:40:53","3","616","<p>I am in the process of putting together a little Android app.  I have created a couple of widgets by extending the ImageView and ScrollView widgets.  The problem that I am having is not with the code itself (i.e. everything runs wonderfully) but rather with the Eclipse ""intellisense"" in an XML layout.  If I am using the native android widgets, I get the normal eclipse suggestions and all is well.  However, as soon as I add a reference to my widget (i.e.  ) I lose intellisense on my widget AND (more painfully) on all widgets below my widget.  In other words, I don't get intellisense on a  if it exists below my widget.  Again....everything runs, there is no error anywhere, it just becomes insanely slow to program this way.</p><p>This is very frustrating as I don't remember all the attributes of the various controls.</p><p>Has anyone encountered this or have any suggestions on where to begin trying to solve this?  I don't even know what the correct term in Eclipse to start looking at this.  After 3 days looking off and on, I am at my wits end.</p><p>Thanks in advance for any suggestions!</p>","470806","","","","","2011-02-11 14:48:06","Custom Android Widget and Eclipse Intellisense","<android><eclipse><layout><intellisense><widget>","1","0","1","",""
"3895904","1","","","2010-10-09 06:10:50","5","12963","<p>I am really confused on how to get data in and out of an android app from the internet.</p><p>I imagined that i would store information in the mysql db on the server i already have set up.  But from what I have read, I would need some type of in-between web service to make quiries with data sent from the app.</p><p>Can anybody toss me some tips on how to get something like this started.</p><p>Or, if you know of a better way, let me know about it.</p>","470882","","","","","2013-02-11 07:18:15","How to have Android App communicate with external MySQL db","<mysql><android><database>","3","1","2","",""
"3895979","1","3895991","","2010-10-09 06:45:13","0","633","<p>hi in android i want to print the key codes for each and every key which i pressed.i am not getting any method from which i can print key codes.plz help me because without getting keycode i m unable to complete my project.</p>","450601","","","","","2010-10-09 06:50:31","Printing Key codes","<android><key>","1","0","","2012-08-19 11:13:04",""
"3896064","1","","","2010-10-09 15:05:54","1","1767","<p>As I am very pissed off of using the emulator to develop any Java class, I thought of setting up a project in Eclipse and instead of the usual JRE I linked to the Android.jar (version 2.1) that usually the Android projects link to. I don't mean to use this to develop Layouts or other specific platform things, I was just trying to create a class that uses HttpClient. It miserably crashes like this. </p><blockquote>  <p>Exception in thread ""main""  java.lang.RuntimeException: Stub!     at  org.apache.http.impl.client.AbstractHttpClient.(AbstractHttpClient.java:5)    at  org.apache.http.impl.client.DefaultHttpClient.(DefaultHttpClient.java:7)    at  AdsCatcher.(AdsCatcher.java:26)    at TestAll.main(TestAll.java:10)</p></blockquote><p>Stub! I mean I'd like to develop libraries (and test them) so that when I go to the emulator I don't have to deal with them. Is there a good way to do this? This seems not to work for some reason.</p>","138606","","251173","","2010-10-09 15:34:00","2010-10-09 15:34:40","How to develop using android libraries in a simple java project (without using dalvik and such)","<java><android><project>","1","2","2","",""
"3896233","1","","","2010-10-09 15:42:10","2","343","<p>Is there a high level android library for gestures that sends event when ascii character is drawn? So far I has seen only support for low level gestures --- strokes etc. I would like to add a GestureKeyBoardListener that calls back when a character from a to z (upper or lower case) or digit from 0 to 9 is entered.</p><p>The Google Gestures android app (http://gesturesearch.googlelabs.com/) converts gestures to characters. Are there plans to make the gestures-to-char code use in it as part of a library that any developer can use?</p>","388241","","","","","2010-10-09 17:09:53","Is high-level android lib for gestures that sends event when ascii char is drawn","<android><gestures>","1","0","","",""
"3896294","1","3896933","","2010-10-09 15:59:23","2","3513","<p>I have a multiselection ListView in my android app. What I need to know is how many items on that list I have selected. </p>","470991","","771469","","2011-12-03 16:28:28","2013-04-11 11:56:23","Get number of selected items in android ListView","<android><listview>","3","1","2","",""
"3896301","1","3897986","","2010-10-09 16:01:01","23","25845","<p>After I added some .png files into my Project Workspace drawable folder I refreshed my drawable folders in Eclipse and the newly added files showed up. But when I tried to access those resources using R.drawable.xyzimage, xyzimage although in the folder could not be resolved. </p><p>So I did a Project Clean and guess what after this clean R.java is totally gone and all my classes accessing resources using R.java is showing all sorts of error and Eclipse won't let me run the code anymore. </p><p>I have backup of my source code but I want to explore if R.java can be regenerated and how?</p><p>Thanks for all the help.</p>","447886","","","","","2014-03-26 15:30:33","R.java disappears after project clean","<android><eclipse>","30","3","6","","2014-03-26 15:30:33"
"3896326","1","3897012","","2010-10-09 16:06:43","1","731","<p>I have this JSON to parse</p><pre><code>{""files_informations"": {                         ""row"":{""value"":""artist1""},                         ""row"":{""value"":""artist2""}                       }}</code></pre><p>I would like to know how can I get the first value <strong>artist1</strong> and then the second one <strong>artist2</strong></p><p>This is what I am doing :</p><pre><code>JSONObject myObject = jObject.getJSONObject(""files_informations"");JSONObject rowObject = myObject.getJSONObject(""row"");Iterator&lt;JSONObject&gt; rowIt = rowObject.keys();while (rowIt.hasNext()) {     JSONObject tmp = rowIt.next();                  Log.e("""", tmp.getString(""value""));}</code></pre><p>I got java.lang.classCastException for this <code>JSONObject tmp = rowIt.next();</code></p><p><strong>So there are my two questions</strong> :</p><ul><li>Do I need to use iterators in thiscase ?</li><li>How do one should use them ?</li></ul><p><strong>Edit :</strong></p><p>Should the JSON looks like this ?</p><pre><code>{""files_informations"": [                         ""row"":{""value"":""artist2""},                         ""row"":{""value"":""artist1""}                       ]}</code></pre>","290613","","290613","","2010-10-09 16:21:17","2010-10-09 17:01:04","Parsing JSON, not sure on how and when to use iterators (Android Platform)","<java><android><json><parsing><java-me>","1","3","","",""
"3896337","1","","","2010-10-09 16:09:45","3","134","<p>I have an iPhone application which is a reporting application, by this I mean, a user searches for a postcode, and gets information for free on that postcode. Then for a cost (about £1-£3) they can purchase a complete report.</p><p>I purchase the report data legitimately per request, and put a markup on the price and deliver it through the iPhone. </p><p>I have been pulling my hair out with my android application as I can't find an answer on how to do the same for Google. Paypal has an API, but I am unsure if I will get approval in the market.</p><p>I don't care who takes their cut, be it Google through checkout (cant find anyway to implement) or PayPal, but my business model works by letting the user search for free to obtain basic data, and upsells them useful data.</p>","471010","","881229","","2014-02-04 20:51:35","2014-02-04 20:51:35","Taking In-App purchases to mimic my iPhone app on Android","<android><iphone>","1","4","","",""
"3896458","1","","","2010-10-09 07:34:11","3","1125","<p>I am designing an application which requires Drag&amp;Drop functionality to transfer items from one list to another.Is there any way to drop item into another list, as i have seen applications to drag and drop items in the same list(Reordering the list)?</p>","470902","","","","","2010-10-10 02:58:33","How to implement Drag and Drop items between two lists in android?","<android><drag-and-drop>","1","1","2","",""
"3896634","1","3898921","","2010-10-09 08:47:40","1","1919","<p>Is there a possibility to add a view or derivative (button, textview, imageview etc...) to another view without having to go through layouts?</p><p>I have a class called ScreenView, it derives from View (e.g. public class ScreenView extends View).I wanted to display text into it, labels, images etc..</p><p>On an iPhone it's trivial, simply create my objects and use addSubview method ; you can embed any UI objects into another. Most UI toolkits work that way too.</p><p>Problem with layouts is that I haven't found an easy way to properly position a subview (say a text view) in a given location of the enclosing View. I want one to contain the other...</p><p>I was hoping I had missed something in the documentation (which is far from being intuitive that's for sure) and I could do something like myView.addView(subview). But it ain't so :)</p><p>As a side question, what is the closest to iPhone's UILabel in the Android world?A UILabel can contain a text or a graphic. Right now I've been using TextView and ImageView but they aren't anywhere as flexible when it comes to layout as a UILabel</p><p>Edit: Making my View inherit from ViewGoup instead, let me add subview..However, I want to draw in my view. I found that when ScreenView extends ViewGroup, the onDraw function is never called then.</p><p>Something like:</p><pre><code>        @Override        protected void onDraw(Canvas canvas) {            super.onDraw(canvas);            Paint paint = new Paint();            paint.setStyle(Paint.Style.FILL);            // make the entire canvas yellow            paint.setColor(Color.YELLOW);            canvas.drawPaint(paint);}</code></pre><p>Would paint in yellow my view if ScreenView extends View ; but not if it extends ViewGroup.</p><p>How do you draw directly in the view then?</p><p>ThanksJY</p>","298699","","298699","","2010-10-10 01:17:11","2010-10-10 03:40:09","Adding Views to another View","<java><android>","2","1","","",""
"3896789","1","","","2010-10-09 09:40:58","2","1687","<p>i am working with andriod2.2 while calling web service getting error like java.net.SocketException permission denied error ...already added the internet permission in andriodmanifeast file since getting error ....plz help me soon............... </p>","470979","","","","","2010-10-09 09:40:58","error java.net.socketexception permission denied","<android>","0","1","","2012-04-07 14:30:32",""
"3896821","1","","","2010-10-09 09:50:44","0","157","<p>how can we on or off GPS and 3G by clicking on button without going on setting screen in android?</p>","470986","","","","","2010-10-09 09:56:05","how can we on or off GPS and 3G by clicking on button without going on setting screen in android?","<android>","1","0","","",""
"3896856","1","","","2010-10-09 16:23:23","0","1432","<p>I have a pre-populated database, I hadd .csv and make a database in sqllite manager and imported all values into this database.</p><p>Now I put this database into android's assets folder and want to use this via ORMLite in my android application.</p><p>Please, need your help and will be thankful to you.</p>","471014","","","","","2013-12-17 23:13:13","Android ORMLite, use pre-populated database and use it","<android><sqlite><ormlite>","1","0","1","",""
"3896905","1","","","2010-10-09 16:33:13","5","4875","<p>I need to draw a graph in Android which continuously gets data from the server. Based on one data item the graph needs to be displayed in various colors. The graph should keep moving from right to left like a ECG graph. Its something like continuous moving graph. </p><p>Will I be able to achieve this using Android 2D graphics library? Do I need to use tween animation? Do I have to use interpolators also?</p>","471021","","184184","","2012-06-27 05:59:43","2013-11-18 14:29:26","Dynamic graph rendering in Android","<android><graph><androidplot>","2","1","1","",""
"3896943","1","","","2010-10-09 16:44:52","5","2815","<p>I am trying to autoplay youtube videos on android, the same thing as in</p><p><a href=""http://stackoverflow.com/questions/3405242/how-can-i-autoplay-a-video-using-the-new-embed-code-style-for-youtube"">http://stackoverflow.com/questions/3405242/how-can-i-autoplay-a-video-using-the-new-embed-code-style-for-youtube</a></p><p>The following HTML works in google chrome browser, but not in the browser in android emulator.</p><pre><code>&lt;iframe title=""YouTube video player"" class=""youtube-player"" type=""text/html"" width=""640"" height=""390"" src=""http://www.youtube.com/embed/xxxxxxxx?autoplay=1&amp;vq=medium"" frameborder=""0""&gt;&lt;/iframe&gt;</code></pre><p>Can anyone shed light on this ?</p>","442971","","","","","2013-07-30 14:14:36","Autoplay youtube videos in android","<html><android><youtube><autoplay>","1","2","1","",""
"3896960","1","3897753","","2010-10-09 16:49:19","1","2693","<p>My AndroidManifest.xml file does not create a launcher icon as it should.</p><p>The XML is as:</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.jbrooksuk.iTunesTweet""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application    android:icon=""@drawable/itticon""    android:label=""@string/app_name"" &gt;    &lt;activity android:name="".iTunesTweet""        android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;category android:name=""com.jbrooksuk.iTunesTweet"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;     &lt;activity        android:name="".OAUTH""        android:label=""@string/oauth_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;            &lt;data android:scheme=""itt"" android:host=""twtr"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;receiver        android:name=""com.jbrooksuk.iTunesTweet.AndroidMusicReceiver""        android:exported=""true""        android:enabled=""true""&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""com.android.music.metachanged"" /&gt;            &lt;action                android:name=""com.android.music.playstatechanged"" /&gt;            &lt;action                android:name=""com.android.music.playbackcomplete"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;    &lt;receiver        android:name=""com.jbrooksuk.iTunesTweet.HeroMusicReceiver""        android:exported=""true""        android:enabled=""true""&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""com.htc.music.metachanged"" /&gt;            &lt;action                android:name=""com.htc.music.playbackcomplete"" /&gt;            &lt;action                android:name=""com.htc.music.playstatechanged"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;    &lt;service        android:name=""com.jbrooksuk.iTunesTweet.iTTService""        android:enabled=""true""        android:exported=""false""&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""com.jbrooksuk.iTunesTweet.playstatechanged"" /&gt;        &lt;/intent-filter&gt;    &lt;/service&gt;&lt;/application&gt; &lt;uses-sdk    android:minSdkVersion=""3""    android:targetSdkVersion=""4"" /&gt; &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt;</code></pre><p>The icon should take the user to the main class; com.jbrooksuk.iTunesTweet but no icon is even created.</p><p>When I run the code from ADB the layout is displayed though!</p><p>James</p>","394013","","","","","2011-11-25 13:35:04","AndroidManifest does not generate launcher icon","<android><android-manifest>","2","2","","",""
"3896962","1","3897312","","2010-10-09 16:49:48","1","353","<p>after much time and effort I have managed to create a map with a set location and add a push pin(marker) to the map showing exact location.  Now I want to add a navigation button,  I have five buttons at the top of the screen that allow zoom in and out street view and satillite view.  </p><p>The final button is for navigation, I plan to use the coordinates I have and send them to the google maps application so the usert can navigate there.</p><p>Is it possible to do this and if so how would I go about doing it.   </p>","445174","","","","","2012-09-21 05:10:09","Add a navigation button to map","<java><android><eclipse><google-maps>","2","0","","",""
"3897007","1","","","2010-10-09 17:00:08","1","318","<p>I have to manage different text views in tabs for chatting in android.In my code if a list item is clicked new tab will be generated having one text view one EditText box and a button.With the construction of the tab a new class having will be initialized which will check whether there is any new message or not after every 30 seconds.If new message comes then this will write to that specific text view of the tab.My sample code is follwing:<code>ForPractice fp=new ForPractice(tabHost,""abcd"");</code>When a tab is created this class is called.In its constructor I am sending tabtag and tabhost.And this class consists of following code: `public class ForPractice implements Runnable{    String str;    Thread thrd;    TabHost host;</p><pre><code>public ForPractice(TabHost tabHost,String name) {    str=name;    thrd=new Thread(this, name);    this.host= host;    thrd.start();}@Overridepublic void run() {    while(true)    {        try {            str=""This is for test\n"";            thrd.sleep(30000);            str="""";            test();        } catch (Exception e) {            // TODO Auto-generated catch block            System.out.println(e.getMessage());        }                }        }private void test(){   // get tab by tab, where tag=str (passed during the constructor)   // access the textview in this tab   // append text(str) in that textview}</code></pre><p>}`----My question is how to do the codes in 'private void test()';</p>","459331","","459331","","2010-10-10 22:05:30","2010-10-10 22:05:30","Writing in text view of different tabs in android","<android>","0","2","","",""
"3897045","1","10257585","","2010-10-09 17:08:41","5","5108","<p>I have made an xml file like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:gravity=""bottom""              android:layout_gravity=""bottom""              android:background=""#04600F""              android:padding=""10dp""&gt;              &lt;TextView android:id=""@+id/txtMessage""                        android:layout_width=""fill_parent""                         android:gravity=""center""                        android:layout_height=""wrap_content""/&gt;              &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                              android:orientation=""horizontal""                              android:layout_width=""fill_parent""                              android:layout_height=""wrap_content""&gt;                            &lt;Button android:id=""@+id/btnOne""                                    android:layout_width=""wrap_content""                                     android:layout_height=""wrap_content""                                    android:textSize=""20dip""                                    android:textColor=""#ffffff""                                    android:layout_alignParentLeft=""true""                                    android:background=""@drawable/black_menu_button""                                    android:layout_marginLeft=""5dip""                                    android:layout_centerVertical=""true""                                    android:layout_centerHorizontal=""true""/&gt;                             &lt;Button android:id=""@+id/btnTwo""                                    android:layout_width=""wrap_content""                                     android:layout_height=""wrap_content""                                    android:textSize=""20dip""                                    android:textColor=""#ffffff""                                    android:layout_alignParentRight=""true""                                    android:background=""@drawable/blue_menu_button""                                    android:layout_marginRight=""5dip""                                    android:layout_centerVertical=""true""                                    android:layout_centerHorizontal=""true""/&gt;              &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And I try to access it like this:</p><pre><code>    final Dialog dialog = new Dialog(ctx,android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);    dialog.setContentView(R.layout.myxml);.....</code></pre><p>It looks on the screen exactly how I want it, on the bottom of it. My application has the following set on AndroidManifest:</p><pre><code>android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""</code></pre><p>The only draw back of what I did is the fact that the Android title bar (the one with battery/signal... ) becomes visible as long as my Dialog is visible. How can I disable it ?</p><p>Later edit</p><p>Thank you for pointing that to me, the solution was fairly simple indeed</p><pre><code>dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);</code></pre>","379865","","379865","","2010-10-10 09:54:22","2012-07-11 18:31:31","Android custom dialog shows android title bar","<android><dialog><titlebar>","1","1","","",""
"3897053","1","","","2010-10-09 17:10:34","0","709","<p>So i am making a android app, and i want it to be so if i call lets say 911 it sends my GPS coordinents to a certain IP, i know everything but how i make it so if i call 911 it sends the info and how i can make it send the info to the IP via 3g, can anyone help? </p>","471046","","150771","","2010-10-09 17:18:00","2011-03-17 06:53:32","Help sending info from Android phone to an computer IP with Android Emulator","<android><gps><android-emulator>","1","1","","",""
"3897148","1","5044406","","2010-10-09 17:32:48","1","965","<p><a href=""http://stackoverflow.com/questions/1567443/how-accurate-is-android-gps"">I know that</a> the absolute precision of position detection for gps hardware isn't that accurate.</p><p>But assume that I have two androids and they are syncing each other at one place. In which precision (horizontal area) can I predict the other android position if the devices don't walk away too much (e.g. 1km) ? </p><p>Would this as bad as several meters? Or could I increase the precision in a different way when I have two or more androids in an area of 1km^2? A precision of ~10cm would be nice.</p>","194609","","","","","2011-02-18 17:19:17","Relative Precision of Android's GPS","<android><gps><precision>","1","0","","",""
"3897162","1","3897569","","2010-10-09 17:37:22","3","1383","<p>I have a large XML file which is arranged like so:  </p><blockquote>  <p><code>&lt;item&gt;&lt;title&gt;...&lt;/title&gt;&lt;link&gt;...&lt;/link&gt;&lt;/item&gt;</code></p></blockquote><p>How can I use <code>parse(new InputSource());</code> to point to this XML file if it's stored within my project directory and where do I put the XML file?</p>","471060","","","","","2010-10-09 19:34:11","Android placement of custom XML files","<android>","1","0","1","",""
"3897173","1","","","2010-10-09 17:41:37","1","1861","<pre><code>progressDialog = ProgressDialog.show(GetResponse.this, """", ""Loading..."");new Thread()         {            public void run()             {                try                {// inside i have written code for making connection to the server using SSL connection.}catch (Exception e)  {                 progressDialog.dismiss();                  exception(e.getMessage())                  }.start();  } private void exception(String msg)  {  Toast.makeText(this, msg, Toast.LENGTH_LONG).show();  this.finish();  Intent i = new Intent(getBaseContext(), LoginPage.class);  startActivity(i); }</code></pre><p>my LoginPage.java is previous activity.If the connection is successfull it goes to the next activity ot doesnt give any error,But if der is any prob with connection then i want progress bar should be stopped and go back to the LoginPage activity and also i want the error msg to be displayed.From the above im getting some error.. Please help me out on this</p>","471055","","15187","","2010-10-10 03:44:16","2010-10-10 03:44:16","Using of Toast with thread in android","<android>","2","0","1","",""
"3897176","1","3897466","","2010-10-09 17:42:18","1","5739","<p>This code works fine if I move the findViewById call in to the Activity. Any hints as to why it doesn't work from inside the LearningView class? I've tried moving the TextView inside the com.example.LearningView tag but no joy. I'd prefer to get the TextView from within the SurfaceView subclass as I feel it's more logical to treat the TV as a ""child"" of the SV.</p><p>This is a contrived example I wrote to figure out the problem in a larger application, but the gist of it is the same, and the stack trace is basically the same.</p><p>For what it is worth, the findViewById call is returning null, which obviously threw NullPointerExceptions in some attempts to fix this.</p><p>As you can probably gather from my attempts I'm flying blind on this one.</p><p>Learning.java:</p><pre><code>package com.example.Learning;import android.app.Activity;import android.os.Bundle;public class Learning 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>LearningView.java:</p><pre><code>package com.example.Learning;import android.content.Context;import android.util.AttributeSet;import android.util.Log;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.widget.TextView;public class LearningView extends SurfaceView implements SurfaceHolder.Callback {    public LearningView(Context context, AttributeSet atts) {        super(context, atts);        getHolder().addCallback(this);          }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {        TextView t = (TextView) findViewById(R.id.contents);        t.setText(""testing"");    }    @Override    public void surfaceCreated(SurfaceHolder holder) {    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {    }}</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:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;com.example.Learning.LearningView        android:id=""@+id/learningview"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;    &lt;TextView android:id=""@+id/contents"" android:layout_gravity=""bottom|left""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:textColor=""#ffffffff"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>Stack trace:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception RuntimeException))      ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2454      ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2470       ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119     ActivityThread$H.handleMessage(Message) line: 1821      ActivityThread$H(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4310        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>","153275","","","","","2013-05-20 19:43:17","findViewById in a subclassed SurfaceView throwing RuntimeException","<android>","3","0","","",""
"3897198","1","3897575","","2010-10-09 17:49:12","2","671","<p>I wrote an iPhone app some time ago that creates sound programatically. It uses an AudioQueue to generate sound. With the AudioQueue, I can register for a callback whenever the system needs sound, and respond by filling a buffer with raw audio data. The buffers are small, so the sound can respond to user inputs with reasonably low latency.</p><p>I'd like to do a similar app on Android, but I'm not sure how. The MediaPlayer and SoundPool classes seems to be for playing canned media from files, which is not what I need. The JetPlayer appears to be some sort of MIDI playback engine.</p><p>Is there an equivalent to AudioQueue in the Android Java API? Do I have to use native code to accomplish what I want?</p><p>Thanks.</p>","127613","","","","","2010-10-09 19:36:26","How do I play synthesized sounds on Android?","<android><audio>","1","0","","",""
"3897409","1","3897611","","2010-10-09 18:45:22","4","6058","<p>Hi?I am working on a MapView app in Android. I have three markers that I want to be able to use the Google Map API getlocation-function on, later on. In order to try it out I would like to move the marker with a drag and drop-function, and then check the location. </p><p>Anyone who has gotten a drag and drop to work on an android marker, or know a way to start figuring it out?</p><p>/AK</p>","455479","","455479","","2010-10-09 19:29:37","2013-11-11 10:01:49","How does one implement drag and drop for Android marker?","<android><drag-and-drop><android-mapview><marker>","5","0","8","",""
"3897668","1","3897685","","2010-10-09 20:06:45","3","3498","<p>I want to merge Two HashMaps.</p><p>I could use map1.putAll(map2); but I don't want to overwrite the key's as yes they will have conflicting keys.</p><p>So the keys in each map will be like this</p><pre><code>word1     word1word2     word2word3     word3</code></pre><p>and when I merge them I would like:</p><pre><code>word1word2word3word4word5word6</code></pre><p>It can just overwrite the keys, aslong as the keys are incremental and use the first key text i.e. reads one of the pairs and extracts 'word' so each would be word1  word2.</p><p>But the other caveat I was thinking of the mobile environment and what I can do without having to put up a loading screen or even capable of.</p><p>So as a starter I suppose:</p><pre><code>    HashMap&lt;String, Object&gt; hm1 = new HashMap&lt;String, Object&gt;();    hm1.put(""key1"", ""a"");    hm1.put(""key2"", ""a"");    hm1.put(""key3"", ""a"");    HashMap&lt;String, Object&gt; hm2 = new HashMap&lt;String, Object&gt;();    hm2.put(""key1"", ""1"");    hm2.put(""key2"", ""2"");    hm2.put(""key3"", ""3"");    HashMap&lt;String, Object&gt; newHM = new HashMap&lt;String, Object&gt;();          String keyWord = """";    for (String  s: hm1.keySet()) {        keyWord = s;        break;    }    int count = 0;    for (Object o : hm1.values()) {        newHM.put(keyWord+count, o);    }    for (Object o : hm2.values()) {        newHM.put(keyWord+count, o);    }</code></pre><p>But I'm wondering, how efficient is this? It looks correct, And is there a better way to do it? I don't want to use extra object's unnecessarily </p>","413127","","236831","","2011-03-19 12:08:18","2011-03-19 12:08:18","Merge two Hash Maps Android","<java><android><optimization><performance><hashmap>","2","2","1","",""
"3897723","1","3897742","","2010-10-09 20:16:15","1","4067","<p>I have an Android app with 3 tabs in a TabHost (text labels, no images). I set up the tabs like so:</p><pre><code>intent = new Intent().setClass(this, AnnouncementsActivity.class);spec = tabHost.newTabSpec(""news"").setIndicator(""News"").setContent(intent);tabHost.addTab(spec);</code></pre><p>I start up a background thread to fetch announcements from my server and I want to update the text label on the tab to tell the user how many new announcements there are. For example, I want to change the text on the Tab to ""News (3)"". How can I access and change the text label on the tab?</p><p>Any suggestions are welcome!</p>","416631","","","","","2013-08-18 02:28:37","Change the Text on an Android Tab","<android><android-tabhost>","2","0","1","",""
"3897775","1","","","2010-10-09 20:32:34","8","14267","<p>I have a Java Swing application which draws diagrams. It uses Graphics2D calls and awt objects such as Rectangle etc.</p><p>At some point I might want to port this to Android. I understand that I can't use Graphics2D on Android, but can I still use the awt Rectangle, Font, Color (etc) classes.</p><p>What I want to do is to isolate any code changes between the swing version and the Android version by adding an emulation layer so my Graphics2D calls can be converted to Android drawing calls.</p><p>Is this feasible?</p><p>Just to be clear, I am not too worried about the Swing UI side of things (the UI is minimal and can be rewritten for Android), I am concerned about the actual drawing code which calls Graphics2D from many places.</p>","471147","","","","","2012-02-28 12:38:44","Using awt with android","<android><graphics><awt>","3","1","2","",""
"3897892","1","","","2010-10-09 21:12:38","0","289","<p>I've pulled and compiled the latest Android tree.  Now I want to make changes to the Android's Browser application.</p><p>The environment in Eclipse is already set up.  I tried creating the project by selecting ""Build project from existing source"", but it fails to build because it uses libraries not in the SDK.</p><p>Does anyone know how to import the missing source in order to build the Browser app, or even better, how to just copy the source into a separate project and use it like I was developing a regular application?</p>","471167","","","","","2010-10-09 21:20:19","Making changes to a built-in Android apps","<android>","1","0","","",""
"3897982","1","4147720","","2010-10-09 21:42:32","2","1217","<p>I'm succesfully using Signpost to authorize calls to protected resources in a Google account via OAuth.</p><p>However it seems a bit weird that the user has to go each and every time through Google and grant access. Is there a way of serializing the Consumer and recreating it so that re-authorization is not needed? I've tried keeping the tokens, secret and verifier in the shared preferences and setting them in the Consumer but I receive a OAuthExpectationFailedException.</p><p>Any ideas?</p>","128136","","","","","2010-11-10 18:24:27","Signpost OAuth on Android: how to re-create the Consumer between two succesive runs?","<android><oauth><signpost>","1","0","3","",""
"3898091","1","3901131","","2010-10-09 22:16:54","2","2100","<p>I've been making some apps for android for quite a while but I've only been using windows 7. Due to some reasons sometimes I'm forced to program in linux so I followed the guide to configure the SDK and eclipse (http://developer.android.com/guide/developing/device.html).</p><p>After that I ran ""adb devices"" and got this:</p><pre><code>List of devices attached ???????????? device</code></pre><p>As you can see the name is unknown but this also happens in windows so I didn't fret too much over it.</p><p>Then I launched eclipse and made a very simple project to test the deployment but here two things happened:</p><p>1st- It doesn't detect the android SDK version. (http://img515.imageshack.us/img515/5611/escolha.jpg)</p><p>2nd- when I try to deploy I get the following output:</p><pre><code>[2010-10-09 23:06:45 - testeAndroid] Android Launch![2010-10-09 23:06:45 - testeAndroid] adb is running normally.[2010-10-09 23:06:45 - testeAndroid] Performing com.examples.teste.teste activity launch[2010-10-09 23:06:45 - testeAndroid] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.[2010-10-09 23:09:50 - testeAndroid] WARNING: Unknown device API version![2010-10-09 23:09:50 - testeAndroid] Uploading testeAndroid.apk onto device '????????????'[2010-10-09 23:09:50 - testeAndroid] Failed to upload testeAndroid.apk on device '????????????'[2010-10-09 23:09:50 - testeAndroid] com.android.ddmlib.AdbCommandRejectedException: device not found[2010-10-09 23:09:50 - testeAndroid] Launch canceled!</code></pre><p>I'm using: </p><p>eclipse 3.5.2 </p><p>adt 0.9.9</p><p>android SDK tools r7</p><p>android phone: vodafone 845 = Huawei U8120 - android 2.1-update1</p><p>Any idea for what is happening?</p><p>thanks in advance ;)</p>","471200","","471200","","2010-10-10 14:25:48","2011-02-26 13:27:42","Can't deploy apk from eclipse in ubuntu 10.10","<android>","3","0","1","",""
"3898447","1","3898507","","2010-10-10 00:22:25","7","6221","<p>I need my Android app to save it's state to disk when its activity is put in the background or killed. It's been suggested that I start a thread when onPause() is called and perform any expensive I/O procedures there (see <a href=""http://stackoverflow.com/questions/3894668/saving-loading-document-state-quickly-and-robustly-for-image-editor"">http://stackoverflow.com/questions/3894668/saving-loading-document-state-quickly-and-robustly-for-image-editor</a>).</p><p>In what situations will the OS kill the thread and how commonly do these situations occur?</p><p>I assume it will be like how Activities are dealt with where the OS can arbitrary decide to kill the thread but will mostly only do this when resources are extremely limited. It would be nice to find some specific documentation of this though.</p><p>From playing around, with some test code, a background thread started in onPause() will run indefinitely in the background on my device (I tried loading lots of apps and couldn't get it to be killed).</p><p>For my specific app, I'm writing a bitmap editor where I'm using the Command pattern and the Memento pattern to allow undo and redo of edits. I'd like the user to be able to undo/redo their edits even e.g. the user gets a phone call and the activity is killed when it is put in the background. The best solution I can think of is to use a background thread to constantly save my command and memento objects to disk during application use and to finish up saving any objects that are left in a background thread if onPause is called. In the worse case, if the thread is killed I'll only lose some edits.</p>","461841","","","","","2012-03-22 16:06:26","How does Android handle background threads when leaving an Activity?","<java><android><multithreading><mobile>","3","0","1","",""
"3898749","1","","","2010-10-10 02:23:40","14","3114","<p>Is there any way to re-index a SectionIndexer after new items are added to a ListView?</p><p>I found this <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/a5293bd51de4df3c/9e7c7aa58f3e63c6?lnk=gst&amp;q=sectionindexer+%3D#9e7c7aa58f3e63c6"">solution</a>, but the overlay is position in the top left corner after the SectionIndexer is refreshed.</p><p>Anyone have any ideas?</p>","215056","","","","","2013-04-26 04:45:54","Re-index/Refresh a SectionIndexer","<android><listview>","2","1","4","",""
"3898876","1","7964513","","2010-10-10 03:20:36","20","30269","<p>I'd like to lock the screen. I want to disable the home key and only use the back key. How do I accomplish this?</p>","233618","","330204","","2011-10-20 19:18:08","2014-03-14 09:49:17","How to disable the home key","<android>","4","1","26","",""
"3899003","1","4501893","","2010-10-10 04:16:57","8","1352","<p>I'm trying to add a custom data field and MIME type to the Contacts screen. Is there a way to do this such that when a user views a contact with my data saved on it, my field appears there? This is something I've seen other apps do--how do the Facebook, Twitter, Last.fm, etc. apps add their status information to contacts, for example? I can't seem to figure it out from the Contacts API documentation.</p>","331598","","","","","2010-12-21 17:05:27","How do I add custom data and fields to the the Contacts screen in Android?","<java><android><android-contacts>","2","0","","",""
"3899036","1","3899284","","2010-10-10 04:29:46","0","1518","<p>The Official Twitter Android app has a neat way of presenting a message bubble when you click on a button. I was wondering how that can be done using the Android SDK?</p>","19875","","","","","2010-10-10 06:28:22","How to replicate the popup box in the Twitter Android app?","<android><listview><twitter>","1","1","1","",""
"3899133","1","","","2010-10-10 05:22:20","0","560","<p>I had develop an android app that allow user to request info from their phone based on chrometophone example.Everything is working well but i noticed that c2dm message only sent once to the device and subsequence c2dm will only reach phone after screen unlock.</p><p>This make me annoy as my app required to get data from phone without unlock screen multiple times. Anyone can help on this?</p><p>Thanks and sorry for my bad English.</p>","471336","","","","","2010-10-11 03:58:20","frequent c2dm message request","<android><android-c2dm>","2","0","","",""
"3899158","1","","","2010-10-10 05:38:20","2","383","<p>I recently created a program that gets medi-large amounts of xml data and converts it into arrays of Strings, then displays the data.</p><p>The program works great, but it freezes when it is making the arrays (for around 16 seconds depending on the size).</p><p>Is there any way I can optimize my program (Alternatives to string arrays etc.)</p>","471348","","143378","","2010-10-10 06:05:08","2010-10-10 19:28:50","Can large String Arrays freeze my program?","<android><xml><optimization>","3","0","1","",""
"3899275","1","4182026","","2010-10-10 06:23:58","0","906","<p>I was able to fix this, but I am wondering if I can get a good explanation for why this was broken.</p><p>I created a utility function to handle my date conversions with the database for an android application. This code failed the second time it was accessed:</p><pre><code>public class Util {  private static final ParsePosition pos = new ParsePosition(0);public static String isoDateFormat(Date d) {      SimpleDateFormat databaseformat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");      return databaseformat.format(d);  }  public static Date isoToDate(String isodate) {      SimpleDateFormat databaseformat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");      return databaseformat.parse(isodate, pos);  } }</code></pre><p>I understand that the various SimpleDateFormat features are not thread safe, but (as far as I know) my program was running inside a single thread. I am new to android and maybe I'm mistaken. I do know that I was able to fix this by moving the ParsePosition into the methods and newing it. Even if it's not thread safe, isn't it pretty much just a constant? Why would a read only constant break a thread?</p><p>Thanks!</p><p>EDIT: Here is the stacktrace:</p><pre><code>E/AndroidRuntime( 2753): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mobile/com.example.mobile.ExampleSelector}: java.lang.NullPointerExceptionE/AndroidRuntime( 2753):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime( 2753):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime( 2753):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime( 2753):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime( 2753):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 2753):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 2753):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime( 2753):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 2753):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 2753):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 2753):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime( 2753):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 2753): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 2753):    at Util.isoToDate(Util.java:34)</code></pre>","210920","","210920","","2010-10-10 06:43:43","2010-11-15 06:45:43","SimpleDateFormat Failing in Android","<java><android><simpledateformat>","2","5","","",""
"3899343","1","3899527","","2010-10-10 06:55:31","0","437","<p>I'm writing a JavaScript for an open source browser available for Android to <strong>replace</strong> the <strong>text</strong> in the <strong>body tag</strong> of the pages loaded into the browser with some different text. </p><p>This should be worked in away that once a page get loaded into the browser, this JavaScript executes &amp; the replacements take place &amp; finally the page with replaced text is visible in the browser.</p><p>This is the replacing part of the code: </p><pre><code>var textnodes, node, i;textnodes = document.evaluate(""//body//text()[not(ancestor::script) and not(ancestor::style)]"",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);replace();function replace() {   for (i = 0; i &lt; textnodes.snapshotLength; i++) {      node = textnodes.snapshotItem(i);      text = node.data;      text = text.replace(/\'/g, ""?"");      //The rest of the replacements      node.data = text;   }}</code></pre><p>However <code>document.evaluate</code> seems to be not working. Can anyone help me to correct this code or any suggestions to do this replacing body text task in any other way?</p><p>Thanks!</p>","471349","","","","","2010-10-10 08:09:16","JavaScript for replacing text in the body tag of pages loaded into an open source browser for Android","<javascript><android><browser><replacement><evaluate>","1","0","","",""
"3899378","1","","","2010-10-10 07:08:27","2","3160","<p>I'm trying to import a vcard (vers. 3.0) automatically into the android contacts.Within the contact manager there is an option to import a vcf file stored on the sd-card into the contacts. How can I trigger this function with handing over a file?</p>","471391","","73488","","2010-10-10 07:37:49","2012-04-21 13:14:04","Import a vcard 3.0 automatically into android contacts (Android 2.1)","<android><import><contacts><vcard><vcf>","1","0","3","",""
"3899521","1","3900041","","2010-10-10 08:08:00","3","769","<p>I'm using ant to compile my android projects into debug apks. But sometimes when running my app, objects are getting mixed up and showing up at the wrong places.</p><p>For example:</p><pre><code>&lt;TextView android:id=""@+id/deviceText""        android:textSize=""22sp""        android:textColor=""@color/white""        style=""@style/shadow""        android:layout_column=""0"" /&gt;&lt;Button android:id=""@+id/editDeviceButton""        android:text=""@string/edit""        android:enabled=""false""         android:layout_column=""2"" /&gt;</code></pre><p>This is some code from profile.xml which is used in Profile.java. Here the @string/edit is a reference to the string ""Edit"", but instead of showing ""Edit"" in the app, is says ""sdk"" which is the text that should be assigned to the TextView. The ""sdk"" string is generated from Profile.java</p><p>To solve this problem I have to save the Profile.java file(which already exists) that use this xml file. And by save i mean just save it, not editing it at all, it is just as it were before.</p><p>Ant version:Apache Ant version 1.8.0 compiled on April 9 2010</p>","348956","","348956","","2010-10-10 08:20:24","2010-10-10 11:04:24","Pointers getting mixed up in android","<java><android><pointers><ant>","1","2","","",""
"3899564","1","3899962","","2010-10-10 08:20:54","1","781","<p>I have an android application, which needs to display an image and make that images particular part click listenable... anybody please help me with some hints..</p>","462695","","","","","2010-10-10 10:39:22","make image's particular part click listener in android","<android>","1","0","3","",""
"3899888","1","","","2010-10-10 10:16:37","-1","7630","<p>I Have a Java application and I need to convert it to an Android applicationis there any resources to show how ? in Android developer site I didnt found anything like that!</p><p>I need to use the Java methods and classes in android ,How it can be done?</p>","325296","","","","","2011-09-23 03:42:35","converting Java code to Android","<java><android><methods>","1","1","0","",""
"3899902","1","3900124","","2010-10-10 10:20:19","1","617","<p>I have a project in Eclipse with maybe 7 different classes that i open with Intent.  The problem is when I install the .apk on my HTC phone I get an icon for every class.  How do I make the project so it installs as one app only?  /Johan Andersson</p>","471464","","","","","2010-10-10 11:30:59","When I install my apk I get an icon for every class in the project","<android><eclipse><apk>","2","0","","",""
"3899924","1","3900031","","2010-10-10 10:27:32","0","1855","<p>In my application I implemented a remote service that exchange data with a webserver each 20 minutes and modify the value of some object in MyApplication Class that extends Application.</p><p>After 12 or 15 hour android kill MyApplication class and/or my Service.I tried to implement the </p><p>android:alwaysRetainTaskState=""true""</p><p>without results. Some could explain to me how to make a service or an application persistent in android? I see more application that stay in background for days without problems, but I don't know how to do that.</p><p>I know that android could kill each application if it needs some free memory but my system has 180mb of free memory and no application running because I use it for testing my programs.</p>","444442","","","","","2010-10-10 11:02:12","android service persistent","<java><android><service><persistent>","1","0","0","",""
"3899966","1","","","2010-10-10 10:40:20","2","2058","<p>I am trying to get my head around threads, and after attempting many times to get my head around it, I am stuck on this point.</p><p>I want to get some remote data from a server. I create a thread to handle this operation. I understand this. But if I want to get some more remote data, I end up creating a new thread. This seems a bit daft, as shouldnt I be able to re-use the existing thread.</p><p>After trying to understand how I could do this, I think the answer lies in sending messages to the thread? But I am totally baffled by this.</p><p>Here is a example of where I need to get lots of remote data based on a variable within a for statement:</p><pre><code>for(int i = 0; i &lt; jsonarray.length(); i++){   String httpUserId = jsonarray.getJSONObject(i).getString(""user_id"");   //Get Sub Comments   userId = httpUserId   Thread t = new Thread(null, getUserPrefs, ""getUserPrefs"");   t.start();}</code></pre><p>As you can see in the example, I need to call the remote server lots of times, but instead of creating a new thread each time, shouldnt I be able to reuse one thread that I can create earlier?</p><p>If anyone can help I would be most grateful :)</p>","471477","","","","","2011-02-01 11:37:51","Reusing a thread","<android>","2","0","3","",""
"3900044","1","3900156","","2010-10-10 11:05:44","7","3983","<p>I have a ViewGroup defined in XML with a view inside, at onCreate time I'd like to have a variable of those.<br>I don't want to go through the hassle of using a listview+adapter cause its clearly overkill as I know the list won't change since onCreate()<br>This is more or less the code I'd  like to have.</p><pre><code>TextView mytextview = myViewGroup.findViewById(R.id.mytext);for(String test : strings){  mytextview = mytextview.clone();  mytextview.setText(test);  myViewGroup.addView(mytextview);}</code></pre><p>But it is not working.</p>","78667","","","","","2013-01-28 07:36:01","Clone textview to append it to a ViewGroup","<java><android><views><textview>","3","2","","",""
"3900066","1","3900084","","2010-10-10 11:12:41","1","5567","<p>I just read some tutorials in order to parse a xml feed from the web and turn them into a Listview:</p><pre><code>URL file = new URL(""http://..../file.xml""); SAXParserFactory fabrique = SAXParserFactory.newInstance();SAXParser parseur = fabrique.newSAXParser();XMLReader xr = parseur.getXMLReader(); ReglageParseur gestionnaire = new ReglageParseur();xr.setContentHandler(gestionnaire);xr.parse(new InputSource(file.openStream()));</code></pre><p>Everything is fine and I am able to parse xml.</p><p>My second step is to store the xml file from web into a xml file on the phone and only update it when user ask it. ( In fact, this xml file should not change or maybe once every 6 month, so I don't want to download it each time.)</p><p>So, what I did is to store the file on the phone and update it on user demand.</p><p>And I can read it by doing:</p><pre><code>fIn = openFileInput(""fichier.xml"");InputStreamReader isr = new InputStreamReader(fIn);char[] inputBuffer = new char[255];isr.read(inputBuffer);String readString = new String(inputBuffer);</code></pre><p>So, for now, everything seem fine and I am nearly happy.</p><p>The problem is now when I want to parse the new file on the phone:</p><pre><code>xr.parse(InputSource);</code></pre><p>I need an InputSource as parameter.</p><p>So my question is:</p><p>How can I turn my file in the phone into a InputSource?I succeed to have a InputStreamReader or a String but would like to convert that into InputSource.</p><p>Thank a lot for any precious help</p>","327402","","","","","2012-03-30 16:42:33","Convert a String or a InputStreamReader into InputSource","<android><xml>","2","0","","",""
"3900101","1","3900142","","2010-10-10 11:23:39","2","4104","<p>Is there any way to programatically open the Android Music Player?</p><p>I'm sure there is some kind of Intent somewhere but I cannot find it.</p><p>James</p>","394013","","","","","2013-09-23 10:49:47","Android - Open Music Player","<android>","4","0","","",""
"3900170","1","4078152","","2010-10-10 11:49:19","2","2836","<p>I have been searching for an answer for this for some time now. I have an async task that downloads the database needed for my app, while this is downloading my app cant do anything as all the data it references is in this file, i have the app waiting for the file to be downloaded but i am attempting to show a progress dialog so the user knows something is happening while they wait for this to happen.</p><p>my code is currently</p><pre><code>public class fileDownloader extends AsyncTask&lt;Void, Integer, SQLiteDatabase&gt; {    private File dbFile;    private ProgressDialog progressDialog;    private Context context;    private SQLiteDatabase database;    private SQLiteDatabase.CursorFactory factory;    public fileDownloader(Context c)    {        super();        context = c;    }    @Override        protected void onPreExecute()     {               super.onPreExecute();        progressDialog = new ProgressDialog(this.context);        progressDialog.setMessage(""Downloading Database..."");        progressDialog.setCancelable(false);        progressDialog.setIndeterminate(true);        progressDialog.show();    }    @Override    protected SQLiteDatabase doInBackground(Void... v)     {             ....    }    @Override    protected void onPostExecute(SQLiteDatabase db1)    {        progressDialog.dismiss();    }</code></pre><p>however nothing shows up i have also tried directly calling ProgressDialog.show in the pre execute and moving this to the calling activity with no luck.</p><p>please help!</p>","272710","","","","","2013-04-27 07:57:38","Progress dialog wont show with async task","<android><progress-bar><android-asynctask>","3","1","","",""
"3900281","1","3904294","","2010-10-10 12:29:33","0","2630","<p>I just want to know how to, if a Hashmap is already on the list add 1 to quantity, if it is not then add it to list. This is what I've done that just add eventhough the item is already on list.</p><pre><code>list = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();Cursor c = db.rawQuery(""SELECT code,desc,price FROM TbLPrice WHERE code ="" + txtCode.getText().toString(), null);  //search database                if (c.moveToFirst()){ //if successful                    txtDesc.setText(c.getString(1)); //get desc                     txtPrice.setText(c.getString(2)); // get price @ database                    HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();                    map.put(""desc"", c.getString(1));                    map.put(""price"", c.getString(2));                    map.put(""quantity"",""1"");                    list.add(map);                    adapter.notifyDataSetChanged();</code></pre>","471515","","","","","2010-10-12 00:51:18","Updating List <HashMap>","<android><list><hashmap>","3","4","","",""
"3900318","1","3902143","","2010-10-10 12:41:06","1","1679","<p>I have a ViewFlipper that is transitioned between each view, I want to draw animation to a set of canvases, one for each view. How would I go about integrating the canvas into the view  so that I can still have my buttons on top of it for example?</p><p>If this isn't possible, how would I go about making images drawn to the canvas clickable so i can construct my own buttons?</p>","353674","","","","","2010-10-10 20:51:01","Android Canvas in my layouts?","<android><animation><button><views>","1","0","","",""
"3900445","1","","","2010-10-10 13:18:13","1","869","<p>I have a simple program where I set a spinner to a position.  I then call a second module and when I return, I reset the spinner.  The spinner display does not display the spinner value.  When you tap the spinner, it IS pointing to the correct value, but it displays an incorrect value.  In fact, it actually steps down.</p><p>I wrote the following simple program to demonstrate.  This only happens when the form has a spinner within either a Linearlayout or TableLayout with at lease 1 other element.</p><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;  &lt;TextView      android:layout_width=""fill_parent"" android:layout_height=""200dp""    android:text=""Main Form"" /&gt;  &lt;LinearLayout android:id=""@+id/widget43""     android:layout_width=""320dp"" android:layout_height=""wrap_content""    android:orientation=""horizontal"" &gt;    &lt;Button        android:id=""@+id/btn"" android:text=""Button"" android:textSize=""16sp""            android:layout_width=""160dp"" android:layout_height=""40dp"" /&gt;    &lt;Spinner        android:id=""@+id/btnFour"" android:textSize=""16sp""            android:layout_width=""160dp"" android:layout_height=""40dp""    /&gt;  &lt;/LinearLayout&gt;       &lt;/LinearLayout&gt;</code></pre><p>next.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""    &gt;    &lt;TextView android:id=""@+id/id1""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Next""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>main.java</p><pre><code>package tt.zzz;import android.app.Activity;import android.os.Bundle;import android.content.Intent;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.Spinner;public class main extends Activity { @Override protected void onCreate(Bundle icicle)  {     super.onCreate(icicle);          setContentView(R.layout.main);         fillSpinner();     Button btnGo = (Button) findViewById(R.id.btn);  btnGo.setOnClickListener(new Button.OnClickListener() {   public void onClick(View v) { Go(); } }); } void Go() {  Intent i = new Intent(this, next.class );  startActivityForResult( i, 0 ); } public void fillSpinner(){  Spinner spin_test = (Spinner) findViewById( R.id.btnFour );  ArrayAdapter&lt;CharSequence&gt; myAdapter =   new ArrayAdapter&lt;CharSequence&gt;(    this,    android.R.layout.simple_spinner_item    );  myAdapter.setDropDownViewResource(                    android.R.layout.simple_spinner_dropdown_item);    myAdapter.add(""Option 1"" );  myAdapter.add(""Option 2"" );  myAdapter.add(""Option 3"" );  spin_test.setAdapter(myAdapter);  spin_test.setSelection(1);  spin_test.setOnItemSelectedListener(                 new Spinner.OnItemSelectedListener(){                public void onItemSelected(AdapterView&lt;?&gt;                           arg0,View arg1,int arg2,long arg3){    }   public void onNothingSelected(AdapterView&lt;?&gt; arg0) {   }  });  } @Override protected void onActivityResult(int requestCode, int resultCode,            Intent intent) {  super.onActivityResult(requestCode, resultCode, intent);  fillSpinner();  }}</code></pre><p>next.java</p><pre><code>package tt.zzz;import android.app.Activity;import android.os.Bundle;public class next extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.next);    }}</code></pre>","411203","","","","","2011-08-05 04:14:14","Spinner displays wrong value","<android><spinner>","3","0","","",""
"3900564","1","3900959","","2010-10-10 13:54:47","5","3669","<p>Is it possible to modify an active call by overlaying a sound track during the call? I looked up the SDK, but couldn't find any api to do this in the documentation. </p><p>I am trying to investigate the feasibility of playing a previously recorded call/audio clip onto an ongoing call. </p><p>Thanks in advance.</p>","17404","","","","","2012-04-26 04:32:49","Play an audio clip onto an ongoing call","<android>","1","0","6","",""
"3900658","1","","","2010-10-10 14:18:27","21","23377","<p>I want change the default font of webview to a custom font. I'm using webview in developing an bilingual browser app for Android.</p><p>I tried getting an instance of custom typeface by placing my custom font in assets. But still couldn't set webview's default font to my font.</p><p>This is what I tried:</p><pre><code>Typeface font = Typeface.createFromAsset(getAssets(), ""myfont.ttf""); private WebView webview;WebSettings webSettings = webView.getSettings();webSettings.setFixedFontFamily(font);</code></pre><p>Can anyone correct this or suggest any other method to change webview's default font to a custom font?</p><p>Thanks!</p>","471349","","471349","","2010-10-10 14:34:13","2014-02-20 13:04:43","How to change font face of Webview in Android?","<android><webview><font-face><custom-font>","7","4","13","",""
"3900740","1","3901198","","2010-10-10 14:40:03","6","8784","<p>What is the best way for sharing one SQLite DB between several activities? Tables from DB are shown in ListView, and also deleting/inserting records is to be performed. I heard smth about Services, but did not found example for my problem. Now I have SQLiteOpenHelper class for opening DB. I close db in OnPause() and open it in onResume(). But I can't insert data to db from sub-activity, smth goes wrong.</p>","468311","","","","","2010-10-14 07:22:28","Android SQLite database shared between activities","<android><sqlite>","2","0","8","",""
"3900742","1","","","2010-10-10 14:40:22","1","1624","<p>I want to add separate event listener to dynamically created list of textview. The code so far is like this:</p><pre><code>while (cur.moveToNext()){    TextView tv = new TextView(this);    temp = cur.getString(cur.getColumnIndexOrThrow(""_ID""));    result = ""some text"";    tv.setText(result);    tv.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Intent myIntent = new Intent(v.getContext(), newsDetails.class);                myIntent.putExtra(""id"", temp);                startActivity(myIntent);            }        });    lOut.addView(tv);}</code></pre><p>But this does not work. Separate text views are created in a form of list but separate event listeners are not working. </p>","418965","","","","","2010-10-10 16:39:54","Seperate event listener for every textview in android","<java><android><event-handling><eventlistener>","2","0","","",""
"3900825","1","3901114","","2010-10-10 15:07:11","1","549","<p>I'm writing an app, that has a somewhat modular system. It has a core app, and some apps, that consist of a single <code>Service</code>, that implements the desired interface. I followed <a href=""http://developer.android.com/guide/developing/tools/aidl.html"" rel=""nofollow"">the guide</a> to create the IPC communication. But now I need to get all the services, installed on the system, that my core app can wotk with. How do I do this? I mean, is there any way to mark my <code>Service</code> apps with some kind of a tag, and then filter results, presented by the <code>PackageManager#getInstalledPackages()</code> based on that tag value? What's the common practice of doing so?</p>","163423","","","","","2010-10-10 16:26:14","Getting packages from PackageManager","<android><service><android-package-managers>","1","0","1","",""
"3900858","1","3901122","","2010-10-10 15:18:29","0","674","<p>Some phones seem to not have livewallpaperpicker.apk.   Is there an API I can call from inside the app to set the live wallpaper to itself ?</p>","62709","","19750","","2011-03-30 21:53:23","2011-03-30 21:53:23","Live wallpaper that can set wallpaper to itself?","<android><live-wallpaper>","1","0","","",""
"3900943","1","3901320","","2010-10-10 15:44:26","0","690","<p>Let's say I have MyActivity and inside my onCreate method I initialize MyBackgroundView, then MyPlayer1View then MyPlayer2View.  I want to be able to touch the screen, figure out if I have touched Player1 or Player2 and then respond with changes to the players if I have touched them.  </p><p>My problem is, where do I put the onTouchListener?  Can only MyBackgroundView listen for touches, or can the players listen for touches too?  If MyBackgroundView can only accept touches, do I need to call view.ontouchlistener that says, you have touched me, and I have a player at those coordinates, so I'll pass the motion event to the player and let it handle it?  Or do call view.ontouchlistener in each of the players that says, you've touched me, now I will react to the motion event?</p>","404762","","","","","2010-10-10 17:24:28","How do I implement multiple views that react to onTouch?","<android>","1","0","","",""
"3900957","1","","","2010-10-10 15:47:50","4","2753","<p>Could it be possible now, which we can develop an Android application having the following requirement for its working steps</p><ol><li>Automatic receive the call, then</li><li>Play some sound out to the caller, wait for DTMF response, then</li><li>Record the caller sound (in the case that they permit, by pressing 1 as DTMF response)</li><li>Callee can play back the recoreded sound later.</li></ol><p>Thank for all answers in advance  .....</p>","471595","","148271","","2011-07-23 21:35:07","2014-03-04 18:20:47","How to automatically answer call and play prerecorded sound out to the caller and DTMF on Android","<android>","3","2","1","",""
"3901053","1","","","2010-10-10 16:12:55","6","6019","<p>When I record video by MediaRecorder, it always records in landscape mode, regardless of real device orientation.How to force MediaRecorder/Camera use real orientation ?</p>","281887","","213269","","2011-08-12 20:59:38","2013-07-03 16:15:45","how to change video orientation in MediaRecorder to portrait","<android><video-recording><device-orientation><mediarecorder>","3","0","1","",""
"3901107","1","","","2010-10-10 16:25:10","0","2225","<p>Has anyone tried porting clamav to android??</p>","275674","","","","","2013-06-10 10:13:55","clamav for android","<android>","1","0","","",""
"3901231","1","3901434","","2010-10-10 16:58:22","0","6807","<p>I have a spinner with items, populated via ArrayAdapter. I want to change font style for some (not for all) of spinner items, both for spinner's combobox and listbox. I guess that I need to subclass something, but I don't understand what. How can I do that?</p><p>Thanks! </p>","227024","","","","","2014-01-31 12:09:59","How to change font style for spinner item","<android><spinner>","2","0","1","",""
"3901342","1","","","2010-10-10 17:31:37","7","2557","<p>I've an XML file in the assets directory of my test application. I want to access this file from my suite method of the test class.</p><p>ie.,</p><p>public static TestSuite suite(){    InputStream stream = // Some code which returns the asset}</p><p>Any idea how I can do this? I tried with Resources.Resources.getSystem().getAssets() but no luck :-(. help please.</p><p>Thanx in adv,Joseph</p>","471641","","","","","2011-10-28 16:27:05","android - accessing test application assets","<android><xml><unit-testing><assets><suite>","2","0","1","",""
"3901507","1","","","2010-10-10 18:07:40","-2","145","<p>Android 2.2 had come up with a new feature called WifiHotspot.This feature is not available in previous versions.What is importance of this feature. What is meant by WifiHotspot ? Can anyone tell me detailed explanation regarding this feature. Where can I find information about this feature.</p><p>Thanks in Advance,</p>","429501","","","","","2010-10-10 21:05:36","What is meant by WifiHotspot in Android2.2","<android>","1","1","","2010-10-11 06:36:20",""
"3901555","1","","","2010-10-10 18:18:28","0","1658","<p>when my Async task is executed it completely crashes the appHere is the code to the class. It sits inside of my main activity class.I'm new to threading, so sorry if I've done something ridiculous lol, I don't fully understand it.</p><p><strong>EDIT:</strong></p><pre><code>    private class TeamSearchTask extends AsyncTask&lt;String,Void,Void&gt; {    CharSequence nfo;    String [] matches;    protected Void doInBackground(String... teamNumber)     {            //Team information ------------------------------------------------------------------------------------            //Array of team data            String [] data = APIconnection.getTeams(teamNumber[0], """");            //Display basic team info            nfo = (""\nFormal Team Name:\n"" + data[1] +                     ""\n\nLocation:\n"" + data [3] + "", "" + data[4] + "", "" + data[5] +                    ""\n\nRookie Year:\n"" + data[6] +                    ""\n\nRobot Name:\n"" + data[7] +                    ""\n\nWebsite:\n"" + data[8] + ""\n\n\n\n\n\n\n\n\n"");             //Make match archive --------------------------------------------------------------------------------------            String [] events = APIconnection.getEventIdsByYear(year1);            String [] matches = new String [(events.length*11)];;            for (int i = 0; i&lt;events.length; i++)            {                matches[(i*11) + i] = APIconnection.getMatches2(teamNumber[0], events[i] ,"""","""")[i];                        }            return null;    }    protected void onProgressUpdate(Void...voids )     {}    protected void onPostExecute(Void result) {        info.setText(nfo);        matchArchive(matches);    }}</code></pre>","471348","","471348","","2010-10-11 21:39:28","2010-10-11 21:39:28","Help with Async task, crashes on .execute()","<android><android-asynctask>","2","16","","",""
"3901590","1","3901704","","2010-10-10 18:27:09","3","27968","<p>This is a followup to this post:</p><p><a href=""http://stackoverflow.com/questions/3897176/findviewbyid-in-a-subclassed-surfaceview-throwing-runtimeexception"">http://stackoverflow.com/questions/3897176/findviewbyid-in-a-subclassed-surfaceview-throwing-runtimeexception</a></p><p>Based on Romain Guy's feedback (which I'll accept shortly as it is a solution), I'd like to obtain the calling Activity from within the View, so that I can use it to obtain the desired TextView resource.</p><p>I don't see any methods in View that return Activity. What is the proper way to do this? Or is there a better alternative for working with TextViews from within another View context.</p><p>Basically, I am calling setContentView(R.layout.xxx) in onCreate() (as usual), so I don't really have a way to pass in references to additional TextViews unless I awkwardly retrieve the View after setContentView and then make calls on it.</p>","153275","","1765573","","2013-07-24 06:43:48","2013-07-24 06:43:48","get Activity object while in View context","<android><android-activity><android-context>","2","0","","",""
"3901632","1","3902153","","2010-10-10 18:38:15","3","2154","<p>If I wanted to connect to another device via bluetooth how would I do it?</p><p>Nothing I've done seems to work.  The phone I'm trying to connect to is non android and has bluetooth on and discoverable.</p>","445342","","","","","2012-03-17 20:09:11","Android Bluetooth","<android><bluetooth>","1","0","2","",""
"3901796","1","3903612","","2010-10-10 19:17:44","1","623","<p>I'm trying to get access to the metadata about podcasts, such as the show notes/description, the show title and the icon image. I'm at least partially using ContentResolver to query for most of the AudioColumns information, but for some reason ALBUM_ART is missing, there seems to be no column for the description, and in general, it's not clear what the mapping is. Since podcasts are not songs, they don't generally have ""composers"", ""artists"" and ""albums"" they have show titles, episode titles, hosts, etc. Is there any information out there on what standards are generally used for podcast metadata and how I can efficiently access it?</p>","467366","","295525","","2010-10-11 06:32:11","2010-10-11 06:32:11","How to access podcast metadata?","<android><podcast>","1","0","","",""
"3901813","1","3901934","","2010-10-10 19:20:18","2","14533","<p>I have an xml file like below which I will use to set background for <code>Textview</code>: <br></p><h1>row.xml <br></h1><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:endColor=""#CCCCCC"" android:startColor=""#CCCCCC""      android:angle=""270"" /&gt;      &lt;stroke android:width=""1dp"" android:color=""#999999"" /&gt;      &lt;corners android:bottomRightRadius=""0dp""      android:bottomLeftRadius=""0dp"" android:topLeftRadius=""0dp""      android:topRightRadius=""0dp"" /&gt;&lt;/shape&gt;</code></pre><p>The above Xml I will set as background for TextView in main.xml as below: <br></p><h1>main.xml</h1><pre><code>&lt;TextViewandroid:id=""@+id/rowtext3""android:text=""Availablity""android:layout_height=""25px""android:layout_width=""60px""android:textSize=""10px""android:textStyle=""bold""android:textColor=""@color/black""android:gravity=""center""android:background=""@drawable/row""/&gt;</code></pre><p>But I want this to do from code rather than Xml.I have done everything  that I have done in Xml like font, width, Height, font dynamically through code, but not able to set Background that I mentioned in Xml file. How can we set content of Xml file as background to textview similar to how we set background as XML in main.xml. <br></p><p>In the code I have done like this: <br></p><pre><code>    t1=new TextView(this); &lt;br&gt;    t1.setText(ed1.getText()); &lt;br&gt;    t1.setHeight(25); &lt;br&gt;    t1.setWidth(60); &lt;br&gt;    t1.setTextSize(10); &lt;br&gt;</code></pre><p>But I didn't find how to set background i.e. how to set XML content as background? <br>Can any one help me in sorting out this issue? <br>Thanks In Advance,</p>","429501","","1049263","","2012-10-03 20:26:34","2012-10-03 20:26:34","How to set Background of a TextView dynamically from Xml file","<android>","2","0","","",""
"3901904","1","","","2010-10-10 19:41:21","0","634","<p>I'm trying to get the name of the file attached to an email on the gmail app? Can anyone point in the direction of getting the file name ? I can get the attachemnt, just don't know how to get the original file name.</p>","443376","","","","","2012-01-19 21:22:47","Android Gmail attachment","<android><gmail><attachment>","1","0","","",""
"3902058","1","","","2010-10-10 20:29:39","0","2250","<p>Google mapview does not load the actual maps in the emulator, just the  grid. My overlays are displayed ok. sdk version 2.2. It works fine in a real phone. I use a debug key and trippel checked the manifest. It has been working in earlier projects. I just cant figure it out.. Any ideas, what to check? </p>","437162","","","","","2012-04-09 06:42:01","Google maps works on phone NOT on emulator","<android><google-maps><emulator>","4","0","","",""
"3902066","1","3902495","","2010-10-10 20:31:38","1","3131","<p>So I'm writing an Android app which uses a large c++ library.  I have everything working so that the java app can call the c++ delegation methods, but I'm finding myself wishing I could log messages from c++ to the Android log.  This is easy from java, but I'm at a loss as to how to call a java method from c++.  My searches found methods for opening a jvm from c++, which is not at all what I want to do.  Ideally, I'd like to pass a log method pointer to c++, which could then be used whenever I wanted.  Of course, java doesn't support method pointers.  My java method would look something like:</p><pre><code>private void log(String s){   Log.i(Tag, s);     // Android log}</code></pre><p>I just don't know how to allow c++ to access this method.</p>","453264","","","","","2014-03-07 06:28:07","How to call Java methods from C++ in JNI","<java><c++><android><jni><android-ndk>","2","2","4","",""
"3902079","1","3902147","","2010-10-10 20:34:23","1","1879","<p>I am trying to write a select query from one single table in SQLite DB in my app where data exists.</p><p>This is the SQL.table has these columns - id(INTEGER), start_time(INTEGER), category(TEXT)</p><p><code>select category from tuuserid_pref where id = (select max(id) from tuuserid_prefwhere start_time &lt; '1242');</code> by the way I want to bind the value shown in 1242 which I have in an Integer variable.</p><p>I have written selects and inserts and updates without binding parameters and they work using db.execSQL and db.rawQuery functions but just cannot figure the binding parameters out.</p><p>Any help is much appreciated.</p>","447886","","","","","2010-10-10 21:13:11","How do I write this Query for SQLite for android App?","<android><sqlite>","1","0","","",""
"3902099","1","","","2010-10-10 20:39:29","0","503","<p>I have pages that users will be accessing that contain iframes. I would like to be able to parse out the source URL for sharing. </p>","471723","","","","","2010-10-10 20:39:29","Parse iframe source in Android WebView","<html><android><html-parsing>","0","2","","",""
"3902184","1","","","2010-10-10 21:01:54","2","716","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4375375/how-to-resolve-waiting-for-debugger-message"">How to resolve &ldquo;Waiting for Debugger&rdquo; message?</a>  </p></blockquote><p>This might be helpfull for the one or the other:If the debugger doesn't attach (hang-up of the screen ""waiting for debugger), then you probably use the phone device and the emulator at the same time. </p><p>Just unplug the phone or close the emulator and everything's fine again.</p>","471743","","707795","","2012-07-23 08:55:54","2012-07-23 08:55:54","Android: ""waiting for debugger"" hang-up","<android>","0","4","1","2011-12-29 13:05:27",""
"3902217","1","","","2010-10-10 21:11:41","7","22723","<p>I need native(standart) android music player source code. Where i can find it?</p>","457683","","422597","","2010-10-10 22:33:34","2012-06-19 12:57:24","Android music player source code","<java><android><android-music-player>","2","0","6","",""
"3902621","1","3902642","","2010-10-10 23:21:05","0","343","<p>So I am a complete newb, and am currently taking an intro to Mobile Programming course in which we use Android (I have some experience with Java).  I am trying to do a simple assignment which displays a text field and an image, and upon entering the correct ""password"" and pressing enter, the image changes.</p><p>Should be so simple! But I am having a really hard time with this and can't figure out what I am doing wrong, even after doing a good bit of searching (I assume it is something super obvious and I'm missing it).</p><p>Here is my code:</p><pre><code>package CS285.Assignment1;import android.app.Activity;import android.os.Bundle;import android.widget.EditText;import android.view.KeyEvent;import android.view.View;import android.view.View.OnKeyListener;import android.widget.ImageView;public class DisplayImage extends Activity       implements OnKeyListener{ private EditText enteredText; private String pass = ""monkey"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        enteredText = (EditText)findViewById(R.id.passField);        enteredText.setOnKeyListener(this);        }    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         switchImage();          return true;        }        return false;    }    public void switchImage(){  if(enteredText.getText().toString() == pass){   ImageView imgView = (ImageView)findViewById(R.id.Image);         imgView.setImageResource(R.drawable.marmoset);  }         }}</code></pre><p>and 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""    &gt; &lt;TextView android:id=""@+id/textPrompt""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:background=""#ff993300""   android:text=""Please enter password to see my real picture:""  &gt; &lt;/TextView&gt; &lt;EditText android:id=""@+id/passField""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""    &gt;        &lt;/EditText&gt;&lt;ImageView  android:id=""@+id/Image"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:adjustViewBounds=""true""  android:src=""@drawable/airplane""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I thought at first that I was not properly extracting the String from ""enteredText"" so the comparison to the ""password"" wasn't happening correctly, but I have since tried just printing the enteredText and it works fine.</p><p>Totally frustrated--Any help would be greatly appreciated!</p><p>Daniel</p>","471791","","2345913","","2013-09-05 06:53:11","2013-09-05 06:53:11","Change Image on Correct Password","<android><string><passwords><android-imageview><android-edittext>","1","0","","",""
"3902772","1","3902874","","2010-10-11 00:14:13","5","6258","<p>So my aim is to flip an image horizontally then draw it on a canvas. Currently I'm using canvas.scale(-1,1) which effectively works and draws the image horizontally, however it also screws with the x axis values where before the scale the x position would be 150 and after I'd have to switch it to -150 to render in the same spot.</p><p>My question is, how can I make it so the x value is 150 in both cases without having to adjust the x position after the scale? Is there a more effective way to do this without taking a hit on performance?</p>","437414","","","","","2010-12-06 15:04:04","Android canvas.scale(-1,1)","<android><graphics><canvas>","3","0","1","",""
"3902859","1","3904039","","2010-10-11 00:38:23","0","4394","<p>I'm writing an app that stores secret (encrypted+hidden using <a href=""http://en.wikipedia.org/wiki/Steganography"" rel=""nofollow"">steg</a>) information in MMS messages. Obviously I need a way to test this, in particular, sending and receiving MMS messages. I have one Android phone, a Nexus One. I know that <a href=""http://developer.android.com/sdk/RELEASENOTES.html"" rel=""nofollow"">MMS's cannot be sent between emulator instances</a>, but other than using up loads of MMS credit, is there another way of testing out MMS sending/receiving without just spending loads of money?</p>","319618","","","","","2010-10-11 06:54:36","What's the best way to test sending/receiving MMS messages with Android?","<android><testing><mms>","1","0","","",""
"3902943","1","","","2010-10-11 01:11:20","9","8723","<p>I saw an article about including additional javax.* packages in your Android App <a href=""http://code.google.com/p/dalvik/wiki/JavaxPackages"">http://code.google.com/p/dalvik/wiki/JavaxPackages</a>.</p><p>I wanted to do the same thing, but using Eclipse.Could anyone help me figure out how to do this? </p>","471183","","5387","","2012-03-29 23:57:04","2013-09-04 17:48:25","How to Include additional javax.* packages in Android App with Eclipse?","<android><eclipse>","2","2","0","",""
"3903258","1","5097921","","2010-10-11 02:54:51","1","3484","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5907369/file-upload-in-webview"">File Upload in WebView</a>  </p></blockquote><p>For Example, <a href=""http://imgur.com"" rel=""nofollow"">http://imgur.com</a>In the stock browser on an android phone you can press the ""Browse"" button on imgur.com and navigate to a photo you wish to upload. This works great in the browser. Is there something I should set to true to allow this in a webview? </p>","393373","","","","","2011-02-23 22:17:40","Allow file upload in webview?","<android><file-upload><webview>","1","0","","2012-10-22 13:16:07",""
"3903309","1","","","2010-10-11 03:13:32","2","6284","<p>I've tried to open Google Map application on iphone &amp; android. From iPhone developer reference website I am able to open the native google map from link.</p><p><a href=""http://maps.google.com/maps?ll=11.5558762589,104.921697935&amp;z=15"" rel=""nofollow"">http://maps.google.com/maps?ll=11.5558762589,104.921697935&amp;z=15</a></p><p>However, I have trouble with adding a marker into the map. As in google static map, we can add markers into map. I wonder if we can do the same to google map link.</p>","471848","","","","","2010-12-08 04:27:57","google map link with marker (on iphone & android)","<iphone><android><google-maps><google-maps-markers>","2","3","1","",""
"3903380","1","","","2010-10-11 03:41:29","1","280","<p>i want to share on facebook,tweet on twitter same like Add This functionality</p><p>any one guide me is it possible in android? if yes,then please guide what is the procedure for all facebook ,twitter,linked in..etc..and without installing ADD THIS application in phone. i mean programmatically.</p><p>any help would be appreciated.</p>","249991","","","","","2012-04-07 10:21:07","AddThis functionality in android application?","<android>","2","2","","",""
"3903419","1","3903519","","2010-10-11 03:54:25","0","773","<p>HelloIn my android application i have a video list screen,a buffering screen and a videoplayer screen.As soon as the user clicks an item from videolist screen ,he is navigated to buffering screen and then to videoplayer.In the buffering screen i am using Async task and doing the loading process in on background process.</p><p>Now my issue is like the user if has selested a video then gets navigated to buffering screen.But if the user clicks back when he is in buffering screen then initially he is getting navigated to videolist screen but immediately after that again he is navigated to videoplayer screen.</p><p>What i would like to have is either the back button should be made disable in buffering or should prevent the player tostart if back is clicked.</p><p>Could you please let me know your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2010-10-11 12:31:42","back button in android","<android>","2","5","","",""
"3903442","1","3903481","","2010-10-11 04:04:07","2","4560","<p>when i try to debug on X10 but on screen select device i haven't see X10 device (Only have AVD device).</p><p>I was intall driver: Sony_Ericsson_PC_Companion_2.00.146_Web.exe but nothing happen.Anyone have experiment with this device please give me suggest.Thanks for your help</p><p>@Update solution:I got solution: just flow steps:</p><pre><code>Menu -&gt; Settings -&gt; Applications -&gt; Development -&gt; USB Debugging!</code></pre>","289277","","289277","","2010-10-11 04:32:01","2012-06-23 08:10:41","How to debug on Sony Ericsson X10i","<android><x10>","2","0","1","",""
"3903450","1","4524602","","2010-10-11 04:06:39","0","914","<p>I know this should be on the facebook developer site but I can't seem to register. Anyway I'm using the new api to obtain a access token when connecting to the xmpp chat server but this access token doesn't work; I have to use the old rest api's 'session_key' but I can't seem to find a way to get it. Could someone help me? </p><p>I currently use the android facebook sdk but that doesn't have the session key; it only returns an authentication token which doesn't work with my xmpp client. </p>","311001","","","","","2011-01-02 21:36:31","Facebook session key using the old rest api","<android><facebook><chat><xmpp>","1","0","","",""
"3903474","1","","","2010-10-11 04:14:09","1","351","<p>I want to extend android's default IME, LatinIME. I cloned LatinIME's Android 2.1 tag from here (<a href=""http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git;a=summary"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git;a=summary</a>), but there are some issues with the code... </p><p>For example in the class <code>CandidateView</code> the variable <code>mScrollX</code> is used, which is part of <code>View</code>, the extended class. But turns out that with the public SDK, that variable is private so it can't be used by children classes.</p><p>What I found in Google to be the solution to this is to change the use of <code>mScrollX</code> for the public getters of <code>View</code>, but the code also sets that variable and there are no setters available.</p><p>Another issue is that <code>com.android.internal.R</code> is used, which also isn't public available.</p><p>How am I supposed to extend LatinIME? Has anyone tried to do something like this?</p><p>Thanks in advance.</p>","237347","","237347","","2013-03-10 20:01:43","2013-03-10 20:01:43","Extending LatinIME","<android>","1","0","","",""
"3903650","1","","","2010-10-11 05:12:31","4","1719","<p>How do I determine how long an application has been running? Is there a broadcast each time an app is launched and shutdown? </p><p>I am trying to log the time spent using an application.</p>","17404","","","","","2010-10-12 00:53:46","Time that an application is running","<android>","1","1","2","",""
"3903736","1","","","2010-10-11 05:37:17","6","7899","<p>I am having a problem in running Android unit test. I got this error when I tried to run a simple test. </p><p>Here's the log:</p><blockquote>  <p>Blockquote  java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.wsandroid.Activities/.SplashActivity }  at android.app.Instrumentation.startActivitySync(Instrumentation.java:371)  at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:120)  at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:98)  at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:87)  at com.wsandroid.test.activity.TestEULA.setUp(TestEULA.java:15)  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)  at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</p></blockquote><p>This error occurs for Android less than 2.2. It works fine for Android 2.2 emulator. Yet Android 2.2 emulator has a bug of sending a key twice even though we only press it one. Application to be tested runs on Android 2.2 platform.</p><p>Appreciate if anyone of you can help me. </p><p>Dzung.</p>","471915","","","","","2011-08-09 19:04:42","Unable to resolve activity for: Intent","<android><unit-testing>","3","0","1","",""
"3903744","1","3907130","","2010-10-11 05:39:50","0","734","<p>Whenever I start the application it keeps force closing citing the log below. Is this a CPU overload issue or memory management issue? I really don't understand how to resolve this?Any help is much appreciated.</p><p>I am running Eclipse v 3.5.2 and Android SDK 0.98 and AVD is Froyo (2.2)</p><p>DDMS Log</p><p>10-10 23:53:53.379: ERROR/ActivityManager(60): ANR in Test.Tooyoou10-10 23:53:53.379: ERROR/ActivityManager(60): Reason: Executing service Test.Tooyoou/.TooyoouWidget$UpdateService10-10 23:53:53.379: ERROR/ActivityManager(60): Load: 1.17 / 0.68 / 0.2610-10 23:53:53.379: ERROR/ActivityManager(60): CPU usage from 20436ms to 33ms ago:10-10 23:53:53.379: ERROR/ActivityManager(60):   adbd: 3% = 0% user + 3% kernel / faults: 10 minor10-10 23:53:53.379: ERROR/ActivityManager(60):   Test.Tooyoou: 2% = 2% user + 0% kernel / faults: 197 minor 4 major10-10 23:53:53.379: ERROR/ActivityManager(60):   system_server: 2% = 1% user + 0% kernel / faults: 134 minor 2 major10-10 23:53:53.379: ERROR/ActivityManager(60):   ndroid.settings: 1% = 1% user + 0% kernel / faults: 3016 minor 12 major10-10 23:53:53.379: ERROR/ActivityManager(60):   ndroid.launcher: 0% = 0% user + 0% kernel / faults: 32 minor10-10 23:53:53.379: ERROR/ActivityManager(60):   m.android.phone: 0% = 0% user + 0% kernel / faults: 174 minor10-10 23:53:53.379: ERROR/ActivityManager(60):   ronsoft.openwnn: 0% = 0% user + 0% kernel / faults: 99 minor10-10 23:53:53.379: ERROR/ActivityManager(60):   d.process.media: 0% = 0% user + 0% kernel / faults: 22 minor10-10 23:53:53.379: ERROR/ActivityManager(60):   netd: 0% = 0% user + 0% kernel / faults: 64 minor 1 major10-10 23:53:53.379: ERROR/ActivityManager(60):   com.svox.pico: 0% = 0% user + 0% kernel / faults: 26 minor10-10 23:53:53.379: ERROR/ActivityManager(60):  +sh: 0% = 0% user + 0% kernel10-10 23:53:53.379: ERROR/ActivityManager(60):  +logcat: 0% = 0% user + 0% kernel10-10 23:53:53.379: ERROR/ActivityManager(60): TOTAL: 11% = 5% user + 4% kernel + 0% irq + 0% softirq</p>","447886","","","","","2010-10-11 14:30:39","ERROR/ActivityManager(60) has anyone encountered this on Android Emulator?","<android>","1","0","","",""
"3903751","1","3903860","","2010-10-11 05:41:25","0","85","<p>Hi want to use the image directly from website .i did not place that image in drawable folder. for this purpose what can i do.Give me some suggestions thanks in advance.</p>","699226","","","","","2010-10-11 06:17:44","Invoke the image directly from website to our app","<android>","1","0","","",""
"3903796","1","3904011","","2010-10-11 05:58:24","11","18563","<p>I'm having a really hard time understanding how to use custom tabs in android. I don't want to just be able to set the text and stuff. How can I change the size, and the image, and all that.</p><p>I've googled and I can't find anything that makes sense</p>","375874","","","","","2012-12-25 18:53:43","Custom tabs in android","<android><android-tabhost>","1","0","8","2012-12-26 01:29:44",""
"3903857","1","","","2010-10-11 06:17:27","2","6917","<p>In my Android application I would like get all the available APNs and check if the client APN is available. I would like to run my app using this client APN.</p><p>Is there a way to achieve this on Android?</p>","420261","","63550","","2014-04-04 16:50:43","2014-04-04 17:09:15","Set APN programmatically on Android","<android>","2","0","2","",""
"3903887","1","3904627","","2010-10-11 06:24:46","0","526","<p>I wish to work with checked list views wherein only one item can be selected at a time. Some queries related to this:</p><ol><li><p>Is it advised to work with CheckedTextView as the ListView items, or a combination of CheckBox and TextView?</p></li><li><p>If using CheckedTextView, the text comes first and the checkbox appears on the right edge. Is it possible to make the checkbox appear on the left of the TextView?</p></li><li><p>How can I make one of the items as checked in onCreate()?</p></li></ol><p>Note: I am using array adapter and calling setAdapter() to populate list.</p>","454660","","496830","","2011-03-30 06:29:38","2011-03-30 06:29:38","Android: How to work with Checked ListViews","<android><arrays><listview><checkbox><adapter>","1","0","","",""
"3903895","1","3903927","","2010-10-11 06:26:39","15","9089","<p>I am trying to open a webpage in my application using <code>WebView</code>. When I open webpage it shows me blank screen for a while and then open that page in browser inside my application.</p><p>Anyone suggest me how to show progress or get rid of that blank screen which comes during loading of webview?</p><p>I am using following code:</p><pre><code>WebView mWebView = (WebView) findViewById(R.id.mywebview);mWebView.getSettings().setJavaScriptEnabled(true);// error handlingfinal Activity activity = this;mWebView.setWebViewClient(new WebViewClient() {    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {        Toast.makeText(activity, ""Oh no! "" + description, Toast.LENGTH_SHORT).show();    }});// error  handlingmWebView.loadUrl(URL);mWebView.setWebViewClient(new HelloWebViewClient());</code></pre>","249991","","436938","","2012-06-19 14:13:30","2014-01-30 13:44:40","how to show progress bar on webview?","<android>","4","1","5","",""
"3904034","1","","","2010-10-11 06:53:13","2","4572","<p>Is it possible to create a application that gets network activity / statistics while running as a background process? Or just make a application that listen to traffic on a specific port?</p><p>ThanksM</p>","410248","","410248","","2010-10-11 07:23:18","2010-10-11 11:08:06","Android network stats","<android>","1","0","1","",""
"3904064","1","3927195","","2010-10-11 07:01:00","3","1345","<p>Is there a way to make my textview wrap around other views? For example in the picture, is there a way to get it to wrap to the edge once it gets below the imageview?</p><p><img src=""http://i.stack.imgur.com/ai0vu.png"" alt=""alt text""></p><p>This is my xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""@android:color/white""&gt;    &lt;LinearLayout android:id=""@+id/AUTHOR_TITLE""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""vertical""        android:layout_alignParentTop=""True""&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:textSize=""20dip""            android:text=""Author Name""            /&gt;    &lt;/LinearLayout&gt;        &lt;RelativeLayout      xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""wrap_content""android:layout_height=""wrap_content""    android:layout_below=""@id/AUTHOR_TITLE""&gt;            &lt;ImageView android:id=""@+id/PICTURE""            android:layout_alignParentLeft=""True""            android:layout_alignParentTop=""True""            android:src=""@drawable/icon""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""  /&gt;                    &lt;TextView android:id=""@+id/DESCRIPTION""             android:layout_toRightOf=""@id/PICTURE""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF OMGTESTLOLWTFOMGTESTLOLWTF ""/&gt;           &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I'm really surprised that no one's done this yet =\ Sigh.</p>","375874","","375874","","2010-10-19 21:27:54","2013-11-28 09:34:57","Having a view wrap around another view","<android><textview>","1","0","","",""
"3904086","1","","","2010-10-11 07:03:31","0","226","<p>I want to filter market and non market applications installed on android device.How can I do this...</p><p>Thanks,Prateek</p>","434652","","","","","2011-01-19 15:18:18","Identifying market and non market apps on android device","<android>","1","0","","",""
"3904288","1","3904840","","2010-10-11 07:31:13","1","473","<p>I'm working on a C++ project and I need to find an external library whichprovides HTML parser and regular expression support.</p><p>The project is under 2 OS - iOS &amp; Android.</p><p>I was thinking using libxml2 which has a HTML parser module and xml regular expression.</p><p>Can I use the xml regular expression module on HTML page?</p><p>In addition, I need some basic html function support in C++.Like those 2 PHP functions: rawurlencode &amp; urlencode.</p><p>I'm open to different libraries.</p><p>Thanks</p>","231246","","","","","2010-10-11 09:07:39","Needed C++ HTML parser + regular expression support","<c++><html><android><regex><html-parsing>","1","0","","",""
"3904416","1","3904513","","2010-10-11 07:52:58","1","7036","<p>is there any possibility to set background image dynamically?!</p><p>I try to explain what I mean.</p><pre><code>String picVariable = getPictureFromServer();ImageView image = (ImageView)v.findViewById(R.id.dynamic_image);// I know, that doesn't work, but that's the way I looking forimage.setBackgroundResource(picVariable); </code></pre><p>Thank you in advance,</p><p>Mur</p><p>Ps.I also read <a href=""http://stackoverflow.com/questions/3516530/set-source-of-imageview-dynamically-android"">this article</a>. It would suggested in one answer, to use java reflection to get a field of the R class by name. But I've never used reflextion before. An example would be very helpfull</p>","408780","","408780","","2010-10-11 09:08:40","2012-01-31 16:50:54","Set image / background source dynamically","<android>","2","2","2","",""
"3904418","1","3909224","","2010-10-11 07:53:21","1","5369","<p>Can we parse the iPhone/iPad based pList XML from Java on Android?Please tell me if any such library you have used or know about?</p>","395661","","422597","","2010-10-11 07:55:02","2013-05-08 01:48:58","Apple pList form of XML can I parse it through Android Java?","<java><iphone><android><xml><parsing>","6","0","6","",""
"3904467","1","3905534","","2010-10-11 08:00:24","22","27269","<p>How do I get the real device in http_user_agent?When I use a WebView, I can get the real value like this: </p><pre><code>[HTTP_USER_AGENT] =&gt; Mozilla/5.0(Linux; U; Android 2.2; en-gb; LG-P500 Build/FRF91) AppleWebKit/533.0 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1</code></pre><p>But when I use an Apache connection, the result is different: </p><pre><code>[HTTP_USER_AGENT] =&gt; Apache-HttpClient/UNAVAILABLE(java 1.4).</code></pre><p>What's the problem?</p>","430926","","425313","","2014-02-14 21:13:56","2014-02-14 21:13:56","Android HTTP User Agent","<android><http><connection>","3","0","13","",""
"3904488","1","3908092","","2010-10-11 08:07:04","0","4650","<p>I am trying to understand how to go about determining the frequency of various sounds captured on the phone via microphone. </p><p>I am attempting to display a graph plotting the frequency of the note.</p>","17404","","15416","","2010-10-11 09:48:53","2010-12-27 22:25:32","Determine the audio frequency of sound received via the microphone","<android><signal-processing>","2","1","1","",""
"3904531","1","3905405","","2010-10-11 08:14:45","7","19886","<p>I do have a lot of language specific resources. There's one point in my Android apps where I do get a resource value and need to translate this value into the matching id. The value is not necessarily in the language specific file for the current language (en/de/...). It's somewhere in there ... and it's unique.</p><p>After reading the docs and this thread ""<a href=""http://stackoverflow.com/questions/3476430/get-resource-id-by-passing-name-as-a-parameter-in-android"">How to get a resource id with a known ressource name?</a>"" I thought that <code>getIdentifier(String name, String defType, String defPackage)</code> is the correct way to go but I can't get it to work. The result is always ""0"".</p><p>This code is part of an activity and I'm on Android 2.2.</p><p>Is it possible that Android doesn't take all resource files into account and searches just in the current language specific one?</p><p>For an example (current language is ""de""):</p><pre><code>File: values-en/strings.xml&lt;resources&gt;   &lt;string name=""txt_afirsttext""&gt;A first text&lt;/string&gt;   &lt;string name=""txt_asecondtext""&gt;A second text&lt;/string&gt;&lt;/resources&gt;File: values-de/strings.xml&lt;resources&gt;   &lt;string name=""txt_afirsttext""&gt;Ein erster Text&lt;/string&gt;   &lt;string name=""txt_asecondtext""&gt;Ein zweiter Text&lt;/string&gt;&lt;/resources&gt;// Now I want to find the ID to this ""en"" text ...String testValue = ""A second text"";int i = this.getResources().getIdentifier(testValue, ""strings"", this.getPackageName());// ... and translate it to the actual ""de"" languageString translatedValue = this.getResources().getString(i);</code></pre><p>To make things clear. I don't want to miss-use string resources as a database. It's only one part that occurs on very rare situations.</p>","471681","","1267661","","2013-02-21 16:45:05","2013-08-29 06:13:45","Get resource ID from value","<android><resources>","2","0","3","",""
"3904586","1","3905455","","2010-10-11 08:23:43","2","5862","<p>I am creating a TextView dynamically from Activity. I created 2 Textviews and I want to maintain some gap between 2 TextViews. How can this be achieved through code rather than from XML. Normally in XML we use android:layout_marginLeft/Right tag to maintain gap between 2 TextViews. How can this be achieved through code? <br>Thanks in Advance,</p>","429501","","","","","2012-04-16 09:06:12","How to use android:Layout_marginLeft dynamically in Android for TextView","<android>","2","0","","",""
"3904608","1","3904629","","2010-10-11 08:27:53","0","480","<p>hi i am new to andriod.I am creating a table and inserting the values into table by  using sql lite.Now i need to change vales based on the id.how can i done this pls post some code.Thank u in advance.</p>","699226","","","","","2010-10-11 08:44:35","how to modify table values in database","<android>","2","0","","2012-11-14 03:14:24",""
"3904622","1","","","2010-10-11 08:30:29","1","576","<p>If the user taps the Home key, I can pause my application because the <code>onPause</code> event fires.</p><p>However, if the user long-presses Home, the recent app launcher pops up and my application carries on running behind it.</p><p>I want to pause my application in this situation. What can I do?</p><p>(NB. I don't want to prevent the long-press of Home or alter its behaviour in any way. My app just needs to know it's happened. It's a game, so I want to pause it.)</p>","15825","","","","","2011-01-15 10:20:06","How do I pause my app when the user long-presses Home?","<android>","3","0","","",""
"3904647","1","3904777","","2010-10-11 08:33:53","7","9498","<p>I am using a ListView in which only one item can be checked at a time. This is my custom list_row.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dip""    android:textColor=""#FFFFFF""    android:textStyle=""bold""    android:textSize=""20sp""    android:checkMark=""?android:attr/listChoiceIndicatorSingle""    /&gt;</code></pre><p>I populate the list in onCreate() using a normal array adapter:</p><pre><code>ArrayAdapter&lt;String&gt; myAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_row, strings);myList.setAdapter(myAdapter);</code></pre><p>When the list is displayed, I want to have, say, the 5th item in the list appear as Checked. How can I go about doing this? I know CheckedTextView has a function called setChecked(), but how can I get my 5th item from the list to apply this function on it?</p>","454660","","496830","","2011-03-30 06:23:08","2011-03-30 06:23:08","Android: How can I check a particular item in a Checked ListView?","<android><listview><checkbox><checkedtextview>","1","0","1","",""
"3904685","1","3932372","","2010-10-11 08:39:31","3","11702","<p>I am trying to run PhotoStream sample from following link </p><blockquote>  <p><a href=""http://android-developers.blogspot.com/2008/09/android-photostream.html"" rel=""nofollow"">http://android-developers.blogspot.com/2008/09/android-photostream.html</a></p></blockquote><p>But when i try to set the wallpaper of an image ( reference class ViewPhotoActivity.java) i am getting following error </p><blockquote><pre><code>android.content.ActivityNotFoundException:</code></pre>    <p>Unable to find explicit activity class  {com.android.camera/com.android.camera.CropImage};  have you declared this activity in  your AndroidManifest.xml?</p></blockquote><p>and i think the following code is causing the problem</p><pre><code>final Intent intent = new Intent(""com.android.camera.action.CROP"");intent.setClassName(""com.android.camera"", ""com.android.camera.CropImage"");intent.setData(Uri.fromFile(mFile));intent.putExtra(""outputX"", width);intent.putExtra(""outputY"", height);intent.putExtra(""aspectX"", width);intent.putExtra(""aspectY"", height);intent.putExtra(""scale"", true);intent.putExtra(""noFaceDetection"", true);intent.putExtra(""output"", Uri.parse(""file:/"" + mFile.getAbsolutePath()));startActivityForResult(intent, REQUEST_CROP_IMAGE);</code></pre><p>As i tried to find the solution  of this problem but didn't get any.</p>","405383","","","","","2013-03-20 15:17:58","unable to find com.android.camera.CropImage activity in android","<android>","4","2","8","",""
"3904730","1","3904742","","2010-10-11 08:47:00","4","732","<p>Is there any event triggered when the application is finished installed in the phone.I have seen some post but no luck ,there were similar question asked but no answer was found.Any help would be appreciated. Thanks in advance. </p>","95877","","","","","2012-03-04 08:34:40","Event when application gets installed (Android)","<java><android>","2","0","","",""
"3904773","1","","","2010-10-11 08:54:19","0","372","<p>I have done all the necessary settings of proxy in my emulator using comand line as well as Graphical from the emulator's mobile settings. By doing this internet browsing is running in my emulator, but when i run my project to import google maps in my application, Only grid shown having no maps on it. I think proxy server donn't let it to download maps from the site. Any kind of help will be appreciated....</p>","472102","","","","","2010-10-11 09:31:49","Proxy Server Donn't allow to import Google Maps","<android>","1","0","","",""
"3904852","1","4285121","","2010-10-11 09:09:08","19","14544","<p>I encountered this problem when updating my background to use a 9-patch image. The layout is fine on different screens using different sizes of the same image, but when I change the image to be a 9-patch it breaks the entire layout mysteriously.</p><p>The previous layout looks like this:</p><p><img src=""http://onik.org/android/layoutOk.png"" alt=""Original layout"">.</p><p>When changed to 9-patch:</p><p><img src=""http://onik.org/android/layoutError.png"" alt=""9-Patch image"">.</p><p>The XML file remained the same, just the PNG files were altered.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/bg""&gt;    &lt;TextView         android:text=""@string/title""        android:id=""@+id/login_title""        android:layout_width=""fill_parent""        android:layout_height=""40px""        android:textSize=""30px""&gt;    &lt;/TextView&gt;    &lt;View        android:id=""@+id/login_underline""        android:layout_width=""wrap_content""        android:layout_height=""2px""        android:background=""#aaaaaa""&gt;    &lt;/View&gt;    &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:stretchColumns=""1""        android:gravity=""center""        android:paddingLeft=""10px""        android:paddingRight=""10px""&gt;        &lt;TableRow&gt;            &lt;TextView                android:id=""@+id/login_usernameLabel""                android:text=""@string/login_usernameLabel""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:paddingRight=""5px""&gt;            &lt;/TextView&gt;            &lt;EditText                android:text=""""                android:id=""@+id/login_username""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:inputType=""textEmailAddress""                android:lines=""1""                android:nextFocusDown=""@+id/login_password""&gt;            &lt;/EditText&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;TextView                android:id=""@+id/login_passwordLabel""                android:text=""@string/login_passwordLabel""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;            &lt;/TextView&gt;            &lt;EditText                android:text=""""                android:id=""@+id/login_password""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:nextFocusDown=""@+id/login_login""                android:inputType=""textPassword""&gt;            &lt;/EditText&gt;        &lt;/TableRow&gt;        &lt;TableRow android:gravity=""right""&gt;            &lt;Button                android:text=""@string/login_login""                android:id=""@+id/login_login""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;            &lt;/Button&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;CheckBox                android:id=""@+id/login_remember""                android:text=""@string/login_remember""                android:layout_span=""2""&gt;            &lt;/CheckBox&gt;        &lt;/TableRow&gt; &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Any ideas? Or other solutions to get non-scaled, centered background?</p>","416022","","","","","2011-10-26 17:36:10","Android layout broken with 9-patch background","<android><android-layout>","2","2","7","",""
"3905072","1","","","2010-10-11 09:43:38","0","2244","<p>I m developing one application and in my class i have 4 tabs and inside each tab i have list view. i want to display data into the list view. i m providing the data in the array but the problem is when my app starts it display the data of 4 tabs under single tab. bt when i click one by one on tabs den it shows the data correctly. </p><p>Here is the source code..:</p><pre><code>public class test extends TabActivity  implements OnTabChangeListener {private static final String LIST_TAB_TAG = ""News"";private static final String LIST_TAB_TAG2 = ""List2"";private static final String LIST_TAB_TAG3 = ""List3"";private static final String LIST_TAB_TAG4 = ""List4"";private TabHost tabHost,tabHost1,tabHost2,tabHost3;private ListView listView,listview2,listview3,listview4;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.clistview);    tabHost = (TabHost) findViewById(android.R.id.tabhost);    // setup must be called if you are not inflating the tabhost from XML    tabHost.setup();    tabHost.setOnTabChangedListener(this);    listView = (ListView) findViewById(R.id.list);    listview2 = (ListView) findViewById(R.id.list2);    listview3 = (ListView) findViewById(R.id.list3);    listview4 = (ListView) findViewById(R.id.list4);    // create some dummy coordinates to add to the listList&lt;String&gt; list1Strings = new ArrayList&lt;String&gt;();        list1Strings.add("""");        list1Strings.add(""Item 2"");        list1Strings.add(""Item 3"");        list1Strings.add(""Item 4"");        listView.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, list1Strings));    List&lt;GeoPoint&gt; pointsList2 = new ArrayList&lt;GeoPoint&gt;();    pointsList2.add(new GeoPoint((int)(464464645), (int)(979646664)));    pointsList2.add(new GeoPoint((int)(7976566), (int)(987464313)));    listview2.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, pointsList2));    List&lt;GeoPoint&gt; pointsList3 = new ArrayList&lt;GeoPoint&gt;();    pointsList3.add(new GeoPoint((int)(32.864*1E6), (int)(-117.2353*1E6)));    pointsList3.add(new GeoPoint((int)(37.441*1E6), (int)(-122.1419*1E6)));    listview3.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1, pointsList3));    List&lt;GeoPoint&gt; pointsList4 = new ArrayList&lt;GeoPoint&gt;();    pointsList4.add(new GeoPoint((int)(464464645), (int)(979646664)));    pointsList4.add(new GeoPoint((int)(7976566), (int)(987464313)));    listview4.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, pointsList4));    tabHost.addTab(tabHost.newTabSpec(LIST_TAB_TAG).setIndicator(""News"", getResources().getDrawable(R.drawable.newsicon)).setContent(new TabContentFactory()     {        public View createTabContent(String arg0) {            return listView;        }    }));    tabHost.addTab(tabHost.newTabSpec(LIST_TAB_TAG2).setIndicator(""Opinion"", getResources().getDrawable(R.drawable.opinionicon)).setContent(new TabContentFactory() {        public View createTabContent(String arg0) {            return listview2;        }    }));    tabHost.addTab(tabHost.newTabSpec(LIST_TAB_TAG3).setIndicator(""Press"", getResources().getDrawable(R.drawable.pressicon)).setContent(new TabContentFactory() {        public View createTabContent(String arg0) {            return listview3;        }    }));    tabHost.addTab(tabHost.newTabSpec(LIST_TAB_TAG4).setIndicator(""My Stocks"", getResources().getDrawable(R.drawable.mystockicon)).setContent(new TabContentFactory() {        public View createTabContent(String arg0) {            return listview4;        }    }));    //HACK to get the list view to show up first,    //tabHost.setCurrentTab(1);    //tabHost.setCurrentTab(0);}@Override/*protected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}*/public void onTabChanged(String tabId) {    // TODO Auto-generated method stub    }}</code></pre>","383597","","2722799","","2013-10-09 09:57:48","2013-10-09 09:57:48","Android list view under tabs","<android>","1","3","","",""
"3905092","1","4499684","","2010-10-11 09:45:58","1","3654","<p>I need to implement the AutoCompeleteTextView like default Messaging application. I have already implemented it as given in first image. Now I want exactly as given in second image.</p><p><img src=""http://i.stack.imgur.com/3To1R.png"" alt=""alt text""></p><p>The Following code snippet I am using:</p><pre><code>Cursor cursor = this.getContentResolver().query(Phone.CONTENT_URI,            new String[] { Phone.DISPLAY_NAME, Phone.NUMBER }, null, null,            Phone.DISPLAY_NAME + "" ASC"");    startManagingCursor(cursor);    cursor.moveToFirst();    int i = 0;    do {        HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();        map.put(""No"", cursor.getString(cursor.getColumnIndex(Phone.NUMBER))                .replace(""-"", """"));        map.put(""Name"",                cursor.getString(cursor.getColumnIndex(Phone.DISPLAY_NAME)));        list.add(map);        i++;    } while (cursor.moveToNext());    SimpleAdapter adapter = new SimpleAdapter(this, list,            R.layout.autocomplete, new String[] { ""Name"", ""No"" },            new int[] { R.id.name, R.id.number });    txt_mobile_no.setAdapter(adapter);    txt_mobile_no            .setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());</code></pre><p>and the layout file is as below:<strong>autocomplete.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""40dip"" &gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/name""        android:textSize=""16dip""        android:layout_weight=""1""        android:textColor=""#000000""        android:paddingLeft=""6dip""        android:paddingTop=""10dip""/&gt;     &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/number""        android:textSize=""16dip""        android:layout_weight=""1""        android:textColor=""#000000"" android:paddingTop=""10dip""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Now please could anybody suggest me a better way to implement the feature.</p>","457982","","457982","","2011-01-22 06:30:54","2011-03-17 14:45:09","AutoCompeleteTextView like Android default Messaging Application","<android><autocompletetextview>","1","1","2","",""
"3905149","1","","","2010-10-11 09:57:06","0","35","<p>i have an android application which has an imageview object in main thread. i called a method fron another thread to set the bitmap of imageview. it shows an exception ""calledFromWrongthreadException"" anybody please help with some hints</p>","462695","","","","","2010-10-11 10:07:28","showing exception for imageview","<android>","1","0","","",""
"3905358","1","","","2010-10-11 10:30:26","10","30290","<p>I am developing a Ping application for Android 2.2.</p><p>I try my code and it works, but only in local IPs, that's my problem I want to do ping to external servers too.</p><p>Here is my code:</p><pre><code>  private OnClickListener milistener = new OnClickListener() {    public void onClick(View v) {        TextView info = (TextView) findViewById(R.id.info);        EditText edit = (EditText) findViewById(R.id.edit);        Editable host = edit.getText();        InetAddress in;        in = null;        // Definimos la ip de la cual haremos el ping        try {            in = InetAddress.getByName(host.toString());        } catch (UnknownHostException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        // Definimos un tiempo en el cual ha de responder        try {            if (in.isReachable(5000)) {                info.setText(""Responde OK"");            } else {                info.setText(""No responde: Time out"");            }        } catch (IOException e) {            // TODO Auto-generated catch block            info.setText(e.toString());        }    }};</code></pre><blockquote>  <p>Ping 127.0.0.1 -> OK <br>  Ping 8.8.8.8 (Google DNS) -> Time Out</p></blockquote><p>I put the following line at Manifest XML too:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;</code></pre><p>Can anyone suggest me where I'm doing wrong?</p>","472189","","1371853","","2012-07-10 18:21:44","2014-02-12 07:13:48","How to Ping External IP from Java Android","<java><android>","5","5","10","",""
"3905411","1","","","2010-10-11 10:37:48","0","467","<p>I've created a test runner extending android.test.InstrumentationTestRunner. I'm looking for a way to define the set of tests to get executed based on a set of configurations.</p><p>I thought I may be able to override the below methods to return my custom test suite, however, these are not getting called! Just wondering whats the use of these:</p><p>public TestSuite getAllTests ()public TestSuite getTestSuite ()</p><p>Any clues? Any other alternatives I can use to define a custom test suite at runtime?</p><p>Thanx</p>","471641","","","","","2011-03-22 11:03:15","getAllTests and getTestSuite in android.test.InstrumentationTestRunner","<android><testing><instrumentation>","1","0","","",""
"3905506","1","3914520","","2010-10-11 10:50:28","1","289","<p>Hi I have created a splash screen but I am not sure how to get it to start.  I have tried putting it in the top folder but I can't get it to start, I realise this is because it is the last item I created on my app.</p><p>How do I get it to the top of the build path.</p>","445174","","","","","2010-10-12 12:14:31","Splash screen problem?","<java><android><eclipse>","2","3","","",""
"3905545","1","","","2010-10-11 10:55:54","4","2773","<p>Dear all, i just code a snippet code to get date time string as below:</p><pre><code>public static String getCurrentDate(){    Locale.setDefault(Locale.US);    Date date = new Date();    String strDate = date.toString();    return strDate;}</code></pre><p>But problem is it take too long time (about 2 seconds) to convert from Date to string, Logs:</p><pre><code>10-11 17:52:51.733: INFO/Resources(6835): Loaded time zone names for en_US in 2107ms.</code></pre><p>Could you please give me a solution how to increase performance of this method</p><p>Update for solution:I just found an solution by tronman at topic:<a href=""http://stackoverflow.com/questions/454315/how-do-you-format-date-and-time-in-android"">http://stackoverflow.com/questions/454315/how-do-you-format-date-and-time-in-android</a>As below:</p><pre><code>Date date = new Date();java.text.DateFormat dateFormat =    android.text.format.DateFormat.getDateFormat(getApplicationContext());mTimeText.setText(""Time: "" + dateFormat.format(date));</code></pre>","289277","","289277","","2010-10-11 12:08:17","2013-04-10 05:38:30","Android load timezone too long: Loaded time zone names for en_US","<android><locale>","1","2","2","",""
"3905616","1","","","2010-10-11 11:06:24","0","1713","<p>I am having a TableLayout for which I added rows dynamically.In each of the row there are 2 elements of which one is TextView other is Button.When I click the button that is present in a row,that row should be deleted.How can this be done in Android ? How to find rowid and how to delete a row dynamically.can anyone help me in sorting out this issue.</p><p>Thanks in Advance,</p>","429501","","","","","2011-02-23 21:40:46","How to delete a row in TableLayout dynamically","<android>","1","2","","",""
"3905651","1","6555364","","2010-10-11 11:11:48","1","4157","<p>I'm trying to use the <code>playSoundEffect ()</code> method to play a sound effect when a button is clicked, but so far its' proved very difficult for some reason.</p><p>I have defined the following.</p><pre><code>&lt;ImageButton android:id=""@+id/Button_flip"" android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:text=""FLIP!""android:src=""@drawable/flip"" android:soundEffectsEnabled=""true""&gt;&lt;/ImageButton&gt;</code></pre><p>Then,</p><pre><code>button_flip.playSoundEffect(android.view.SoundEffectConstants.CLICK);</code></pre><p>is called in onCreate() method. But I cannot seem to get it to sound when I click the button. What am I missing here? The documentation has nothing much to go on.</p><p>Do I need to define/call in the onClick() method?</p><p>Any help is appreciated.</p><p>Thank you.</p>","455048","","","","","2011-07-02 05:56:20","Playing sound effect (CLICK/NAVIGATION_RIGHT) for button clicks - Android","<android><button><audio><effects>","1","0","2","",""
"3905662","1","3905739","","2010-10-11 11:12:56","0","82","<p>I am gonna develop project in android 2.0,for that i ll be using images etc..it may be deployed in any android devices.should i use different image size of same image for different devices..what is the procedure</p>","461972","","","","","2010-10-11 13:01:35","UI aspect on Android","<android>","2","1","1","",""
"3905809","1","","","2010-10-11 11:37:21","0","370","<p>hi i am working on facebook app and when i am posting my message which is perfectly post but but space between two word which gives '+' sign sign.eg::  Hello+Good+Morning.... so can any one tell me how to fix this please i am waiting.</p><pre><code>public void postMessage() throws UnsupportedEncodingException{     String posttext = """";       posttext = editText.getText().toString().trim();        AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(oauth);  Bundle params = new Bundle();       params.putString(""access_token"", access_token);  params.putString(""message"", URLEncoder.encode(posttext,""UTF-8""));       mAsyncRunner.request(""me/feed"", params, ""POST"", this);}</code></pre><hr>","343678","","6509","","2010-10-11 11:50:06","2012-03-24 21:59:07","URLEncoder.encode() have some problem with facebook in android","<java><android>","1","1","","",""
"3905872","1","","","2010-10-11 11:47:09","0","880","<p>On iPhone you have something like this:</p><pre><code>static NSString *Celldentifier = @""Section1_Cell""; UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier: CellIdentifier];</code></pre><p>where the CellIdentifier is used to dequeue cells of a specific 'type' of cells. So if you have more than one sections in a tableview and the cells of each section follow a different design, you can define what 'type' of cell to dequeue based on their CellIdentifier. This then avoids reusing the wrong kind of cell for a section that needs to draw a different cell.</p><p>I wonder how this can be done on Android. I know you can reuse rows by overriding your Adapter's getView(...) method as below</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent){ View row = convertView; CustomRowWrapper wrapper = null; if (row == null){           // inflate your row layout and create a new row object from it        }</code></pre><p>but this only works if all your cells are exactly the same. If you want to differentiate between row types this is not enough and you can see when scrolling through your list that the 'wrong' type of row is being reused in place of your different set of rows as there is nothing to tell the adapter what type of row to reuse.</p><p>Any suggestions then how this can be done on Android?</p>","200859","","","","","2010-10-11 12:04:20","Reusing Android rows with iPhone-like CellIdentifiers?","<iphone><android><listview><reusability>","2","0","","",""
"3905915","1","","","2010-10-11 11:53:30","-3","122","<p>I want to one Simple UI Design in Andriod Emulator.</p><p>Whats Needed:</p><p>Java Eclipse,then any SDK Pls Suggest</p>","470041","","127880","","2011-07-15 04:08:52","2011-07-15 04:08:52","Java Android Application","<android>","1","0","","",""
"3906150","1","3906221","","2010-10-11 12:28:01","0","1135","<p>I am trying to query a string (TEXT field in the database) and want to fetch records based on that query. I was following a tutorial which works fine if I query an Integer (the _ID field). What will I need to change in the code below to let it search for the string (the TEXT field) instead of the _ID field?</p><p>The activity code:</p><pre><code>protected void getDetails() {    try    {        // The ArrayList that holds the row data        ArrayList&lt;Object&gt; row;        // ask the database manager to retrieve the row with the given rowID        row = db.getRowAsArray(Long.parseLong(txtProjContacts.getText().toString()));        // update the form fields to hold the retrieved data        txtName.setText((String)row.get(1));        txtEmail.setText((String)row.get(2));        txtExpertise.setText((String)row.get(3));        txtCharges.setText((String)row.get(4));    }    catch (Exception e)    {        Log.e(""Retrieve Error"", e.toString());        e.printStackTrace();    }}</code></pre><p>The DB Adapter code:</p><pre><code>public ArrayList&lt;Object&gt; getRowAsArray(Long rowID){    // create an array list to store data from the database row.    // I would recommend creating a JavaBean compliant object     // to store this data instead.  That way you can ensure    // data types are correct.    ArrayList&lt;Object&gt; rowArray = new ArrayList&lt;Object&gt;();    Cursor cursor;    try    {        // this is a database call that creates a ""cursor"" object.        // the cursor object store the information collected from the        // database and is used to iterate through the data.        cursor = db.query        (                TABLE_CONTACTS,                new String[] {     TABLE_CON_ID,                                TABLE_CON_NAME,                                TABLE_CON_EMAIL,                                TABLE_CON_EXPERTISE,                                TABLE_CON_CHARGES},                TABLE_CON_ID + ""="" + rowID,                null, null, null, null, null        );        // move the pointer to position zero in the cursor.        cursor.moveToFirst();        // if there is data available after the cursor's pointer, add        // it to the ArrayList that will be returned by the method.        if (!cursor.isAfterLast())        {            do            {                rowArray.add(cursor.getLong(0));                rowArray.add(cursor.getString(1));                rowArray.add(cursor.getString(2));                rowArray.add(cursor.getString(3));                rowArray.add(cursor.getString(4));            }            while (cursor.moveToNext());        }        // let java know that you are through with the cursor.        cursor.close();    }    catch (SQLException e)     {        Log.e(""DB ERROR"", e.toString());        e.printStackTrace();    }    // return the ArrayList containing the given row from the database.    return rowArray;}</code></pre><p>Thanks in advance.</p>","450534","","","","","2010-10-11 12:36:24","Android - Query String instead of integer","<android><sqlite>","1","0","1","",""
"3906241","1","3906289","","2010-10-11 12:39:25","0","2463","<p>I want to connect to a MySql DB but i don't find the code.Can anyone help me?</p>","469511","","14302","","2010-10-11 12:52:20","2010-10-11 12:52:20","Connect to MySql Database (Android)","<android>","2","0","1","",""
"3906280","1","","","2010-10-11 12:44:19","1","2028","<p>Im doing app in which, uses sqlite db file to get data. table in db having shop name, address,city, latitude, longitude etc columns.</p><p>Im able to get cureent location latitude and longitude and also able to calculate the distance between current location and the location of a shop(in db) using longitude and latitude values.</p><p>Here my issue is I need to get/display 10 shopnames(from db) which are nearest(distance) to the current location.</p><p>Please suggest me or give a reference link to solve this issue</p><p>Thank you</p>","341443","","","","","2014-03-03 19:28:05","How to get 10 nearest locations from the current location","<android>","4","0","2","",""
"3906393","1","","","2010-10-11 12:58:37","3","542","<p>I have met an i18n problem in my application. When I change the phone language, some of the strings used by the application is changed, but some not. </p><p>Following is what I did:</p><ol><li>Set the language to Chinese.</li><li>Launch the application. Current Activity uses Chinese strings.</li><li>Press HOME key, change the phone language to English.</li><li>Resume application from history(long press HOME key).</li></ol><p>Result: Most strings used by fore Activity are changed to English strings, but there is one string which is the text of a <code>CheckBox</code> is still Chinese.</p><p>In another Acitivty which also contains an CheckBox, the text of CheckBox also will not be changed after change the phone language.</p><p>I have tried many times, just the <code>CheckBox</code> text will not be changed. What I can be sure are I do use <code>&lt;CheckBox android:text=""@string/checkbox_text .../&gt;""</code> in layout xml and the <code>checkbox_text</code> string has Chinese version and English version.</p><p>Can somebody please help me? Thanks in advance!</p>","365030","","","","","2012-04-17 01:46:27","Android i18n Problem","<android><internationalization>","2","1","","",""
"3906530","1","","","2010-10-11 13:16:07","-1","495","<p>I have some problem with ""how android manage its activity called from another activity""</p><p>I'm using the following code... whenever I execute the program on the device... it execute the ""second ""activity first before executing the ""first"" activity. </p><p>program display the ""second"" acitivy first. after pressing back button it display the ""first"" activity.</p><p>But I need to execute them in calling sequence as we call methods in java.</p><p>plz help me if anybody know it....... thanx in advance.</p><pre><code>package com.example.ggandroid;import android.content.Intent;import android.app.Activity;import android.os.Bundle;public class RelLayoutdemo extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);      //  setContentView(R.layout.main); Intent first = new Intent(this, VideoViewDemo.class);//first.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK);          this.startActivity(first);       Intent second = new Intent(this, tableview.class);      this.startActivity(second);}}</code></pre>","472320","","1022826","","2011-12-12 09:29:59","2011-12-12 09:29:59","android activity sequence management issue","<android>","1","0","","",""
"3906532","1","3907060","","2010-10-11 13:16:30","17","2348","<p>I was thinking of building an app on android with Scala instead of the regular Java (or the equivalent I guess). Is it worth it? Any problems and unnecessary headaches?</p>","331439","","","","","2013-06-26 12:50:19","Is using scala on android worth it? Is there a lot of overhead? Problems?","<android><scala>","5","1","13","",""
"3906635","1","","","2010-10-11 13:27:43","0","409","<p>I'm working with a CheckBox that needs to hace some links appearing as text, not urls. I'm using something like this:</p><pre><code>        TransformFilter transformer = new TransformFilter() {        @Override        public String transformUrl(Matcher match, String url) {            Log.d(""                "", match.toString() + "" ||||| "" + url);            return url.substring(1, url.length() - 1);        }    };    Linkify.addLinks(acceptCheckbox, Pattern.compile(""\\(.*?\\)""), null, null, transformer);</code></pre><p>If I understand well, if the text in the checkbox contains ""(something here)"" it should output ""something here"" without parentheses.</p><p>This is just a test before adding the link ie. (go to google-http://www.google.com)</p><p>The thing is the links look like links but they are not modified (still with parentheses). Even if I put a schema or I hardcode the String in transformUrl method nothing happens.</p><p>I tried with setting autoLink to none, setAutoLinkMask(0), and maybe some more but still stuck. Any idea?</p><p>Thanks</p>","417131","","","","","2010-10-19 09:56:32","Android Linkify TransformFilter is not transforming","<android><transform><links><linkify>","1","1","","",""
"3906738","1","3907350","","2010-10-11 13:37:48","17","19372","<p>I've been struggling for a few days on this, finally just decided to ask. It's so simple I've got to be missing something very basic. </p><p>I have an XML layout page with an image defined.  I have two anim XML pages, one to change alpha from 0 to 1, and the other from 1 to 0 in order to create a ""blinking"" effect. So the alphaAnimation is defined in XML, I just need to call it. </p><p>The image pops up, but there's no looping blinking effect. </p><pre><code>public class blinker extends Activity {   //create name of animationAnimation myFadeInAnimation;Animation myFadeOutAnimation;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.scanning_view); //grab the imageview and load the animations    ImageView myImageView = (ImageView) findViewById(R.id.blinkingView01);     Animation myFadeInAnimation = AnimationUtils.loadAnimation(null, R.anim.fade_in);    Animation myFadeOutAnimation = AnimationUtils.loadAnimation(null, R.anim.fade_out);//fade it in, and fade it out.     myImageView.startAnimation(myFadeInAnimation);    myImageView.startAnimation(myFadeOutAnimation);     }}   </code></pre><p>Two XML Animation layouts in Anim resource:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;set xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;alpha android:fromAlpha=""0.0""     android:toAlpha=""1.0""     android:interpolator=""@android:anim/accelerate_interpolator""      android:duration=""50"" android:repeatCount=""infinite""/&gt;  &lt;/set&gt; </code></pre><p>And the other:</p><pre><code> &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;set xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;alpha android:fromAlpha=""1.0"" android:toAlpha=""0.0""     android:interpolator=""@android:anim/accelerate_interpolator""      android:duration=""1000"" android:repeatCount=""infinite""/&gt; &lt;/set&gt;</code></pre>","472323","","472323","","2010-10-11 14:43:45","2013-07-25 13:29:57","Android - Blinking image using the Alpha fade animation","<android><fadein>","2","2","8","",""
"3906740","1","3907324","","2010-10-11 13:38:20","1","1583","<p>Can anybody tell me how to convert a string to an xml file in android?</p><p>Thanks</p>","426344","","113141","","2010-10-11 13:59:43","2013-06-12 19:11:24","Convert a string to an xml file in android","<android><xml><string>","3","2","","",""
"3906742","1","3907339","","2010-10-11 13:38:24","0","2486","<p>I am new to Android and I'm after some help.</p><p>Here is my Maingamepannel class which is extending from surfaceview.  I want to add a Progressbar which can show progress on two custom buttons on click.</p><p>Here I have allready added three images nnow i want to add a Progressbar.</p><pre><code>package net.obviam.walking;import net.obviam.walking.model.CowAnimated;import net.obviam.walking.model.ElaineAnimated;import net.obviam.walking.model.FallAnimated;import net.obviam.walking.model.SliderFrameLayout;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.util.Log;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.widget.ProgressBar;/** * @author impaler * This is the main surface that handles the ontouch events and draws * the image to the screen. */public class MainGamePanel extends SurfaceView implements        SurfaceHolder.Callback {    private static final String TAG = MainGamePanel.class.getSimpleName();    //public ProgressBar mImageProgressbar;//  public MyProgressBar pgbar=new MyProgressBar(getContext());    private SliderFrameLayout progressbar;    private MainThread thread;    private ElaineAnimated elaine;    private CowAnimated cowobj;    private FallAnimated fallingobj;    public Bitmap cow=BitmapFactory.decodeResource(getResources(), R.drawable.cow);    public Bitmap falling=BitmapFactory.decodeResource(getResources(), R.drawable.falling);    // the fps to be displayed    //private String avgFps;    //public void setAvgFps(String avgFps) {//      this.avgFps = avgFps;//  }    public MainGamePanel(Context context) {        super(context);        // adding the callback (this) to the surface holder to intercept events        getHolder().addCallback(this);                  //pgbar = new MyProgressBar(getContext());//      pgbar.setIndeterminate(true);//      int pad = 50;//      pgbar.setPadding(pad, pad, pad, pad);//      pgbar.layout(0, 0, 200, 200);//      pgbar.setEnabled(true);//      pgbar.bringToFront();//      pgbar.setVisibility(VISIBLE);        this.progressbar=new SliderFrameLayout(getContext(), null);        // create Elaine and load bitmap        elaine = new ElaineAnimated(                    //BitmapFactory.decodeResource(getResources(), R.drawable.jump)                  BitmapFactory.decodeResource(getResources(), R.drawable.walk)                 , BitmapFactory.decodeResource(getResources(), R.drawable.jump)                 , BitmapFactory.decodeResource(getResources(), R.drawable.falling)                 , 10, 200   // initial position                , 20, 47    // width and height of sprite                //,28,45                //,35,60                //,this.elaine.getSpriteWidth(),this.elaine.getSpriteHeight()                //,elaine.getSpriteWidth(),elaine.getSpriteHeight()                , 10, 6);   // FPS and number of frames in the animation        cowobj = new CowAnimated(              BitmapFactory.decodeResource(getResources(), R.drawable.cow)            , 350, 150  // initial position            , cow.getWidth(), cow.getHeight()   // width and height of sprite            , 1, 1);    // FPS and number of frames in the animation        fallingobj = new FallAnimated(                  BitmapFactory.decodeResource(getResources(), R.drawable.falling)                , 340, 160  // initial position                , falling.getWidth(), falling.getHeight()   // width and height of sprite                , 1, 1);    // FPS and number of frames in the animation        // create the game loop thread        thread = new MainThread(getHolder(), this);        // make the GamePanel focusable so it can handle events        setFocusable(true);    }     //MainGamePanel mnp=new MainGamePanel(getContext());     protected  void onDraw(Canvas canvas)//     {         progressbar.draw(canvas);        //mImageProgressbar.draw(canvas);        // elaine.draw(canvas);         //cowobj.draw(canvas);//         elaine.update(System.currentTimeMillis());//          if(elaine.x&gt;=350)//          cowobj.update(System.currentTimeMillis());//              //  this.update();     }//    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {    }    @Override    public void surfaceCreated(SurfaceHolder holder) {        // at this point the surface is created and        // we can safely start the game loop        thread.setRunning(true);        thread.start();    }    @Override    public void surfaceDestroyed(SurfaceHolder holder)     {        Log.d(TAG, ""Surface is being destroyed"");        // tell the thread to shut down and wait for it to finish        // this is a clean shutdown        boolean retry = true;        while (retry)         {            try             {                thread.join();                retry = false;            } catch (InterruptedException e) {                // try again shutting down the thread            }        }        Log.d(TAG, ""Thread was shut down cleanly"");    }//  public boolean onTouchEvent(MotionEvent event) //  {//      if (event.getAction() == MotionEvent.ACTION_DOWN)//      {//          // handle touch//      }//      return true;//  }    public void render(Canvas canvas)    {        Bitmap log=BitmapFactory.decodeResource(getResources(), R.drawable.log);        Bitmap bkg=BitmapFactory.decodeResource(getResources(), R.drawable.bg);        Paint paint=new Paint();        canvas.drawColor(Color.BLACK);        canvas.drawBitmap(bkg,0,0,paint);        canvas.drawBitmap(log,300,240,paint);        //pgbar.draw(canvas);        //pgbar.setProgress( (int)(System.currentTimeMillis()%1000) );        progressbar.draw(canvas);        elaine.draw(canvas);        cowobj.draw(canvas);        if(elaine.getX()&gt;333)        fallingobj.draw(canvas);        //this.onDraw(canvas);        // display fps        //displayFps(canvas, avgFps);    }    /**     * This is the game update method. It iterates through all the objects     * and calls their update method if they have one or calls specific     * engine's update method.     */    int cowMoveCount=0;    public void update()    {        elaine.update(System.currentTimeMillis());        if(elaine.x&gt;=333)        {              cowMoveCount++;            if(cowobj.getX()&lt;=370)            {                  cowobj.setX(cowobj.getX()+1);                cowMoveCount=0;            }            cowobj.update(System.currentTimeMillis());            fallingobj.update(System.currentTimeMillis());        }    }    private void displayFps(Canvas canvas, String fps)    {        if (canvas != null &amp;&amp; fps != null)        {            Paint paint = new Paint();            paint.setARGB(255, 255, 255, 255);            canvas.drawText(fps, this.getWidth() - 50, 20, paint);        }    }   }</code></pre>","472336","","113141","","2010-10-11 14:01:50","2010-10-11 14:53:21","Adding progressbar on surfaceview","<android>","1","1","","",""
"3906748","1","","","2010-10-11 13:39:23","0","911","<p>I have parsed xml data but I don't know how to insert it into a SQL Lite database and I don't know where I have to place the xml database file in Eclipse IDE folders.</p><p>Kindly provide some example program with deployment descriptor. </p><p>Thanks in advance</p>","470223","","113141","","2010-10-11 13:48:15","2010-10-11 15:46:25","how to insert parsed xml data in to sql lite database in android","<android><xml><sqlite>","1","0","2","",""
"3906919","1","","","2010-10-11 14:02:08","1","626","<p>I have a layout in which I resize an image by doing a transformation with prescale. After the scale the image has the right size, but the layout container around it cuts its size of. I want the layout container arround it to show to complete image.</p><p>I just tried invalidate on the image, the container as well as requestLayout(). Any ideas?</p><p>Thanks</p>","472355","","","","","2010-10-11 17:10:15","Resize layout after an image transformation android","<android>","1","0","","",""
"3906921","1","3907277","","2010-10-11 14:02:15","0","2110","<p>how do i efficiently copy a row data from one table to another table, where both of them are the same structure. i could go the much harder way of retrieving initial values from the row in the first table and then inserting to the second table. But i feel there is a more efficient way this can be done. Thank you</p>","447570","","","","","2013-02-07 13:00:22","How to efficiently copy row data from one Table to another in SQLite android","<android>","2","0","1","",""
"3907062","1","","","2010-10-11 14:22:39","1","1910","<p>I'm writing an Android app to auto-answer incoming calls.I am using a receiver, and trying to send ACTION_MEDIA_BUTTON event when the phone rings.</p><p>It all works great on the emulator -When the phone rings it actually answers the call automatically.</p><p>But when I'm trying it on the device it-self it just does not work (HTC Legend).</p><p>This is the code:</p><pre><code>            // trigger on buttonUp instead of buttonDown            Intent buttonDown = new Intent(Intent.ACTION_MEDIA_BUTTON);                           buttonDown .putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HEADSETHOOK));            context.sendOrderedBroadcast(buttonDown , ""android.permission.CALL_PRIVILEGED"");            // trigger on buttonUp instead of buttonDown            Intent buttonUp = new Intent(Intent.ACTION_MEDIA_BUTTON);                           buttonUp.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_HEADSETHOOK));            context.sendOrderedBroadcast(buttonUp, ""android.permission.CALL_PRIVILEGED"");</code></pre><p>And this is the receiver code in the XML file:</p><p><code>&lt;receiver android:name="".PhoneOutgoingCallReceiver"" android:enabled=""true""&gt; &lt;intent-filter android:priority=""0""&gt;  &lt;action android:name=""android.intent.action.NEW_OUTGOING_CALL"" /&gt;   &lt;/intent-filter&gt;  &lt;/receiver&gt; &lt;receiver android:name="".PhoneIncomingCallReceiver"" android:enabled=""true""&gt; &lt;intent-filter android:priority=""0""&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;  &lt;action android:name=""android.intent.action.PHONE_STATE"" /&gt;   &lt;action android:name=""android.intent.action.MEDIA_BUTTON"" /&gt;  &lt;/intent-filter&gt;  &lt;/receiver&gt;</code></p><p>Anyone knows why it does not work on the real device? what are the different?</p><p>Thanks!</p>","257764","","","","","2012-09-22 05:58:18","ACTION_MEDIA_BUTTON does not work on real device","<android>","1","0","","",""
"3907128","1","3907243","","2010-10-11 14:30:12","2","4367","<p>I have created a custom class for my Android project called ""Sounds"" I want to be able to call it from my activity. The contents of my class are as follows:</p><pre><code>package com.mypackage;import java.util.HashMap;import android.content.Context;import android.media.SoundPool;public class Sounds {private static boolean sound = true;private static final int FLIP_SOUND = 1;private static Context context;private static SoundPool soundPool;private static HashMap&lt;Integer, Integer&gt; soundPoolMap;public static void initSounds() {    soundPoolMap.put(FLIP_SOUND, soundPool.load(context, R.raw.flip, 1));}public static void playFlip() {        soundPool.play(soundPoolMap.get(FLIP_SOUND), 1, 1, 1, 0, 1);}public static void setSound(Boolean onOff) {    sound = onOff;}}</code></pre><p>In my main Activity class I have tried importing the class, creating an instance of it but I guess I'm just not understanding how it's done. Can anybody point me in the right direction please?</p>","353674","","","","","2012-04-03 10:50:52","Importing my custom class and calling it's method?","<android><class><import>","4","1","1","",""
"3907253","1","3907562","","2010-10-11 14:43:54","0","10573","<p>I'm trying to run this piece of code inside my onCreate method as an initial test into writing private data for my app to use. This code is straight out of the Android SDK development guide located here (http://developer.android.com/guide/topics/data/data-storage.html#filesInternal)</p><pre><code>String FILENAME = ""hello_file"";String string = ""hello world!"";FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);fos.write(string.getBytes());fos.close();</code></pre><p>However, this code give me errors for the 3 lines of code at the bottom. The error is an unhanded exception. The suggested quick fix is do to the following:</p><pre><code>    String FILENAME = ""hello_file"";    String string = ""hello world!"";    FileOutputStream fos;    try {        fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);    } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    try {        fos.write(string.getBytes());    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    try {        fos.close();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }</code></pre><p>But after doing that I get an error for the bottom two lines which states that fos may not be uninitialized. How can I fix this code? It's kind of annoying that the Android SDK gives you an example that doesn't even work.</p><p>I can't say I'm an expert at exception handling either.</p>","425962","","","","","2010-10-11 15:24:19","FileOutputStream and exception handling","<android><exception-handling><fileoutputstream>","2","0","","",""
"3907374","1","","","2010-10-11 14:59:00","0","1156","<p>I create a TabHost1 with 3 tabs: tab1, tab2, tab3. When choose tab2, I want the TabHost2 change into another sub TabHost with 2 tabs: tab4, tab5.</p><p>TabHost1.java:</p><pre><code>    Resources res = getResources();    TabHost tabHost1 = getTabHost();    TabHost.TabSpec spec;    Intent intent;    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, Tab1.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost1.newTabSpec(""Tab1"").setIndicator(""Tab1"",                      res.getDrawable(R.drawable.home))                  .setContent(intent);    tabHost1.addTab(spec);    intent = new Intent().setClass(this, Tab2.class);    spec = tabHost1.newTabSpec(""Tab2"").setIndicator(""Tab2"",            res.getDrawable(R.drawable.music))        .setContent(intent);    tabHost1.addTab(spec);    intent = new Intent().setClass(this, Tab3.class);    spec = tabHost1.newTabSpec(""Tab3"").setIndicator(""Tab3"",            res.getDrawable(R.drawable.album))        .setContent(intent);    tabHost1.addTab(spec);    tabHost1.setCurrentTab(0);</code></pre><p>TabHost1.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""        android:padding=""5dp""&gt;           &lt;RelativeLayout            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""               android:layout_alignParentBottom=""true""/&gt;           &lt;FrameLayout              android:id=""@android:id/tabcontent""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:padding=""5dp"" /&gt;           &lt;/RelativeLayout&gt;      &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Activity Tab2.java:</p><pre><code>    Resources res = getResources();    TabHost tabHost2 = getTabHost();    TabHost.TabSpec spec;    Intent intent;    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, tab4.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost2.newTabSpec(""tab4"").setIndicator(""tab4"",                      res.getDrawable(R.drawable.tab4))                  .setContent(intent);    tabHost2.addTab(spec);    intent = new Intent().setClass(this, tab5.class);    spec = tabHost2.newTabSpec(""tab5"").setIndicator(""tab5"",            res.getDrawable(R.drawable.tab5))        .setContent(intent);    tabHost2.addTab(spec);    tabHost2.setCurrentTab(0);</code></pre><p>TabHost2.xml is the same TabHost1.xml</p><p>When I choose tab2 the result like TabHost2 cascaded TabHost1</p><p>Actually I want the TabHost2 overwrite (replace) TabHost1.How can we do it ?</p>","472394","","472394","","2010-10-12 02:41:55","2010-10-12 02:41:55","How to create a sub tabs in android?","<android>","1","0","1","",""
"3907713","1","5539218","","2010-10-11 15:39:17","19","31757","<p>I am trying to pass data between two activities that are inside of tabs.  I am trying to use the sendBroadcast.  With breakpoints set I never reach the OnReceive.</p><p>manifest : </p><pre><code> &lt;activity android:name="".WebResults""              android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;    &lt;action android:name=""com.toxy.LOAD_URL"" /&gt;   &lt;/intent-filter&gt;           &lt;/activity&gt;</code></pre><p>Activity Sender: </p><pre><code>Intent intent=new Intent(getApplicationContext(),WebResults.class);intent.setAction(""com.toxy.LOAD_URL"");intent.putExtra(""url"",uri.toString());sendBroadcast(intent);</code></pre><p>Activity Reciever :</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);        IntentFilter filter = new IntentFilter(""com.toxy.LOAD_URL"");    this.registerReceiver(new Receiver(), filter);} private class Receiver extends BroadcastReceiver { @Override public void onReceive(Context arg0, Intent arg1) {    String url = arg1.getExtras().getString(""url"");    WebView webview =(WebView)findViewById(R.id.webView);    webview.loadUrl(url); }}</code></pre>","118272","","118272","","2010-10-11 15:58:05","2012-01-03 22:56:09","How to send and receive broadcast message","<android><broadcast><message-passing>","2","2","3","",""
"3907830","1","3911077","","2010-10-11 15:55:02","13","15876","<p>I have the following XML code for my <code>CheckBoxPreference</code>:</p><pre><code>&lt;CheckBoxPreference    android:key=""pref_boot_startup""    android:title=""Auto start""    android:defaultValue=""true"" /&gt;</code></pre><p>But when I retrieve the preference in code the value is <code>false</code>.</p><pre><code>sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);boolean autoStart = sharedPreferences.getBoolean(""pref_boot_startup"", true);</code></pre><p>My <code>autoStart</code> variable returns <code>false</code>.</p><p>Is there a specific reason for this? Am I missing a step to set the default value to <code>true</code>?</p>","243999","","","user1521536","2013-02-17 01:24:32","2013-03-08 15:39:00","Android CheckBoxPreference Default Value","<android><default-value><checkboxpreference>","3","0","6","",""
"3907844","1","3908367","","2010-10-11 15:56:48","2","1449","<p>There is no problem with portrait mode but when i try my app on landscape mode it doesn't look how it should.What is general aproach to solve this problem.My first idea is replacing X and Y places.If i am on the right track how should i do this ? Should i use an if statement at the beginning of the onDraw() function and write entire same code twice (one for x,y and other is for y,x) ?</p>","426815","","","","","2010-10-12 15:37:06","How to draw canvas in respect of phone orientation (landscape , portrait)?","<android><canvas><orientation><landscape><portrait>","2","2","","",""
"3907894","1","3909405","","2010-10-11 16:03:40","2","743","<p>I want to vibrate the phone in the same way as the incoming call in sync with the ringtone. How do I achieve it?</p>","421372","","","","","2010-10-12 06:24:16","How to vibrate the phone in sync with the ringtone?","<android><ringtone><vibrate>","1","0","1","",""
"3907986","1","3908471","","2010-10-11 16:14:44","0","637","<p>I'm extremely new to Android and just trying to get my head around these layouts.</p><p>I've got several tabs which contain a LinearLayout with a TabWidget and FrameLayout as children. In the FrameLayout I'd like a certain percentage at the bottom of the screen to be reserved for a table, the rest above to be filled with an image.</p><p>How can I replicate this in the Android XML?</p><p>Any ideas much appreciated.</p>","472428","","","","","2010-10-11 17:19:20","Layout within TabHost and TabWidget","<android>","1","0","","",""
"3908011","1","","","2010-10-11 16:17:14","0","344","<p>I add a listview via Java into @+id/View01.For some reason the items in the listview don't accept clicks.Does anybody have ideas about possible causes?</p><pre><code>&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:orientation=""vertical""  android:layout_height=""fill_parent""  android:background=""@color/light_blue""  &gt;    &lt;Button android:text=""@+id/Button01""         android:id=""@+id/Button01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:textAppearance=""?android:attr/textAppearanceLarge""/&gt;    &lt;AbsoluteLayout     android:id=""@+id/Layout01""     android:layout_width=""fill_parent""    android:orientation=""vertical""    android:layout_below=""@+id/Button01""            android:layout_above=""@+id/Button02""    android:layout_height=""fill_parent""&gt;        &lt;View android:id=""@+id/View01""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:gravity=""center_horizontal""        /&gt;        &lt;ListView android:id=""@+id/ListView02""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""            android:gravity=""center_horizontal""/&gt;    &lt;/AbsoluteLayout&gt;    &lt;Button android:text=""@+id/Button02""         android:id=""@+id/Button02""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:textAppearance=""?android:attr/textAppearanceLarge""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>If I change my code to the following the clicks work but the layout doesn't look the way I want.:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:orientation=""vertical""  android:layout_height=""fill_parent""  android:background=""@color/light_blue""  &gt;    &lt;Button android:text=""@+id/Button01""         android:id=""@+id/Button01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:textAppearance=""?android:attr/textAppearanceLarge""/&gt;    &lt;View android:id=""@+id/View01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_below=""@+id/Button01""        android:gravity=""center_horizontal""        /&gt;    &lt;ListView android:id=""@+id/ListView02""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_below=""@+id/View01""        android:gravity=""center_horizontal""        android:layout_above=""@+id/Button02""/&gt;    &lt;Button android:text=""@+id/Button02""         android:id=""@+id/Button02""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:textAppearance=""?android:attr/textAppearanceLarge""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>One of the functions involved:</p><pre><code>protected void initiateExtraView(FillInput fillInput){    View extraView = fillInput.getExtraView();    ViewGroup parent = (ViewGroup) extraView.getParent();    int index = parent.indexOfChild(extraView);    parent.removeView(extraView);    extraView = fillInput.getLayoutInflater().inflate(             R.layout.extrabuttonlistview,              parent,              false);    parent.addView(extraView, index);    fillInput.setExtraView(extraView);    ListView extraButtonView = (ListView) extraView;    fillInput.setExtraButtonListView(extraButtonView);    ListAdapter adapter = new ExtraButtonAdapter(fillInput, this);    fillInput.getExtraButtonListView().setAdapter(adapter);     }</code></pre><p>The function in the ExtraButtonAdapter that create the particular view that doesn't accept clicks:</p><pre><code>private View getNewForm(int position, View convertView,        ViewGroup parent) {    View view = mInflater.inflate(            R.layout.new_form_button,             parent,             false);    View.OnClickListener listener = new View.OnClickListener() {        public void onClick(View v) {            Log.i(TAG, ""Click on NewForm"");        }    };    view.setOnClickListener(listener);    setNewFormView(view);    return view;}</code></pre><p>R.layout.extrabuttonlistview:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;    &lt;ListView android:id=""@+id/ListView01""     xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:clickable=""true""        android:gravity=""center_horizontal""        android:layout_above=""@+id/Button02""/&gt;</code></pre>","25282","","25282","","2010-10-11 20:37:05","2010-12-12 09:34:43","Android view doesn't accept clicks","<android><android-ui>","2","5","","",""
"3908029","1","","","2010-10-11 16:18:35","0","2052","<p>I've got a list of running processes from ActivityManager.RunningAppProcessInfo, like this:</p><pre><code>ActivityManager am = (ActivityManager) getSystemService(Service.ACTIVITY_SERVICE);List&lt;ActivityManager.RunningAppProcessInfo&gt; processes;            processes = am.getRunningAppProcesses();for(ActivityManager.RunningAppProcessInfo info: processes) {    Log.i(""Process:"", info.processName);}</code></pre><p>Is there any way to retrieve the icons that match the activities for these processes?</p>","62709","","","","","2010-10-11 16:34:55","Android, get icons of running activities?","<android><icons><activity><tasklist>","1","0","0","",""
"3908182","1","","","2010-10-11 16:39:45","0","501","<p>hey iam going to do some applications on mobile </p><p>using image processing applications </p><p>i was asking which will be suitable for me </p><p>as i will need a programming language that supports phonve devices with high </p><p>memory , what is the maxiumm number of ram size that has been released to work on phone </p><p>is there any name about the phone that support high memory so i can buy it to help me in my work </p>","462715","","","","","2011-03-18 14:53:07","which is better android or j2me for image processing on phone","<android><java-me><mobile-application>","1","1","","",""
"3908233","1","3908285","","2010-10-11 16:48:21","0","362","<p>I'm developing a simple app for Android-2.2. What are some key features that can make the app not work for 1.6?</p>","191198","","","","","2010-10-11 16:53:49","Android 1.6 to 2.2","<android>","1","0","","",""
"3908264","1","3911228","","2010-10-11 16:52:57","0","678","<p>i am trying to query my database so that it returns only rows with a specific value in a certain column.but when i run it, it still returns all the rows. please take a look at the code and see if i have done it incorrectly. I am trying to query for the string in the PRIORITY column. i want to display those specific rows in a listview.  Thank you.</p><pre><code>   private static final String DATABASE_NAME = ""MemoData.db"";    private static final int DATABASE_VERSION = 1;    public static final String DATABASE_TABLE = ""Places"";    public static final String KEY_ID = ""_id"";    public static final String NAME = ""Title"";    public static final String CATEGORY = ""category"";    public static final String PRIORITY = ""priority"";        private static final String TAG = ""DBAdapter"";        private static final String DATABASE_CREATE = ""create table Places (_id integer primary key autoincrement, Title text, category text, priority text);""; public Cursor priorityData(){            String[] resultColumns = new String[] {KEY_ID,NAME,CATEGORY,PRIORITY };            String[] condition = {""High""};            Cursor cursor = db.query(DATABASE_TABLE, resultColumns, KEY_ID + ""="" + ""?"",    condition, null, null, null);              if(cursor.moveToNext()){                return cursor;              }            return cursor;          }</code></pre><p>The values for priority columns can be ""Low"", ""Medium"" or ""High"". i am trying to query the database to return rows whose values are set as ""High"" in the PRIORITY column.</p>","447570","","447570","","2010-10-11 21:17:15","2011-07-05 19:56:42","query table columns for specific data values in sqlite android","<android>","2","4","","",""
"3908266","1","3908744","","2010-10-11 16:52:59","1","929","<p>I'm not asking to be spoon fed here, just need some pointers on where to direct my searching</p><p>I want to call a SOAP web service, possibly <a href=""http://webservices.gama-system.com/files/GetCurrentExchangeRatesXML.xml"" rel=""nofollow"">this</a> one</p><p>I don't want to use KSoap, is there anyway I can do this using the apache libraries that are included with the Android SDK?</p>","155695","","","","","2010-10-18 07:59:07","Android; how can you invoke a SOAP web service without using ksoap?","<android><web-services><soap>","2","0","1","",""
"3908301","1","3908341","","2010-10-11 16:55:54","7","15069","<p>I developed my first (small) Andoid application using Eclipse and are now ready to transfer it to my Galaxy S mobile device (develping for Android 2.1)</p><p>Following another thread in SE, I changed the run mode in Eclipse to manual in the hope that I would be able to chose my phone and/or AVD every time I run the program. </p><p>The popup list howerver only show the AVD, my phone is not present in the list.</p><p>So obviously, my Samsung Galaxy S device is not recognized. Howerver, I can transfer to and from the device using a drive letter, so the USB connection is working properly.</p><p>Anyone any idea what I am missing here ? I'm not sure if it is an Eclipse problem , or a driver or ....</p>","231181","","815724","","2011-10-03 08:46:31","2014-03-31 21:46:12","Why doesn't Eclipse see my Samsung Galaxy phone even though I can transfer files using a drive letter?","<eclipse><android>","4","1","","",""
"3908329","1","5358046","","2010-10-11 17:00:44","1","355","<p>I have a landscape layout that features a vertical LinearLayout of buttons on the left side of the screen and a user-defined picture on the right of the screen.  The design I'm working from calls for a double-stroke border around it, which I implemented by creating a rectangular shape background with the border being the outer color and the background of the shape being the inner color.  I then just put some padding around the picture, and you get the double-stroke border.  The problem is expanding the picture to fill the space in the layout.  I don't know the dimensions of the picture, since it is user defined, and I'd like it to expand to exactly fill either dimension while preserving the aspect ratio.  Setting fill_parent for both width and height does that, but it also expands the background all the way to completely fill the cell, resulting in a sort of letter boxing effect.  Is there any way, short of just adjusting the size of the view after layout, of getting this to only expand the view as much as necessary?</p>","104918","","","","","2011-03-18 21:31:30","Android: Stretching ImageView with background","<android><layout>","1","1","1","",""
"3908337","1","4026966","","2010-10-11 17:02:08","1","2165","<p>I am trying to use the KeyGuardManager to unlock the phone easily.so far no problems the phone is unlocked and all is good. However when this code is executed later I notice my phone is behaving weirdly. until a I see the following message in the Logcat file : </p><pre><code>WindowManagerService.mKeyguardTokenWatcher: cleaning up leaked reference</code></pre><p>meaning as far as I can tell the reference to the key-guard was leaked. I have no idea why this would happen especially as I cannot see a method which seems to safely dispose of the keyguard lock.</p><p>The code that aquaired the lock looks like this:</p><pre><code>// use KeyGuardManager to automaticly unlock the device    KeyguardManager kgm = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);    KeyguardLock kgl = kgm.newKeyguardLock(""BusSnooze"");    if (kgm.inKeyguardRestrictedInputMode())        kgl.disableKeyguard();</code></pre><p>Anyone know why this is happening? thanks,Jason</p>","407133","","","","","2011-04-04 08:05:57","problem with KeyGuardManager","<android>","1","0","4","",""
"3908756","1","","","2010-10-11 18:00:15","1","4585","<p>I have a custom class called ""Sound"" with SoundPool, I want to implement the loading complete listener so that my activity can play an intro sound and display the ""start"" button once loading is complete.</p><p>How would I go about implementing the listener and then testing for the complete status from my activity to make sure everything is loaded then go on to do the above.</p><p>A small example would be appreciated.</p><p>MyActivity creates an instance of my class ""Sound"" so that it can call various sound methods from it.</p><pre><code>Sound mySound = new Sound();</code></pre><p>Most of these are not a problem, because by the time they are called, the loading has completed, however, I need for MyActivity to be able to check if loading has completed before calling </p><pre><code>mySound.playIntro(); </code></pre><p>(for example).</p><p>Maybe the OnLoadCompleteListener isn't the best solution, I'm still learning, so I'm open to ideas, this is just the way I guessed it should be done.</p><p>Thanks</p>","353674","","353674","","2010-10-11 19:04:48","2014-03-05 18:51:29","Android onLoadCompleteListener how to implement?","<android><listener><soundpool>","1","0","2","",""
"3908817","1","","","2010-10-11 18:09:12","0","1217","<p>Whenever I run my program, I get this error:</p><pre><code>10-11 17:53:12.135: ERROR/AndroidRuntime(403):     at android.app.Instrumentation.newApplication(Instrumentation.java:957)10-11 17:53:12.135: ERROR/AndroidRuntime(403):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)10-11 17:53:12.135: ERROR/AndroidRuntime(403):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)10-11 17:53:12.135: ERROR/AndroidRuntime(403):     ... 11 more10-11 17:53:53.525: ERROR/AndroidRuntime(434): FATAL EXCEPTION: main10-11 17:53:53.525: ERROR/AndroidRuntime(434): java.lang.RuntimeException: Unable to instantiate application eggplant.passerator.Passerator: java.lang.ClassCastException: eggplant.passerator.Passerator10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.access$3000(ActivityThread.java:125)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.os.Handler.dispatchMessage(Handler.java:99)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.os.Looper.loop(Looper.java:123)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at java.lang.reflect.Method.invokeNative(Native Method)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at java.lang.reflect.Method.invoke(Method.java:521)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at dalvik.system.NativeStart.main(Native Method)10-11 17:53:53.525: ERROR/AndroidRuntime(434): Caused by: java.lang.ClassCastException: eggplant.passerator.Passerator10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.Instrumentation.newApplication(Instrumentation.java:957)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)10-11 17:53:53.525: ERROR/AndroidRuntime(434):     ... 11 more</code></pre><p>. I have no Idea why!!!! This didn't happen before</p><pre><code>!&lt;manifest     xmlns:android=""http://schemas.android.com/apk/res/android""              package=""eggplant.passerator""              android:versionCode=""1""              android:versionName=""1.0""&gt;            &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:name=""Passerator""&gt;                &lt;activity android:name="".Passerator"" android:label=""@string/app_name""&gt;                    &lt;intent-filter&gt;                        &lt;action android:name=""android.intent.action.MAIN"" /&gt;                        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                    &lt;/intent-filter&gt;                &lt;/activity&gt;            &lt;/application&gt;        &lt;/manifest&gt;    package eggplant.passerator;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.CheckBox;import android.widget.EditText;import java.util.Random;public class Passerator extends Activity {    /** Called when the activity is first created. */    private String[] all_letters = {""a"", ""b"", ""c"", ""d"", ""e"", ""f"",""g"",""h"",""i"",""j"",""k"",""l"",""m"",""n"",""o"",""p"",""q"",""r"",""s"",""t"",""u"",""v"",""w"",""x"",""y"",""z""};    private String[] all_words = {""app"",""apple"", ""android"", ""beta"",""brown"", ""cow"",""camp"", ""down"",""dug"", ""elephant"",""eclair"", ""fail"",""full"", ""gone"",""got"",""how"",""honey"",""ill"",""ice"",""jog"",""journey"",""king"",""kangaroo"", ""lemon"",""lobster"",""mark"",""make"",""nose"",""none"", ""origin"",""octpus"", ""power"",""pick"", ""quadrant"",""respect"",""run"",""sun"",""seen"",""tons"",""tan"", ""under"",""unable"",""view"",""venus"", ""what"",""where"",""yes"",""yawn"",""zebra""};    @SuppressWarnings(""unused"")    private Button generateButton;    private EditText minimum;    private EditText maximum;    private CheckBox letters;    private CheckBox words;    private CheckBox numbers;    private EditText password;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        this.generateButton = (Button)this.findViewById(R.id.generate);        this.minimum = (EditText)this.findViewById(R.id.min);        this.maximum = (EditText)this.findViewById(R.id.max);        this.letters = (CheckBox)this.findViewById(R.id.letters);        this.words = (CheckBox)this.findViewById(R.id.words);        this.numbers = (CheckBox)this.findViewById(R.id.numbers);        this.password = (EditText)this.findViewById(R.id.password);    }    public void generate(View v)    {        String mi = minimum.getText().toString();        String ma = maximum.getText().toString();        Boolean num = numbers.isChecked();        Boolean let = letters.isChecked();        Boolean word = words.isChecked();        String new_password = make_password(mi, ma, num, let, word);        password.setText(new_password);    }    @SuppressWarnings(""finally"")    public String make_password(String max, String min, Boolean numbers, Boolean letters, Boolean words)    {        String password = new String("""");        int minimum=0;        int maximum=0;        try        {            minimum = Integer.parseInt(min);            maximum = Integer.parseInt(max);        }        catch(Throwable t)        {            password = ""You must set both the minimum and maximum to an integer!"";        }        finally        {            //if(numbers==true)password+=""numbers,"";            //if(letters==true)password+=""letters,"";            //if(words==true)password+=""words."";            Random random_gen = new Random();            int length = minimum + (int) (Math.random()*(maximum - minimum));            //password+=Integer.toString(length);            //password+="":"";            if(numbers==false&amp;&amp;letters==true&amp;&amp;words==false)            {                while(length!=0)                {                    password+=all_letters[random_gen.nextInt(26)];                    length-=1;                }            }            if(numbers==false&amp;&amp;letters==false&amp;&amp;words==true)            {                if (length&lt;3)password=""To use words only, you must set minimum to at least 3!"";                while(length&gt;3)                {                    String chosen_word=all_words[random_gen.nextInt(all_words.length)];                    if (chosen_word.length()&lt;=length)                    {                    password+=chosen_word;                    length-=chosen_word.length();                    }                }            }            if(numbers==true&amp;&amp;letters==false&amp;&amp;words==false)            {                while(length!=0)                {                    password+=Integer.toString(random_gen.nextInt(9));                    length-=1;                }            }            if(numbers==true&amp;&amp;letters==true&amp;&amp;words==false)            {                while(length!=0)                {                    if(random_gen.nextBoolean()==true)password+=all_letters[random_gen.nextInt(26)];                    else password+=Integer.toString(random_gen.nextInt(9));                    length-=1;                }            }            if(numbers==true&amp;&amp;letters==false&amp;&amp;words==true)            {                while(length!=0)                {                    if(random_gen.nextBoolean()==true)                    {                        password+=Integer.toString(random_gen.nextInt(9));                        length-=1;                    }                    else                    {                        if(length&gt;3)                        {                            String chosen_word=all_words[random_gen.nextInt(all_words.length)];                            if (chosen_word.length()&lt;=length)                            {                                password+=chosen_word;                                length-=chosen_word.length();                            }                        }                    }                }            }            if(numbers==false&amp;&amp;letters==true&amp;&amp;words==true)            {                while(length!=0)                {                    if(random_gen.nextBoolean()==true)                    {                        password+=all_letters[random_gen.nextInt(26)];                        length-=1;                    }                    else                    {                        if(length&gt;3)                        {                            String chosen_word=all_words[random_gen.nextInt(all_words.length)];                            if (chosen_word.length()&lt;=length)                            {                                password+=chosen_word;                                length-=chosen_word.length();                            }                        }                    }                   }            }            if(numbers==true&amp;&amp;letters==true&amp;&amp;words==true)            {                while(length!=0)                {                    int choice=random_gen.nextInt(3);                    if(choice==0)                    {                        password+=all_letters[random_gen.nextInt(26)];                        length-=1;                    }                    if (choice==1)                    {                        if(length&gt;3)                        {                            String chosen_word=all_words[random_gen.nextInt(all_words.length)];                            if (chosen_word.length()&lt;=length)                            {                                password+=chosen_word;                                length-=chosen_word.length();                            }                        }                    }                    if (choice==2)                    {                        password+=Integer.toString(random_gen.nextInt(9));                        length-=1;                    }                }            }            if(numbers==false&amp;&amp;letters==false&amp;&amp;words==false)password=""You must check at least one of the check boxes above!"";            if (minimum&lt;maximum)password=""The maximum must be less than the minimum!"";            return password;        }    }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget35""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;Buttonandroid:id=""@+id/generate""android:layout_width=""320px""android:layout_height=""53px""android:text=""Generate""android:layout_x=""0px""android:layout_y=""272px""&gt;&lt;/Button&gt;&lt;EditTextandroid:id=""@+id/password""android:layout_width=""320px""android:layout_height=""110px""android:textSize=""18sp""android:layout_x=""0px""android:layout_y=""322px""&gt;&lt;/EditText&gt;&lt;CheckBoxandroid:id=""@+id/numbers""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Numbers""android:layout_x=""200px""android:layout_y=""202px""&gt;&lt;/CheckBox&gt;&lt;CheckBoxandroid:id=""@+id/words""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Words""android:layout_x=""110px""android:layout_y=""202px""&gt;&lt;/CheckBox&gt;&lt;CheckBoxandroid:id=""@+id/letters""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Letters""android:layout_x=""20px""android:layout_y=""202px""&gt;&lt;/CheckBox&gt;&lt;EditTextandroid:id=""@+id/max""android:layout_width=""70px""android:layout_height=""wrap_content""android:textSize=""18sp""android:layout_x=""10px""android:layout_y=""122px""android:inputType=""number""android:maxLines=""1""android:maxLength=""2""android:imeOptions=""actionDone""&gt;&lt;/EditText&gt;&lt;EditTextandroid:id=""@+id/min""android:layout_width=""70px""android:layout_height=""wrap_content""android:textSize=""18sp""android:layout_x=""10px""android:layout_y=""72px""android:inputType=""number""android:maxLines=""1""android:maxLength=""2""android:imeOptions=""actionDone""&gt;&lt;/EditText&gt;&lt;TextViewandroid:id=""@+id/max_text""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Maximum Length""android:layout_x=""80px""android:layout_y=""132px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/min_text""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Minimum Length""android:layout_x=""80px""android:layout_y=""82px""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/title""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Passerator""android:textSize=""40sp""android:textStyle=""bold""android:layout_x=""50px""android:layout_y=""2px""&gt;&lt;/TextView&gt;&lt;/AbsoluteLayout&gt;</code></pre>","472574","","472574","","2010-10-11 18:31:52","2010-10-11 18:38:57","Android Manifest Problems","<android><manifest><android-manifest>","1","2","","",""
"3908856","1","3908871","","2010-10-11 18:15:30","2","5603","<p>I have setup my app to launch Google maps to a set location using the code below, but the map displays zoomed full and you cant see any roads you have to zoom out manually to see anything.   How can I set the zoom level with the code below I've tried setZoom(16); but this has no effect.</p><pre><code>if (mapnav == 10) {   String uri = ""geo: 53.777969,-1.571474"";           setZoom(16);   Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));   startActivity(i);}</code></pre><p>Also can I launch into Directions instead of the map</p>","445174","","754559","","2012-06-22 17:21:45","2012-06-22 17:21:45","Launch Google Maps from app","<java><android><eclipse><google-maps>","1","0","3","",""
"3908861","1","","","2010-10-11 18:16:04","0","409","<p>I have created an image gallery in android , now whenever i will click on image on a gallery then that particular image will get added into Grid View.</p><p>my layout has image gallery on top and image grid in bottom (so i have used LinerLayout Vertical )</p><p>so can anyone tell me how to achieve this in android ?</p>","405383","","405383","","2010-10-11 18:24:11","2010-10-12 08:46:29","ImageGallery and ImageGrid in android","<android>","1","3","","",""
"3908912","1","","","2010-10-11 18:24:26","0","226","<p>How to add a scrolling label, if the label size is bigger, then xxx DIP?I want to create a scrolling label, than in the market. How to?</p>","472537","","","","","2010-10-11 18:24:26","Android scrolling label, how to?","<android><scrolling><label>","0","2","","",""
"3909062","1","3909187","","2010-10-11 18:50:09","1","2942","<p>I want to create a relative Layout dynamically through code with 2 Textviews one below the other.How to implement android:layout_below property through code in Android.can anyone help me in sorting out this issue.</p><p>Thanks in Advance,</p>","429501","","","","","2011-05-23 02:07:13","How to align a dynamically create UserInterface using RelativeLayout in Android","<android>","2","0","","",""
"3909076","1","3909277","","2010-10-11 18:52:07","0","312","<p>I have a GridView displaying buttons to different screens of my app.  When this grid screen, the first cell is selected.  Is there a way to programmatically have no cells selected when the screen launches?  Or do I have to hide the selector?</p>","406790","","66708","","2010-10-11 19:24:03","2010-10-11 19:24:03","Losing screen object auto-focus","<android><gridview><focus><autofocus>","1","0","","",""
"3909104","1","3909425","","2010-10-11 18:56:30","0","1691","<p>I'm trying to receive SMS using broadcast receiver. MySMSReceiver :</p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.SmsMessage;import android.util.Log;public class MySmsReceiver extends BroadcastReceiver {    /** Tag string for our debug logs */    private static final String TAG = ""MySmsReceiver"";    @Override    public void onReceive(Context context, Intent intent) {        Log.i(TAG, ""Recieved a message"");        Bundle extras = intent.getExtras();        if (extras == null)            return;        Object[] pdus = (Object[]) extras.get(""pdus"");        for (int i = 0; i &lt; pdus.length; i++) {            SmsMessage message = SmsMessage.createFromPdu((byte[]) pdus[i]);            String fromAddress = message.getOriginatingAddress();            String fromDisplayName = fromAddress;            Log.i(TAG, fromAddress);            Log.i(TAG, fromDisplayName);            Log.i(TAG, message.getMessageBody().toString());            break;                  }    }}</code></pre><p>and added in Mainfest file</p><pre><code>&lt;receiver android:name="".MySmsReceiver"" android:enabled=""false""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;</code></pre><p>but when I run this app and send a sms using emulator it shows following logs in logcat</p><pre>10-12 00:14:53.082: VERBOSE/Telephony(1032): getOrCreateThreadId uri: content://mms-sms/threadID?recipient=989898989810-12 00:14:53.203: VERBOSE/Telephony(1032): getOrCreateThreadId cursor cnt: 110-12 00:14:53.432: DEBUG/Mms:app(1032): getSmsNewMessageNotificationInfo: count=4, first addr=9898989898, thread_id=310-12 00:14:53.482: WARN/NotificationService(62): STOP command without a player10-12 00:14:53.562: DEBUG/MediaPlayer(62): Couldn't open file on client side, trying server side10-12 00:14:53.582: ERROR/MediaPlayerService(34): Couldn't open fd for content://settings/system/notification_sound10-12 00:14:53.592: ERROR/MediaPlayer(62): Unable to to create media player10-12 00:14:53.643: WARN/NotificationService(62): error loading sound for content://settings/system/notification_sound10-12 00:14:53.643: WARN/NotificationService(62): java.io.IOException: setDataSource failed.: status=0x8000000010-12 00:14:53.643: WARN/NotificationService(62):     at android.media.MediaPlayer.setDataSource(Native Method)10-12 00:14:53.643: WARN/NotificationService(62):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:716)10-12 00:14:53.643: WARN/NotificationService(62):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:671)10-12 00:14:53.643: WARN/NotificationService(62):     at com.android.server.NotificationPlayer$CreationAndCompletionThread.run(NotificationPlayer.java:88)</pre><p>Suggest me what could be the reason.</p>","164933","","164933","","2010-10-11 19:02:38","2011-08-29 07:38:59","Error in receiving SMS using Broadcast receiver","<android><broadcastreceiver><receiver>","1","0","","",""
"3909192","1","","","2010-10-11 19:10:58","0","266","<p>In the <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">HelloMapView tutorial</a>, the map seems to load fine, I can see maps, and also I can see the mark of Mexico that the example gives.</p><p>But, when I click on the Mexico mark, my application crashes, with the message</p><blockquote>  <p>Android application crash</p></blockquote><p>I think that I know what the problem is but I don't know how to solve it:</p><p>In step 7, the <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">tutorial</a> says this:</p><blockquote>  <p>Now set up the ability to handle touch events on the overlay items. First, you're going to need a reference to the application Context as a member of this class. So add Context mContext as a class member, then initialize it with a new class constructor:</p></blockquote><pre><code>public HelloItemizedOverlay(Drawable defaultMarker, Context context) {  super(defaultMarker);  mContext = context;}</code></pre><p>Okay, but in the main tutorial class, when it declares this class, it doesn't give it the context:</p><pre><code>HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);</code></pre><p>I tried to do this: <code>new HelloItemizedOverlay(drawable, getApplicationContext());</code></p><p>but that does not work, the map appears without the Mexico mark.</p><p>Does anyone have an idea of where I went wrong?</p>","462055","","321505","","2012-01-15 21:46:03","2012-01-15 21:46:03","Problems with HelloMapView tutorial","<android><google-maps><context>","0","3","","",""
"3909333","1","","","2010-10-11 19:30:46","3","1466","<p>What I want to do: I want to setup some routes overlay on google map in android !</p><p>What I have done so far: I have parsed the file (geo points) and have them ! I am using asynctask. My overlay class has a custom draw method. I have used destroyDrawingCache () in my draw function.</p><p>Problems I faced: While running the app, it gets size exceed error. I can see that the heap size is about 12mb at the time of the error.</p><p>Can anyone please help me out ? Thanks!</p><pre><code>/////////////////////////////Error Message/////////////////////////////10-11 19:23:02.059: ERROR/AndroidRuntime(483): FATAL EXCEPTION: main10-11 19:23:02.059: ERROR/AndroidRuntime(483): java.lang.OutOfMemoryError: bitmap size exceeds VM budget10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.graphics.Bitmap.nativeCreate(Native Method)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.android.maps.StreetViewRenderer.generateNewTileImage(StreetViewRenderer.java:120)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.android.maps.StreetViewRenderer.renderTile(StreetViewRenderer.java:88)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.android.maps.AndroidTileOverlayRenderer.renderTile(AndroidTileOverlayRenderer.java:62)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.googlenav.map.Map.drawTile(Unknown Source)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.googlenav.map.Map.drawMap(Unknown Source)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.android.maps.MapView.drawMap(MapView.java:1048)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.google.android.maps.MapView.onDraw(MapView.java:486)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.View.draw(View.java:6740)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.View.draw(View.java:6743)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.widget.FrameLayout.draw(FrameLayout.java:352)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.View.draw(View.java:6743)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.widget.FrameLayout.draw(FrameLayout.java:352)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewRoot.draw(ViewRoot.java:1407)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.os.Handler.dispatchMessage(Handler.java:99)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.os.Looper.loop(Looper.java:123)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at java.lang.reflect.Method.invokeNative(Native Method)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at java.lang.reflect.Method.invoke(Method.java:521)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-11 19:23:02.059: ERROR/AndroidRuntime(483):     at dalvik.system.NativeStart.main(Native Method)/////////////////////////////////////////////////////////////</code></pre><p>the draw code :</p><pre><code>   public void draw(Canvas canvas, MapView mapv, boolean shadow){     BusLoc.myMapView.destroyDrawingCache ();     super.draw(canvas, mapv, shadow);        Paint mPaint = new Paint();        mPaint.setDither(true);        mPaint.setColor(Color.RED);        mPaint.setStyle(Paint.Style.FILL_AND_STROKE);        mPaint.setStrokeJoin(Paint.Join.ROUND);        mPaint.setStrokeCap(Paint.Cap.ROUND);        mPaint.setStrokeWidth(2);        //ah1[0][0]=35767138;        //ah1[0][1]=-78695548;        //ah1[1][0]=35787497;        //ah1[1][1]=-78667474;        Log.d(""MyOverlay"",""OnDraw"");        int in=0;        for(in=0;in&lt;ind-1;in++)        {         if (ah1[in][0] ==0 ||(ah1[in+1][0]==0)) break;         if((ah1[in][0] !=0) &amp;&amp;(ah1[in+1][0]!=0))         {          GeoPoint gP1 = new GeoPoint((int)(ah1[in][0]*1e6),(int)(ah1[in][1]*1e6));          GeoPoint gP2 = new GeoPoint((int)(ah1[in+1][0]*1e6),(int)(ah1[in+1][1]*1e6));          Point p1 = new Point();          Point p2 = new Point();          Path path = new Path();          Projection projection = BusLoc.myMapView.getProjection();    projection.toPixels(gP1, p1);          projection.toPixels(gP2, p2);          path.moveTo(p2.x, p2.y);          path.lineTo(p1.x,p1.y);          canvas.drawPath(path, mPaint);          Log.d(""MyOverlay"",""drawn: ""+gP1.toString()+"":""+gP2.toString());         }        }        BusLoc.myMapView.destroyDrawingCache ();    }</code></pre>","342925","","838912","","2012-02-13 04:34:03","2012-02-13 04:34:03","java.lang.OutOfMemoryError: bitmap size exceeds VM budget while overlaying on Google map on Android ?","<android><google-maps><routes><overlay><out-of-memory>","0","8","1","",""
"3909531","1","3910166","","2010-10-11 20:02:44","0","3118","<p>My apologies in advance if this is a repeat question, I looked all over and couldn't find any solution to help me. </p><p>I have followed the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">android dev tutorial</a> for creating a tabbed UI that uses a separate activity for each tab. </p><p>And I got it working just fine. Until...</p><p>I am attempting to put a <code>ListView</code> inside one of the tabbed activities (Tab1). To get the usability I want, I find that I need to extend <code>ListActivity</code>. Thats when I get the 'Force close' error. It displays just fine when I extend regular Activity.</p><p>Here is my nonfunctional Tab1.java code:</p><pre><code>public class Tab1 extends ListActivity {    ListView lv;    String[] times = {        ""7:00 AM"", ""8:00 AM"", ""9:00 AM"", ""10:00 AM"", ""11:00 AM"",            ""12:00 AM"", ""1:00 PM"", ""2:00 PM"", ""3:00 PM"", ""4:00 PM"",            ""5:00 PM"", ""6:00 PM"", ""7:00 PM""    };    /** Called when the activity is first created. */@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.tab1);        lv = (ListView) findViewById(R.id.ListView_Tab1);        lv.setAdapter(new ArrayAdapter &lt; String &gt; (this, R.layout.list_item, R.id.times,            times));        lv.setOnItemClickListener(new OnItemClickListener() {@            Override            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>","444454","","193903","","2013-05-20 11:38:27","2013-05-20 11:38:27","Android: Error when using ListActivity inside Tab Layout","<java><android><listview><tabs>","2","1","","",""
"3909575","1","3910619","","2010-10-11 20:10:28","1","1929","<p>The problem is that when I use source code below, i receive cell id's only in 2G mode, if i switch to 3G mode i sometimes receive -1 for HSDPA or nothing for UMTS. Source code is:</p><pre><code>for (int i = 0; i &lt; neighCell.size(); i++) {try {        NeighboringCellInfo thisCell = neighCell.get(i);        int thisNeighCID = thisCell.getCid();        int thisNeighRSSI = -113 + 2*thisCell.getRssi();        log(""Base station ""+(i+1)+"":""+                ""\nCellID: ""+thisNeighCID+                ""; RSSI: ""+thisNeighRSSI+"" dBm"");} catch (NumberFormatException e) {        e.printStackTrace();        NeighboringCellInfo thisCell = neighCell.get(i);        log(thisCell.toString());}    }</code></pre><p>Is there any way to get id's in 3G mode and especially for UMTS?</p>","458024","","","","","2010-10-11 23:20:11","UMTS cell id of neighbor cells","<java><android><cellid>","1","0","","",""
"3909833","1","3909868","","2010-10-11 20:47:22","1","947","<p>I have a main menu screen with a simple ListView that contains ""links"" to further screens in my app (Browse, Bookmarks, Settings, About, etc.). Underneath the ListView there is a TextView (more accurately, a TextSwitcher that rotates TextViews) that changes every 10 seconds to display a new ""tip"".<img src=""http://i.stack.imgur.com/QlzAH.png"" alt=""alt text""></p><p>In portrait mode, this works fine. There are my five list items in the ListView , and my tip label underneath. However, when I switch to landscape mode, the ListView is taller than the screen. The ListView scrolls normally, but I cannot scroll past the end of the ListView to see the TextView underneath.</p><p>I have tried every possible combination of Layouts, wrappers, ScrollViews, and layout_height parameters and I simply cannot get it to behave.</p><p>Here is the simplest code I can use to get the result pictured above:</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:orientation=""vertical""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:id=""@+id/ListLayout""        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"" android:layout_weight=""1""&gt;        &lt;/ListView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/TipLayout""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:layout_below=""@+id/ListLayout""&gt;        &lt;TextSwitcher android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:id=""@+id/TipSwitcher""&gt;            &lt;TextView android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:textSize=""7pt""                android:id=""@+id/Tip1TextView"" android:text=""Tip: Hello, Android!""&gt;&lt;/TextView&gt;            &lt;TextView android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Tip: This is the second TextView in the TipSwitcher!""                android:id=""@+id/Tip2TextView"" android:textSize=""7pt""&gt;&lt;/TextView&gt;        &lt;/TextSwitcher&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Like I've said, I've already tried so many different combinations that I can't list them, and for the most part I was randomly inserting XML in an attempt to get something to work the way I wanted. So I'd greatly appreciate suggestions as to how I would go about doing this the right way.</p><p>Thanks.</p><p>EDIT: Something I forgot to mention, this may or may not be relevant. My MainMenuActivity is extending ListActivity. According to the docs, ""ListActivity has a default layout that consists of a single, full-screen list in the center of the screen."" But, ""If you desire, you can customize the screen layout by setting your own view layout with setContentView() in onCreate()."" So I don't think the ListActivity is interfering.</p>","143987","","","","","2010-10-11 20:51:44","How can I get a ListView and TextView to scroll as one unit when content is taller than the screen height?","<java><android><xml><gui>","1","0","1","",""
"3909903","1","3910229","","2010-10-11 20:56:31","1","1031","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3410475/how-to-detect-an-android-device-whether-it-supports-google-maps-api"">How to detect an android device whether it supports google maps API</a>  </p></blockquote><p>Hi, I've an application with multiple activities. One activity is a MapActivity. Can I disable  MapActivity when it is not supported by the device and let the user install the application and get remaining activities or should I develop two versions of the application (one with MapActivity and another without it)?</p>","472681","","","","","2010-10-11 21:55:54","Disable MapView if it is not supported","<android><activity>","1","0","2","2011-05-10 12:24:01",""
"3910042","1","","","2010-10-11 21:18:37","6","3181","<p>I have:</p><pre><code>String date = ""2010-10-9 12:00:00"";</code></pre><p>I want to parse that string, then subtract that date/time from the current date/time so that I can output a string similar to ""2 days ago"".</p>","472699","","244296","","2010-10-11 21:20:32","2011-11-24 01:06:19","Java(Android) convert SQLite date to ""x days ago""","<java><android><date><format>","4","0","2","",""
"3910121","1","","","2010-10-11 21:33:12","0","169","<p>I'm looking for a way to output the total download time every time a new page is opened in the Android browser.</p><p>I've looked around, but can't find a place to put a timestamp for downloading a web page.  There's a performance monitor in onPageStarted and onPageFinished measuring the page loading time, but nothing (that I can see) that measures the download time.</p>","471167","","","","","2010-10-12 02:33:48","Android Browser output download time","<android>","2","0","","",""
"3910247","1","3910492","","2010-10-11 21:58:41","0","173","<p>Is there an example that would allow a few hundred or thousand words, with paragraphs and CRs, to be displayed in a basic Hello World-style text display, complete with a vert. scroll bar (or vertical grab and move up or down)?</p><p>Thanks.</p>","225626","","","","","2010-10-11 22:49:46","plain text display with vert. scrolling?","<android>","1","0","","",""
"3910348","1","3910733","","2010-10-11 22:19:04","3","1000","<p>Is there any possibility to highlight a street using the Google Maps API? I want to set a color on a street, similar as it is done in the navigation function of Google Maps.</p><p>If there is no generic implementation for this - and I guess there probably isn't - is there any good/simple solution for this? The only thing I could think of was reverse geocoding coordinates and see if those coordinates resolve to the street I want to color and if they did I would then draw some color on to those points. But this is a really ugly solution. ;-)</p><p>I hope some clever genious can help me!</p>","443112","","","","","2010-10-11 23:43:50","Color street on Android MapView?","<android><google-maps>","1","0","","",""
"3910398","1","3912692","","2010-10-11 22:30:51","0","2863","<p>Greetings.</p><p>How can I send two parameters into a thread and run methods when the user pushes buttons on the display.  Having my variables in the UI thread didn't work and were erased when the UI thread randomly restarts.</p><p>UI Thread                <strong><em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>____</strong>    Other Thread</p><p>User presses button -------> Run Method</p><p>Cheers.</p>","445342","","","","","2010-10-12 08:14:32","Thread in Java/Android","<java><android><multithreading>","2","2","","",""
"3910408","1","","","2010-10-11 22:32:27","2","5713","<p>   </p><p>How about, if just to get top border or left border using stroke. Is it possible to set different width for different borders</p>","441730","","","","","2010-10-13 15:22:03","how to set different color of border of rectangle using stroke","<android>","1","1","","",""
"3910473","1","","","2010-10-11 22:46:34","2","2205","<p>I have an application that uses a Service and some list activities. When the activities are opened, I can see the heap usage increase in DDMS, when the activities are closed, the heap usage decreases slightly. The service is still running in the background at this point. If the activity is started again by re-running the application and the closed, the heap usage increases again then decreases, but never returns to the original level before the activity was first opened. If it repeatedly (10-15 times) open the activity then close the activity, the heap size (both MB and # Objects) balloons!</p><p>I'd expect ListActivity's onDestroy to take care of itself when it gets destroyed. What am I missing with this? Am I using ListActivity incorrectly?</p><p>A test app similar to my real code is below. Create a new android application, add this to the manifest:</p><pre>&lt;service android:name=""LeakTestService""/&gt;</pre><p>and these java files:</p><pre>LeakTestActivity.java-------------package LeakTest.Test;import java.util.ArrayList;import java.util.HashMap;import android.app.Activity;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.SimpleAdapter;public class LeakActivity extends ListActivity {    ArrayList> _Data=new ArrayList>();    ArrayAdapter _Adapter;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Intent svc = new Intent(this.getApplicationContext(), LeakTestService.class);        startService(svc);        // the problem happens with both SimpleAdapter and ArrayAdapter        //_Adapter = new SimpleAdapter(this.getApplicationContext(), _Data, android.R.layout.two_line_list_item, new String[] { ""line1"",""line2"" }, new int[] { android.R.id.text1, android.R.id.text2 });        _Adapter = new ArrayAdapter(this.getApplicationContext(), android.R.layout.simple_list_item_1, new String[] {""data1"",""data2""} );        // if this line is removed, the heap usage never balloons if you repeatedly open+close it        getListView().setAdapter(_Adapter);    }    @Override    public void onDestroy() {        _Adapter=null; // this line doesn't help        getListView().setAdapter(null); // neither does this line        super.onDestroy();    }}LeakTestService.java--------package LeakTest.Test;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.widget.Toast;public class LeakTestService extends Service {    @Override    public void onStart(Intent intent, int startId) {        Toast.makeText(getBaseContext(), ""Service onStart"", Toast.LENGTH_SHORT).show();    }    @Override public void onDestroy() {        Toast.makeText(getBaseContext(), ""Service onDestroy"", Toast.LENGTH_SHORT).show();        }    @Override    public IBinder onBind(Intent intent) {        // TODO Auto-generated method stub        return null;    }}</pre>","353014","","","","","2011-06-30 06:03:12","I have a memory leak using ListActivity in Android","<android><memory-leaks><listactivity><listadapter>","2","0","1","",""
"3910703","1","","","2010-10-11 23:38:32","3","164","<p>I'm using MediaPlayer to play some sounds files, which at times overlap. I notice that in the LogCat window I keep getting this message:</p><p>android max instances of component OMX.TI.ACC. Decode already created.</p><p>It seems to have no effect on my application as the sounds continue to play just fine. Does anyone know what this message means, and do I need to worry about it?</p>","472788","","","","","2012-05-15 03:44:32","Error when playing Media Files","<android>","1","0","","",""
"3910708","1","9418798","","2010-10-11 23:38:52","8","6310","<p>I was delighted to discover that Android 2.2 supports the position:fixed CSS selector. I've built a simple proof-of concept, here:</p><p><a href=""http://kentbrewster.com/android-scroller/scroller.html"">http://kentbrewster.com/android-scroller/scroller.html</a></p><p>... which works like a charm.  When I attempt to add an INPUT tag to my header, however, I hit trouble.  On focus, every device I've tried so far clones the INPUT tag, gives it an infinite Z-index, and repaints it on top of the old tag.  The clone is in roughly the right position, but most of its parent's CSS (including, of course, position:fixed) is ignored.  The cloned INPUT tag is the wrong size and shape, and when I scroll the body of the page, it scrolls up and off the screen.  </p><p>Once it's off screen, hilarity ensues.  Sometimes the device will force the scrolling part of the body back down so the cloned blank is back in view; sometimes the keyboard goes away even though the visible box seems to remain in focus; sometimes the keyboard cannot be dismissed even though the INPUT blank is clearly blurred.  Here's an example you can run on your Android 2.2 device to see what's happening:</p><p><a href=""http://kentbrewster.com/android-input-style-bug/"">http://kentbrewster.com/android-input-style-bug/</a></p><p>Styling input:focus has not done the trick for me yet, nor have many different brute-force attempts to listen for focus() and blur() with JavaScript and do the right thing with focus and the keyboard.</p><p>Thanks very much for your help,</p><p>--Kent</p>","1151280","","","","","2013-02-15 16:27:59","How can I style an HTML INPUT tag so it maintains CSS when focused on Android 2.2+?","<html><android><css><input><css-position>","3","2","6","",""
"3911053","1","","","2010-10-12 01:12:23","1","1368","<p>I want to change the android sharedPreferences  save path,the sharedPreferences save in /data/data/xxx.xxx.xxx/shared_prefs,i want to change path to /sdcard. how i do?</p>","364112","","","","","2012-04-05 00:32:31","How to change the android sharedPreferences save path?","<android>","1","0","1","",""
"3911076","1","","","2010-10-12 01:21:33","0","616","<p>I'm getting different results when creating a TableLayout from xml vs. programmatically.  In pure xml, all three children of the TableRow (which are ImageView subclasses in my test code) expand in width so they fill the table horizontally, each taking one-third the width.  But when done programmatically, they are always the minimum size they can be to hold their content.  I want them to expand, but I don't want to hard code the xml.</p><p>Although I also tried ""pure"" programmatic building of the children of the TableRow, below I show it my preferred way, where I, in a loop, inflate each of the children from an xml file that contains just that component, and then add them to the TableRow.  (note that I create the TableRow programmatically)</p><p>Here is main.xml.  Note that the TableRow and children are commented out here, since this is the programmatic version.  (uncomment to do it purely xml)</p><pre><code>&lt;view class=""com.whatev.ButtonMenu""    android:background=""@drawable/test1""     android:layout_height=""50px"" android:layout_width=""fill_parent"" android:padding=""0px""    android:layout_alignBottom=""@+id/map"" android:id=""@+id/buttonMenu"" &gt;&lt;!-- TableRow&gt;    &lt;view xmlns:android=""http://schemas.android.com/apk/res/android"" class=""com.whatev.MenuButton""     android:background=""@drawable/test2"" android:src=""@drawable/bg""     android:scaleType=""center"" android:cropToPadding=""false"" android:padding=""3px""  android:layout_weight=""20""    android:layout_height=""fill_parent"" android:layout_width=""wrap_content"" /&gt;    &lt;view xmlns:android=""http://schemas.android.com/apk/res/android"" class=""com.whatev.MenuButton""     android:background=""@drawable/test2"" android:src=""@drawable/bg""     android:scaleType=""center"" android:cropToPadding=""false"" android:padding=""3px""  android:layout_weight=""20""    android:layout_height=""fill_parent"" android:layout_width=""wrap_content"" /&gt;    &lt;view xmlns:android=""http://schemas.android.com/apk/res/android"" class=""com.whatev.MenuButton""     android:background=""@drawable/test2"" android:src=""@drawable/bg""     android:scaleType=""center"" android:cropToPadding=""false"" android:padding=""3px""  android:layout_weight=""20""    android:layout_height=""fill_parent"" android:layout_width=""wrap_content"" /&gt;    &lt;/TableRow --&gt;    &lt;/view&gt;</code></pre><p>Then in filterbutton.xml, I have this (which is the same as the repeated stuff in comments above):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;view xmlns:android=""http://schemas.android.com/apk/res/android"" class=""com.whatev.MenuButton""     android:background=""@drawable/test2"" android:src=""@drawable/bg""     android:scaleType=""center"" android:cropToPadding=""false"" android:padding=""3px""  android:layout_weight=""20""    android:layout_height=""fill_parent"" android:layout_width=""wrap_content""  /&gt;    /&gt;</code></pre><p>Finally, here is the java code for the constructor of ButtonMenu, which is a subclass of TableLayout.  (comment out everything but the call to super() to do it pure XML.)</p><pre><code>public ButtonMenu(Context context, AttributeSet attrs) {        super(context, attrs);        TableRow firstTableRow = new TableRow(context);        for (int i=0; i&lt;3; i++) {            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);            MenuButton mb = (MenuButton)inflater.inflate(R.layout.filterbutton, null);            firstTableRow.addView(mb);        }         this.addView(firstTableRow);    }</code></pre><p>Any ideas why it behaves differently, or what I have to do to get the children (""MenuButtons"") to expand to each be one third the width of the TableLayout (""ButtonMenu"")?  Note that in the ""real"" case, there will be a variable number of buttons, not always 3.</p>","226507","","","","","2012-01-19 20:43:04","TableLayout differences when populating programmatically","<android>","1","3","","",""
"3911114","1","","","2010-10-12 01:34:48","0","415","<p>How can I make a variable or object available to multiple activities or restarts of the same one.</p>","445342","","","","","2010-10-12 01:42:54","Variables and Multiple Activities","<android><variables><activity>","1","0","2","",""
"3911123","1","","","2010-10-12 01:37:07","2","4259","<p>How do I change the android database storage path? The default path for database storage is / data / data / databases,I want to save it to sdcard, how to do?</p>","364112","","","","","2014-02-17 15:12:29","How to change the android database storage path?","<android>","3","0","4","",""
"3911142","1","3911623","","2010-10-12 01:43:54","1","16427","<p>Im having some troubles trying to get the info stored in my database and showing it in a ListView.</p><p>This is the ListActivity where i want to show the rows:</p><pre><code>public class Prueba extends ListActivity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.i_prueba);        DataBaseAccess db = new DataBaseAccess(this);        db.open();        Cursor result = db.getAllContact();        startManagingCursor(result);        // the desired columns to be bound        String[] columns = new String[] {""_id"", ""nombre"", ""telefono"", ""mail""};        // the XML defined views which the data will be bound to        int[] to = new int[] { R.id.textid, R.id.textNombre, R.id.textTelefono, R.id.textMail };        SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, R.layout.i_listadb, result, columns, to);        this.setListAdapter(mAdapter);    }</code></pre><p>The DB class. Here is the method getAllContact where i get the error:</p><p>public class DataBaseAccess {</p><pre><code>public static final String NOMBRE = ""nombre"";public static final String TELEFONO = ""telefono"";public static final String MAIL = ""mail"";public static final String ID = ""_id"";    public DataBaseAccess(Context context) {        this.androidContext = context;//DataBaseHelper is another class where the Database is created. In the ""onCreate"" //method of that class is where i make the CREATE TABLE and add some values to that //table.        dbHelper = new DataBaseHelper(androidContext);      }    public void open() throws SQLException {        db = dbHelper.getWritableDatabase();        }[...MORE METHODS...]    public Cursor getAllContact(){        String[] columnas = new String[] {ID, NOMBRE, TELEFONO, MAIL};        Cursor mCursor = dbHelper.query(""t_contactos"", columnas, null, null, null, null, null);    if (mCursor != null){        mCursor.moveToFirst();    }    return mCursor;}</code></pre><p>}</p><p>And here is the error messages from the LogCat:</p><pre><code>E/AndroidRuntime(  636): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  636): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pfc.android/com.pfc.android.Prueba}: android.database.sqlite.SQLiteException: no such column: _id: , while compiling: SELECT _id, nombre, telefono, mail FROM t_contactosE/AndroidRuntime(  636):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)E/AndroidRuntime(  636):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)E/AndroidRuntime(  636):    at android.app.ActivityThread.access$2100(ActivityThread.java:116)E/AndroidRuntime(  636):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)E/AndroidRuntime(  636):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  636):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  636):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime(  636):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  636):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  636):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime(  636):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime(  636):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  636): Caused by: android.database.sqlite.SQLiteException: no such column: _id: , while compiling: SELECT _id, nombre, telefono, mail FROM t_contactosE/AndroidRuntime(  636):    at android.database.sqlite.SQLiteProgram.native_compile(Native Method)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:59)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1118)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1006)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:964)E/AndroidRuntime(  636):    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1041)E/AndroidRuntime(  636):    at com.pfc.android.DataBaseAccess.getAllContact(DataBaseAccess.java:97)E/AndroidRuntime(  636):    at com.pfc.android.Prueba.onCreate(Prueba.java:21)E/AndroidRuntime(  636):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)E/AndroidRuntime(  636):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)E/AndroidRuntime(  636):    ... 11 more</code></pre><p>So, can anybody help to get through this?Thank you in advance !</p>","446234","","135152","","2011-05-25 03:09:53","2013-11-28 06:41:18","Android. SQLite Exception: no such column _id","<android><sqlite><listactivity>","4","0","","",""
"3911207","1","4244264","","2010-10-12 02:07:24","0","250","<p>I am trying to specify the minSDKVersion:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""5"" /&gt;</code></pre><p>Whenever I add this line, my titlebar shrinks a little bit. Not sure why? When this line is not in my manifest, everything is fine.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      android:versionCode=""1""      android:versionName=""1.0"" package=""org.stocktwits.activity""&gt;       &lt;uses-sdk android:minSdkVersion=""5"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@style/Theme.DarkGradient"" android:debuggable=""false""&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=""AddStocksActivity""&gt;    &lt;/activity&gt;    &lt;activity android:name=""DetailsActivity""&gt;    &lt;/activity&gt;    &lt;activity android:name=""ChartsActivity""&gt;    &lt;/activity&gt;    &lt;activity android:name=""ARActivity""&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre><p><strong>Update:</strong>I noticed when I set the minimum level to 3 the titlebar size does not shrink. Anything above will shrink. Why is this?</p>","19875","","418183","","2010-11-22 10:10:21","2010-11-22 10:10:21","Titlebar shrinks when I specify a minSdkVersion in AndroidManifest.xml","<java><android><xml><android-manifest>","1","0","1","",""
"3911258","1","3911306","","2010-10-12 02:22:51","32","11240","<p>I am getting the warning:</p><pre><code>Attribute minSdkVersion (3) is lower than the project target API level (8)</code></pre><p>How will this affect my app?</p>","19875","","","","","2012-01-28 04:17:41","What happens if the minSdkVersion is lower than the targetSdkVersion?","<android><xml><android-manifest>","3","1","10","",""
"3911286","1","3911416","","2010-10-12 02:34:39","0","291","<p>I just started working with Android apps and was trying few sample programs. I noticed an issue with the main.xml file. It happened twice today, I added few new layout views in main.xml (Using Layout and XML both), as soon as I made a modification and tried running the program, the R.java class would throw an error, also a new file called main.out.xml is getting created automatically. On top of this, when I am trying to ""clean"" the project, it deletes the R.java file altogether. Why is it acting this way?</p>","449035","","","","","2010-10-12 03:08:02","Android sample application","<android>","2","2","","",""
"3911353","1","","","2010-10-12 02:49:39","1","307","<p>every time i wanna use a event listener in android , i always meet a problem...</p><p>how to write the code? where is a sample code? how do i learn that?</p><p>now i want to write a ExpandableListView OnItemSelectedListener , </p><p>where can i find a sample?? or how to learn to write every listeners in android??</p>","422405","","","","","2012-11-06 03:50:21","android expandablelistview onitemselectedlistener","<android>","1","1","","",""
"3911411","1","","","2010-10-12 03:06:55","1","1233","<p>My problem is that I had a program working before, without threading, and it took a long time to process info (16 seconds to get XML data and display it). Now I've gotten the whole threading and async thing down, but for some reason it is making my program SLOWER (in the emulator, device is not available right now), is there anything I've done that could have caused this, the UI thread is fine, but my async thread takes a minute and a half to execute. (when I had it in the UI thread used to take only 16 seconds, but froze the UI thread)</p><p>Here is the code for my thread, it sits inside of the main class:</p><pre><code>    private class TeamSearchTask extends AsyncTask&lt;String,Void,String&gt; {    CharSequence nfo;    String [] matches;    String [] data;    String teamNum;    ProgressDialog loading;    protected void onPreExecute()    {        //Show the 'loading' dialog        loading = new ProgressDialog(SapphireAlliance.this);        loading.setMessage(""Loading, please wait..."");        loading.show();    }    protected String doInBackground(String... teamNumber)     {        try        {            //Team information ------------------------------------------------------------------------------------            teamNum = teamNumber[0];                    //Array of team data            data = APIconnection.getTeams(teamNum, """");            //Display basic team info            nfo = (""\nFormal Team Name:\n"" + data[1] +                     ""\n\nLocation:\n"" + data [3] + "", "" + data[4] + "", "" + data[5] +                    ""\n\nRookie Year:\n"" + data[6] +                    ""\n\nRobot Name:\n"" + data[7] +                    ""\n\nWebsite:\n"" + data[8] + ""\n\n\n\n\n\n\n\n\n"");             //Make match archive --------------------------------------------------------------------------------------            String [] events = APIconnection.getEventIdsByYear(year1);            ArrayList&lt;String&gt; matches = new ArrayList&lt;String&gt;();            for (int i = 0; i&lt;events.length; i++)            {                String [] add = APIconnection.getMatches2(teamNum, events[i] ,"""","""");                for(int j = 0; j&lt;add.length; j++)                    matches.add(add[j]);                        }            String [] out = new String [matches.size()];            matches.toArray(out);            return """";        }        catch(Exception e)        {            return e.toString();        }    }    protected void onPostExecute(String result) {        if(result.equals(""""))        {            info.setText(nfo);            matchArchive(matches);            //title             CharSequence ttl = ""Team "" + teamNum;            titlets.setText(ttl.toString());            loading.dismiss();        }        else         {            alert.setMessage(result);            alert.show();        }    }}</code></pre><p>Anything in there that could be causing this? :| </p>","471348","","471348","","2010-10-12 04:01:58","2011-10-06 14:35:30","Asynctask taking ridiculous amount of time","<android><android-asynctask>","2","0","","",""
"3911419","1","3913559","","2010-10-12 03:09:09","1","3988","<p>I just got started with Robotium and tried a first very simple test, but experience some problem which I can't explain / doesn't seem logic to me.</p><p>I have a TabHost with an ActivityGroup and a toggle button on each activity that's displayed in the tabhost content section. When I press the toggle button, the tab content area changes to another activity (mTabHost.setCurrentTab(Intent intent);). Every activity holds such a toggle button, always with a label ""Toggle"". When I click the toggle button on the seconds activity, it will switch back to the first (all inside the tab content area).</p><pre><code>|-----------------|| TabHost |       | |-----------------| |                 | | Toggle-Button   | |                 | | (ActivityGroup: | | Activities      | | change in here) ||                 | |-----------------|</code></pre><p>Now, manually this all works fine, but the robotium test doesn't. When I attempt to click the toggle button on the second activity, I get an error message ""junit.framework.AssertionFailedError: View can not be clicked!""</p><p>This is my test - very simple and small:</p><pre><code>    solo.sleep(5000);    solo.waitForActivity(""StartTabsActivity"", 10000);    solo.clickOnButton(""Toggle"");    // this will swap the activity inside the tabhost content section    solo.sleep(5000);    solo.waitForActivity(""StatusListActivity"", 5000);    solo.assertCurrentActivity(""Expected StatusList activity"", ""StatusListActivity"");    LogUtils.logD(""robotium: button label: "" + solo.getButton(1).getText());     // ... outputs: robotium: button label: Toggle    LogUtils.logD(""robotium: button clickable: "" + solo.getButton(1).isClickable());     // ... outputs: robotium: button clickable: true    solo.clickOnButton(""Toggle"");       // ... throws: junit.framework.AssertionFailedError: View can not be clicked!</code></pre><p><strong>What I don't understand here: I am checking that the button with ""Toggle"" label exists and is clickable, nevertheless, I'm getting an error saying ""This view cannot be clicked."". And there's only one ""Toggle"" button in the respective current activity.</strong></p><p>Related to this question I have another minor one:When I work with TabHost + ActivityGroup, will ""solo.getCurrentActivity()"" always return the embedded activity of the ActivityGroup, not the outer one? Can solo still access elements of the outer activity though?In my above case though, the toggle button is always part of the inner/embedded activity - in case that matters here.</p>","241475","","","","","2012-03-31 15:14:50","Robotium test fails with: junit.framework.AssertionFailedError: View can not be clicked!","<android><unit-testing><testing><robotium>","2","1","1","",""
"3911541","1","","","2010-10-12 03:43:37","1","911","<p>I am working on a Android application which can only run on a 3G network but We currently do not have a 3G network available in the country. Is there any way to hack/modify some parts of Android's connectivity Manager or other framework components to simulate the behavior that we are using 3G n/w but underlying the requests are being processed through Wifi? Has anyone tried anything like this? and If at all it can be done, How can it be acheived?</p>","452307","","","","","2011-03-28 22:32:29","simulate 3G n/w using wifi","<android><wifi><3g>","1","0","","",""
"3911603","1","","","2010-10-12 04:00:58","2","169","<p>Why does this crash when touched:<br><code>text_link.setText(Html.fromHtml(""&lt;a href=""HTTP://WWW.GOOGLE.COM""&gt;Test&lt;/a&gt;""));</code>  </p><p>But this works fine:<br><code>text_link.setText(Html.fromHtml(""&lt;a href=""http://www.google.com""&gt;Test&lt;/a&gt;""));</code>  </p><p>The only difference is the url in the first is UPPERCASE and the bottom is not.</p>","471060","","","","","2013-01-31 20:45:47","Uppercase url in fromHTML results in crash","<android>","1","0","","",""
"3911756","1","6196849","","2010-10-12 04:41:00","0","877","<p>I am using frame animation for displaying some images. But it's working only in a button action. I want to call this function when the program starts. How can I achieve this with out a button?</p><p>I use the following code for the animation:</p><pre class=""lang-java prettyprint-override""><code>public class FrameAnimationActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        this.setupButton();    }    private void setupButton(){        Button b = (Button)this.findViewById(R.id.startFAButtonId);        b.setOnClickListener(          new Button.OnClickListener(){            public void onClick(View v){                parentButtonClicked(v);            }          });    }    private void parentButtonClicked(View v){        animate();    }    private void animate(){        ImageView imgView = (ImageView)findViewById(R.id.imageView);        imgView.setVisibility(ImageView.VISIBLE);        imgView.setBackgroundResource(R.drawable.frame_animation);        AnimationDrawable frameAnimation = (AnimationDrawable) imgView.getBackground();        if (frameAnimation.isRunning()){            frameAnimation.stop();        }        else{            frameAnimation.stop();            frameAnimation.start();        }    }}</code></pre><pre class=""lang-xml prettyprint-override""><code>&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android"" android:oneshot=""false""&gt;    &lt;item android:drawable=""@drawable/colored-ball1"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball2"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball3"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball4"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball5"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball6"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball7"" android:duration=""50"" /&gt;    &lt;item android:drawable=""@drawable/colored-ball8"" android:duration=""50"" /&gt;&lt;/animation-list&gt;</code></pre>","461386","","603891","","2011-05-29 20:53:29","2011-06-01 05:51:41","Frame animation in Android?","<android><animation><event-handling><effects>","2","2","","",""
"3911807","1","","","2010-10-12 04:57:42","0","822","<p>I downloaded the AOSP, but I forget to specify the froyo branch, so I got the master branch.Because of this I got building error saying I need a 64bit system to build beyond Froyo (I managed to fix this by editing some makefiles, but I want to use Froyo specifically for sake of API level).</p><p>How can I switch to the froyo branch without re-downloading the whole AOSP? I tried <code>repo start froyo -all</code> and <code>repo checkout froyo</code> but I'm not sure, is this right?</p>","86169","","1108213","","2012-02-13 22:36:32","2012-02-13 22:36:32","AOSP : how to switch/downgrade to froyo branch from master?","<android><android-source>","1","0","1","",""
"3911887","1","","","2010-10-12 05:22:23","2","5469","<p>Is it possible to customize tab bar in android? Customize in the sense, like in iPhone, the tab bar is at the bottom of the screen; in Android, can we place the tab bar at the bottom and its content on top of it?</p>","357450","","1292730","","2012-05-01 12:27:11","2012-07-25 08:47:22","Custom Tab bar in Android","<android><tabbar><android-ui><navigationcontroller><tabbarcontroller>","1","1","1","",""
"3911944","1","","","2010-10-12 05:37:30","1","1261","<p>I want to display excel sheet on android screen with horizontal and vertical scrollbars..plz help me.I have searched so much on net.thanks</p>","472948","","","","","2013-12-16 19:09:58","how to display spreadsheet like table in android with horizontal and vertical scrollbars","<android>","4","0","","",""
"3911988","1","","","2010-10-12 05:46:46","-1","1700","<p>How can I implement  SIP protocol in Android?</p><p>I want to make video conferencing application using SIP protocol.</p><p>So is it feasible using SIP protocol, and how do I start?</p>","443387","","1276306","","2012-11-09 22:32:27","2012-11-09 22:32:27","SIP protocol stack in android","<java><android><sip>","2","3","","2012-11-10 10:22:06",""
"3911989","1","","","2010-10-12 05:48:07","0","1229","<p>I hope, my issue would be clear for you from my question title. I have three linear layouts in each row of the list view. One linear layout contains an Imageview and the other two linear layout contains text views. These three linear layouts comprise my list view row. But, to my surprise, the listview default selection(orange colored) does not work when I move the trackball of mouse or when I select it from the phone.</p><p>Can anyone guide me resolve this issue.</p><p>Any help is appreciated.Looking forward..</p>","264953","","","","","2010-10-12 16:19:46","Android Listview - Default Selection not working","<android><listview><android-widget>","2","0","","",""
"3912017","1","3912082","","2010-10-12 05:54:54","0","508","<p>I have a mediaplayer object inside an activity that plays from mp3 files situated in the res/raw folder. The </p><pre><code>MediaPlayer.create(Context context, int resid)</code></pre><p>method is used to create and return a mediaPlayer object to play this track.</p><p>What I have noticed is that when the activity is obscured by another activity and hence the ""onStop()"" method is called , the music continues to play. Can anyone explain why this occurs? I though that onStop would essentially freeze any actions taking place by objects associated with the activity, except for services etc</p>","467485","","","","","2010-10-12 06:08:21","OnStop() does not affect MediaPlayer","<android>","1","0","0","",""
"3912087","1","3913895","","2010-10-12 06:10:01","0","475","<p>I am been stuck , while developing an alarm based application on android.Currently my alarm is firing correctly.But i have kept a toast, to notify the alarm.</p><p>I want to use ringtone for alarm notification.</p><p>Can anyone, help me out with this.</p><p>RgdsYaaga</p>","419685","","","","","2010-10-12 10:56:57","Setting ringtone for Alarms","<android>","1","1","","",""
"3912211","1","3919774","","2010-10-12 06:43:01","1","856","<p>I am looking for an XML parsing solution for Android besides the built-in kXML pull parser. I am trying to parse a large (4MB+) XML file downloaded from a server and the kXML parser throws an OutOfMemory error after trying to allocate a 1MB+ byte array while parsing. A good streaming XML parser shouldn't be allocating such a big array!!</p><p>The kXML v2 parser being used in Android appears to be about 7 years old. I'd like to try something else to see if it fixes my problem, ideally something that implements the same org.xmlpull.v1 interface since my code is already written against it. Woodstox looks like a good choice and it has an XMLPullParser adapter but apparently the Android engineers are making it difficult to include the javax.xml.streaming libraries. I see some rather involved ""jar-jar"" workarounds but I'd rather not spend a bunch of time messing around with Ant if there is an easier way. Has anyone else already gotten another XML pull parser working and can point me to it?</p>","215266","","","","","2013-10-07 20:46:38","Alternate XML parser implementations for Android","<java><android><xml><parsing>","4","0","","",""
"3912275","1","3913870","","2010-10-12 06:54:45","0","354","<p>I have Parsed the Json Response and Now I want to use the BaseAdapter Class in my Application. I have a rough Idea about the BaseAdapter Class but not very clear about the same.</p><p>Can anybody please tell me what exactly the Base Class does.</p><p>Also do I need to use the Getter and Setter Methods if I am using the BaseAdapter Class in my Application?</p><p>Thanks,david</p>","422859","","","","","2010-10-12 10:54:17","BaseAdapter Class used with Json Parsing","<android><json><parsing>","1","0","","",""
"3912440","1","3912501","","2010-10-12 07:28:27","0","508","<p>I assume that it is possible to invoke skype or another VOIP solution by starting the appropriate activity. My question is; are there any VOIP solutions that can be used as services in some way, making it possible to write a separate app with its own user interface that just uses the VOIP functionality of the original VOIP app?</p><p><a href=""http://developer.skype.com/"" rel=""nofollow"">This question</a> is similar, but talks about hooking into the audio streams. Skype has <a href=""http://developer.skype.com/"" rel=""nofollow"">an SDK</a> but is is currently only aimed at desktop applications.</p>","128800","","","","","2011-01-24 07:44:06","Is there an Android VOIP solution (such as skype) that can be used as a service from my own activity?","<android><service><sdk><voip><skype>","2","2","","",""
"3912494","1","3925592","","2010-10-12 07:39:26","4","2352","<p>I need to pass some values to a URL by Post Method in my apllication. Please Help</p>","436765","","","","","2012-06-09 02:51:35","Doing HTTP Post with Android","<android>","2","0","2","",""
"3912523","1","3912588","","2010-10-12 07:45:38","1","391","<p>I have 2 Activities <strong>A</strong> and <strong>B</strong>. Now these are my objectives.</p><ol><li>When I'm in <strong>B</strong> and if I press the <strong>Home</strong> button, the state of the Activity should be saved. (No problem with this.)</li><li>When I start <strong>B</strong> from <strong>A</strong> after step 1 a new instance of <strong>B</strong> should be created (i.e) Previous state should be discarded.</li></ol><p>But in Step 2 the state of <strong>B</strong> still prevails. How do I accomplish my objective?</p>","421372","","","","","2010-10-12 15:17:31","Navigating through multiple activities","<android><activity><state>","3","0","","",""
"3912533","1","4004580","","2010-10-12 07:47:43","0","55","<p>How do I check whether there are any <code>AlertDialog</code>s on the screen programmatically?</p>","421372","","421372","","2013-03-15 06:34:34","2013-03-15 06:34:34","Checking for other AlertDialogs in an Activity?","<android><alertdialog>","2","2","","",""
"3912548","1","4317476","","2010-10-12 07:50:18","147","35427","<p>I can run and debug my Android app on my phone just fine, most of the time. Then, seemingly randomly, when I try to run or debug my app from Eclipse, the Console in Eclipse says:</p><pre><code>[2010-10-12 09:36:48 - myapp] Android Launch![2010-10-12 09:36:48 - myapp] adb is running normally.[2010-10-12 09:36:48 - myapp] Performing com.mycompany.myapp.MyActivity activity launch[2010-10-12 09:36:48 - myapp] Automatic Target Mode: using device 'HT01TP800561'[2010-10-12 09:36:48 - myapp] Uploading myapp.apk onto device 'HT01TP800561'[2010-10-12 09:36:48 - myapp] Failed to upload myapp.apk on device 'HT01TP800561'[2010-10-12 09:36:48 - myapp] java.io.IOException: Unable to open sync connection![2010-10-12 09:36:48 - myapp] Launch canceled!</code></pre><ul><li>Retry: doesn't help, same messages.</li><li>Restart Eclipse: doesn't help.</li><li>Restart adb (<code>adb killserver &amp;&amp; adb start-server</code>): no errors, doesn't help.</li><li>Reconnect the phone: <em>sometimes</em> helps.</li><li>Reboot the computer: kind of drastic, haven't tried this yet.</li></ul><p>Using Ubuntu 10.4, Eclipse Galileo 3.5.2, Android SDK 7, ADT plugin 0.9.6, Nexus One, Android 2.2.1.</p><p>Any bright ideas?</p>","14637","","779408","","2013-04-07 07:27:52","2013-12-05 02:37:24","Android adb ""Unable to open sync connection!""","<android><eclipse><adb><android-debug-bridge>","16","5","29","",""
"3912563","1","","","2010-10-12 07:52:09","2","2088","<p>I'm looking for a way to decode AAC natively to PCM on Android.   The decoder source code is at <a href=""http://android.git.kernel.org/?p=platform/external/opencore.git;a=tree;f=codecs_v2/audio/aac/dec;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/external/opencore.git;a=tree;f=codecs_v2/audio/aac/dec;hb=HEAD</a>, but I'm not familiar with NDK at all.</p><p>1) There's no way of doing this directly using the Android SDK, but can this be done via the NDK?</p><p>2) I would especially be interested in a simple way of accessing the decoder from SDK, with a short ""bridge"" through the NDK.  Is this feasible?</p><p>3) Would such a solution work all Android versions (1.5-2.2)?</p><p>4) I guess I could use <a href=""http://code.google.com/p/aacplayer-android/"" rel=""nofollow"">http://code.google.com/p/aacplayer-android/</a> instead, but it looks like this implementation is fairly CPU intensive.  Does anyone have experiences with this?</p>","13365","","","","","2011-09-07 18:46:50","Is the native AAC decoder available when using Android NDK?","<android><android-ndk><pcm><aac><opencore>","2","1","1","",""
"3912688","1","","","2010-10-12 08:13:59","0","8218","<p>I have an <code>ActivityA</code>, which starts <code>ActivityB</code> through Intent's <code>startActivity()</code> method.The context is as below: <br> </p><h1>A.java <br></h1><pre><code>String name = edittext.getString();  Intent i = new Intent(A.this,B.class);  Bundle b = new Bundle();  b.putString(""Name"",name);  i.putExtras(b);  startActivity(b);  </code></pre><h1>B.java</h1><pre><code>Bundle bb=getIntent().getExtras();String namee=bb.getString(""name"");</code></pre><p>In this B Activity there will be Back button which when clicked takes control back to A as below: <br></p><pre><code>     back.setOnClickListener(new OnClickListener()    {         public void onClick(View arg0) {   Intent backToDetails = new Intent(B.this,A.class);   startActivity(backToDetails);}     });</code></pre><p><br>Now control comes to <code>ActivityA</code>. When I again start <code>Activity B</code> from <code>Activity A</code> , the previous value of the name is lost .So, I again get new Value by overwrting old value in <code>Activity B</code>. So, how to save previous name value ?How to save the state of Activity B?Can any one help me in sorting out this issue? <br><br>Thanks In Advance,</p>","429501","","829188","","2012-04-12 09:42:37","2012-09-20 19:33:50","How to save state of activity while starting other activity through StartActivity() method od Intent?","<android>","1","0","","",""
"3912803","1","3913083","","2010-10-12 08:31:38","2","677","<p>I have an android application that needs to zoom an image about centre. i implemented the code<br>                      Matrix matrix = new Matrix();                      matrix.setScale(scaleWidth, scaleHeight);                      imView.setScaleType(ScaleType.MATRIX);                      imView.setImageMatrix(matrix);                     imView.invalidate(); But i get the zooming about top left of the imView(imageView). i need to make it about centre. anybody please help</p>","462695","","","","","2010-10-12 09:11:05","zooming android image about centre of the image","<android>","1","0","","",""
"3912849","1","5135929","","2010-10-12 08:39:15","35","29226","<p>I was surfing the net looking for a nice effect for turning pages on Android and there just doesn't seem to be one. Since I'm learning the platform it seemed like a nice thing to be able to do is this.</p><p>I managed to find a page here: <a href=""http://wdnuon.blogspot.com/2010/05/implementing-ibooks-page-curling-using.html"">http://wdnuon.blogspot.com/2010/05/implementing-ibooks-page-curling-using.html</a></p><pre><code>- (void)deform{  Vertex2f  vi;   // Current input vertex  Vertex3f  v1;   // First stage of the deformation  Vertex3f *vo;   // Pointer to the finished vertexCGFloat R, r, beta;  for (ushort ii = 0; ii &lt; numVertices_; ii++)  {    // Get the current input vertex.    vi    = inputMesh_[ii];                           // Radius of the circle circumscribed by vertex (vi.x, vi.y) around A on the x-y plane    R     = sqrt(vi.x * vi.x + pow(vi.y - A, 2));     // Now get the radius of the cone cross section intersected by our vertex in 3D space.    r     = R * sin(theta);                           // Angle subtended by arc |ST| on the cone cross section.    beta  = asin(vi.x / R) / sin(theta);       // *** MAGIC!!! ***v1.x  = r * sin(beta);v1.y  = R + A - r * (1 - cos(beta)) * sin(theta); v1.z  = r * (1 - cos(beta)) * cos(theta);// Apply a basic rotation transform around the y axis to rotate the curled page. // These two steps could be combined through simple substitution, but are left    // separate to keep the math simple for debugging and illustrative purposes.    vo    = &amp;outputMesh_[ii];    vo-&gt;x = (v1.x * cos(rho) - v1.z * sin(rho));    vo-&gt;y =  v1.y;    vo-&gt;z = (v1.x * sin(rho) + v1.z * cos(rho));  }  }</code></pre><p>that gives an example (above) code for iPhone but I have no idea how I would go about implementing this on android. Could any of the Math gods out there please help me out with how I would go about implementing this in Android Java.</p><p>Is it possible using the native draw APIs, would I have to use openGL? Could I mimik the behaviour somehow?</p><p>Any help would be appreciated. Thanks.</p><p><em><strong></em>**<em>*</em>****</strong><em>EDIT</em><strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>***</strong></p><p>I found a Bitmap Mesh example in the Android API demos: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/BitmapMesh.html"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/BitmapMesh.html</a></p><p>Maybe someone could help me out on an equation to simply fold the top right corner inward diagnally across the page to create a similar effect that I can later apply shadows to to gie it more depth?</p>","353674","","256324","","2011-02-17 19:49:32","2011-06-12 11:12:12","Implement page curl on android?","<android><math><transition>","3","0","33","",""
"3912935","1","","","2010-10-12 08:52:25","0","1119","<p>I am developing an application which shows the current location of the user. I want to display a marker on the current location of the user. </p><p>I have used an image as marker to display current location. But i want to display an animated arrow showing the range just like in the google maps android app. Can anyone please tell me how to achieve this. Any sample code will be of great help...</p>","303155","","245205","","2010-10-16 00:28:19","2010-10-16 00:28:19","gps marker on google maps android","<android><android-mapview>","1","0","","",""
"3913023","1","3914450","","2010-10-12 09:03:36","3","3315","<p>So, I've setup the Android LVL with my application to check for licensing. This seems to work great with the Test Accounts. The problem is, if I turn the phones internet connection off and try to run the app, the licensing check will fail and tell me it's NOT licensed!</p><p>One thing is, why does it tell me the application is NOT licensed and more importantly, how can I have the application 'remember' if it is licensed or not.</p><p>Any help would be appreciated! :)</p>","143979","","143979","","2010-10-12 12:05:14","2010-12-08 13:21:18","Android License Verification Library when offline","<android><licensing><google-play>","2","0","4","",""
"3913197","1","","","2010-10-12 09:27:31","0","616","<p><br><br>I need to run DDMS commands via java code.<br>.So is there any way to run the commands like: geo fix, etc from java code in Android.</p>","405521","","","","","2010-10-12 09:27:31","Android run DDMS command from code","<android><ddms>","0","4","","",""
"3913300","1","3913846","","2010-10-12 09:41:11","0","381","<p>I have an Activity that uses a ListView to simply display a list of options for a user to select and when they select an option they are taken to a new Activity.</p><p>However on occasion the Activity with the options freezes when I try to select one of the options, I get the ANR and in the log cat the following error is displayed: </p><pre><code>java.lang.RuntimeException: Performing pause of activity that is not resumed:&lt;Activity&gt;</code></pre><p>Does anyone know what this error means and how to diagnose it?</p><p>A search brings up very little.</p><p>Does anyone know what may be causing the error?</p><p>I can post the code on request</p><p><strong>Code as requested:</strong></p><pre><code>lvMenu.setOnItemClickListener(new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {            switch(position){            case 0:                Intent intent = new Intent(this, SettingsApp.class);                startActivity(intent);                break;            case 1:                Intent intentHO = new Intent(.this, SettingsHO.class);                startActivity(intentHO);                break;            case 2:                Intent intentWifi = new Intent(this, Settings.class);                startActivity(intentWifi);                break;            case 3:                Intent intentAudio = new Intent(this, SettingsAudio.class);                startActivity(intentAudio);                break;            case 4:                Intent intentDiagnostics = new Intent(this, PhoneStatus.class);                startActivity(intentDiagnostics);            }        }        });</code></pre>","243999","","243999","","2010-10-12 11:07:56","2010-10-12 11:07:56","Unusual Android error","<android>","1","0","","",""
"3913317","1","","","2010-10-12 09:43:49","0","947","<p>I plan to develop database application in a Android mobile ?  Is that possible to connect a SQL Server 2000 from an Android mobile, that I could add / delete / edit records from that mobile ?</p>","437782","","","","","2013-07-14 17:07:21","Connect SQL Server from Android based mobile","<android><sql-server-2000>","1","0","","",""
"3913319","1","","","2010-10-12 09:44:05","1","609","<p>i have a problem with ExpandableListView: in my app i use a ExpandableListView and i fill it with my adapter<code>""class MyExpandableListAdapter extends BaseExpandableListAdapter"".</code>In method </p><pre><code>   public View getChildView(int groupPosition, int childPosition, boolean isLastChild, view convertView, ViewGroup parent) {        if (groupPosition == 0) {            SearchView search = new SearchView(ApplicationPlaceActivity.this);            return search;        } else if (groupPosition == 1) {            MyUpdates myUp = new MyUpdates(ApplicationPlaceActivity.this);            return myUp;        }    }</code></pre><p>This code works fine, but it's not good for me because every time i create a new instance of SearchView and MyUpdate. I make <code>""SearchView search""</code> and <code>""MyUpdates myUp""</code> as global variables but this creates some issues: after a while the layout doesn't respond on touch event, or better it responds on next touch event. so i came back with the original code posted here, but this it's no good for me. any suggestion? thanks</p>","451247","","1050058","","2012-11-14 09:36:54","2012-11-14 09:36:54","Android ExpandableListView variable scope","<android><expandablelistview>","1","0","1","",""
"3913338","1","3922142","","2010-10-12 09:46:38","16","8873","<p>When I got something like this</p><pre><code>ERROR/AndroidRuntime(18677): Caused by: java.lang.NullPointerExceptionERROR/AndroidRuntime(18677):     at com.companyname.a.a.a(Unknown Source)</code></pre><p>How can I know where the problem is and debug this issue?I only got the mapping output from ProGuard and don't know the line number.Thanks.</p>","428022","","","","","2013-02-20 09:57:01","How to debug with obfuscated (with ProGuard) applications on Android?","<android><debugging><obfuscation><proguard>","3","0","6","",""
"3913379","1","3913536","","2010-10-12 09:52:46","0","835","<p>i am trying to create a basic custom dialoge view on android witha few drop down boxes and a  background image.</p><p>the issue i am having is that  for some reason, it always draws the dialogue box bigger than necesary and therefore, the background image doesnt cover the whole dialogue box.</p><p>Its best i show you a pic of what i mean:</p><p><img src=""http://i.stack.imgur.com/73Ivm.png"" alt=""alt text""></p><p>Sorry, here is my xml file related to this view:</p><p></p><pre><code>&lt;ImageButton android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/closeButton""    android:src=""@drawable/close_dialogue"" android:background=""@null""    android:layout_alignParentRight=""true"" android:layout_marginRight=""10dip"" android:layout_marginTop=""10dip""&gt;&lt;/ImageButton&gt;&lt;TextView android:layout_height=""wrap_content""    android:layout_width=""wrap_content"" android:id=""@+id/nzbNameText""    android:text=""Nzb Title"" android:layout_below=""@+id/closeButton"" android:layout_marginLeft=""10dip"" style=""@style/BoldBlackStyle""&gt;&lt;/TextView&gt;&lt;TextView android:layout_height=""wrap_content""    android:layout_below=""@+id/nzbNameText"" android:layout_width=""wrap_content""    android:text=""Catagory"" android:id=""@+id/catagoryLabel""    android:layout_marginTop=""20dip"" android:layout_marginLeft=""10dip"" android:textColor=""@color/Black""&gt;&lt;/TextView&gt;&lt;Spinner android:layout_height=""wrap_content""    android:layout_below=""@+id/catagoryLabel"" android:layout_width=""fill_parent""    android:id=""@+id/catagorySpinner"" android:layout_marginLeft=""10dip"" android:layout_marginRight=""10dip""&gt;&lt;/Spinner&gt;&lt;TextView android:layout_height=""wrap_content""    android:layout_width=""wrap_content"" android:layout_below=""@+id/catagorySpinner""    android:id=""@+id/postProcessLabel"" android:text=""Post process""    android:layout_marginTop=""10dip"" android:textColor=""@color/Black"" android:layout_marginLeft=""10dip""&gt;&lt;/TextView&gt;&lt;Spinner android:layout_height=""wrap_content""    android:layout_below=""@+id/postProcessLabel"" android:id=""@+id/postProcessSpinner""    android:layout_width=""fill_parent"" android:layout_marginRight=""10dip"" android:layout_marginLeft=""10dip""&gt;&lt;/Spinner&gt;&lt;TextView android:layout_height=""wrap_content""    android:layout_below=""@+id/postProcessSpinner"" android:layout_width=""wrap_content""    android:id=""@+id/priorityLabel"" android:text=""Priority""    android:layout_marginTop=""10dip"" android:layout_marginLeft=""10dip"" android:layout_marginRight=""10dip"" android:textColor=""@color/Black""&gt;&lt;/TextView&gt;&lt;Spinner android:layout_height=""wrap_content""    android:layout_below=""@+id/priorityLabel"" android:layout_width=""fill_parent""    android:id=""@+id/prioritySpinner"" android:layout_marginLeft=""10dip"" android:layout_marginRight=""10dip""&gt;&lt;/Spinner&gt;&lt;Button android:layout_height=""wrap_content""    android:layout_below=""@+id/prioritySpinner"" android:layout_width=""wrap_content""    android:id=""@+id/downloadButton"" android:text=""Download"" android:layout_marginLeft=""10dip"" android:layout_marginRight=""10dip""&gt;&lt;/Button&gt;</code></pre><p></p>","444668","","","","","2010-10-12 10:12:37","apply a background to a android dialogue box","<android>","1","0","1","",""
"3913490","1","3914130","","2010-10-12 10:05:42","0","1321","<p>My android application needs another NATIVE application executable to run before the android one, so that they can communicate through sockets. Android application has a JNI layer for handling the client-side communication.</p><p>Now i need to bundle up the native executable along with the apk file, so that when it is installed on a device it gets unzipped into either the phone memory or the memory card.</p><p>How do i do this? I tried keeping the native executable in res/asset and in res/raw folders, but they still don't get unzipped in /data/data/ folder.</p><p>One way I could find is to use AssetManager and then with help of InputStream and OutputStream, i can write this file onto the device the first time it is run and then use it. But there is no point to write it manually on phone memory as it might eat up the memory. ( the case where if memory card is not present. )</p><p>Can anyone help me on how can i achieve this? It would be great if there is an option to unzip the necessary files automatically at the time of installation.</p>","473184","","","","","2014-02-13 13:11:57","How to unpack some files from .apk to /data/data/<package> folder while installing the .apk?","<android><unzip>","3","0","","",""
"3913592","1","3913720","","2010-10-12 10:19:11","82","46923","<p>I'm very new on Android development.</p><p>I want to create and start an activity to show information about a game. I show that information I need a gameId.</p><p>How can I pass this game ID to the activity? The game ID is absolutely necessary so I don't want to create or start the activity if it doesn't have the ID.</p><p>It's like the activity has got only <strong>one</strong> constructor with one parameter.</p><p>How can I do that?</p><p>Thanks.</p>","68571","","","","","2013-05-16 17:18:09","Start an Activity with a parameter","<android><activity><oncreate>","2","0","19","",""
"3913655","1","3918242","","2010-10-12 10:27:54","0","364","<p>I have sprites image, which contain set of sprites. i want to pull out each sprite from grid.<img src=""http://i.stack.imgur.com/3LNp6.gif"" alt=""alt text""></p><p>I know that we have to split them through their pixels positions. But i think its not an easy task and time consuming. so is there other way or tool to get thier pixel position to retrieve images ?</p><p>Thank you ,</p><p>Srinivas</p>","414777","","","","","2011-01-26 12:58:25","How to pull out individual sprites from grid of sprites?","<android><sprites>","2","0","","",""
"3913687","1","","","2010-10-12 10:32:35","4","2076","<p>I have an Android <code>ListView</code> whose items have a checkbox.</p><p>The checkbox is checked by default. Once unchecked it should be removed from the list.</p><p>The problem is that <code>onCheckedChanged</code> is being fired twice: when I tap the checkbox to uncheck it (with <code>isChecked</code> <code>false</code>) and after I remove the item (with <code>isChecked</code> <code>true</code>).</p><p>This is the relevant code of my ArrayAdapter:</p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {    ViewHolder holder;    if (convertView == null) {        convertView = mInflater.inflate(R.layout.item, parent, false);        holder = new ViewHolder();        holder.check = (CheckBox) convertView.findViewById(R.id.check);        convertView.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    final Object item = this.getItem(position);    holder.check.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener() {        @Override        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {            if (!isChecked) {                remove(item); // This somehow calls onCheckedChanged again            }        }    });    return convertView;}</code></pre><p>What am I doing wrong?</p>","143378","","143378","","2010-10-12 10:52:07","2011-10-07 11:42:24","CheckBox changes value twice","<android><listview><checkbox><android-arrayadapter>","2","2","2","",""
"3913750","1","3919813","","2010-10-12 10:39:34","4","9834","<p>I have an ImageView on which I have applied a rotate animation. Since I want the rotation to go on continuously, I gave the repeatCount as infinite in my rotate.xml:</p><pre><code>android:repeatCount=""infinite""</code></pre><p>In onCreate(), I load the animation and start it.</p><pre><code>Animation myAnim    = AnimationUtils.loadAnimation(this, R.anim.rotate);objectImg.startAnimation(myAnim); </code></pre><p>When a button is pressed, the rotation must stop. Hence in my onClick(), I called clearAnimation().</p><pre><code>objectImg.startAnimation(myAnim); </code></pre><p>My simple question is whether stopping the animation is the right thing to do. I assume clearAnimation() corresponds to loadAnimation(), but there is no stopAnimation() that corresponds to startAnimation().</p>","454660","","496830","","2011-03-30 06:29:11","2011-03-30 06:29:11","Android: How can I stop an infinite animation applied on an ImageView?","<android><animation><imageview><infinite>","2","0","2","",""
"3913758","1","","","2010-10-12 10:40:46","3","2587","<p>Scenario: I have three buttons defined in xml </p><pre><code>&lt;button android:id=""@+id/firstbtn""     .../&gt;&lt;button android:id=""@+id/secbtn""     .../&gt;&lt;button android:id=""@+id/thirdbtn""     .../&gt;</code></pre><pre>In Java one way to  listen to them is  Button firstbtn = (Button) findViewById(R.id.firstbtn);      firstbtn.setOnClickListener(new View.OnClickListener() {              public void onClick(View v) {                  Toast.makeText(getBaseContext(),                           ""You have clicked first button"",                           Toast.LENGTH_SHORT).show();              }          });  </pre><p>for second btn , same code has to be repeated with different id ??<br>How can I make it generic enough that , it can listen to all buttons (say in for loop) and while handling I should be able to differentiate different btns. (may be get elements id)</p>","207646","","","","","2013-02-07 10:33:01","generic listener for buttons in a layout of android?","<android>","3","0","","",""
"3913792","1","","","2010-10-12 10:44:38","2","1394","<p>I have a android database and it has a column called 'name'.'Name' column can have international characters. Now when I query this database, I want to sort the name column. The sort should consider international characters while sorting. I have read that there is a UNICODE collator for android but I am not able to use it in queries. Anybody has an idea how to use UNICODE collator. Can I really use UNICODE collator for sorting ? Any pointers will be appreciated.</p>","248132","","","","","2011-03-03 22:59:08","Android sqlite: order by to sort international characters","<sorting><android><sqlite3>","1","0","3","",""
"3913808","1","","","2010-10-12 10:46:39","2","1442","<p>I'm working on a program which used the functions as title.</p><p>There's a problem that the tunctions above do not have their metrics on API website.</p><p>To avoid misunderstanding, here is an example about ""metric"" I metioned before.</p><p>Ex. size = pixel, pressure = kilogram(kg)</p><p>I have no idea about the metric at all.</p><p>Please show me where can I find the information I need.</p><p>Or, tell me under this topic.</p><p>thx again.</p>","443150","","","","","2010-10-12 11:19:30","metric of MotionEvent API getPressure, getSize","<android>","1","0","","",""
"3913842","1","3914335","","2010-10-12 10:52:09","1","611","<p>How do you discover when, in the future, the device is expected to sleep?</p><p>Or, at least, when the last user activity was?</p>","15721","","15721","","2010-10-12 11:57:16","2010-10-12 11:57:16","Determine time since last user activity in Android","<android><power-management>","1","1","","",""
"3913863","1","3914459","","2010-10-12 10:53:43","0","897","<p>i have been having this issue for some time now, and have not gotten an answer for it yet. i have this custom Cursor adapter which i use to populate a list view from an sqlite database. Now my issue is that i want to populate the listview based on certain conditions.An example is if the condition is important, the listview should display only data that fits into that criteria and so on. I already have working methods that query the database accordingly.</p><p>now my problem is that, i can't seem to populate the listviews based on those methods and conditions without:</p><p>1) creating a copy of the exact same custom cursor adapter and just changing the names variables.2) creating a copy of the exact xml layout and changing the id's.</p><p>As i say, its working this way, but i feel am having unnecessary classes and xml layout since its exactly the same thing. I know am doing something wrong, i just don't know what. Please any help and explanation would be appreciated. here is the necessary part of the code Code for the CustomCursorAdapter:</p><pre><code> public class ViewItems extends ListActivity implements OnItemClickListener{     DBAdapter adapter;     Cursor cursor;     ListView list;     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.view_list);      adapter = new DBAdapter(this);      adapter.open();      fillData();      list = (ListView)findViewById(android.R.id.list); // default android listView id      list.setOnItemClickListener(this);     }     // Different method calls     protected void fillImportantData() {      Cursor cursor = adapter.retrieveImportant();      startManagingCursor(cursor);        String[] from = new String[]{DBAdapter.NAME, DBAdapter.DATE, DBAdapter.TIME, DBAdapter.PRIORITY};        int[] to = new int[]{R.id.viewNameId, R.id.viewDateId, R.id.viewTimeId};        customCursorAdapter items = new customCursorAdapter(this, R.layout.view_items, cursor, from, to);        setListAdapter(items);        }     public class customCursorAdapter extends SimpleCursorAdapter {      private int layout;      Context context;      public customCursorAdapter(Context context, int layout, Cursor cursor, String[]from, int[] to) {       super(context, layout, cursor, from, to);       this.layout = layout;       this.context = context;      }      @Override      public void bindView(View view, Context context, Cursor cursor) {       ViewHolder holder;       if(view != null){        holder = new ViewHolder();        holder.viewName = (TextView)view.findViewById(R.id.viewNameId);        holder.viewStartDate = (TextView)view.findViewById(R.id.viewDateId);        holder.viewStartTime = (TextView)view.findViewById(R.id.viewTimeId);        view.setTag(holder);       }else{        holder = (ViewHolder)view.getTag();       }       int namecol = cursor.getColumnIndex(DBAdapter.NAME);        String name = cursor.getString(namecol);       if(holder.viewName != null){       holder.viewName.setText(name);       holder.viewName.setTextColor(Color.RED);       }       String startDate = cursor.getString(cursor.getColumnIndex(DBAdapter.DATE));       holder.viewStartDate.setText(startDate);       String startTime = cursor.getString(cursor.getColumnIndex(DBAdapter.TIME));       holder.viewStartTime.setText(startTime);      }      @Override      public View newView(Context context, Cursor cursor, ViewGroup parent) {       LayoutInflater inflater = LayoutInflater.from(context);       final View view = inflater.inflate(layout, parent, false);       return view;      }     @Override      public long getItemId(int id){       return id;      }    @Override      public Object getItem(int position){       return position;      }     }     static class ViewHolder{      TextView viewName;      TextView viewStartDate;      TextView viewStartTime;     }    }// methods in databasepublic Cursor retrieveAll(){  String[] resultColumns = new String[] {KEY_ID, NAME DATE, TIME, PRIORITY};    Cursor cursor = db.query(DATABASE_TABLE, resultColumns, null, , null, null, null);     return cursor;     }public Cursor retrieveImportant(){  String[] resultColumns = new String[] {KEY_ID, NAME DATE, TIME, PRIORITY};  String[] condition = {""important""};  Cursor cursor = db.query(DATABASE_TABLE, resultColumns, PRIORITY + ""="" + ""?"", condition, null, null, null);     return cursor;     }</code></pre>","316843","","316843","","2010-10-12 12:54:08","2010-10-12 12:54:08","Strange behaviour with custom cursor adapter android","<android>","1","0","","",""
"3913940","1","","","2010-10-12 11:03:03","1","2115","<p>I want to create a bitmap / image which has many images like ""Collage"" which has more then one images in a single picture.</p><p>I have stored all my images in a grid view but now i want to create a single image from all those images. And even i want to make few images click able </p><p>so what can be the road map to do this ? any sort of help / example will be helpful.</p><p><em><strong>reference image</em></strong> </p><p><img src=""http://i.stack.imgur.com/miwU0.png"" alt=""alt text""></p>","405383","","73488","","2010-10-12 11:37:15","2011-06-11 12:55:55","multiple images in a one single image","<android><android-widget>","2","0","2","",""
"3914022","1","","","2010-10-12 11:13:16","0","248","<p>I'm developing an Android project ,the main activity well call a method(Ptime.GetDate) which will change a global variable (output)then this activity   will print this variable </p><pre><code>public class calendar extends main_menu {</code></pre><p>int i=0;    /** Called when the activity is first created. */    @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.prayers);          final Context con = getBaseContext();</p><pre><code>          /* *************** Print ***************/       pTime.GetDate(0);       String []  str = new String [18];// = pTime.output;       for (int ii = 0; ii&lt;18; ii++)        str[ii] = pTime.output[ii];            TextView textView = (TextView) findViewById(R.id.Hdate);      textView.setText(str[0]  );     //---Button view---     Button btnOpen = (Button) findViewById(R.id.btnOpen);        btnOpen.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {             Intent i = new Intent(v.getContext(), NextDate.class);         startActivity(i);            }        });</code></pre><p>}</p><p>when the user press this button a new intenet will be crated to start nextDate activity.</p><p>NextDate.class</p><pre><code>public class NextDate  extends main_menu {</code></pre><p>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.prayers);</p><pre><code>         /* *************** Print ***************/       pTime.GetDate(0); String []  str = pTime.output;           TextView textView = (TextView) findViewById(R.id.Hdate);      textView.setText(str[0] );      TextView textView4 = (TextView) findViewById(R.id.Gdate);      textView4.setText("" wafa"" );</code></pre><p>}}</p><p>the problem is with pTime.GetDate method because it called in two activities the main activity and the subactivity</p><p>What I should do to end the main activity ? or is there any other way to make two activities call the same method  </p><p>now when I run my program , this error comes out( the application has stopped unexpectedly)!!!</p>","325296","","73488","","2010-10-12 11:36:41","2010-10-12 11:36:41","How can I call one method in two activities?","<android><class><methods><activity><call>","0","2","1","",""
"3914070","1","3915197","","2010-10-12 11:19:16","0","552","<p>Anybody please help me with some hints to draw a spot(small filled circle) on a bitmap image.  </p>","462695","","73488","","2010-10-12 11:34:49","2012-10-25 12:46:38","draw a spot in the bitmap image","<android>","1","1","","",""
"3914171","1","3964160","","2010-10-12 11:33:43","0","1660","<p>i am having the same problem described in the following post ""Android emulator reports unknown virtual device"" <a href=""http://stackoverflow.com/questions/3384070/android-emulator-reports-unknown-virtual-device"">http://stackoverflow.com/questions/3384070/android-emulator-reports-unknown-virtual-device</a> and have followed all of the instructions in an attempt to resolve but still i cannot run my AVD. </p><p>I only have one drive on my Windows 7 machine (C:) and the AVD is being created in the correct location -> <code>C:\Users\MyUser\.android</code></p><p>Ive also tried to setup an environment variable ""ANDROID_SDK_HOME""</p><p>The actual error is: </p><pre><code>emulator: ERROR: unknown virtual device name: 'my_AVD' emulator: could not find virtual device named 'my_AVD'</code></pre><p>Can someone please help me?</p>","96854","","96854","","2010-10-13 00:42:14","2012-12-06 01:16:22","Android emulator reports unknown virtual device","<eclipse><android>","3","1","","",""
"3914191","1","","","2010-10-12 11:36:42","1","1707","<p>I would like to know about the 'service discovery' mechanisms supported by android - particularly, Printer Discovery.</p><p>Does android provide such a discovery option? example : support for snmp broadcast?</p><p>I tried out an application ""PrinterShare"" link : <a href=""http://www.printeranywhere.com/mobile.sdf"" rel=""nofollow"">http://www.printeranywhere.com/mobile.sdf</a> where Printer Discovery is achieved through ipp.</p><p>Any help is appreciated.</p>","461269","","","","","2010-12-21 07:41:48","How to achieve service discovery like ""Printer Discover"" on android?","<android><printing><service><discovery>","3","0","1","",""
"3914329","1","3914662","","2010-10-12 11:50:36","9","16477","<p>I want to create a circular button having a plus and minus sign on to this and exactly used in AndroidContacts application like shown in the image as below:</p><p><img src=""http://i.stack.imgur.com/uuSMc.jpg"" alt=""alt text""></p>","457982","","457982","","2011-01-11 09:09:04","2012-10-25 08:10:33","Round button in Android","<android><layout><button><contacts>","2","0","6","",""
"3914364","1","","","2010-10-12 11:54:58","1","802","<p>i am aware of android BROADCAST_PACKAGE_REMOVED for notify when any application is uninstalling from device. </p><p>Now it is possible that when i uninstall one application and that application do some work before and uninstall.e.g: my application work with android contact if application uninstall at that time i want to change in contact data. </p><p>can i get any event for uninstalling app? </p><p>Thanks.</p>","412907","","","","","2011-02-21 09:27:08","Want to do work on my Application Uninstall:android","<android><events><uninstall>","1","0","0","",""
"3914487","1","","","2010-10-12 12:09:21","9","1621","<p>I have some java code (compiles nicely for Android) in a library project (LIB) that I want to use in an another Android project (A).</p><p>As LIB's code is unlikely to change much, I opted for adding it as a jar to A. It works fine.</p><p>I have another project that is an Android instrumentation project, testing the first Android project (B).</p><p>So what we have now is A including LIB as an external jar, and B testing A.</p><p>The problem starts when I want to access from B code written in LIB.From what I see, unless I add LIB as an external jar to B, it refuses to compile (that is, it cannot access the code in the LIB jar that is included in A).</p><p>I am reluctant to add LIB as an external jar to B because:1. It doesn't feel right, and2. When running the tests it fails with:</p><blockquote>  <p>java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation</p></blockquote><p>I found <a href=""http://stackoverflow.com/questions/2472059/cant-build-and-run-an-android-test-project-created-using-ant-create-test-projec"">Mike's question</a>, but his solution only covers compiling using an ant script, and I currently prefer to use the Eclipse IDE for this project.</p><p>Any idea how can I solve this issue?</p>","247924","","","","","2013-01-18 18:10:21","Android - Junit - Tested project uses external Jar","<android><junit><jar><instrumentation>","1","2","1","",""
"3914492","1","4570300","","2010-10-12 12:09:51","4","6175","<p>If I insert an external sd card formatted in ext2 or ext3, will it betreated as a normal sd card (FAT32)?</p><p>The device is Samsung Galaxy S (Korean) running Android 2.1I need the answer before I get the device tomorrow, because by thetime I get the device, I will not have any option to change anythingin the card.</p><p>RegardsSarwar Erfan </p>","408863","","","","","2011-03-21 09:38:57","Can I use ext2 or ext3 formatted external SD card in Android 2.1","<android>","2","1","","",""
"3914530","1","","","2010-10-12 12:15:55","0","65","<p>i have two activities each contain its own textview any one help me that when i click the one textview text the text goes to the another textview of the second activity please any on help me in this problem </p>","467591","","","","","2010-10-23 00:18:53","text of the textview sending","<android>","1","0","","",""
"3914555","1","3970177","","2010-10-12 12:18:10","0","712","<p>I have an Activity that contains a FrameLayout and two views. The first is a ViewFlipper and the second is an ImageView. If I comment out the ViewFlipper, the activity renders the ImageView and its background correctly, but when the ViewFlipper is visible, the ImageView's background is completely ignored.</p><p>Is this a ""feature"" of ViewFlipper? Is there a way I can work around this?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""       android:background=""@android:color/background_light""       &gt;            &lt;ViewFlipper android:id=""@+id/flipper""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:flipInterval=""5000""       &gt;                &lt;include layout=""@layout/cell_1"" android:id=""@+id/cell_1""/&gt;                &lt;include layout=""@layout/cell_2"" android:id=""@+id/cell_2""/&gt;                &lt;include layout=""@layout/cell_3"" android:id=""@+id/cell_3""/&gt;   &lt;/ViewFlipper&gt;    &lt;ImageView        android:background=""@drawable/alpha_gradient_background""        android:id=""@+id/statusIcon""        android:src=""@drawable/status_icon""        android:padding=""5dp""        android:layout_gravity=""right""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:top=""10dp""        android:right=""10dp""        /&gt;&lt;/FrameLayout&gt; </code></pre><p>And my background drawable looks like this:</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;stroke android:width=""3dp"" android:color=""#ffff0000"" /&gt;    &lt;gradient         android:startColor=""#66660000""         android:centerColor=""#66006600""         android:endColor=""#66000066""         android:angle=""270""     /&gt;&lt;/shape&gt;</code></pre>","193096","","","","","2010-10-19 15:48:26","Background properties on ImageView ignored when placed over ViewFlipper","<android><viewflipper>","1","0","","",""
"3914622","1","3914755","","2010-10-12 12:24:29","0","640","<p>Can anybody tell about the ""asynctask"" used in android application. Currently I am working on an application where I have to create a Class in which I have to just get the response of any particular URL given. </p><p>I this particular class I was told to perform this task by making use of ""asynctask"". I had been getting very quick responses of all my Questions from here so far and I am greatly obliged to all of them who are helping me since my first question I posted here.</p><p>I am quite new to Android Programming and feeling a bit confidence by the community's camouflage with me.</p><p>Thanks,david</p>","422859","","","","","2011-04-29 14:34:55","asynctask in Android","<android><parsing><class><response><android-asynctask>","1","1","","",""
"3914707","1","","","2010-10-12 12:33:52","2","3912","<p>Can anyone tell me how to reduce the width and height of CheckBox in order to display very small CheckBox in Android ?</p><p>Thanks In Advance,</p>","429501","","","","","2012-12-07 13:44:11","How to decrease the Width and Height of CheckBox in Android","<android><android-manifest>","3","0","","",""
"3914810","1","5281782","","2010-10-12 12:45:15","3","7935","<p>I created a custom dialog that extends Dialog.  One button on that the dialog is an “OK” button which the user is expected to press when finished entering information in other fields.  I cannot get any listeners set to that button to fire.</p><pre><code>public class HeightDialog extends Dialog {   private Button okButton;   …   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.heightdialog);      this.okButton = (Button)this.findViewById(R.id.userOkWithHeight);      this.okButton.setOnClickListener(new android.view.View.OnClickListener() {         public void onClick(View v) {            // Does not fire            HeightDialog.this.dismiss();            return;         }      });      this.okButton.setOnLongClickListener(new OnLongClickListener() {         public boolean onLongClick(View v) {            // Does not fire            HeightDialog.this.dismiss();            return true;         }      });     this.okButton.setOnTouchListener(new OnTouchListener() {        public boolean onTouch(View v, MotionEvent event) {           // Does not fire           HeightDialog.this.dismiss();           return true;        }     });   …}</code></pre><p>I also attempted an implementation where the Dialog class implemented the listeners(http://www.androidcompetencycenter.com/2009/01/android-basics-dialogs-and-floating-activities/) instead of using inner classes(http://about-android.blogspot.com/2010/02/create-custom-dialog.html):Still no luck.</p><pre><code>public class HeightDialog extends Dialog implements View.OnClickListener {   private Button okButton;   …   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.heightdialog);      this.okButton = (Button)this.findViewById(R.id.userOkWithHeight);      this.okButton.setOnClickListener(this);   public void onClick(View view){      HeightDialog.this.dismiss();      return;   }          …}</code></pre><p>I have set breakpoints inside each of the listeners in both versions of the implementation, and the debugger never stops execution.  I have attempted to use inner classes for the listeners which did not solve the problem.</p><p>Any clues?Thanks</p>","473347","","473347","","2010-10-12 13:31:24","2012-04-05 14:06:28","Button on Custom Dialog Not Responding to Click Events","<android>","4","0","1","",""
"3914860","1","","","2010-10-12 12:51:12","2","3906","<p>I Im working with a Motorola DEXT with a 1.5 api, and the application launcher icon it's not shown. When I use an emulator with a 1.6 or newer api it works just fine. Is there any additional steps to configure the icon for older apis like the 1.5 I'm working on?</p><p>Thank you very much</p>","465467","","","","","2013-11-05 20:05:21","How to set launcher application icon on Android Cellphone with 1.5 api","<android><api><icons>","2","2","","",""
"3914939","1","3915029","","2010-10-12 13:01:40","3","7852","<p>how to make content of a web page fully scaled whatever the width/height of the device visible portion is?</p>","277696","","","","","2010-10-19 08:07:25","Scaling website to 100% width/height of visible area","<iphone><android><mobile-website>","2","0","3","",""
"3915080","1","3915153","","2010-10-12 13:16:54","0","4793","<p>I have developed my first small Android application using Eclipse and managed to transfer it to my Samsung Galaxy S mobile phone.</p><p>My collegue at work has got another Android mobile phone running the same version (Android 2.1).</p><p>How can I give him my new application without him needing to install an development environment? Is this possible ?</p><p>It's an internal program so I don't want to publish it to the Android market (at least, not just yet).</p>","231181","","","","","2010-10-12 13:45:38","How can I transfer an Android application I have developed to another phone?","<android><eclipse><deployment>","1","0","","",""
"3915156","1","","","2010-10-12 13:25:22","0","3939","<p>hii .. I want to make this kind alertdialog..</p><p><a href=""http://mobile.tutsplus.com/tutorials/android/android-sdk-sending-pictures-the-easy-way/"" rel=""nofollow"">http://mobile.tutsplus.com/tutorials/android/android-sdk-sending-pictures-the-easy-way/</a></p><p>can you help find a solution???thanks before.. :D</p>","430280","","","","","2013-01-10 04:05:23","How to make list multi items(image and text) in alertdialog","<android><list><alertdialog>","2","1","","",""
"3915230","1","","","2010-10-12 13:31:54","2","2704","<p>I am using <code>PopupWindow</code> class and on <code>PopupWindow</code> I have one <code>EditText</code>, my problem is that when <code>PopupWindow</code> is visible and I click on <code>EditText</code> at that time the soft keyboard is not visible and I am not able to enter Input. Can anybody tell me how to solve this problem?</p>","446366","","313758","","2011-12-14 09:17:07","2012-04-20 21:22:12","How to show keyboard on PopupWindow?","<android><android-softkeyboard><popupwindow>","3","0","","",""
"3915255","1","4274991","","2010-10-12 13:33:53","3","8155","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2994116/load-an-swf-into-a-webview"">Load an SWF into a WebView</a>  </p></blockquote><p>I have a .swf file and I want to open it into a webview and also want to play flash games loaded there in the webview. How do I do that?</p><p><img src=""http://i.stack.imgur.com/04yhu.png"" alt=""alt text""></p><p>I am getting swf file in encoded form in webview instead of a clock.</p>","411893","","1288","","2011-03-30 15:16:25","2011-03-30 15:17:07","loading flash files (.swf) webview in android","<android><flash><webview>","1","1","3","2011-06-28 05:18:38",""
"3915360","1","3915432","","2010-10-12 13:45:02","1","2015","<p>I am very new to Android (and Java) originally a C# developer.. and am struggling with the concepts and terminology.I have been through almost all the tutorials and have decided to start on my first test app.</p><p>The first part of my app is going to involve using the gallery widget (based on the <a href=""http://developer.android.com/resources/tutorials/views/hello-gallery.html"" rel=""nofollow"">hello gallery tutorial</a>) to display a load of images. (these images will eventually come from the phones camera, but I will cross that bridge later!) My images are currently stored in the drawable folder in my project.</p><p>As a first step I want to just have the user click on an image and it pops up full screen, just so I know how to get reference to it, but I am struggling. Evetually I want the user to click an image, then a window/activity(?) will open asking them for a bit of text. This will then be store in sqllite against the image.</p><p>So far I have two classes:Class1 &amp; OpenImage. Class1 one contains the ImageAdapter class similar to the HelloGallery tutorial.. I am adding an onclick listener in the ""getView"" as follows:</p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        i.setImageResource(mImageIds[position]);        i.setLayoutParams(new Gallery.LayoutParams(150, 100));        i.setScaleType(ImageView.ScaleType.FIT_XY);        i.setBackgroundResource(mGalleryItemBackground);        i.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View view) {                                        Intent i = new Intent(Class1.this, OpenImage.class);                    startActivity(i);                    finish();                                }          });             return i;    }</code></pre><p>The part I am struggling with is opening my OpenImage and getting it to show the image.</p><p>Firstly I'm not actually sure what I need to pass and how I do it, then how I get it on the OpenImage page/activity.</p><p>I am not even sure of the terminology of what I'm trying to do so I am also finding it hard to research. Am I opening a new activity when I am opening the fullscreen image? or should it be some sort of pop up?</p><p>This seems like the simplest thing to do but I'm falling at the first hurdle.Can someone give me some guidance?</p><p>Thanks Bex</p>","390501","","","","","2010-10-12 13:52:58","Extending HelloGallery tutorial. Click on Image and pass the image to another activity/page","<android>","1","0","","",""
"3915397","1","3915517","","2010-10-12 13:48:18","0","288","<p>I have a 3 buttons, say LanguageButton, CountryButton and PinCodeButton. When LanguageButton is pressed, I must display a list of languages. Similarly for CountryButton a list of countries and so on. Only one list is to be displayed at a time.</p><p>My question is whether it is better to define a single ListView in my layout or 3 separate ListViews for each list in my layout!</p><p>I tried to use a single ListView and set corresponding adapters when different buttons are pressed, i.e in <code>onClick()</code> of languageButton, I give <code>setAdapter(languageArray);</code>But my doubt arose in implementing the <code>onItemClick()</code> of the list. Because what must be done whenfirst item is clicked in languageList is different from what must be done in countryList. Hence that would add to more code in the java file.</p><p>So I am just wondering whether I should simplify my onItemClick() code by defining separate ListViews, or should I simplify my layout and add logic to code?</p><p>Regards,Kiki</p>","454660","","","","","2010-10-12 14:01:53","Android: Using the same ListView for different lists","<android><listview><layout>","3","3","","",""
"3915425","1","3916468","","2010-10-12 13:52:20","0","3080","<p>I want to be able to assign different images to my tabs in the TabLayout control depending on whether the item is selected or not. I followed the tutorial on the Android site but they made the example with just one image and for it it works. But it doesn't work for the rest of the tabs. How can I make it work? This is my code:</p><p>The main activity:</p><pre><code>public class Main extends TabActivity {    private Resources res;    private TabHost tabHost;    private TabHost.TabSpec spec;  // Resusable TabSpec for each tab    private Intent intent;  // Reusable Intent for each tab    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // The IDs in main2 should be exactly like the current ones.        setContentView(R.layout.main2);        res = getResources(); // Resource object to get Drawables        tabHost = getTabHost();  // The activity TabHost        // Create an Intent to launch an Activity for the tab (to be reused)        intent = new Intent().setClass(this, Tab1.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_artists_grey))                      .setContent(intent);        tabHost.addTab(spec);        // Do the same for the other tabs        intent = new Intent().setClass(this, Tab2.class);        spec = tabHost.newTabSpec(""albums"").setIndicator(""Albums"",                          res.getDrawable(R.drawable.ic_tab_albums_grey))                      .setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, Tab3.class);        spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"",                          res.getDrawable(R.drawable.ic_tab_songs_grey))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(1);    }}</code></pre><p>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""        android:padding=""5dp""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>The selector for the first tab:</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>The selector for the second tab:</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_songs_grey""          android:state_selected=""true"" /&gt;    &lt;!-- When not selected, use white--&gt;    &lt;item android:drawable=""@drawable/ic_tab_songs_white""/&gt;&lt;/selector&gt;</code></pre><p>etc. My images are called ic_tab_songs_white, ic_tab_songs_grey, ic_tab_albums_white, ic_tab_albums_grey, ic_tab_artists_white, ic_tab_artists_grey.</p>","247927","","247927","","2010-10-12 13:58:19","2010-12-30 17:43:38","Android Tab Layout tutorial?","<android><select><tabs><unselect>","1","0","","",""
"3915497","1","3915532","","2010-10-12 14:00:03","1","4718","<p>I am having a customized list view in my application, which is showing an image and text.The Image I am getting from URL, using the code below:</p><pre><code>private static Drawable ImageOperations(Context ctx, String url,        String saveFilename) {    try {        InputStream is = (InputStream) fetch(url);        Drawable d = Drawable.createFromStream(is, ""src"");        return d;    } catch (MalformedURLException e) {        e.printStackTrace();        return null;    } catch (IOException e) {        e.printStackTrace();        return null;    }}public static Object fetch(String address) throws MalformedURLException,IOException {    URL url = new URL(address);    Object content = url.getContent();    return content;}</code></pre><p>all is working perfect, except the list view scrolling, its very slow. If I disable the images, the scroll speed smooth-ens , but with the image enabled, it lags alot.</p><p>Is there any possible way I can reduce or remove this lagging?</p><p>Thanks</p>","328518","","","","","2011-06-11 02:55:38","ListView scrolling lag in android","<android><image><listview><scrolling><lag>","3","0","0","",""
"3915567","1","","","2010-10-12 14:07:19","4","2027","<p>Okay, so I recently completed most of my first app for android. It's almost ready for the market, but I'd like to put in ads. I have installed and registered with AdWhirl, but I cannot figure out how to actually make ads show up, based on their instructions. I have found a few resources out there that help somewhat (such as <a href=""http://malsandroid.blogspot.com/2010/05/admob-and-adwhirl.html"" rel=""nofollow"">http://malsandroid.blogspot.com/2010/05/admob-and-adwhirl.html</a> ) but nothing that has actually let me make the ads work. I'm not sure if my inexperience is the issue or if the AdWhirl support is just that bad. </p><p>The AdWhirl support says:<br>""<br>4. In the Activity where you intend to add the ad:<br>? Import the com.adwhirl.AdWhirlLayout package<br>? Add an AdWhirl layout with a code snippet similar to below.  </p><p><code>LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);<br>AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, ""AdWhirl SDK Key"");<br>RelativeLayout.LayoutParams adWhirlLayoutParams =<br>    new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);<br>layout.addView(adWhirlLayout, adWhirlLayoutParams);<br>layout.invalidate();<br></code>""</p><p>I have added this code to my app, but I cannot get any ads to display. I DID import the package and I DID replace the ""AdWhirl SDK Key"" bit with my SDK Key so I know that is not the issue. I am wondering where this code snippet should be placed in my code and how I should modify this snippet to make ads work. Also, any insight as to what each piece of this code does (or is trying to do) would be extremely helpful. </p><p>Anyways, thanks for looking this over... I really appreciate.</p>","467151","","446006","","2011-03-01 13:03:49","2011-03-01 13:03:49","Beginning Android Programming - Adding Ads to the App","<android><adwhirl>","2","0","3","",""
"3915816","1","3916511","","2010-10-12 14:39:10","0","318","<p>I am developing an android application where I need to have an IVR type system. The person should get a call from the application and some questions will be asked and the person has to answer those questions. These answers should be saved somewhere. Is a self call possible? </p><p>If not, is there a way to play and record at the same time. I will send a long ring notification to the user and when he responds to the notification, I want to play an mp3 file as well record what user is saying. How can I do that? </p>","255650","","","","","2010-10-12 15:46:30","Is self-call possible using Android","<android><voice-recording>","1","0","","",""
"3915952","1","3916068","","2010-10-12 14:55:51","25","32269","<p>I was looking at the way Android handles orientation change for my application (I discovered that it restarts the mainactivity on orientation change. I've seen that you can override the method </p><pre><code>protected void onSaveInstanceState(Bundle outState)</code></pre><p>To save stuff, then have the in onStart. The problem is that I've my view with custom objects and a listview using a custom adapter. Everything is in a ArrayList of these objects, but I've noticed that you can't put arbitrary objects in the bundle! So how do I save the state? </p>","138606","","815724","","2013-07-16 03:42:10","2014-04-11 18:49:57","How to save state during orientation change in Android if the state is made of my classes?","<android>","4","0","13","",""
"3916075","1","","","2010-10-12 15:06:20","1","422","<p>Hi I'm engineer but more from a chip/assembler x86 level. I'm new to Android. Still figuring some general things out. I have written some apps, but have a general question. If I were to write an improved version of - let's say - TextView. Is it possible to make all app's on the system using this class, basically replace TextView? How are the java classes on the Android system, are they compiled, can I replace the library? Is this protected? Thanks for help</p>","473473","","","","","2010-10-12 15:47:36","Android system / system context / replace classes","<android>","1","0","","",""
"3916096","1","3916115","","2010-10-12 15:08:44","111","58180","<p>I am new to Android development.<br>I know if you change a android phone from portrait to landscape sometimes the app relays its self out on the screen.. so how do I simulate rotating a phone with the AVD? On the Blackberry emulators there's a button in the menu to turn the phone, but I can't find it or any option on the Android ones?  </p><p>What am I missing?</p>","390501","","213269","","2011-03-22 08:28:09","2013-09-03 11:45:35","Android AVD rotate Portrait/Landscape How?","<android><avd>","3","0","18","2014-01-21 15:54:49",""
"3916184","1","3917360","","2010-10-12 15:17:05","0","2499","<p>i want to set scandinavian keyboard as default keyboard on an android device andi want to do this by code.So i try with InputMethodManager :</p><pre><code>InputMethodManager mng = (InputMethodManager)getSystemService(LoginActivity.INPUT_METHOD_SERVICE);List&lt;InputMethodInfo&gt; m_list=mng.getInputMethodList();</code></pre><p>and i find the method setInputMethod  (IBinder  token, String  id) of the InputMethodManager class. But i don't find examples/documentation that explain me how to use it.Any suggestion? Thanks.</p>","451247","","","","","2010-10-12 17:25:10","Android set default keyboard","<android><keyboard>","1","0","","",""
"3916321","1","","","2010-10-12 15:30:08","20","68624","<p>My goal is to develop a GUI application on top of a background image with buttons in specific places on the image.  The first step is to display the background.</p><p>The image can be displayed with resources and is described in several FAQs including this one:</p><p><a href=""http://stackoverflow.com/questions/3307090/how-to-add-background-image-to-activity"">how-to-add-background-image-to-activity</a></p><p>It compiles and runs without errors, but the background is black.</p><p>Here is the main.xml 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/rootRL""                 android:orientation=""vertical""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:background=""@drawable/background""&gt;&lt;/RelativeLayout&gt;</code></pre><p>The image has been in png, 9.png, and jpg format with basenames of 'main' and 'background'.  It builds but does not display.  Making clean and recompiling does not help.</p><p>This behavior occurs on both the emulator and on hardware -- an Atmel AT91SAM9M10-G45-EK.  The SDK version is 2.0.1.</p><p>Thank you for your help.</p>","473480","","867603","","2011-12-01 13:25:55","2013-03-21 08:51:02","How to add a background image to an Android Activity?","<android>","2","0","1","",""
"3916330","1","3916700","","2010-10-12 15:30:31","25","58873","<p>I have tried the following to fit the webpage based on the device screen size.</p><pre><code>mWebview.setInitialScale(30);</code></pre><p>and then set the metadata viewport</p><pre><code>&lt;meta name=""viewport"" content=""width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"" /&gt;&lt;meta name=""viewport"" content=""width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;""/&gt;&lt;meta name=""viewport"" content=""width=device-width, target-densityDpi=medium-dpi""/&gt;</code></pre><p>But nothing works, webpage is not fixed to the device screen size.</p><p>Can anyone tell me how to get this?</p>","275845","","436938","","2011-12-07 10:28:13","2014-03-20 12:01:18","Android Webview - Webpage should fit the device screen","<android><webview><scaling><android-webview>","12","0","28","",""
"3916493","1","3948397","","2010-10-12 15:44:49","0","750","<p>i was requested to make in android a view that groups several items like checkboxes or text views in vertical rows, separated by transparent dividers while the background is with a certain alpha level and the edges are round.</p><p>I thought of two solutions and i hope for some feedback on good\bad or other solutions if you got'em.</p><ol><li>just use regualr linear layout but have a single style A that uses a 9 patch as background, includes padding,margins and whatever i need to make it look like what i want. i then create another style A.up and A.down that represents the upper most and lower most items that will use a different 9-path with round corners.</li><li>inherit from linear layout, in the onMeasure and layoutChildren add to all the children some kind of space between them, i can create new attribute for it that can be customized in a style. i can override the dispatchDraw to paint the background for each view before it draws so i can paint my round borders, my only demand will be that each View added to this layout will have to be with transparent background.</li></ol><p>So what do you think ?</p>","312288","","","","","2010-10-16 09:53:52","grouping texts plus images + round edges in android","<android><layout><android-widget><rounded-corners>","1","0","","",""
"3916506","1","3916557","","2010-10-12 15:46:09","0","415","<p>I'm very new on Android development.</p><p>I have this:</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setMessage(R.string.message_user_registered)       .setCancelable(false)       .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int id) {               Intent intent =                    new Intent(GameDescriptionActivity.this,                              GameHomeActivity.class);               Bundle extraData = new Bundle();               extraData.putInt(Constants.GAME_ID, this.gameId);               startActivity(intent);           }       });AlertDialog alert = builder.create();alert.show();</code></pre><p>But this line doesn't work:</p><pre><code>extraData.putInt(Constants.GAME_ID, this.gameId);</code></pre><p>I can't get access to <code>this.gameId</code>.</p><p>How can I fix this?</p><p>Thanks.</p>","68571","","","","","2010-10-12 15:51:11","Accessing private members inside an AlertDialog's onClick event","<android><alertdialog>","1","0","","",""
"3916616","1","","","2010-10-12 15:57:58","2","765","<p>In android, is it possible that I would create my own Map figure, and then use this Map with the gps location from Google Map API </p><p>Example, I draw a map for my own house, then apply Google Map API to be able to make the location of each point in the map</p>","471595","","","","","2010-10-12 18:25:38","Google Map API, with my own created Map figure","<android><google-maps>","1","1","1","",""
"3916699","1","","","2010-10-12 16:05:33","0","1110","<p>I'm trying to draw a map from a textfile onto a Bitmap, but the Bitmap is all black</p><p>First i load a textfile that looks like this (shortened):</p><p>0000000000 (200 width)<br>0111111110<br>0111100010<br>0000111110<br>0000111000<br>0000000000<br>(120 height)</p><p>Where ""1"" is ground and ""0"" is a wall, 1 should be white and 0 should be black.</p><p>Code:</p><pre><code>public Map(String map) {    this.map = map;    init();}public void init() {    mapArray = new int[WIDTH*HEIGHT];    String[] splitMap = map.split(""\n"");    int width = splitMap[0].length();    int height = splitMap.length;    int[] colors = new int[WIDTH * HEIGHT];    for(int y = 0; y &lt; height; y++) {        for(int x = 0; x &lt; width; x++) {            int type = Integer.valueOf(splitMap[y].charAt(x));            setType(x, y, type);            if(type == WALL) {                setColor(x, y, Color.rgb(0, 0, 0), colors);            } else if(type == GROUND) {                setColor(x, y, Color.rgb(255, 255, 255), colors);            } else if(type == GOAL) {                setColor(x, y, Color.rgb(255, 255, 255), colors);            }        }    }    bitmap = Bitmap.createBitmap(colors, WIDTH, HEIGHT, Config.ARGB_8888);}public void setColor(int x, int y, int color, int[] colors) {    for(int y1 = 0; y1 &lt; 4; y1++) {        for(int x1 = 0; x1 &lt; 4; x1++) {            colors[(x + x1) + (y + y1) * WIDTH] = color;        }    }}public void setPixel(int x, int y, int color) {    for(int y1 = 0; y1 &lt; 4; y1++) {        for(int x1 = 0; x1 &lt; 4; x1++) {            bitmap.setPixel(x + x1, y + y1, color);        }    }}public void setType(int x, int y, int type) {    for(int y1 = 0; y1 &lt; 4; y1++) {        for(int x1 = 0; x1 &lt; 4; x1++) {            mapArray[(x + x1) + (y + y1) * WIDTH] = type;        }    }}public int getType(int x, int y) {    return mapArray[x + y * WIDTH];}public void doDraw(Canvas canvas) {    canvas.drawBitmap(bitmap, 0, 0, null);}private final static int WALL = 0;private final static int GROUND = 1;private final static int GOAL = 2;private final static int WIDTH = 800;private final static int HEIGHT = 480;private int[] mapArray = null;private String map = null;public Bitmap bitmap;</code></pre>","473527","","","","","2010-10-12 21:53:22","Android Bitmap is black","<android><bitmap>","1","0","","",""
"3916740","1","3917336","","2010-10-12 16:09:44","2","1287","<p>Im doing an app which uses sqlite db file in assets folder, There is a screen in my app having a button 'check for update'.</p><p>Client has given me an URL link to update db file(which gives a sqlite file). </p><p>When user clicks on the button i need to upgrade the old db file with new db file from URL.</p><p>Please suggest me how i can do this, or give me a reference to follow</p><p>Thank you </p>","341443","","135152","","2011-05-25 03:09:39","2011-05-25 03:09:39","How to upgrade sqlite database file","<android><sqlite>","1","0","","",""
"3916809","1","","","2010-10-12 16:17:49","2","416","<p>HI All,</p><p>I m calling one webservice(SOAP) on Click of button. Web service is taking around 20 secs to get response. in the mean time i want to show progress bar.</p><p>So how can i do that?where should i code for progress bar? on button click? any source code, example would be very helpfull.</p><p>Thanks in advance.</p>","383597","","199972","","2012-06-12 21:48:31","2012-06-12 21:48:31","Android progress bar","<android><android-widget>","0","2","","",""
"3916832","1","3917196","","2010-10-12 16:20:31","1","613","<p>I'm pretty new to java programming and am looking to do basic data mappings.  I have a ListView object with a simple data array setup like this:</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.my_list_xml, MY_DATA));</code></pre><p>What I want to happen is when you click an item it goes to it's subcategory.  I'm not worried about switching the data when an item is clicked.  I'm just not sure how to create the data set in an efficient way using Android.  Eventually this will be driven by a database but I want to figure out how to use mock-data to get this working first.  An example of what I need the data structure will be is like:</p><pre><code>myData = { 'category1' =&gt;             { 'subcategory1' =&gt; 'subcategorydetail1',               'subcategory2' =&gt; 'subcategorydetail2'},           'category2' =&gt;             { 'subcategory3' =&gt; 'subcategorydetail3',               'subcategory4' =&gt; 'subcategorydetail4'}       }</code></pre><p>I'd like to be able to access it like myData['category2'] or myData['category2']['subcategory3']</p><p>Should I create this in xml files and link them up or is it best to create a new class structure for it?  </p><p>Thanks for your help!</p>","235708","","235708","","2010-11-17 21:09:51","2010-11-17 21:09:51","Need efficient data mappings example for a ListView drill down in Android/Java","<android><xml><listview><data-structures>","1","0","","",""
"3916948","1","","","2010-10-12 16:34:34","2","1548","<p>I am trying to view a web page, fron an Android app,  that requires authentication and get the following message:</p><p>----- Android webView error start --------</p><p>""You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending WWW.Authenticate header field that the Web server in not configured to accept""</p><p>HTTP Error 401.2 = Unauthorized: Access is denied due to the server configuration. Internet Information Services (IIS).</p><p>----- Android webView error end --------</p><p>On the Android side I have the following:-------  code snip start -----</p><p>public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);</p><pre><code>   // web view   webView = (WebView) findViewById(R.id.web_view);          webView.getSettings().setJavaScriptEnabled(true);          webView.setHttpAuthUsernamePassword(""123.example.com"", """", ""username"", ""password"");   // webView.setHttpAuthUsernamePassword(""123.example.com/admin.default.aspx"", """", ""username"", ""password"");   webView.loadUrl(""http://123.example.com/admin/default.aspx"");       </code></pre><p>}</p><p>------- code snip end --------</p><p>On the IIS 6.0 side</p><p>in the ""Authentication Methods"" dialog boxUncheck: ""Enable anonymous access""Check: ""Integrated Windows authentication""</p><p>When using a ""regular Browser"" if I navigate to ""http://123.example.com/admin/default.aspx"" I get a dialog box asking for username and password.Once entered I have access to the site. It is a user name/password I have set up in Windows.</p><p>However when using the above ""code snip"" I get the above ""error"", using the same username and password.</p><p>Can you please offer advise or otherwise steer me in the ""right"" direction.</p>","473583","","115145","","2010-10-12 17:59:42","2013-08-10 13:16:27","Authentication Error","<android><iis><webview><android-browser><www-authenticate>","1","1","","",""
"3916980","1","3917052","","2010-10-12 16:38:20","0","250","<p>I have Acvtivity that creates view and mediaplayer. I want to use OnCompletion event to make that view clickable. But it throws exception, I don't know why. Probably, mediaplayer runs in another thread and cannot access elements from main ui thread? Thank you for any information</p>","473587","","","","","2010-10-12 20:32:12","Android. How to make view clickable when mediaplayer stops playback","<android>","1","0","","",""
"3917076","1","3951555","","2010-10-12 16:49:49","1","5638","<p>I am using code from the <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">Google Bluetooth Chat Example</a> to set up a bluetooth listening server.  I want the app to listen always for an incoming connection.  When the app sees a connection request it will accept the connection, read in the string that the remote device will send, and then respond by sending a file.</p><p>The problem is that the app never accepts the connection.  It blocks at <code>socket = mmServerSocket.accept();</code> and never moves on.  See the code below after the line <code>if(D) System.out.println(""Waiting to connect************"");</code> To test it I start the activity that starts the thread and then attempt to connect with my laptop and send a file.  When I do this the overall Android bluetooth manager sees the file and downloads it effectively bypassing my Android device.  Is this the only way to test it?  I cant figure out if its a testing or coding problem.</p><pre><code>private class AcceptThread extends Thread {    // The local server socket    private final BluetoothServerSocket mmServerSocket;    public AcceptThread() {        BluetoothServerSocket tmp = null;        // Create a new listening server socket        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;        // Listen to the server socket if we're not connected        while (mState != STATE_CONNECTED) {            try {                // This is a blocking call and will only return on a                // successful connection or an exception                if(D) System.out.println(""Waiting to connect************"");                socket = mmServerSocket.accept();                if(D) System.out.println(""We have accepted connection and are connected***************"");            } catch (IOException e) {                Log.e(TAG, ""accept() failed"", e);                break;            }            // If a connection was accepted            if (socket != null) {                synchronized (BluetoothServer.this) {                    switch (mState) {                    case STATE_LISTEN:                    case STATE_CONNECTING:                        // Situation normal. Start the connected thread.                        connected(socket, socket.getRemoteDevice());                        break;                    case STATE_NONE:                    case STATE_CONNECTED:                        // Either not ready or already connected. Terminate new socket.                        try {                            socket.close();                        } catch (IOException e) {                            Log.e(TAG, ""Could not close unwanted socket"", e);                        }                        break;                    }                }            }        }        if (D) Log.i(TAG, ""END mAcceptThread"");    }</code></pre>","451037","","","","","2011-05-27 16:21:13","Bluetooth creates socket but blocks at connect() ANDROID","<android><sockets><bluetooth>","3","0","1","",""
"3917194","1","3917284","","2010-10-12 17:05:24","0","772","<p>Can you please tell me how can I keep the MediaRecorder keeps recording after an orientation change? I try looking into source code of  packages/apps/SoundRecorder/src/com/android/soundrecorder/Recorder.java, I don't see it handles that cases.</p><p>Thank you.</p>","286802","","","","","2010-10-12 17:15:15","How can I keep the MediaRecorder keeps recording after an orientation change","<android>","1","0","","",""
"3917288","1","","","2010-10-12 17:15:29","16","12018","<p>I am struggling with this which apparently is a very simple effect but incredibly haven't found any intutitive way for doing it in Android.</p><p>I have a ListView and I managed to customize the background images so the selected item gets highlighted by getting a new background drawable. This I do creating a new style where I set the <strong>android:listSelector</strong> attribute to point a <strong>StateListDrawable</strong> where I have specified which drawables to use for every state.</p><p>However each ListView item is a LinearLayout where i have two TextViews. My goal is to be able to change the text color of these child views whenever the parent is selected or pressed, at the same time as the background drawable does. I know there is a <strong>ColorStateList</strong> but haven't been succesful setting that up.</p><p>Has anybody succeed getting something like this to work? </p><p>Thanks.</p>","473619","","317491","","2010-10-12 17:17:49","2012-12-17 07:08:23","how to change font color in selected/focused ListView items?","<android><listview><layout>","3","1","7","",""
"3917672","1","3917693","","2010-10-12 18:08:54","0","895","<p>I am trying to read a csv file from assets/file.csv, but the log keeps spitting out that it doesn't exist.  Is my path correct for internal file storage?  This is the class file:</p><pre><code>package com.xxx.view;import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import java.io.IOException;import java.util.StringTokenizer;public class ReadList {    public String[][] mainMenuList() throws IOException {        String [][] arrayList = new String [24][24];        File file = new File(""/data/data/com.xxx.view/file.csv"");        BufferedReader bufRdr  = new BufferedReader(new FileReader(file));        String line = null;        int row = 0;        int col = 0;        while((line = bufRdr.readLine()) != null &amp;&amp; row &lt; 24) {             StringTokenizer st = new StringTokenizer(line,"","");            while (st.hasMoreTokens()) {                arrayList[row][col] = st.nextToken();                col++;            }            col = 0;            row++;        }        return arrayList;    }}</code></pre>","375566","","","","","2010-10-12 18:12:34","Android 1.6 SDK - Internal File Path Issue","<java><android>","1","0","","",""
"3917811","1","","","2010-10-12 18:30:22","0","723","<p>I have a buffer of raw audio coming from AudioRecord and I want to convert it to mp3 or any other format for emailing it.</p><p>any ideas?</p>","102092","","","","","2010-10-12 20:53:14","Ecoding raw audio to mp3/ogg","<java><android>","2","1","","",""
"3917816","1","3919173","","2010-10-12 18:30:41","1","834","<p>I'm having a problem with my ListView in a ListActivity with a Custom ArrayAdapter.</p><p>When the ListActivity becomes hidden (paused, whatever), the data that was present in the ArrayAdpater seems to go away.  Rotation works fine, but I am only assigning the array in the ArrayAdapter in the onCreate(), nowhere else.  The array is stored in a global static so the array itself should be fine.  but the ListView seems to be pitching the array somewhere after the onCreate in the Activity Lifecycle.</p><p>I'm thinking the array should be re-assigned on one of the onResume(), onStart() or onRestart(), but I'm looking for a more concrete reason as this happens only rarely and never with my Cursor based Adapters.</p>","473677","","","","","2010-10-12 21:29:22","ListActivity/ListView content is ""disappearing""","<android><listactivity><android-arrayadapter>","1","2","1","",""
"3917845","1","","","2010-10-12 18:35:07","3","691","<p>I have a custom title bar that I would like to apply to all my activities. I have searched online and found a few ways of doing that however I have ran into a problem.</p><p>It seems that despite the fact I have a TextView in my titlebar with id @android:/title, Android will not use the value defined in the manifest in android:label for each activity.</p><p>I tried also calling setTitle(R.string.myTitle) but it still will not render it! If I manually put some text in my TextView in the xml it shows up fine.</p><p>How can I have a custom title bar that is linked and makes Android use my manifest values for labels? I do not want to lose the setTitle() or the XML attributes functionality.</p><p>Thanks.</p>","254638","","","","","2010-10-12 21:39:37","Android custom title bar, does not work with android:label from manifest","<java><android><layout>","2","0","","",""
"3917870","1","","","2010-10-12 18:38:05","0","526","<p>Often when I open my Android app from either my Home screen shortcut or from the apps menu it restarts the main activity.</p><p>How can I prevent this behavior and make it bring the existing instance to the foreground if there is one running?</p><p>I've searched quite a bit to no avail. It would seem as though most others are not having this problem?</p><p>Thanks!</p>","467627","","","","","2010-10-12 18:45:18","Android app activity always restarts","<android>","1","1","","",""
"3918023","1","3918571","","2010-10-12 18:54:20","0","1535","<p>There is an online stream that is 512Kb MPEG4 and total size of 312mb online and if I'm correct after looking over docs in order to play the movie I just simply put:</p><pre><code>MediaPlayer mp = new MediaPlayer();Try{  mp.setDataSource(""http://site.com/movie.mp4"");}Try {  mp.prepare();}mp.start();</code></pre><p>It is triggered to play after a button press which after a few seconds after pressing the button it plays the audio BUT doesn't show the video, why not?  Do I have to use a surface view or something for visual playback of the stream (the android docs don't seem to help me much)?</p>","152986","","","","","2012-01-05 11:58:14","Video stream (MPEG4 video) not showing on android using MediaPlayer?","<android><video-streaming>","1","2","1","",""
"3918034","1","3918579","","2010-10-12 18:55:14","2","1119","<p>I'm trying to save a sound as a ringtone in Android using <a href=""http://www.stealthcopter.com/blog/2010/01/android-saving-a-sound-file-to-sd-from-resource-and-setting-as-ringtone/"" rel=""nofollow"">this</a> code. It works like a charm but will fail if I try to save a ringtone that has already been inserted.</p><p>A ""SQLiteConstraintException"" occurs while saving but I'm not able to catch the exception, in fact, I can't catch <em>any</em> execption.</p><p>Here's the part of my code:</p><pre><code>Uri uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath());try {  this.getContentResolver().insert(uri, values);} catch (SQLiteConstraintException e) {  Log.e(""error"", e.getMessage());} catch (SQLiteException e) {  Log.e(""error"", e.getMessage());} catch (Exception e) {  Log.e(""error"", e.getMessage());}</code></pre><p>So I'm trying to actually catch any possible exception, but <em>none</em> is caught.</p><p>This is the LogCat:</p><pre><code>10-12 18:32:51.627: ERROR/Database(217): Error inserting album_id=-1 title=Applause is_notification=true title_key=%,%J%J%B%,%T%P%4% mime_type=audio/ogg date_added=1286908371 _display_name=Applause.ogg is_alarm=true is_ringtone=true artist_id=1 is_music=false _data=/mnt/sdcard/media/audio/ringtones/Applause.ogg10-12 18:32:51.627: ERROR/Database(217): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed10-12 18:32:51.627: ERROR/Database(217):     at android.database.sqlite.SQLiteStatement.native_execute(Native Method)10-12 18:32:51.627: ERROR/Database(217):     at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:55)10-12 18:32:51.627: ERROR/Database(217):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1549)10-12 18:32:51.627: ERROR/Database(217):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)10-12 18:32:51.627: ERROR/Database(217):     at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1813)10-12 18:32:51.627: ERROR/Database(217):     at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1638)10-12 18:32:51.627: ERROR/Database(217):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)10-12 18:32:51.627: ERROR/Database(217):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:146)10-12 18:32:51.627: ERROR/Database(217):     at android.os.Binder.execTransact(Binder.java:288)10-12 18:32:51.627: ERROR/Database(217):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>I found a workaround: I check if the soundfile exists before I call the .insert-method (and don't call it, if the file's already there), but I'd really like to understand why no exception is caught. Hope anybody can help me out.</p><p>Kind regards,Select0r</p>","255905","","","","","2011-11-19 07:13:43","Android: save sound as ringtone / SQLiteConstraintException","<android><exception><sqlite><ringtone>","2","1","","",""
"3918083","1","3918116","","2010-10-12 19:01:19","38","27757","<p>I Googled this and read the Java documentation, but I'm a bit confused. Can somebody please explain what a <code>Context</code> is in plain English? </p>","413414","","3937","","2010-10-12 19:17:49","2013-05-27 06:56:46","What exactly is a Context in Java?","<java><android>","6","7","21","2013-07-23 14:53:36",""
"3918141","1","3918354","","2010-10-12 19:08:58","1","344","<p>I am writing a slide-show like application for android phone which I am going to sell. it will target very narrow audience and I do not think I will sell more than 1000 copies of it. I was going to buy pictures for it from microstock agencies like istockphoto but it turned out that they require purchase of ""extended license"" if you want to put their images into apps. And guess what? extended license runs from $70-100 per image!</p><p>so my question for you, where did you get images for your apps you want to sell?</p>","473725","","168868","","2012-04-12 00:04:00","2012-05-11 02:52:46","what is the best source to buy pictures for mobile applications","<android><image><mobile>","2","0","","",""
"3918316","1","","","2010-10-12 19:31:13","2","2352","<p>What I'm trying to do is to show some data for a book like Title, Author, and a Cover, and beneath these data, to have a ListView containing a list of clickable chapters.</p><p>One way I've thought would be to have a ListView with different type of cells, where the first would contain the data, and the rest of them would be simple cells containing the chapters. The ListView binds to a custom CursorAdapter that implements the newView(...) and bindView(...) methods, which I don't know how to customise in order to return different types of cells based on the cell's position.</p><pre><code>@Overridepublic void bindView(View view, Context context, Cursor cursor) {    TextView title = (TextView) view.findViewById(R.id.title);    title.setText(cursor.getString(cursor.getColumnIndex(Constants.TITLE)));    ..}@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    LayoutInflater inflater = LayoutInflater.from(context);    View v = inflater.inflate(R.layout.bookcell, parent, false);    bindView(v, context, cursor);    return v;}</code></pre><p>How should I do that?</p><p>Thanks!</p>","473744","","","","","2010-10-12 20:59:57","Multiple Cell Types in Android ListView","<android><listview>","1","0","","",""
"3918325","1","4044605","","2010-10-12 19:33:06","4","6476","<p>I'm saving a sound from my app to be used as a ringtone or a notification sound. Here's part of my code, taken from <a href=""http://www.stealthcopter.com/blog/2010/01/android-saving-a-sound-file-to-sd-from-resource-and-setting-as-ringtone/"" rel=""nofollow"">this</a> page:</p><pre><code>ContentValues values = new ContentValues();values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());values.put(MediaStore.MediaColumns.TITLE, soundName);values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");values.put(MediaStore.Audio.Media.ARTIST, ""artist"");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);Uri uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath());this.getContentResolver().insert(uri, values);</code></pre><p>My understanding is that the sound will be saved as well as a ringtone, a notification sound and an alarm, as the flags are all set to ""true"". At least on the emulator this does work but on the actual device, the sound only shows up in the ringtone list, and I have no idea why.</p><p>EDIT: I've tried to investigate further: removing the line with ""IS_RINGTONE"" won't change anything (in case only one flag can be used at a time), the sound doesn't show up in the list with the notification-sounds.</p><p>Any help is appreciated.</p><p>Kind regards, Select0r</p>","255905","","255905","","2010-10-28 15:45:16","2011-10-17 20:04:34","Android: save sound as ringtone and notification","<android><audio><notifications><ringtone>","3","1","2","",""
"3918363","1","","","2010-10-12 19:40:38","0","439","<p>I would like to be able to detect when a user types a key in the Search Dialog. I plan on using this to hook in to custom suggestion functionality.</p><p>Note: The built-in Search Manager custom suggestions functionality won't work for me because I need to customize the layout of the suggestions.</p>","473753","","","","","2014-03-02 18:34:08","Is it possible to listen to Search Dialog UI Events?","<android><search>","1","0","","",""
"3918452","1","3919003","","2010-10-12 19:50:34","0","352","<p>I am creating an extension of ItemizedOverlay. When a user taps a pin on the map (onTap) I want to display a RelativeLayout, which is included in the same .xml file as the map. When the RelativeLayout is visable, it covers the map. </p><p>Since this view is the context for the main class, I do not know how to access the view (DetailLayout) from within the onTap() call.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainlayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/mapview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:clickable=""true""        android:apiKey=""MY KEY HERE""    /&gt;        &lt;RelativeLayout         android:id=""@+id/DetailLayout""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""          android:gravity=""left""        xmlns:android=""http://schemas.android.com/apk/res/android""&gt;            &lt;LinearLayout                android:id=""@+id/DetailCloseButtonLayout""                android:layout_width=""fill_parent""                 android:layout_height=""36dp""                 android:gravity=""center_vertical|right""                xmlns:android=""http://schemas.android.com/apk/res/android""&gt;                &lt;Button                           android:id=""@+id/DetailCloseButton""                         android:background=""@drawable/close""                      android:layout_width=""15dp""                            android:layout_height=""15dp""                    android:layout_marginRight=""10dp""                     android:gravity=""center_vertical""&gt;                &lt;/Button&gt;            &lt;/LinearLayout&gt;            &lt;TextView                 android:text=""Detail Here. Detail Here.""                 android:id=""@+id/DetailTextView""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_below=""@id/DetailCloseButtonLayout""&gt;            &lt;/TextView&gt;    &lt;/RelativeLayout&gt;       </code></pre><p></p>","300129","","","","","2010-10-12 21:02:13","Accessing an Android View from extended ItemizedOverlay?","<android><google-maps>","1","0","","",""
"3918473","1","","","2010-10-12 19:54:14","1","3200","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3808167/android-sdk-manager-gives-failed-to-fetch-url-https-dl-ssl-google-com-android"">Android SDK Manager gives &ldquo;Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml&rdquo; error when selecting repository</a>  </p></blockquote><p>In trying to set up the Android SDK, I can't seem to get connected to the repository. With the proxy set correctly, and https forced to http, I get this error:</p><p><strong>Failed to fetch URL <a href=""http://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">http://dl-ssl.google.com/android/repository/repository.xml</a>, reason: Connection reset</strong>. </p><p>Without the proxy set, I get the same result, except it says the connection has timed out.</p><p>Anything I'm missing here?</p>","473759","","","","","2011-03-30 12:25:23","setting up Android SDK - get the ""Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml"" error no matter what","<android><connection><repository>","1","0","","2011-09-22 22:23:53",""
"3918517","1","3918838","","2010-10-12 20:00:23","51","32768","<p>I have implemented a <code>ListView</code> in my Android application.  I bind to this <code>ListView</code> using a custom subclass of the <code>ArrayAdapter</code> class.  Inside the overridden <code>ArrayAdapter.getView(...)</code> method, I assign an <code>OnClickListener</code>.  In the <code>onClick</code> method of the <code>OnClickListener</code>, I want to launch a new activity.  I get the exception:</p><pre><code>Calling startActivity() from outside of an Activity  context requires the  FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</code></pre><p>How can I get the <code>Context</code> that the <code>ListView</code>(the current <code>Activity</code>) is working under?</p>","226376","","493939","","2012-11-25 08:40:29","2014-02-25 15:19:42","Calling startActivity() from outside of an Activity context","<android><android-activity><android-context>","4","1","14","",""
"3918738","1","3919308","","2010-10-12 20:28:25","0","337","<p>I have an app on the market that is for rooted devices only. I have tested the app extensively on a rooted and unrooted G1, MT3G and Cliq with no errors. I am receiving a number of low ratings from people with supposedly rooted devices, saying that the app tells them that they are not rooted (of course, they usually don't leave important info like what phone and what rom)</p><p>Here is the code that generates the error... can anyone see out what the problem might be?</p><pre><code>final Button button = (Button) findViewById(R.id.******);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                String command1 = ""mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system"";                String command2 = ""cp -f /sdcard/******* /etc/"";                String command3 = ""dos2unix -u /etc/*****"";                String command4 = ""mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system"";                execCommandLine1(command1);                execCommandLine1(command2);                execCommandLine1(command3);                execCommandLine1(command4);}void execCommandLine1(String command)    {        Runtime runtime = Runtime.getRuntime();        Process proc = null;        OutputStreamWriter osw = null;        try        {            proc = runtime.exec(""su"");            osw = new OutputStreamWriter(proc.getOutputStream());            osw.write(command);            osw.flush();            osw.close();        }        catch (IOException ex)        {            Log.e(""execCommandLine()"", ""Command resulted in an IO Exception: "" + command);            return;        }        finally        {            if (osw != null)            {                try                {                    osw.close();                }                catch (IOException e){}            }        }        try         {            proc.waitFor();        }        catch (InterruptedException e){}        if (proc.exitValue() != 0)        {            **// Error Dialog that is being erroneously displayed**        }        else {               // Success Dialog        }    }</code></pre>","473799","","473799","","2010-10-12 20:55:27","2010-10-12 21:49:05","Android: App not working on some rooted devices... Why?","<android>","1","4","","",""
"3918750","1","","","2010-10-12 20:29:32","1","884","<p>The footprints and clock app on a HTC sense phones use a slider control on the bottom buttonbar (see this movie for an example: <a href=""https://docs.google.com/leaf?id=0B9hmEy_z2CRzOTJmYTVlNDktYjkwMS00YTM5LTk3ODQtYmIzODU4Yzk1YjA0&amp;hl=en&amp;authkey=CMWwwegG"" rel=""nofollow"">https://docs.google.com/leaf?id=0B9hmEy_z2CRzOTJmYTVlNDktYjkwMS00YTM5LTk3ODQtYmIzODU4Yzk1YjA0&amp;hl=en&amp;authkey=CMWwwegG</a>). </p><p>From the hierarchy viewer I can see that they use a custom control for this. I'm looking for a way to achieve the same effect. I want a buttonbar on the bottom of my app with a movable selector which I can drag from left to right and back, thereby selecting the different tabs.</p><p>Can anyone give some tips on how I might achieve this? Which layout controls could I use for this purpose? I know how to create the tabs and the button bar, but I'm a bit puzzled on the sliding selector.</p><p>Thanks and kind regards,Ivo</p>","473800","","","","","2010-10-13 12:46:11","how to create a buttonbar with a sliding control in android?","<android><htcsense><buttonbar>","2","0","","",""
"3918807","1","","","2010-10-12 20:35:55","0","190","<p>I want to build an Android widget that will update very frequently (5 seconds). This means, I want to only update it when the screen is on and when the home screen is the active Activity.</p><p>How do I get a list of home apps (or apps that respond to <code>&lt;category android:name=""android.intent.category.HOME""/&gt;</code>)</p><p>In the android API, can I use <code>Intent.createChooser(Intent target, CharSequence title)</code> and somehow get the list or do I have to get all activities, retrieve their Intents and use <code>hasCategory(String category)</code> on every Intent.</p><p>Thanks!</p>","398148","","","","","2010-10-13 00:05:22","All packages that respond to a certain category on Android?","<android><android-widget><android-intent><android-manifest><category>","2","1","1","",""
"3918810","1","3918872","","2010-10-12 20:36:10","1","2128","<p>my problem is a simple one.  i want to play a looping sound only when a button is pressed.  the following are the switch statement and if else approaches i've tried. at best, i can play the sound but it won't pause when the button is no longer pressed.</p><pre><code>    public boolean onTouch(View v, MotionEvent event) { MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.clash); if (v.getId() == R.id.clash &amp;&amp; event.getAction() == MotionEvent.ACTION_DOWN){  mp.setLooping(true);  mp.start(); }else if (v.getId() == R.id.clash &amp;&amp; event.getAction() == MotionEvent.ACTION_UP) {mp.pause(); }}    public boolean onTouch(View v, MotionEvent event) {    MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.clash);     switch (event.getAction()){     case MotionEvent.ACTION_DOWN:      mp.setLooping(true);      mp.start();     case MotionEvent.ACTION_UP:      mp.pause();    }    return false;   }</code></pre>","2451972","","390989","","2010-10-12 20:41:02","2011-10-21 12:27:45","playing a looping sound when button is pressed in android","<android><ontouchlistener>","2","0","","",""
"3918850","1","","","2010-10-12 20:42:20","1","447","<p>I developed an Android application that uses many services, including GPS and orientation (compass). The genre of the application is AR (augmented reality) and I'm moving image views around the screen in real-time depending on the phone orientation. However, after a while, the phone freezes for a second and then reboots (Motorola Droid). I'm unable to find any useful log about this event. The log in the Eclipse is cleared after the phone reboots; I use ""adb logcat"" command to write the log to a file on my PC. The last meaningful rows of information are:</p><pre><code>I/ActivityManager( 1272): Displayed activity com.zlatko/.Main: 2656 ms (total 2656 ms)D/CameraHal( 1050): Zoom callback param1: 65536, param2: 1D/CameraHal( 1050): processZoom/1:0. stopped=1D/CameraHal( 1050): Stored Zoom Data/0/1:0D/dalvikvm( 1272): GC freed 8444 objects / 453552 bytes in 268msD/dalvikvm( 1656): GC freed 13158 objects / 456056 bytes in 257msD/dalvikvm( 1656): GC freed 23844 objects / 787840 bytes in 98msD/dalvikvm( 1656): GC freed 22942 objects / 756408 bytes in 94ms</code></pre><p>How can I find the reason for this frustrating behavior? The logs don't offer insight, there are no explicit exceptions thrown, the system is indeterminate (that means, I cannot conclude at what point in time exactly the phone reboots)...</p><p>Any recommendation?</p><p>Thanks,Zlatko</p>","473815","","","","","2010-10-15 20:20:12","Android phone reboots while executing my own developed application","<android><gps><orientation><phone>","1","8","","",""
"3918891","1","","","2010-10-12 20:47:13","0","216","<p>Just a quick question. I've created a custom ExpandableListAdapter, both the parent and child have it's own XML layout file. But it's lost the highlight option when you select it (obviously it still selects the row). What option do I need to set to make it highlight like the standard layout would.</p><p>Thanks!</p>","326468","","","","","2011-02-15 09:39:03","Highlight child in custom ExapandableListAdapter- Android","<android><highlight><expandablelistadapter>","1","0","","",""
"3918945","1","3919149","","2010-10-12 20:53:59","0","585","<p>I don't understand what's going on here.I have a ListPreference with the entries and entryValues correctly set.</p><p>When I go in the prefernces activity and change the value it successfully works (I added a Toast to output the value after changing the option to test).</p><p>But when I do the following to compare it, it always executes the else statment when I change it everytime, even like above when I changed the ListPreference and the value was ""bluesky"" it still failed to execute the correct if statement.</p><p>Here's the code I use to check the value of the ListPreference in the onResume():</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this)String backgroundPref = prefs.getString(""backgroundPref"", """");  if(backgroundPref == ""bluesky""){    mainLayout.setBackgroundResource(R.drawable.bluesky);     Toast.makeText(getBaseContext(), ""Blue Sky"", Toast.LENGTH_SHORT).show();  }else if(backgroundPref == ""sky""){    mainLayout.setBackgroundResource(R.drawable.sky);       Toast.makeText(getBaseContext(), ""Sky"", Toast.LENGTH_SHORT).show();  }else{    mainLayout.setBackgroundResource(R.drawable.sunsetscene);    Toast.makeText(getBaseContext(), ""Sunset Scene"", Toast.LENGTH_SHORT).show();  }</code></pre><p>The Toasts are there so I can double check which statement gets executed, and it always seems to be the else one.</p><p>Am I having a bad day and getting something wrong?</p>","427234","","","","","2010-10-12 21:24:30","Android Development: ListPreference Trouble","<android><string><list><listpreference>","1","0","","",""
"3919071","1","3929312","","2010-10-12 21:14:19","3","1891","<p>I have an android app I want to connect to a Google App Engine based server.  I can get the auth token from the AccountManager.  It seems the next thing I am supposed to do is talk to an auth page to get a cookie.  Following the awesome instructions here: <a href=""http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app"" rel=""nofollow"">http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app</a>I think my url should be:</p><pre><code>https://MYAPP.appspot.com/_ah/login?continue=http://localhost/&amp;auth=CrAZYl000ngToken</code></pre><p>but rather than a redirect, I get a 500 server error:</p><pre><code>Error: Server ErrorThe server encountered an error and could not complete your request.If the problem persists, please report your problem and mention this error message and the query that caused it.</code></pre><p>What's up with that?  What is the URL I am supposed to be going to?  Or maybe I'm doing something else wrong?</p>","209131","","","","","2010-10-14 01:05:25","What is the proper URL to get an Auth Cookie from a GAE based Application","<android><google-app-engine><authentication><cookies><token>","1","1","4","",""
"3919089","1","3919414","","2010-10-12 21:16:52","5","5728","<p>There are a lot of Android SDK APIs where callback handlers are registered.  For a concrete example, with MediaPlayer you can set an onCompletionListener callback.  Will these callbacks be called from the main (UI) thread?  If the answer is ""it depends"", then I'm looking for some general rules for what callbacks will be called from the main thread versus another thread.  The SDK documentation doesn't seem to spell it out.  (Maybe I missed it.)</p><p>It seems important to know, because if I'm guaranteed main thread callbacks, then I can skip some thread synchronization on data shared between different places in code.  If I'm forced to be pessimistic out of ignorance, then I have to write extra synch block code and worry about deadlocks, data integrity, and reduced performance.</p>","284013","","","","","2012-09-01 15:59:21","Do callbacks occur on the main (UI) thread?","<android>","5","0","2","",""
"3919166","1","","","2010-10-12 21:27:13","0","802","<p>I'm experimenting with the Android platform, and I'm beginning to love it, but right now I'm stuck, at this cursor/list adapter problem-thing.The thing is, that I request a function, returning a data object, with several properties I'd like to map to different TextView's.</p><p>My <strong>list_item.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=""fill_parent""&gt;    &lt;TextView android:id=""@+id/schedule_item_text""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""10dp""        android:textSize=""16sp"" /&gt;    &lt;TableRow android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:stretchColumns=""1""&gt;        &lt;TableRow&gt;            &lt;TextView android:layout_column=""1"" android:text=""teacher"" android:padding=""3dip""/&gt;            &lt;TextView android:gravity=""right"" android:text=""Test"" android:padding=""3dip"" /&gt;        &lt;/TableRow&gt;    &lt;/TableRow&gt;&lt;/LinearLayout&gt;</code></pre><p>So what I would like to do is: Map a property of an array of objects to several fields in the file. How? Help?</p>","75267","","","","","2010-10-12 21:59:06","ListAdapter / Cursor, Android. Custom Layout problem","<java><android><xml>","1","0","","",""
"3919258","1","","","2010-10-12 21:38:29","4","3110","<p>How can I detect if a device is equipped with the ""PVPlayer"" components or ""AwesomePlayer"" components?</p><p>I noticed that the Droid X, despite being on Android 2.2, still uses the PVPlayer component rather than AwesomePlayer. in other words, the Droid X has difficulty playing certain types of media.</p><p>Let me know if you need any clarification.</p><p>Thanks!</p>","467627","","","","","2011-01-25 15:53:57","Android: Detect if PVPlayer or AwesomePlayer?","<android>","1","0","4","",""
"3919370","1","3921493","","2010-10-12 21:56:47","0","1150","<p>I was seeing some application and saw this application i was wondering how they created this horizontal navigation menu for their android application. </p><p><img src=""http://i.stack.imgur.com/18Q2X.jpg"" alt=""alt text""></p><p>So what is this horizontal navigation called in android?? and can any one point me to any resource which has some sample example for creating 1 for android?</p><p>Thanks</p>","443694","","","","","2010-10-13 07:13:22","What is this called and how can i create something similar in android?","<android><android-widget>","4","0","2","",""
"3919407","1","3919523","","2010-10-12 22:01:56","0","305","<p>Here is what I am trying to do.</p><p>From my Android App code I do an HTTP POST which is as below</p><pre><code>HttpPost httppost = new HttpPost(""http://xyz.com/Retrieve.php"");</code></pre><p>The PHP code is supposed to send back an image and an URL.</p><pre><code>$q=mysql_query(""SELECT image, url FROM testblob WHERE id = 'id[0]'"");list($data) = mysql_fetch_row($q);echo $data;</code></pre><p>Now in my Android code I do the following and the image is retrieved perfect from the response but how do I retrieve the URL as well.</p><pre><code>httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));response = httpclient.execute(httppost);HttpEntity entity = response.getEntity();InputStream is = entity.getContent();</code></pre><p>I retrieve the image as below and this part works.</p><pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();byte[] buf = new byte[1024];int n = 0;while ((n=is.read(buf))&gt;=0)    {    baos.write(buf, 0, n);    }    is.close();    byte[] bytes = baos.toByteArray();    Bitmap bitmap2 = null;    bitmap2 = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);</code></pre><p>So I would like to know if both the image and the url is received in the InputStream is object and if yes how do I retrieve the URL out of it?</p><p>Thanks for all the help.</p>","447886","","","","","2010-10-13 03:14:20","How do I retrieve two field values received from an HTTP POST to PHP?","<java><php><android>","3","3","","",""
"3919477","1","7966018","","2010-10-12 22:12:57","1","1132","<p>I have installed the plugin many times before, but this time I keep getting this error:</p><p><img src=""http://imgur.com/NkS4y.png"" alt=""Install has encountered a problem""></p><blockquote>  <p>'Install' has encountered a problem</p>    <p>An error occurred while installing the items</p></blockquote><p>Eclipse has some memory issues when running on my machine, so I just want to install the bare minimum plugins, etc.</p><p>Has anyone got any ideas how to get around this error?</p><p><strong>SOLVED</strong></p><p>I had the wrong version of Eclipse installed. I just installed the version from the Ubuntu software center and it didn't work, do I uninstalled it and downloaded the Java EE version from Eclipse's website and now it works.</p>","348261","","348261","","2010-10-13 11:20:06","2012-09-23 08:00:26","Error installing ADT plugin in Eclipse on Ubuntu 10.04","<android><eclipse><plugins><adt>","2","4","1","",""
"3919512","1","","","2010-10-12 22:20:35","10","3893","<p>As part of my Android app, I'd like to upload bitmaps to be remotely stored.  I have simple HTTP GET and POST communication working perfectly, but documentation on how to do a multipart POST seems to be as rare as unicorns.</p><p>Furthermore, I'd like to transmit the image directly from memory, instead of working with a file.  In the example code below, I'm getting a byte array from a file to be used later on with HttpClient and MultipartEntity.  </p><pre><code>    File input = new File(""climb.jpg"");    byte[] data = new byte[(int)input.length()];    FileInputStream fis = new FileInputStream(input);    fis.read(data);    ByteArrayPartSource baps = new ByteArrayPartSource(input.getName(), data);</code></pre><p>This all seems fairly clear to me, except that I can't for the life of me find out where to get this ByteArrayPartSource.  I have linked to the httpclient and httpmime JAR files, but no dice.  I hear that the package structure changed drastically between HttpClient 3.x and 4.x.  </p><p>Is anyone using this ByteArrayPartSource in Android, and how did they import it?</p><p>After digging around in the documentation and scouring the Internet, I came up with something that fit my needs.  To make a multipart request such as a form POST, the following code did the trick for me:</p><pre><code>    File input = new File(""climb.jpg"");    DefaultHttpClient client = new DefaultHttpClient();    HttpPost post = new HttpPost(""http://localhost:3000/routes"");    MultipartEntity multi = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);    String line;    multi.addPart(""name"", new StringBody(""test""));    multi.addPart(""grade"", new StringBody(""test""));    multi.addPart(""quality"", new StringBody(""test""));    multi.addPart(""latitude"", new StringBody(""40.74""));    multi.addPart(""longitude"", new StringBody(""40.74""));    multi.addPart(""photo"", new FileBody(input));    post.setEntity(multi);    HttpResponse resp = client.execute(post);</code></pre><p>The HTTPMultipartMode.BROWSER_COMPATIBLE bit is very important.  Thanks to <a href=""http://radomirml.com/2009/02/13/file-upload-with-httpcomponents-successor-of-commons-httpclient/comment-page-1#comment-97"" rel=""nofollow"">Radomir's blog</a> on this one.</p>","458290","","458290","","2010-11-06 17:18:23","2012-09-26 18:47:22","Android Multipart Upload","<android><http-status-code-404><multipart>","3","2","5","",""
"3919519","1","3919586","","2010-10-12 22:21:25","8","10907","<p>I hate the OK/Cancel dialogs, because if my application ask somebody if (s)he really want to do something you should never answer with ""Cancel"".</p><p>A little example:</p><pre><code>final AlertDialog.Builder b = new AlertDialog.Builder(this);b.setIcon(android.R.drawable.ic_dialog_alert);b.setTitle(""Hello World"");b.setMessage(""Did you do your homework?"");b.setPositiveButton(android.R.string.yes, null);b.setNegativeButton(android.R.string.no, null);b.show();</code></pre><p>Is it possible that the constants ""yes"" and ""no"" really means ""yes"" and ""no"" with localization? Or have I do this explicit in my string resource and can't use global constants. So I replace the two lines with:</p><pre><code>b.setPositiveButton(""Yes"", null);b.setNegativeButton(""No"", null);</code></pre><p>(or the resources instead of constants here)</p><p>SincerelyxZise</p>","473890","","473890","","2010-10-13 07:58:30","2011-12-29 12:18:49","Show Yes/No-Dialog instead of OK/Cancel","<android>","3","0","2","",""
"3919632","1","3919665","","2010-10-12 22:43:18","0","2184","<p>I'm new to android developing but right now I'm working on an application that displays Random Facts. Since I don't want it to be in a random order, I would like to have them in a list. I would like to order through them one by one and show them using TextView.</p><pre><code>Resources res = getResources();myString = res.getStringArray(R.array.FactsArray); </code></pre><p>That's what I have so far. If I'm right, that just establishes the array so I can be able to use it later. What I had before was rgenerator which chose a random string from the array and displayed it when I clicked a button.</p><pre><code>Resources res = getResources();myString = res.getStringArray(R.array.myArray); fact = myString[rgenerator.nextInt(myString.length)];TextView tv = (TextView) findViewById(R.id.text1);tv.setText(fact);</code></pre><p>But Like I said, I would like to just order through them one by one when a button is clicked.</p>","473903","","12707","","2010-10-12 22:46:34","2011-03-13 03:59:50","Navigating an Array (Android String Array)","<android><arrays><string><list><textview>","1","0","","",""
"3919903","1","4262145","","2010-10-12 23:54:27","0","883","<p>I have a listview that when scrolled and the items go off of the screen they are not redrawn when I scroll back to them (the text and checkbox).  In fact, items that are off the bottom of the screen in the listview never get drawn when scrolling to them.  This only happens in Froyo.  Any other version it works just fine.  I have checked and the data is there as expected in the adapter when the getItem method is called, it is just not visible.  The listview item is there (it's occupying the same amount of screen space per item), I just cannot see the text or checkbox once scrolled off screen and back on again.</p><p>My code is such:</p><pre><code>for(checklist cl : checkLists) {    ArrayList&lt;checklistItem&gt; ChecklistItems = database.getChecklistItems(                                                  cl.getId());    ListView lv = new ListView(this);    lv.setScrollingCacheEnabled(true);                      lv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,                                         LayoutParams.WRAP_CONTENT));    la = new checklistItemAdapter(this, layoutItem, ChecklistItems);          la.setActivity(this);    lv.setAdapter(la);                    TextView tv = new TextView(this);    tv.setText(cl.getItemText());    tv.setGravity(1);    tv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 50));    tv.setBackgroundColor(Color.BLUE);    tv.setTextSize(28);    tv.setTextScaleX(2);    tv.setTypeface(Typeface.DEFAULT_BOLD);    tv.setTypeface(Typeface.SANS_SERIF);    layoutChecklist = new LinearLayout(this);                    layoutChecklist.setOrientation(1);    layoutChecklist.addView(tv);    layoutChecklist.addView(lv);    layoutChecklists.addView(layoutChecklist);}</code></pre>","371077","","995926","","2012-05-05 13:58:47","2012-05-05 13:58:47","Android Listview Items not redrawn when they scroll off the screen in Froyo","<android><listview><android-2.2-froyo>","1","6","1","",""
"3920106","1","","","2010-10-13 00:57:33","0","1941","<p>I am trying to implement a robust RSS/Atom reader for android, and since Xerces won't compile I am struggling to find an alternative. I am using org.xmlpull.v1.sax2.Driver(), however this just wraps a DOM parser with SAX callbacks. </p><p>Is there anything comparable to Xerces on Android?</p>","474005","","","","","2012-09-20 15:43:48","Android SAX parser","<android><xml>","2","0","","",""
"3920204","1","","","2010-10-13 01:22:37","2","3050","<p>I have a RadioButton that is when clicked, it will bring to a popup window.Currently, I am planning to make the popup window to contain a browse Button with TextEdit left of it.</p><p>What it does is, when a user click on browse Button, a window explorer (something like that) will appear and let the user to traverse the phone's primary/secondary memory. When a file has been selected (clicked twice), the TextEdit will contain the whole directory address for the specified file.</p><p>I am not sure how to do this implementation, and I have google it and can't find any answer.Do you guys by any chance know any tutorial or information about this?</p><p>Thank you so much in advance</p>","448732","","1140748","","2012-05-08 10:31:25","2012-05-08 10:31:25","How to create Browse File Button functionality in Android","<android><popup><radio-button>","1","1","","",""
"3920595","1","","","2010-10-13 03:32:15","2","961","<p>I have developed two android apps...when i install them on my phone to test them.. they overwrite each other. I do not want this to happen. The intent is to have both installed on the phone as separate apps.. how do i fix this? I developed them with eclipse.</p>","474026","","","","","2012-02-25 10:09:14","app installations overwriting each other","<android><eclipse>","3","0","","",""
"3920640","1","","","2010-10-13 03:49:32","13","15440","<p>i am using alert dialog  with code below now i want to put image before each text</p><p>for example email icon then text Email,facebook icon then text Facebook etc.. in alert dialog</p><p>using following code please guide how to add icon before each text value?</p><pre><code>final CharSequence[] items = { ""Email"",                ""Facebook"",""Twitter"",""LinkedIn""};        AlertDialog.Builder builder = new AlertDialog.Builder(More.this);        builder.setTitle(""Share Appliction"");        builder.setItems(items, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {                if (item == 0) {                } else if (item == 1)                 {                }else if(item == 2)                {                }                 else if(item == 3)                {                }            }        });        AlertDialog alert = builder.create();        alert.show();</code></pre>","249991","","","","","2014-01-09 16:09:41","how to add icon in alert dialog before each item?","<android>","3","1","8","",""
"3920754","1","","","2010-10-13 04:24:24","1","404","<p>The application reads a key from a file to hit production vs test server.I want to create a test apk build that will pick test key and second build apk for release that will pick the production key</p><p>I am currently building app using eclipse</p>","474061","","","","","2010-10-13 04:30:15","Building multiple apks from on android app source","<android><eclipse><build><apk>","1","1","","",""
"3920810","1","","","2010-10-13 04:37:30","0","189","<p>I am looking at buying photoshop to be able to use some of the .psd files on the develop.android.com site (eg. <a href=""http://developer.android.com/intl/zh-TW/guide/practices/ui_guidelines/widget_design.html"" rel=""nofollow"">http://developer.android.com/intl/zh-TW/guide/practices/ui_guidelines/widget_design.html</a>). In addition, ideally, there would be many tutorials for that version, so I can learn quickly.</p><p>I see multiple versions of photoshop; is there a minimum version anyone can recommend which will provide suitable functionality to make basic icons etc?</p><p>Thank you for any advice.</p>","411539","","","","","2011-01-14 06:38:45","Which version of photoshop for android","<android><photoshop><android-ui>","3","2","","",""
"3920833","1","","","2010-10-13 04:44:43","3","12481","<p>I've set up an onTouch class to determine when one of my 40 buttons is pressed.</p><p>The problem I am facing is determining <em>which</em> button was pressed.</p><p>If I use:</p><p>int ID = iv.getId();</p><p>When I click on button ""widgetA1""</p><p>I receive the following ID:</p><p>2131099684</p><p>I would like it to return the string ID ""widgetA1""</p><p>from:game.xml</p><pre><code>&lt;ImageView android:layout_margin=""1dip"" android:id=""@+id/widgetA1"" android:src=""@drawable/image"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;</code></pre><p>from:game.java</p><pre><code>public boolean onTouch(View v, MotionEvent event) {  ImageView iv = (ImageView)v;  int ID = iv.getId();  String strID = new Integer(ID).toString();  Log.d(TAG,strID);  //.... etc }</code></pre><p>+-+-+-+-+-+-</p><p>I other wise works fine, it knows what button you are pressing. I am quite new to this Android JAVA. Let me know if you guys can help me.</p>","474068","","","","","2013-12-19 00:59:32","Android : ImageView getID(); returning integer","<android><button><imageview><ontouchlistener>","8","0","2","",""
"3920982","1","3921008","","2010-10-13 05:23:29","1","622","<p>I want to launch an application in the phone by clicking its link in the browser..How can I do this???</p>","461386","","","","","2010-10-13 09:20:33","Launching an application using browser?","<android>","2","0","","",""
"3920994","1","","","2010-10-13 05:26:02","0","606","<p>I'm getting crash reports from my app in the marketplace throwing an IndexOutOfBoundsException outside of my code with the following stack trace:</p><pre><code>java.lang.IndexOutOfBoundsException: charAt: -2 &lt; 01. android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:110)2. android.text.TextUtils.getCapsMode(TextUtils.java:1573)3. android.view.inputmethod.BaseInputConnection.getCursorCapsMode(BaseInputConnection.java:273)4. com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:202)5. com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:57)6. android.os.Handler.dispatchMessage(Handler.java:99)7. android.os.Looper.loop(Looper.java:123)8. android.app.ActivityThread.main(ActivityThread.java:4595)9. java.lang.reflect.Method.invokeNative(Native Method)10. java.lang.reflect.Method.invoke(Method.java:521)11. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)13. dalvik.system.NativeStart.main(Native Method)</code></pre><p>It looks like someone has reported this to Google per this issue:<a href=""http://code.google.com/p/android/issues/detail?id=6040"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=6040</a></p><p>Since there's been no response from Google on this I'm wondering if anyone here has run into this, and more importantly, found a workaround since I can't reproduce it myself and am at a loss as to how to debug it.</p><p>I appreciate any insight anyone can offer.</p>","309885","","","","","2012-01-19 18:22:40","Android IndexOutOfBoundsException","<android>","1","2","","",""
"3921013","1","3938638","","2010-10-13 05:29:00","2","475","<p>I am trying to send a list of objects from an android mobile phone app to a j2ee webserver.I create json objects and then put the objects into an jsonarray(in an order) and then send it. I am able to receive the jsonarray on the server, obtain the objects individually too, but the order of how I inserted the objects into the jsonarray is different compared to the order present in the received array. The order of elements plays a crucial role in my data processing. Could somebody please tell me a workaround for this.</p><p>Thanks,raqz</p>","377337","","750987","","2011-06-16 04:23:54","2011-06-16 04:23:54","json changes the order of elements","<android><json><servlets>","1","0","","",""
"3921034","1","","","2010-10-13 05:35:12","1","1181","<p>In eclipse, I open a android project, click the layout xml file. then pop the dialog ""Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so"" and the file didn't be opened.</p><p>How can I open the xml normally, it seems jdk6 is installed with error or the path is wrong.</p><p>os is ubuntu 9.04.</p>","438633","","","","","2010-10-13 05:55:23","Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so","<android><ubuntu><jdk>","1","0","","",""
"3921136","1","4056608","","2010-10-13 05:58:50","0","1712","<p>I have an application with a SurfaceView and a MapView. They are displayed in a single view, like so:</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=""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=""XXXXXXXXredactedXXXXXXXXXXXXx""    /&gt;&lt;class.that.extends.SurfaceView    android:id=""@+id/surfaceview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""#00000000""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Note the MapView comes before the SurfaceView. Because of this, the MapView is drawn ""under"" the SurfaceView, and all that I see is a black background, with the things that I draw on the SurfaceView showing. If I swap the order, and put SurfaceView first in the file and MapView second, the MapView is drawn, with none of the SurfaceView showing. </p><p>According to the <a href=""http://developer.android.com/reference/android/view/SurfaceView.html"" rel=""nofollow"">SurfaceView Javadoc</a>:</p><blockquote>  <p>The surface is Z ordered so that it is behind the window holding its SurfaceView; the SurfaceView punches a hole in its window to allow its surface to be displayed. The view hierarchy will take care of correctly compositing with the Surface any siblings of the SurfaceView that would normally appear on top of it.</p></blockquote><p>To me, this means that I should be able to put the SurfaceView first in the file, and have it ""punch through"" the MapView and display what it has. But, as it is, they seem to be two views, and only one is visible at a time.</p><p>After thought: I tried setting the background to #00000000 so that the alpha of the background would be zero (i.e. transparent), but it doesn't have any effect.</p>","28001","","","","","2010-10-29 23:56:11","Compositing Android MapView and SurfaceView","<android><mapping><android-mapview><surfaceview>","2","0","1","",""
"3921138","1","","","2010-10-13 05:59:44","11","15567","<p>hi i have to add a gesture to my listview,i want to implement the same functionality of contact application.when i left swipe it should send a message,right swipe it should call. can anyone help me how to do those gesture detection... i have implemented it in various other views... but i couldn't do for listView... i don't what going worng...my code is`</p><pre><code>/** Called when the activity is first created. */public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    // Create an array of Strings, that will be put to our ListActivity    String[] names = new String[] { ""Linux"", ""Windows7"", ""Eclipse"", ""Suse"", ""Ubuntu"", ""Solaris"", ""Android"", ""iPhone""};    // Create an ArrayAdapter, that will actually make the Strings above    // appear in the ListView    this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.id.MyList, names));    gestureListener = new ListView.OnTouchListener() {        public boolean onTouch(View v, MotionEvent event) {            if (gestureDetector.onTouchEvent(event)) {                return true;            }            return false;        }    };      }@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: "" + keyword, Toast.LENGTH_LONG).show();}@Overridepublic boolean onTouchEvent(MotionEvent event) {    if (gestureDetector.onTouchEvent(event))        return true;    else        return false;}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) {                Context ctx = getApplicationContext();                CharSequence txt = ""Right to Left Swipe"";                int duration = Toast.LENGTH_LONG;                Toast toast = Toast.makeText(ctx, txt, duration);                toast.show();                Toast.makeText(this.getItem(lv.pointToPosition((int)e1.getX(),(int) e1.getY())));                // return super.onFling();                                                      } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                Context ctx = getApplicationContext();                CharSequence txt = ""Left to Right Swipe"";                int duration = Toast.LENGTH_LONG;                Toast toast = Toast.makeText(ctx, txt, duration);                toast.show();            }        } catch (Exception e) {            // nothing        }        return false;    }}</code></pre>","430652","","1417267","","2013-01-05 10:31:37","2013-04-21 18:40:57","Gesture in listview android","<android><flip><gesture><swipe>","2","1","14","",""
"3921242","1","4241642","","2010-10-13 06:23:06","1","1624","<h2>E/ddms IllegalArgumentException 'Bad version' with both 32 and 64 bit Java JRE installed</h2><p>Hello.  Working on a Windows 7 Pro 64-bit system, that has the 64-bit Java JDK (and via the JDK the JRE) installed, and using Eclipse 3.5.2 and the latest Android SDK (rev 7).  Everything works fine.</p><p>If I then install the 32-bit Java JRE on the same machine (so that I can run Java applets in Chrome/Firefox), and try to start up the emulator (from either the command prompt or from within Eclipse), I get the following exception...</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>What specifically happens, when I try and launch the emulator, is I get a Windows command prompt window with a title of ""Java -version"", which quickly goes away, then another Windows command prompt window with a title of ""C:\Windows\system32\cmd.exe"", which also goes away quickly, and then finally a third Windows command prompt window with the above-mentioned exception information in it, and with a title of ...</p><p>""java   -Djava.ext.dirs=lib\x86;lib\ -Dcom.android.ddms.binddir= -jar lib\ddms.jar ping emulator standal...""<br>(the '...' is because the window was not wide enough to show the rest of the title)</p><p>... which also quickly goes away.  All three windows display/disappear within a 1-2 second span of time.</p><p>Uninstalling/removing the 32-bit Java JRE from my system makes the problem go away, reintroducing the Java 32-bit JRE causes it to come back.</p><p>For now I'm just not having the 32-bit Java JRE installed, and if I need to access a web page with a Java applet, I use the 64-bit version of I.E. (which Java 64-bit works in), but I'd like to be able to have harmony between my Android/Eclipse 64-bit development environment, and my need to run the 32-bit of the Java JRE so I can use applets in Chrome/Firefox.</p><p>Any advice/info would be appreciated.  Thanks in advance for your time and efforts.</p><p>P.S. Here's a composite screenpic of the three Windows command prompt windows that I described earlier: <a href=""http://img409.imageshack.us/img409/3182/tempb.png"" rel=""nofollow"">http://img409.imageshack.us/img409/3182/tempb.png</a></p>","435519","","","","","2012-06-27 05:18:01","E/ddms IllegalArgumentException 'Bad version' with both 32 and 64 bit Java JRE installed","<java><android><android-emulator>","5","0","0","",""
"3921269","1","3921746","","2010-10-13 06:28:02","1","2459","<p>If it must implement with AIDL?And please kindly provide an example, thanks.</p><p>EDIT:There are several solutions, Does anyone know which is better?</p>","428022","","428022","","2010-10-15 01:47:46","2012-04-22 10:05:28","How to implement callbacks using IntentService on Android?","<android><service><aidl>","2","0","1","",""
"3921272","1","","","2010-10-13 06:28:33","0","247","<p>Is it possible to place a viewflipper and sliding drawer in the same screen</p>","446010","","","","","2011-02-28 14:59:45","Is it possible to place a viewflipper and sliding drawer in the same screen","<android>","1","0","","",""
"3921274","1","","","2010-10-13 06:29:45","8","12932","<p>I'm using a WebView to open some files saved to the app.  Is there a way to link to the app's directory where files saved at runtime would be, in a similar way that file:///android_asset/ does?  By link I mean <code>loadUrl( *path* )</code> and also in the HTML markup of the file being opened <code>&lt;img src=""*path*"" /&gt;</code></p><p>As oppose to using an absolute path like file:///data/data/PACKAGENAME/files/</p>","445348","","445348","","2010-10-13 06:35:04","2012-04-05 11:19:27","Is there a path similar to file:///android_asset/ that points to the apps directory?","<android><webview><absolute-path>","2","0","5","",""
"3921362","1","3921377","","2010-10-13 06:46:55","0","1262","<p>This is my problem. </p><p>I have a <strong>ListView</strong>, each row is a <strong>CheckedTextView</strong>. The list view items are  ""1"", ""2"" and ""3"".When a ListItem is clicked, I want to read the number and assign it to an <strong>int</strong> variable.I did the following to read the Text of the clicked item:</p><pre><code>onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {               int num = 0; //initialise to 0  CharSequence s = ((TextView)v).getText(); // s contains the number, how to get it into num?}</code></pre><p>Basically, I want the number read in s to be converted and given to num. I know it maybe simple, but please help if you have an answer..</p><p>Regards,Kiki</p>","454660","","","","","2010-10-13 06:50:59","Android: How to read a number as int from a String; basically to read Text of a ListViewItem?","<android><integer><listviewitem><charsequence>","1","0","","",""
"3921387","1","3921396","","2010-10-13 06:53:38","0","678","<p>I am new to Java and I referred regarding my question on the Net but not quite Satisfied. I want to know what the ""Utility Class"" in Java is?</p><p>Can anybody please tell me with an Example.</p><p>Thanks,david</p>","422859","","","","","2010-10-13 07:42:54","Utility Classes in Java Programming","<java><android><class><utility>","3","0","2","",""
"3921467","1","","","2010-10-13 07:09:37","22","17647","<p>I don't have an Android phone right now.  But in my application I need to use the accelerometer values.  So I need an a simulator capable of it.  How can I do this?</p>","474166","","1439305","","2013-01-17 09:57:13","2013-12-27 21:50:45","How can i simulate accelerometer in android emulator?","<android><accelerometer><avd>","6","0","9","",""
"3921495","1","3928114","","2010-10-13 07:13:24","1","1297","<p>I am trying to create a content provider where the key contains forward slash ""/"". I searched about it for quite a while but there is no place/example illustrating it. </p><p><strong>content://com.lily.provider/items/*</strong></p><p>General example, which I understand: <strong>content://com.lily.provider/items/ab</strong></p><p>What I want to do: my key is a string with ""/""<br><strong>content://com.lily.provider/items/a/b</strong>where a/b is the item id, which is in the same position as ab. </p><p>My question:</p><ol><li>will content://com.lily.provider/items/a/b be matched to content://com.lily.provider/items/* ? why is that?</li><li>are there any work-around I could use to solve the problem</li></ol>","90765","","90765","","2010-10-13 20:18:31","2010-10-13 21:20:04","Android ContentProvider Uri Matching","<android><uri><android-contentprovider>","1","1","","",""
"3921516","1","4536836","","2010-10-13 07:17:36","0","1949","<p>How create an iphone-like search for android?</p><p>I could not alter the standard search android. Is it possible?I decided to make a my custom widget.</p><p>Have any ideas how best to do this?</p>","396628","","396628","","2011-01-13 15:39:43","2012-02-10 08:46:40","how to create an iphone-like search for android","<java><android><search><ios-simulator>","1","0","0","",""
"3921519","1","3921543","","2010-10-13 07:18:01","1","1124","<p>I have total 3 activities.First activity(A) starts second activity(B). From Activity B, 3rd activity(C) is called.</p><p>Activity B, shows list with checkbox to select items and single OK button. On clicking OK button Activity C is called with selection. </p><p>When user clicks BACK button in Activity C, by default Activity B is displayed (with selected checkbox).</p><p>I want to display Activity A when BACK button is clicked in Activity C.</p><p>How to achieve that?</p><p>I have handled OnKeyDown() in Activity C to startactivity(A). it is working. But when user clicks BACK button on Activity A, again Activity C is displayed. while application should end.</p><p>In this direction how to skip Activity B is ever called?</p><p>Thanks in advance,</p><p>JRC</p>","465751","","","","","2010-10-13 07:21:01","How to avoid history of activity","<android><button><back>","1","0","2","",""
"3921598","1","","","2010-10-13 07:33:46","0","1304","<p>Hi i am trying to create a basic contact list that has same functionality has the native one i.e. arranged in alphabetical order and have the scrolling thumb tab on the side to scroll through letters.</p><p>How do i create that scroll tab thing? i will use some sort of sorting algorithm to sort my contact list in order so that should be fine but im wondering how to do the fast thumb tab scroll seen in the pic below:</p><p><img src=""http://i.stack.imgur.com/kVdrU.jpg"" alt=""alt text""></p>","444668","","","","","2011-02-18 14:20:52","create a android contactList view?","<android>","1","0","1","",""
"3921603","1","","","2010-10-13 07:34:26","0","1375","<p>In my TabHost activity, I want to show an ImageView below the selected tab (the ImageView overlaps the tab content). What would be the best solution to do this? I was thinking that creating a custom tab widget that can overlap the child activity layout may be a solution. </p><p>Thank you in advance!</p>","460611","","460611","","2010-10-13 09:21:11","2010-10-13 09:21:11","TabWidget overlapping the tab content","<android>","2","2","","",""
"3921648","1","","","2010-10-13 07:42:45","0","3758","<p>I want to create a file in emulator android storage path /data/...</p><p>but it seems I can't create a new file by programs,</p><p>I should upload an empty file to /data/... and then write the file,</p><p>Can anyone help here?</p><p>openFileOutput(""file.txt"", MODE_PRIVATE) seems can create a new file in /data/data/Package/files/...</p><p>but it can't create in path /data/...</p><p>Thank you so much !</p>","346955","","","","","2013-08-08 02:46:35","Create a new file in Android emulator path /data/","<android>","2","0","1","",""
"3921685","1","7565015","","2010-10-13 07:48:27","2","3818","<p>I'm successfully generating my textures using GLUtils.texImage2D,but when I use the textures generated I get problems with my alpha: they are darker than wanted.</p><p>after having checked several things I finally got the the conclusions that the problem comes from GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bmp, 0);</p><p>I created a second function that uses gl.glTexImage2D(GL10.GL_TEXTURE_2D, level, GL10.GL_RGBA, width, height, 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixels2);</p><p>but it is costly in processing to create pixels2 which is a bytebuffer in which I have to recopy the bytes while changing the values from the bitmap ARGB to texture RGBA.</p><p>Has anybody noticed that ? and if so how did you solve this...   </p><p>jason </p><hr><p>Thank you for your answer,I'm already using </p><pre><code>gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);</code></pre><p>and I'm getting this problem</p><p>my problem is that the alpha generated by GLUtils isn't the one of the texture, its darker. </p><p>the difference is like looking at a color in the sun and in the shade (if that makes any sence).</p><p>I already tried gl.gltextimage2d but the creating the buffer takes too long, unless there is a tool to convert a bitmap to a byte buffer that I don't know of...</p>","440336","","267","","2011-08-11 20:17:28","2013-11-06 11:03:01","Issues with GLUtils.texImage2D and Alpha in Textures","<android><opengl-es><bitmap>","5","0","1","",""
"3921731","1","","","2010-10-13 07:56:55","4","275","<p>does anybody know what android widget/view this is:</p><p><img src=""http://i.stack.imgur.com/UA11V.png"" alt=""alt text""></p><p>i want to be able to implement a similar widget for my own needs but i dont know what kind of view/widget it is. All i see is that it is embeded on the ContactContract class as a quickContact object.</p><p>Anyone used one of these and customized it? if so, how? Thanks in advance</p><p>edit: is it also possible to include more than 5 items as shown below and have it scrollable horizontaly</p>","444668","","444668","","2010-10-13 08:14:39","2012-02-20 14:33:17","What android widget is this?","<android>","2","0","2","",""
"3921816","1","3921833","","2010-10-13 08:13:21","6","4033","<p>I want to implement a generic, thread save class which takes the RessourceId of an ImageView and the Url (http) where the desired image file is stored. It'll download the image and fills the src of the ImageView in the UiThread.</p><p>I thought <a href=""http://developer.android.com/reference/android/os/AsyncTask.html"">AsyncTask</a> would be the best thing for me. However I noticed that I only can pass one type of parameters to the <code>doInBackground()</code> Method. Like an Array of Urls. Is that true? What would u suggest me?</p>","433718","","","","","2013-01-10 22:25:37","Can I pass different types of parameters to an AsyncTask in Android?","<android><multithreading><android-asynctask>","2","0","4","",""
"3921846","1","","","2010-10-13 08:17:51","3","6559","<p>i am using fastscroll with indexer, but i want to implement a alphabetic scroll view just similar to Iphone. any idea?</p><p>i hope u can take a look at this image<img src=""http://i.stack.imgur.com/Ifs1g.png"" alt=""alt text""></p>","430652","","430652","","2010-11-22 06:19:06","2012-11-13 03:08:08","how to implement alphabetic scroll bar in android","<android><scroll><alphabet>","1","1","1","",""
"3922042","1","","","2010-10-13 08:49:53","1","1979","<p>Can anyone tell me how to check if the android phone has a front camera too? I'd tried to use some help form <a href=""https://docs.google.com/View?id=dhtsnvs6_57d2hpqtgr"" rel=""nofollow"">https://docs.google.com/View?id=dhtsnvs6_57d2hpqtgr</a> but Camera camera = FrontFacingCamera.getFrontFacingCamera(); sometimes works sometimes not.Any help please?</p>","447816","","","","","2010-10-14 21:52:19","How to detect android front camera programmatically","<android>","1","0","","",""
"3922117","1","3926368","","2010-10-13 09:01:01","0","4807","<p>I'm new to android programming and I would like some help. I have the following code:</p><pre><code>Object[] list_cities = parsedData.getCityname().toArray();            Object[] list_countries = parsedData.getCountryname().toArray();            // Display the available locations            list_search.setAdapter(new ArrayAdapter&lt;Object&gt;(this, android.R.layout.simple_list_item_2, android.R.id.text1, list_cities));            list_search.setAdapter(new ArrayAdapter&lt;Object&gt;(this, android.R.layout.simple_list_item_2, android.R.id.text2, list_countries));</code></pre><p>I would like to display double rows for each entry in the list (city and country) but I have no luck. With the above code I only see the countries but not the cities. Is there any way to add both the adapters to the list_search so I can see all the data?</p><p>Thank you all for your answers!!</p>","474250","","474250","","2010-10-16 06:47:24","2012-08-23 14:13:59","Double rows in a listview with ArrayAdapter (Android)","<android><listview><android-arrayadapter>","3","0","","",""
"3922140","1","","","2010-10-13 09:03:17","1","1244","<p>I have a ListActivity with obviously a ListView on it. This ListView consists of different sections, each of them have a header.</p><p>When I display the list of items to the user, first header is on top. If user scrolls, header is hidden and rest of items are displayed. I know how to make that simple header static, always on top, but what i want now, is to have last displayed header always on top.</p><p>Last version of GMail is a good example of what i want. While on a message, if you scroll, you will always see that message header on top. If you keep scrolling and go to next message, when that new message header is about to disappear because of the scrolling action, it will replace the current static header, so that user will have always current message's header on top, as a floating panel.</p><p>Is there any example out there, or some guidance about how to implement this?</p><p>Thanks!</p>","367029","","","","","2011-03-09 15:38:24","Static headers on a listview","<android><listview><static><header>","1","2","","",""
"3922244","1","","","2010-10-13 09:19:12","1","252","<p>There is a few questions about this, but mostly lacking details and no definitive answer.</p><p>So I am using xhr long polling, my poll is pretty basic and just looks like</p><pre><code>var poll = function() {   $.get(url, function(data) {    doStuff(data);    poll();   });};</code></pre><p>I start that from a script that is imported just before , I remove absolutely everything else on the page so the only thing that is loaded in javascript (synchronously), I then wrap the call in</p><pre><code>window.onload = function () {    setTimeout(poll, 0);};</code></pre><p>However webkit still gives me a constantly loading url bar, I can change 0 to some arbitrary number to fix it, however I would really like a consistent way to never see this issue again.</p><p>Anyone have any ideas? I have tried various other techniques to wait for loading, checking in web inspector shows the file that contains runs the above js is the last thing to load before the poll starts, and the last line of that file is the })(); that executes the whole thing.</p>","144799","","","","","2010-10-13 09:19:12","How to prevent webkits constant url loading url / throbber of doom","<javascript><android><webkit><xmlhttprequest><long-polling>","0","0","1","",""
"3922250","1","","","2010-10-13 09:19:59","0","1074","<p>I'm an android-newbie and I'm looking for a solution, how to overlap a horizontal-scrolling  image-gallery with a vertical-scrolling image-gallery. that means one transparent image of the vertical-scrolling gallery should overlap one image of the horizontal-scrolling gallery (like a cross).</p><p>furthermore it should be possible to scroll either vertical or horizontal so that the image of the vertical-scrolling gallery or the image of the horizontal-scrolling gallery will change. is there an way ?</p><p>thanks a lot!</p>","437057","","","","","2011-01-03 11:16:21","how to overlap a horizontal gallery with a vertical gallery","<android><scrolling><gallery>","1","0","1","",""
"3922257","1","","","2010-10-13 09:20:59","4","3321","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2988072/problems-when-handling-orientation-changes"">Problems when handling orientation changes</a>  </p></blockquote><p>I have a very simple Activity...</p><pre><code>public class ShowOrientation extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.d(""ShowOrientation"", ""Orientation: "" + getOrientation());    }    private String getOrientation() {        int o = getResources().getConfiguration().orientation;        if (o == 1)            return ""PORTRAIT"";        else if (o == 2)            return ""LANDSCAPE"";        else            return ""*UNKNOWN!*"";    }}</code></pre><p>When I run the Activity in the emulator, it starts up in PORTRAIT mode.  When I rotate the screen (via the 9 button on the numeric keypad), I see in my log file a single entry... </p><pre><code>Orientation: LANDSCAPE</code></pre><p>Now, if I rotate the screen back to PORTRAIT mode (via the 7 button on the numeric keypad), here is what I am seeing in my log file...</p><pre><code>Orientation: LANDSCAPEOrientation: PORTRAIT</code></pre><p>And then if I switch back to LANDSCAPE again, I see this...</p><pre><code>Orientation: LANDSCAPE</code></pre><p>Since this logging is done in onCreate(Bundle), I can only assume that my Activity is being destroyed/created twice when rotating from LANDSCAPE to PORTRAIT screen orientation, and only once when going from PORTRAIT to LANDSCAPE!</p><p>I'm still new to Android, so I may be missing something about the activity lifecycle, but <em>it doesn't seem right to me that an Activity is created/destroyed twice when doing a screen rotation one way, but only once when doing a screen rotation another way</em>.</p><p>Did I find a bug?   Is it supposed to work this way?  Or do I not know something about activity lifecycle that explains this?</p><p>EDIT: Forgot to mention, this is using Android 2.2 api, Eclipse 3.5.2, and Android SDK Rev. 7.</p>","435519","","","","","2010-10-13 17:22:31","Why is onCreate called twice when doing screen rotation from landscape to portrait?","<android><android-emulator>","0","4","1","2011-08-30 22:48:53",""
"3922265","1","3922417","","2010-10-13 09:23:29","1","1323","<p>I need to clear about android:anyDensity attribute with true | false,i gone through the developer guide,but i can't clear about.what the difference of using true or false value for it,Please clear about it.</p>","393953","","","","","2011-12-13 02:17:04","Use of android:anyDensity","<android>","1","0","","",""
"3922361","1","","","2010-10-13 09:39:51","0","2306","<p>I have create a canvas in android and inside that i have multiple bitmap images.not i want to make these images click able.</p><p>I have tried following things so far..</p><p>I tried to add bitmap in image view as imageview has a setOnClickListnerbut i think ImageView can't be added into Canvas , so i dropped this idea. because even Bitmap itself has no click events.</p>","405383","","","","","2012-08-20 20:44:06","clickable image inside canvas","<android><android-sdk-2.1>","2","0","","",""
"3922367","1","3922611","","2010-10-13 09:41:40","0","241","<p>Hi i want to know that how can i weight the coin in android phone. I want to develop an application in android where i put the coin on the screen of the device and device will weights the coin and show me the results. there are some application in I-Phone who does this work. Is this possible in the android or not? If possible then how can i implement?</p><p>I have lots of research in this topic but i don't get any stuff regarding this please help if you solve this problem.</p>","339116","","","","","2010-10-13 10:16:24","How android weights coin","<android>","2","1","1","",""
"3922406","1","3922618","","2010-10-13 09:47:09","4","20196","<p>I have a ListView showing names of countries. I have stored the names in strings.xml as a string-array called <strong>country_names</strong>.</p><p>In populating the ListView, I use an ArrayAdapter which reads from strings.xml:</p><pre><code>String[] countryNames = getResources().getStringArray(R.array.country_names);ArrayAdapter&lt;String&gt; countryAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.checked_list, countryNames);myList.setAdapter(countryAdapter);</code></pre><p>Now I also have a CountryCode for each country. When a particular country name is clicked on the ListView, I need to Toast the corresponding CountryCode.</p><p>I understand implementing a HashMap is the best technique for this. As far as I know, the HashMap is populated using put() function.</p><pre><code>myMap.put(""Country"",28);</code></pre><p>Now my questions are:</p><ol><li><p>Is it possible to read the string.xml array and use it to populate the Map? I mean, I want to add items to the Map, but I must be able to do so by reading the items from another array. How can I do this?</p><p>The basic reason I ask is because I want to keep the country names and codes in a place where it is easier to add/remove/modify them.</p></li><li><p>The string-arrays are stored in strings.xml. Where must similar integer arrays be stored? In values folder, but under any specific XML file?</p></li></ol>","454660","","560648","","2011-07-01 09:32:41","2012-10-25 08:11:29","Using HashMap to map a String and int","<android><string><hashmap>","1","0","5","",""
"3922433","1","3984535","","2010-10-13 09:50:32","2","824","<p>I uploaded an application in the Android Market yesterday, I'm receiving house ads on my application and occasionally I also receive 3rd party ads (Checked on my phone). But my AdMob developer dashboard says my status for this Application is inactive. I have disabled test ads on the server side and also in my code. I have more than 400 users, but still nothing seems to be working. Any ideas?</p>","421372","","759866","","2013-12-28 10:53:48","2013-12-28 10:53:48","AdMob status is inactive but I'm receiving house ads","<android><admob>","1","0","","",""
"3922552","1","","","2010-10-13 10:07:20","2","1686","<p>Kindly give me the way to create a 3D object in android application</p>","474166","","","","","2012-01-24 03:18:21","how can i create a 3D object in android application?","<android>","2","0","2","",""
"3922571","1","","","2010-10-13 10:10:20","0","844","<p>I created my TextView through code rather than XML. I want to draw a border around the  TextView.How can we do this using code rather than XML? I also wanted when I try to setText for the TextView which is of some 2 lines then TextView is moving downward? plz also guide me to solve this problem.I will be waititng for reply . <br>Regarda,</p>","429501","","","","","2010-10-13 11:27:38","How to draw borders for TextView created using Code not by XML in Android","<android>","1","0","","",""
"3922606","1","5016624","","2010-10-13 10:15:26","10","7427","<p>I have a application that registers a handler for custom URI on the Phone. I am able to launch the application by making a link to ""myapp://act/launch"" from my phone web pages. This works only if my application is installed on the device. What I want to do is detect if the URI Scheme is supported from the browser and then prompt my own message saying ""please download the app etc..."" if the handler for the URI scheme is not found.</p><p>Is there a way I can detect or find the list of URL Scheme handlers on the Phone from the Web Browser ?</p>","461386","","","","","2013-09-11 23:07:31","Detect an application is installed or not?","<android>","2","0","10","",""
"3922612","1","3923302","","2010-10-13 10:16:27","0","1245","<p>This function runs on the UiThread, but it seems that doesnt mean it also has access to the activity context. Shall I implement to my AsyncTask a public Setter to pass the activity (as reference)?</p><pre><code>protected void onPostExecute( Bitmap bitmap ) {         //following is underlined red due to missing context        (ImageView)findViewById(ResId)).setImageBitmap(bitmap);       }</code></pre>","433718","","","","","2010-10-13 11:53:42","Do I still have to pass the ActivityContext to the AsyncTask in order to manipulate Views?","<android><multithreading><activity><android-asynctask>","1","0","","",""
"3922670","1","4323001","","2010-10-13 10:23:40","0","913","<p>I am getting an error wil parsing an XMl using the xmlPull parser.The exception that i am getting is org.apache.http.MalformedChunkCodingException: Chunked stream ended unexpectedly</p><p>Can you please let me know the reason for the error and methods to handle it.</p>","366053","","","","","2012-04-12 09:39:00","Android xmlPullParser Exception Chunked stream ended unexpectedly","<android><xml-parsing>","2","0","","",""
"3922691","1","3923066","","2010-10-13 10:26:28","0","968","<p>I'm trying to make animation in android like an effect in ipad when we turn the page.Anyone has a clue for this matter?Thanks.</p>","430926","","","","","2010-10-19 10:17:02","Android animation effect","<android><animation>","1","0","","",""
"3922718","1","3922762","","2010-10-13 10:29:03","3","9837","<p>I have a tabbed view with one Activity per tab, and when I switch from the first tab, which has a TextView, to the second tab, which only shows a clickable list, the soft keyboard is still there. I want it to go away, so I tried this:</p><pre><code>public static void hideSoftKeyboard (Activity activity, View view) {  InputMethodManager imm = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);  imm.hideSoftInputFromWindow(view.getWindowToken(), 0);}</code></pre><p>but this does not work, because there is no relevant view to provide, as there is no View on the screen that takes keyboard input. Any suggestions on how to solve this?</p>","1507543","","","","","2014-01-09 20:29:11","Hide soft keyboard on activity without any keyboard operations","<android>","4","0","1","",""
"3922820","1","3922892","","2010-10-13 10:45:38","0","150","<p>..i want to list different images..so </p>","244540","","244540","","2012-05-01 10:00:23","2012-05-01 10:00:23","Listing different images along with text in android?","<android>","1","0","","",""
"3922893","1","","","2010-10-13 10:56:21","3","4801","<p>I am developing an app for android. Just a general questions as to , if is it possible to connect to a device which is non discoverable publicly?</p><p>Thanks in advance.</p>","170986","","","","","2013-08-22 22:35:36","connect to non-discoverable bluetooth device","<android><java-me><bluetooth>","4","0","1","",""
"3922918","1","","","2010-10-13 11:00:02","0","619","<p>Any one have idea what resolution android support.. what is the idle bit rate and Frame rate for android mp4 video... </p>","474358","","","","","2010-10-13 11:12:06","mp4 Resolution in android","<android>","1","0","","",""
"3922965","1","3927905","","2010-10-13 11:07:53","2","4281","<p>I need to generate an apk file using an Ant script, but I'm having problems with the compile target. To automatically generate the Ant script, I've used the Android tool with the command <code>android update project</code>. The problem is that this project depends on another project, so I need to use a custom compile task.</p><p>For that reason, I've overridden that target: I've copied the compiled task from <code>ant_rules_r3.xml</code> and I've changed the <code>javac</code> task like this (see comments for what I changed):</p><pre><code>&lt;!--I've changed the target 1.5 to target 1.6 --&gt;&lt;javac encoding=""UTF8"" target=""1.6"" debug=""true"" extdirs=""""                    destdir=""${out.classes.absolute.dir}""                    bootclasspathref=""android.target.classpath""                    verbose=""${verbose}""                    classpath=""${extensible.classpath}""                    classpathref=""android.libraries.jars""&gt;                &lt;src path=""${source.absolute.dir}"" /&gt;                &lt;!--My project has two src directories --&gt;                &lt;src path=""${source2.absolute.dir}"" /&gt;                &lt;src path=""${gen.absolute.dir}"" /&gt;                &lt;src refid=""android.libraries.src"" /&gt;                &lt;!--I've added here the src dir of the other project --&gt;                    &lt;src path=""${dep1.source.absolute.dir}""/&gt;                &lt;classpath&gt;                    &lt;!--I've added here the lib dir of the other project --&gt;                    &lt;fileset dir=""${dep1.external.libs.absolute.dir}"" includes=""*.jar"" /&gt;                    &lt;fileset dir=""${external.libs.absolute.dir}"" includes=""*.jar"" /&gt;                    &lt;fileset dir=""${extensible.libs.classpath}"" includes=""*.jar"" /&gt;                &lt;/classpath&gt;            &lt;/javac&gt;</code></pre><p>The problem is that when I compile with <code>ant compile</code>, I get the following error:</p><pre><code>[javac].... cannot find symbol[javac] symbol  : constructor IOException(java.lang.String,java.security.NoSuchAlgorithmException)[javac] location: class java.io.IOException[javac]             throw new IOException(""Algorithm not found"", e);</code></pre><p>It seems as though it's been compiled with JDK 1.5 instead of 1.6 even though I have set the target property to 1.6. My computer is using Java version 1.6.0_20.</p><p>I've tried using <code>javac compiler=""javac1.6""</code>, but I get the same error.</p><p>I've also set in my <code>build.properties</code>:</p><pre><code>ant.build.javac.target=1.6ant.build.javac.source=1.6</code></pre><p>but it doesn't solve the problem either. Setting it to 1.3 instead of 1.6 causes more errors, so it seems it is using the JDK I'm setting here.</p><p>How can I get this to compile correctly?</p>","249699","","122607","","2011-09-12 19:35:05","2011-09-12 19:35:05","""cannot find symbol"" when compiling with Ant","<java><android><ant><build-automation><compilation>","1","0","","",""
"3923034","1","3931597","","2010-10-13 11:18:50","0","273","<p>I create data file in android for my application in the app's data directory. The write is successful with no exceptions but file contents are not complete. It truncates at 90112 bytes. Any idea what is going on ? Is there a limit ?</p><p>Here is the snippet<pre><code>try {            fos = parentActivity.openFileOutput(mmCacheFName,                    Context.MODE_PRIVATE | Context.MODE_APPEND);            OutputStreamWriter osw = new OutputStreamWriter(fos);            BufferedWriter bosw = new BufferedWriter(osw);            int indx = lastIndx - 10;            while (indx >= 0) {                IEventHolder ev = deltaList.get(indx);                bosw.write(ev.getRawData() + ""\n"");                indx--;            }            osw.flush();        } catch (FileNotFoundException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        } catch (Throwable t) {                t.printStackTrace()         } finally {            try {                if (fos != null)                    fos.close();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }</pre></code></p>","474375","","474375","","2010-10-14 01:02:20","2010-10-14 08:58:07","90112 bytes limit for data files?","<android>","2","2","","",""
"3923110","1","","","2010-10-13 11:27:41","0","917","<p>My app plays short audio files and if you want to increase or decrease the volume you have to press the side buttons really fast while it's playing, otherwise you increase/decrease the ringer volume on your phone.</p><p>I was looking through the API and I can't find a way to set the default to the media volume? Does anyone know if I'm missing something or if there's a way to do this?</p><p><strong>SOLVED</strong></p><p><a href=""http://stackoverflow.com/questions/628659/how-can-i-manage-audio-volumes-sanely-in-my-android-app"">It was already solved here</a></p>","348261","","348261","","2010-10-13 11:40:57","2010-10-13 11:40:57","How do I set the side buttons to only change the media volume and not the ringer volume?","<android><default><media><volume>","0","2","","",""
"3923119","1","3923254","","2010-10-13 11:28:34","5","2293","<p>I have a Cursor 'c' that generates a ListView. The Content Provider ensures that the ListView gets updated whenever the underlying data changes. However, I want to additionally make a call to another function to update my Header/Footer views everytime the listview is drawn.</p><p>How does one implement this with ContentObservers?</p>","356580","","","","","2010-10-13 11:46:39","Android ContentObserver","<android><listview><cursor>","1","0","1","",""
"3923142","1","3923175","","2010-10-13 11:30:12","1","369","<pre><code>&lt;ViewFlipper android:id=@+id/flipper &gt;    &lt;ListView android:id=@+id/xyz /&gt;    &lt;ListView android:id=@+id/pqr /&gt;    &lt;ListView android:id=@+id/abc /&gt;&lt;/ViewFlipper&gt;</code></pre><p>flipper=(ViewFlipper)findViewById(R.id.flipper);</p><pre>   Can I access the id of child elements of flipper(xyz,pqr,abc) ? no. of child elements of flipper ?</pre>","207646","","","","","2010-10-13 13:26:27","Accessing child elements, using parent defined in xml, android","<android>","1","0","","",""
"3923243","1","","","2010-10-13 11:45:22","0","1199","<p>I have a pretty standard iPhone app that creates a series of around 7 unique Activities initialised by Intents.</p><p>However if the app crashes on the 7th Activity, the app restarts on the users phone around the 5th activity. The problem then is the info gathered from activities 1-4 is null, meaning the app is useless and the only way to get the app working again is to either continually press back or else kill the process.</p><p>Why does this behaviour occur, and is there a way to force the app to start back at the first activity when it crashes.</p>","474406","","114066","","2010-10-13 13:19:13","2010-10-13 13:24:55","Android Intent Activity crash behaviour - app restarts halfway through the app","<android><crash><activity><android-intent>","1","0","1","",""
"3923329","1","3923351","","2010-10-13 11:57:07","0","3287","<p>The need is to make a title (TextView) tappable to edit it(EditText)...</p><p>I'm using the trick to have 1 TextView and 1 EditText next to each other in my xml layout, and then I play with .setVisibility(View.INVISIBLE/VISIBLE) to visually switch them.</p><p>Since TextView and EditText are pretty close, is that possible to effectively switch one for the other?Or does anyone have a better trick I couldn't find?</p><p>Thanks</p>","474411","","","","","2013-08-20 10:46:17","switching a TextView to an EditText","<android><textview><edittext>","2","1","1","",""
"3923498","1","","","2010-10-13 12:19:17","0","710","<p>I have android code that shows profile of user in screen and sometimes i need to display image not always.so i want to add scrollview for image whenever i need to display image but when i m adding scrollview it scrolls whole activity always which i dont want plz help me out to add dynamically scrollview for only image.</p><p>can anyone provide a better solution?</p>","474419","","","","","2010-10-13 12:19:17","how to add scrollview dynamically in android","<android>","0","2","","",""
"3923501","1","3928226","","2010-10-13 12:19:39","3","2692","<p>I've created a custom ViewGroup based on a LinearLayout.</p><p><strong>ClearableEditText.java</strong></p><pre><code>package test.todolist;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.LinearLayout;public class ClearableEditText extends LinearLayout{    private EditText editText;    private Button button;    public ClearableEditText (Context context){        super (context);        String service = Context.LAYOUT_INFLATER_SERVICE;        LayoutInflater li = (LayoutInflater)getContext ().getSystemService (service);        li.inflate (R.layout.clearable_edit_text, this, true);        editText = (EditText)findViewById (R.id.clearEditText);        button = (Button)findViewById (R.id.clearButton);        configButton ();    }    private void configButton (){        button.setOnClickListener (new Button.OnClickListener (){            public void onClick (View v){                editText.setText ("""");            }        });    }}</code></pre><p><strong>clearable_edit_text.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=""vertical""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""&gt;    &lt;EditText        android:id=""@+id/clearEditText""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""    /&gt;    &lt;Button        android:id=""@+id/clearButton""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""        android:text=""@string/clear""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>How can I use ClearableEditText now?</p><p>I've tried to put a node inside a layout (main.xml) in 2 ways:</p><pre><code>&lt;test.todolist.ClearableEditText/&gt;</code></pre><p>and </p><pre><code>&lt;test.todolist.clearable_edit_text/&gt;</code></pre><p>but none of them have worked.</p><p>My <strong>main.xml</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;test.todolist.ClearableEditText/&gt;</code></pre><p>My <strong>ToDoList.java</strong> (main activity):</p><pre><code>package test.todolist;import android.app.Activity;import android.os.Bundle;public class ToDoList extends Activity{    @Override    public void onCreate (Bundle savedInstanceState){        super.onCreate (savedInstanceState);        setContentView (R.layout.main);    }}</code></pre><p>Thanks.</p>","458093","","458093","","2010-10-13 21:34:32","2010-10-13 21:34:32","How to use Compound Controls","<android>","1","4","1","",""
"3923571","1","","","2010-10-13 12:26:20","1","5233","<p>In my application I have a custom view which requires some text input. As the view in itself doesn't contain any actual views (it's a Surface with custom drawing being done), I have a FrameLayout which contains the custom view and underneath it an EditText -view. When the user does a specific action, the custom view is hidden and the EditText takes over for user input. This works fine, but android:imeOptions seem to be ignored for this view. I'm currently doing this:</p><pre><code>    InputMethodManager inputMethodManager = (InputMethodManager)parent.getSystemService(Context.INPUT_METHOD_SERVICE);    EditText t = (EditText)parent.findViewById(R.id.DummyEditor);    t.setImeOptions(EditorInfo.IME_ACTION_DONE);    inputMethodManager.showSoftInput(t, 0, new ResultReceiver(mHandler) {      @Override      protected void onReceiveResult(            int resultCode, Bundle resultData) {               // We're done            System.out.println(""Editing done : "" +              ((EditText)parent.findViewById(R.id.DummyEditor)).getText());            }      }    );</code></pre><p>It seems that the setImeOptions(EditorInfo.IME_ACTION_DONE) has no effect. I've also tried adding the option to the layout XML with android:imeOptions=""actionDone"". No help.</p><p>Any ideas?</p>","251455","","","","","2014-03-22 21:03:22","Defining EditText imeOptions when using InputMethodManager.showSoftInput(View, int, ResultReceiver)","<android>","1","0","1","",""
"3923610","1","","","2010-10-13 12:30:58","10","8434","<p>I am planning to display images from SD card in a webview in order to take advantage of he built in zoom capabilities of webview. However, I am facing an issue with displaying images that are bigger than screen size (e.g. 1800x1200) to fit the screen initially, like in an ImageView. I want the image to be displayed in full at first and provide zoom control to the users.I have tried using WRAP_CONTENT for webview's width and height, but that does not work. Any ideas?Following is a code snippet I am using:</p><pre><code>    String path = getRealPathFromURI(mUriList.get(0)); // this gets the file path    webView = (WebView) findViewById(R.id.WebView01); WebSettings settings= webView.getSettings(); settings.setBuiltInZoomControls(true); settings.setSupportZoom(true);      webView.loadUrl(""file://"" + path);</code></pre>","474449","","","","","2011-07-06 10:16:19","Fit image in webview","<android><webview>","2","1","1","",""
"3923652","1","","","2010-10-13 12:35:55","2","3891","<p>I am using android inbuilt camera to take picture and then attaching the same picture to email, when i am testing this functionality in 1.6 device, i am able name the  picture that to be taken by in built camera, but in 2.1, the picture is having a name i.e given by device, </p><p>How to give user defined name in 2.1 inbuilt camera images..</p><p>to avoid that problem i am saving the image manually but when i try to get the image back through intent as bitmap and then saving it to sd card using compress method</p><p>this methods handles result from inbuilt camera </p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {  File file = new File(Environment.getExternalStorageDirectory()    + ""/test.png"");  switch (requestCode)  {  case PHOTO_ACTION:   if (resultCode == RESULT_CANCELED)   {     addPhoto = false;     Toast.makeText(this, ""Canceled "", Toast.LENGTH_LONG).show();     break;   } else if (resultCode == RESULT_OK)   {    Bundle b = data.getExtras();    Bitmap bm = (Bitmap) b.get(""data"");    FileOutputStream out;    try     {     out = new FileOutputStream(file);     bm.compress(Bitmap.CompressFormat.JPEG, 100, out);     out.flush();     out.close();     scanPhoto(file.toString());     out = null;     addPhoto = true;     } catch (Exception e)      {       e.printStackTrace();       addPhoto = false;      }</code></pre><p>but when i am storing like this i am getting two images. one with system given name and other with name given by me. but the image one which has user defined is having less resolution so i question is how to save the bitmap with more resolution with out compressing it ..please help.... me</p>","400942","","614807","","2012-09-05 08:34:35","2012-09-05 08:34:35","Saving bitmap to SD card with out compressing it in android","<android><bitmap><camera><store>","1","1","","",""
"3923712","1","","","2010-10-13 12:41:42","0","1049","<p>I qadrouple checked phone Id. Still does not work. What, besides of phone Id, is the difference betwween running on the Emulator and on the phone?Thx,</p>","437162","","","","","2011-04-08 14:26:35","AdMob testmode show in emulator not in phone","<android><admob>","2","1","","",""
"3923758","1","","","2010-10-13 12:47:07","0","924","<p>I am using the native Android class VideoView for playing streaming videos from URL.</p><p>I am <strong>unable to play some of the 3gp , mp4 format streaming videos.</strong></p><p>Kindly inform if anyone has come across <strong>limitations of playing streaming videos of 3gp/mp4 format.</strong> </p><p>I had series of problems:</p><p><strong>i>Able to hear the audio but unable to view the video for a video file being streamed from a specific Url.</strong></p><p>Can the problem be due to parameters like <strong>frame rate &amp; bit rate</strong> of the video?</p><p>I have already gone through the following URL which gives information about the media format support:</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>Kindly help.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-10-13 12:47:07","Unable to play all streaming videos","<android>","0","3","","",""
"3923927","1","3935185","","2010-10-13 13:06:00","2","2266","<p>it's a easy question, but I can't figure it out:</p><p>this 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=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;GG.My_pic.testA        android:id = ""@+id/myview""        android:layout_width = ""fill_parent""        android:layout_height = ""fill_parent""    /&gt;&lt;/FrameLayout&gt;</code></pre><p>In lunar lander, the main thread uses</p><pre><code>    // tell system to use the layout defined in our XML file    setContentView(R.layout.lunar_layout);</code></pre><p>But I can't use my </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);}</code></pre><p>If I change my R.layout.main to --> new testA(this) , it works</p><p>(testA is the class that extends SurfaceView implements SurfaceHolder.Callback)</p><p>why??</p>","408278","","212275","","2010-10-30 15:22:02","2010-11-21 17:32:27","android surfaceview can't work","<java><android><surfaceview>","1","0","0","",""
"3923949","1","4446896","","2010-10-13 13:07:08","1","760","<p>I have created two tabs, say TAB1 and TAB2. For TAB1, i have loaded one Activity, say ActivityOne, into TAB1 as </p><pre><code>Intent intent = new Intent(this,ActivityOne.class);    TabHost.TabSpec spec = getTabHost().newTabSpec(""ActivityOne"")                                       .setIndicator(""Activity One"",getResources().getDrawable(R.drawable.artists)).setContent(intent);    getTabHost().addTab(spec);</code></pre><p>This ActivityOne has extended the ActivityGroup and i added one button in this activity. By clicking on this button it will call another activity, say ActivityOne_One, as</p><pre><code>public void onClick(View v) {            // TODO Auto-generated method stub            Intent intent = new Intent(ActivityOne.this,ActivityOne_One.class);            replaceContentView(""ActivityOne_One"",intent);        }public void replaceContentView(String id, Intent intent){    View view = this.getLocalActivityManager().startActivity(id, intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();        this.setContentView(view);}</code></pre><p>When we click on that button ActivityOne_One will be launched under same TAB1. In this application i have two problems:1) If i want to go back to ActivityOne under same TAB1 by using traditional BACK button on emulator it is not working..2)ActivityOne_One is launching with no animation(like sliding from right to left) effect.</p><p>If anyone know about any one of these, give your advice..</p><p>Thanks,<br>venu</p>","461975","","","","","2010-12-15 05:08:59","Problem with back button on emulator when multiple activities are there in single tab","<android>","2","0","1","",""
"3924343","1","3924378","","2010-10-13 13:44:27","0","114","<p>I have build an application in android. This app needs to display a list of text, but the list of text increase continuously. It means user can see increased list of text. Each text is separated by a horizontal row. It looks like google market when market try to show list of applications. How can i do in this situation ?</p>","422579","","102937","","2011-12-19 20:16:27","2011-12-19 20:16:27","How to make a list that can show the changeable content","<android>","1","0","1","",""
"3924389","1","","","2010-10-13 13:49:59","0","2486","<p>Android has ListView component which is quite nice. The problem is that I created my own adapter to supply viewitems for each item displayed and I don't get anymore:</p><ul><li>Background color change when i scroll the items using up/down arrows</li><li>Background color change when I select an item.</li></ul><p>How do I do that?</p>","138606","","","","","2010-10-13 13:52:26","Android listView and selected items, with a custom ListAdapter","<android><listview>","1","0","","",""
"3924464","1","3924512","","2010-10-13 13:57:34","2","710","<p>I want to display the same options menu on all of my application's activities. I created a generic Activity that implements the menu, and all my further activies extend it. </p><p>The problem: when I need to extend other specific activities, like ListActivity and MapActivity, I can't figure out how to extend the generic activity and add the List or Map behaviour to the new class. To deal with the issue I had to create three different generic activities, each extending Activity, ListActivity and MapActivity.</p><p>I've tried creating an abstract activity but it doesn't work, I would need to extend two classes at the same time. I could try interfaces but since I can't implement methods, I would have to paste the menu implementation all over the second-level classes, right?</p>","169786","","","","","2010-10-13 14:02:56","How to implement a generic activity that can be extended by normal, List and Map Activities?","<java><android><extends>","1","0","","",""
"3924665","1","","","2010-10-13 14:19:37","2","1376","<p>I would like to implement a service in Android that basically should monitor the time elapsed since the user didn't touched the screen. For example the user opens Internet or Adobe Reader, starts reading and don't interact anymore withe the touchscreen.I want that my running service know the time since the user didn't touched the screen.How can I do this ?I'm thinking at two approaches:1. The better one : After the time is elapsed (the service is set that after 2 or 5 or 10 minutes to check if the screen was or not touched) the service query some system object for this information.2. The not so better one (I think this could have an impact on performance) At every touch of the screen the service to be notified.</p><p>Please help. Thanks.</p>","467780","","","","","2010-10-13 20:42:46","How to get an event in a service when the screen is touched?","<android><time><service><screen><touch>","2","1","1","",""
"3924802","1","4110439","","2010-10-13 14:33:58","2","1294","<p>This is my onCreate method of my first activity of my app. It initalizes all Widgets and then starts a Thread to load model data from the internet. In some cases, when the network is really slow or not responding, the <code>""initializeModelThread""</code> seems to take the whole CPU and doesnt allow the onCreate Methode to finish. </p><p>In one case I saw that <code>Log.v(""Time...)</code> was called after 300 ms, but the screen remained black for about 20 seconds until a HttpException stopped the <code>initalizeModelThread</code>. You already can see that I set the Priority of the Thread to low. </p><p>Would the use of AsyncTask help in this case? Do u have any other thoughts about that issue?</p><pre><code>public void onCreate( Bundle savedInstanceState ) {        super.onCreate(savedInstanceState);        Long time = System.currentTimeMillis();        initializeWidgets();        Thread threadInstance = new Thread(initializeModelThread);        threadInstance.setPriority(Thread.MIN_PRIORITY);        threadInstance.start();        Log.v(""Time"", ""Difference from start "" + Long.toString(System.currentTimeMillis() - time));      }</code></pre>","433718","","","","","2010-11-05 21:57:27","Thread in Android method onCreate() still stops the UiThread in 10% of the cases","<android><multithreading><ui-thread>","2","0","","",""
"3924901","1","3925003","","2010-10-13 14:44:01","15","4801","<p>I'm developing on multiple computers.  If I deploy to my phone directly from Eclipse on one computer, I can't deploy from the other without uninstalling first.  I'm assuming this is because there is a debug certificate being used to sign the app, and they're not the same across the two machines.</p><p>Is it possible to copy one over to the other so that Eclipse is using the same one on both machines?</p>","53501","","","","","2013-02-19 23:58:32","Using the same debug keystore on multiple computers","<android><keystore>","1","0","7","",""
"3924923","1","","","2010-10-13 14:45:33","0","180","<p>well im making an app and it needs to know on what its running.lets say i run it on an android phone.first is there somewhere on in phone that says ""android""? i need things things like screen size and if it can get touch, supported file types, jsr`s installed.is there a way to get that info from a phone?or am i doomed to try and make the mother of all phone databases?</p>","356350","","356350","","2010-10-14 03:22:12","2010-10-14 08:50:40","how do i get phone platform details?","<android><java-me>","1","1","","",""
"3924946","1","3925493","","2010-10-13 14:48:05","1","1071","<p>I would like to test my app-layout with different resolutions. Therfore I created an emulator-device with a resolution of 480x832 (the same as my motorola droid/milestone).</p><p>I did all my layout_width with ""fill_parent"" or with dp - but what looks good on the device (e.g. filling up the whole width) is much too small in the emulator. fill_parent works, but layouts with dp are a lot different.</p><p>What am I doing wrong?</p><p>Thanks a lot!</p>","27404","","","","","2010-10-13 15:47:22","Android: Resolution Emulator vs. Device","<android><android-emulator>","1","5","1","",""
"3924980","1","3984787","","2010-10-13 14:51:38","1","1155","<p>Hy!</p><pre><code>    public static void addNotification(String sAppname, String sDescription) {     NotificationManager notifManager = (NotificationManager) mycontext.getSystemService(NOTIFICATION_SERVICE);       Notification note = new Notification(R.drawable.icon, sDescription, System.currentTimeMillis());       Intent i = new Intent (mycontext, mStart.class)             .setAction(Intent.ACTION_MAIN)             .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);     PendingIntent contentIntent = PendingIntent.getActivity(mycontext, 0, i, 0);      note.setLatestEventInfo(mycontext, sAppname, sDescription, contentIntent);       notifManager.notify(NOTIFY_ID, note);  }</code></pre><p>mStart is my first activity</p><p>if i click on the notification this code is ""re-create"" the intent, and show up a new one.</p><p>i dont want this. i d like to show up the existing main intent. how to?</p>","472537","","","","","2010-10-21 06:19:21","Android notification click, run the main intent?","<android><android-intent>","1","0","","",""
"3925018","1","3925066","","2010-10-13 14:55:40","6","5541","<p>I want to make two emulators use the same SD-Card image. I automatically created a SD-Card in the first emulator and downloaded all the data to this SD-Card.</p><p>How can I load this SD-Card in another emulator? I don't want to recreate all the data on the SD-Card for every single emulator all the time. </p>","114066","","","","","2013-04-26 11:58:16","Where does the Android Emulator store the SD-Card files?","<android><emulator><sd-card>","2","1","","",""
"3925030","1","3935612","","2010-10-13 14:56:56","15","14078","<p>I'm working with Android, trying to make my AudioTrack application play a Windows .wav file (Tada.wav).  Frankly, it shouldn't be this hard, but I'm hearing a lot of strange stuff.  The file is saved on my phone's mini SD card and reading the contents doesn't seem to be a problem, but when I play the file (with parameters I'm only PRETTY SURE are right), I get a few seconds of white noise before the sound seems to resolve itself into something that just may be right.</p><p>I have successfully recorded and played my own voice back on the phone -- I created a .pcm file according to the directions in this example:</p><p><a href=""http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html"">http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html</a></p><p>(without the backwards masking)...</p><p>Anybody got some suggestions or awareness of an example on the web for playing a .wav file on an Android??</p><p>Thanks,R.</p>","453989","","","","","2013-11-06 02:00:05","Using AudioTrack in Android to play a WAV file","<android><wav><audio-streaming>","5","0","6","",""
"3925072","1","","","2010-10-13 15:00:32","7","3642","<p>What is translatable attribute translatable=""false"" means?</p>","474634","","","","","2012-12-03 22:07:07","what is the purpose of using translatable in Android strings?","<android><string>","5","0","","",""
"3925116","1","","","2010-10-13 15:05:04","0","115","<p>My adapter contain the following Views:</p><pre><code>private static class ViewHolder {ImageView p_Image;TextView p_Name;TextView p_Price;TextView p_Psave;}</code></pre><p>This Is how I implement onItemClick :</p><pre><code>gridView.setOnItemClickListener(new OnItemClickListener() {               public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {                   }           });</code></pre><p>How can I know which view from the above 4 was actually pressed (while running OnItemClickListener via GridView) ?</p><p>Thanks</p>","474643","","390989","","2010-10-13 15:32:00","2010-10-15 20:16:02","How to retrieve the right view?","<android>","1","0","","",""
"3925144","1","6881643","","2010-10-13 15:08:12","1","1315","<p>How to overlay two images like the one in iphone notification icon or new launcher pro notification? I want to add new image on top right of an imageview to show notification</p><p>Here is the example of launcher pro notification and tweetcaster checked button (with facebook icon on topright)</p><p><a href=""http://londatiga.net/images/overlayimg.png"" rel=""nofollow"">http://londatiga.net/images/overlayimg.png</a></p>","431041","","","","","2011-07-30 06:56:52","Overlay Image in Android","<android><imageview>","1","0","1","",""
"3925232","1","3925831","","2010-10-13 15:19:54","2","754","<p>I am quite new to Android yet, and I have an application that has a webview on it. </p><p>I need to know when the webview finishes loading a page that has a <strong>random</strong> number of <strong>redirects</strong> (sometimes to the same page, and the order of the redirects also change), so I can remove the Splash Screen only when there is a fully loaded page.</p><p>On the webviewclient the onPageStarted and onPageFinished functions are called once per each redirect, as is the onNewPicture (even though the screen is always blank during the redirects). So I can't be sure when it's called the last time (page actually loaded).</p><p>I also tried using the onLoadResource to count the number of resources loaded (dangerous and unreliable approach, but I am getting desperate here), but this also failed, since after the page is cached, it is called only one or two times.</p><p>That is one big puzzle I am unable to solve using what I know so far, can anyone please help me? </p><p>Thanks a lot in advance.</p>","367342","","","","","2010-10-13 16:23:19","I need to know when a page really finishes loading","<android><webview><webviewclient>","1","0","1","",""
"3925267","1","","","2010-10-13 15:22:45","3","1392","<p>What are the best practices to design webservices for mobile (particularly Android) apps?Personally I'm focused on using JSON (and not XML) and I try to make it the less verbose I can. But I'm probably missing a lot of things.</p>","220095","","","","","2010-11-09 19:54:42","What are the best practices to design webservices for mobile (particularly Android) apps?","<android><web-services>","3","0","2","",""
"3925310","1","","","2010-10-13 15:28:06","4","239","<p>I have written a web application to run on Google AppEngine using the Restlet framework, communicating using json with web clients. Those work as expected. However, one specific resource written to provide response to an Android client doesn't work when accessed through Android. However, it does work when accessed through a web browser (I do not send the request parameters from the browser and thus get a 400 which is ok in this case).</p><p>This code works when running on the DevAppServer:</p><pre><code>public class PlayResource extends ServerResource {private final float SCOREBASE = 1000.0F;@Get@Postpublic JsonRepresentation play() {    try {        JsonRepresentation rep = new JsonRepresentation(getRequestEntity());        JSONObject inputJson = rep.getJsonObject();        JSONObject outputJson = new JSONObject();        String country = inputJson.optString(""country"");        outputJson.put(""country"", doSomething(""country"",country));                    ......        ......        return new JsonRepresentation(outputJson);    } catch (IOException e) {        try {            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);            return new JsonRepresentation(                    new JSONObject()                        .put(Messages.TYPE_ERROR, Messages.BAD_REQUEST));        } catch (JSONException e2) {            setStatus(Status.SERVER_ERROR_INTERNAL);            return null;        }    } catch (JSONException e) {        try {            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);            return new JsonRepresentation(                    new JSONObject()                        .put(Messages.TYPE_ERROR, Messages.BAD_FORMAT));        } catch (JSONException e2) {            setStatus(Status.SERVER_ERROR_INTERNAL);            return null;        }    }}}</code></pre><p>and the client Android device is running this code:</p><pre><code>  Client client = new Client(Protocol.HTTP);    try {        JsonRepresentation requestJSON = new JsonRepresentation(new JSONObject()            .put(""country"", country.trim())        );        Request req = new Request(Method.GET,""http://****.appspot.com/resource/play"",requestJSON);        Response resp = client.handle(req);        String res = resp.getEntity().getText();        JSONObject resultJSON = new JSONObject(res);</code></pre><p>Running this request just hangs the Android client, the server doesn't write any log messages whatsoever suggesting the request doesn't arrive there.</p>","474648","","","","","2011-04-26 17:30:15","Problems running deployed apps on Google AppEngine","<android><google-app-engine>","1","2","2","",""
"3925355","1","","","2010-10-13 15:32:47","10","10198","<p>I want to add fadeout animation for my splash screen, that is while closing the splash screen I want to bring the fadeout animation effect.</p><p>Here are the codes which I have tried.</p><pre><code>overridePendingTransition(R.anim.fade_in, R.anim.fade_out);</code></pre><p>But the above can be used only from 2.0. Ny app should support from 1.5.</p><p>So I have set the following animation for my main activity.</p><pre><code>getWindow().setWindowAnimations(android.R.style.Animation_Toast);</code></pre><p>OR</p><pre><code>getWindow().setWindowAnimations(R.style.Theme_FadeIn);</code></pre><p>My Theme.FadeIn contains</p><pre><code>&lt;style name=""Theme.FadeIn""&gt;&lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;&lt;item name=""android:activityOpenEnterAnimation""&gt;@anim/fade_in&lt;/item&gt;   &lt;/style&gt;</code></pre><p>Now I can see the fadein effect, but I can see the blackscreen. </p><p>How to get this fadein or fadeout effect without blackscreen.</p><p>Can anyone help me to solve this asap?</p><p>Thanks in advance.</p>","275845","","","","","2011-01-11 07:35:07","Android - Fadeout animation for splash screen","<android><animation><activity><fadeout>","3","0","5","",""
"3925363","1","3926023","","2010-10-13 15:33:51","0","473","<p>Is there any way to nest APKs so that you can open one with another?</p><p>I am looking to wrap a bunch of APKs with some control options that can fire an APK when selected. Even if i can start with one opening one other it would be a start...</p><p>I have thus far tried the dex loader to no avail... Keep getting a load error in the log dump.</p><p>Can anyone suggest a way to do this?</p><p>Thanks in advance for any help!</p>","413872","","","","","2010-10-13 16:49:48","Nesting Android APKs","<android><wrapping><nesting><apk>","1","0","2","",""
"3925435","1","3931458","","2010-10-13 15:41:25","1","411","<p>I'm new in android testing. All I've used in the testing is only the ActivityInstrumentationTestCase2 (AITC2) which is explained in the Hello, Testing tutorial.</p><p>I've made a test class using AITC2 and it runs well. But once I changed the base test class to SingleLaunchActivityTestCase (SLATC) I got RuntimeException specifying ""Unable to resolve intent.. blabla.."" which I suspect was originated from launchActivity().</p><p>I thought AITC2 and SLATC are pretty much the same, besides that in SLATC the activity being tested only launched once (setUp() only launched once for all test cases) and in AITC2 the activity will be launced for every test cases.</p><p>I've tried to find some example or documentation about how to use SLATC but still no luck.. :(.</p><p>Anybody knows why the activity cannot be launched in SLATC? Thanks in advance :)</p>","305864","","","","","2010-10-14 08:41:30","SingleLaunchActivityTestCase cannot launch activity on test","<android><unit-testing>","1","0","","",""
"3925442","1","","","2010-10-13 15:42:09","2","2783","<p>I was using audiotrack to play some sounds in a loop. Now I need to know in which period of time I'm right now, so i decided to use <strong>setPositionNotificationPeriod</strong> which works quite good.The problem is that it just work for the first ""loop"" but stop being called after that :\</p><p>The code looks like the following:</p><pre><code>...audioTrack.setPositionNotificationPeriod(bufferSize/numCalls);audioTrack.setPlaybackPositionUpdateListener(this); audioTrack.setLoopPoints(0,bufferSize,-1);...public void onPeriodicNotification(AudioTrack track) {    Log.d(""Hey I'm on call: ""+numCall++);}</code></pre><p>With that I got just #numCalls# calls but I want them to be forever.</p><p>Any idea how to fix it?</p><p>Thank you very much</p><p><strong>EDIT: I forgot to say I'm using an static audiotrack instead of stream</strong></p>","474684","","474684","","2010-10-13 19:19:48","2012-05-13 21:56:26","Using Android setPositionNotificationPeriod with AudioTrack in loop mode","<android><audio>","0","4","","",""
"3925573","1","3926078","","2010-10-13 15:54:56","2","959","<p>I have been looking this but haven't found a concrete example. Is there a way to click a specific point on a Map and then draw a overlayitem it?</p>","382920","","1221571","","2014-01-17 18:54:27","2014-01-17 18:54:27","Map Click and drawing item","<android><google-maps>","1","0","","",""
"3925699","1","","","2010-10-13 16:08:06","1","1692","<p>I'm a complete newbie on android (and Java), and got myself some example code from a Drag and Drop tutorial to play around with and try to understand. Doing fairly well, but this code generates the java.lang.ArrayIndexOutOfBoundsException error and a force close every second time the app starts.</p><p>I'm guessing it might be something simple about the app not clearing out its resources, would appreciate if someone knows what part of the code is causing it and why.Tried on both 1.5 and 2.2.</p><p>Main.java :</p><pre><code>package eas.org;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);        // draw the view        setContentView(new DrawView(this));    }}</code></pre><p>DrawView.java :</p><pre><code>package eas.org;import android.content.Context;import android.graphics.Canvas;import android.graphics.Point;import android.view.MotionEvent;import android.view.View;public class DrawView extends View {   private ColorBall[] colorballs = new ColorBall[3]; // array that holds the balls   private int balID = 0; // variable to know what ball is being dragged    public DrawView(Context context) {        super(context);        setFocusable(true); //necessary for getting the touch events        // setting the start point for the balls        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(context,R.drawable.bol_groen, point1);        colorballs[1] = new ColorBall(context,R.drawable.bol_rood, point2);        colorballs[2] = new ColorBall(context,R.drawable.bol_blauw, point3);    }    // 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);          }    }    // events when touching the screen    public boolean onTouchEvent(MotionEvent event) {        int eventaction = event.getAction();         int X = (int)event.getX();         int Y = (int)event.getY();         switch (eventaction ) {         case MotionEvent.ACTION_DOWN: // touch down so check if the finger is on a ball            balID = 0;            for (ColorBall ball : colorballs) {                // check if inside the bounds of the ball (circle)                // get the center for the ball                int centerX = ball.getX() + 25;                int centerY = ball.getY() + 25;                // calculate the radius from the touch to the center of the ball                double radCircle  = Math.sqrt( (double) (((centerX-X)*(centerX-X)) + (centerY-Y)*(centerY-Y)));                // if the radius is smaller then 23 (radius of a ball is 22), then it must be on the ball                if (radCircle &lt; 23){                    balID = ball.getID();                    break;                }                // check all the bounds of the ball (square)                //if (X &gt; ball.getX() &amp;&amp; X &lt; ball.getX()+50 &amp;&amp; Y &gt; ball.getY() &amp;&amp; Y &lt; ball.getY()+50){                //  balID = ball.getID();                //  break;                //}              }             break;         case MotionEvent.ACTION_MOVE:   // touch drag with the ball            // move the balls the same as the finger            if (balID &gt; 0) {                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        invalidate();         return true;     }}</code></pre><p>ColorBall.java :</p><pre><code>package eas.org;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Point;public class ColorBall  { private Bitmap img; // the image of the ball private int coordX = 0; // the x coordinate at the canvas private int coordY = 0; // the y coordinate at the canvas private int id; // gives every ball his own id, for now not necessary private static int count = 1; private boolean goRight = true; private boolean goDown = true;    public ColorBall(Context context, int drawable) {        BitmapFactory.Options opts = new BitmapFactory.Options();        opts.inJustDecodeBounds = true;        img = BitmapFactory.decodeResource(context.getResources(), drawable);         id=count;        count++;    }    public ColorBall(Context context, int drawable, Point point) {        BitmapFactory.Options opts = new BitmapFactory.Options();        opts.inJustDecodeBounds = true;        img = BitmapFactory.decodeResource(context.getResources(), drawable);         id=count;        count++;        coordX= point.x;        coordY = point.y;    }    public static int getCount() {        return count;    }    void setX(int newValue) {        coordX = newValue;    }    public int getX() {        return coordX;    }    void setY(int newValue) {        coordY = newValue;   }    public int getY() {        return coordY;    }    public int getID() {        return id;    }    public Bitmap getBitmap() {        return img;    }    public void moveBall(int goX, int goY) {        // check the borders, and set the direction if a border has reached        if (coordX &gt; 270){            goRight = false;        }        if (coordX &lt; 0){            goRight = true;        }        if (coordY &gt; 400){            goDown = false;        }        if (coordY &lt; 0){            goDown = true;        }        // move the x and y         if (goRight){            coordX += goX;        }else        {            coordX -= goX;        }        if (goDown){            coordY += goY;        }else        {            coordY -= goY;        }    }}</code></pre><p>Crash log :</p><pre><code>10-13 15:15:15.038: ERROR/AndroidRuntime(492): FATAL EXCEPTION: main10-13 15:15:15.038: ERROR/AndroidRuntime(492): java.lang.ArrayIndexOutOfBoundsException10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at eas.org.DrawView.onTouchEvent(DrawView.java:112)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.view.View.dispatchTouchEvent(View.java:3766)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.os.Handler.dispatchMessage(Handler.java:99)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.os.Looper.loop(Looper.java:123)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at java.lang.reflect.Method.invokeNative(Native Method)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at java.lang.reflect.Method.invoke(Method.java:521)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-13 15:15:15.038: ERROR/AndroidRuntime(492):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Thankful for any help I can get with this!</p>","474731","","","","","2012-04-05 13:52:18","Drag and drop - java.lang.ArrayIndexOutOfBoundsException","<java><android>","3","0","","",""
"3925729","1","","","2010-10-13 16:11:46","2","4941","<p>In Handler, we can pass some data from a background thread to the UI thread like this:</p><pre><code>private void someBackgroundThreadOperation() {    final String data = ""hello"";    handler.post(new Runnable() {        public void run() {            Log.d(TAG, ""Message from bg thread: "" + data);        }     }}</code></pre><p>If we use the above, we cannot then use Handler.removeCallbacks(Runnable r), because we won't have references to any of the anonymous runnables we created above.</p><p>We could create a single Runnable instance, and post that to the handler, but it won't allow us to pass any data through:</p><pre><code>private void someBackgroundThreadOperation() {    String data = ""hello"";    handler.post(mRunnable); // can't pass 'data' through.}private Runnable mRunnable = new Runnable() {    public void run() {        Log.d(TAG, ""What data?"");    }}</code></pre><p>We can however use the Handler.removeCallbacks(mRunnable) method then, since we have a reference to it.</p><p>I know I can setup some synchronization myself to get the second method working, but I'm wondering if Handler offers any utility for passing data through to a single referenced Runnable, almost like in the example above?</p><p>The closest I can think of from browsing the docs is to use something like:</p><pre><code>private void someUiThreadSetup() {    mHandler = new Handler(new Callback() {        @Override        public boolean handleMessage(Message msg) {            String data = (String)msg.obj;            return false;        }    });}private void someBackgroundThreadOperation() {    String data = ""please work"";    Message msg = mHandler.obtain(0, data);    mHandler.sendMessage(msg);}private void cleanup() {     mHandler.removeMessages(0);}</code></pre><p>Is this the proper way of doing it?</p><p>Thanks</p>","291701","","","","","2010-10-13 17:26:41","Passing data from bg thread to UI thread using Handler?","<android>","1","1","1","",""
"3925760","1","","","2010-10-13 16:16:14","0","2110","<p>Hello with regard to the known issue of unwanted checkboxes being checked while scrolling through a listview, can anyone please give me an idea how to use a checkedTextView properly so that i can maintain check state properly when scrolling through the list. I thought the listview takes care of maintaining the checkbox state when using a checkedtextView but that does not seem to be the case. or do i have to use the default Id for the checkedTextView. I can't seem to find an example that uses a cursorAdapter or a SimpleCursorAdapter for this case. Thank you</p><p>i have tried using this, but am not really sure what to do with the set tag position. here is a small piece of code:</p><pre><code>  //bindView() method in SimpleCursorAdapter //viewHolder holder;    //Cursor c;    holder.checkedText = (CheckedTextView)view.findViewById(R.id.view_checked);    holder.checkedText.setTag(c.getPosition());        holder.checkedText.setOnClickListener(new View.OnClickListener() {                        public void onClick(View v)                        {                              v.getTag();                            ((CheckedTextView) v).toggle();                        }                    });</code></pre><p>my xml standard 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""&gt;    &lt;ListView android:id=""@android:id/list""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:choiceMode=""multipleChoice""/&gt;    &lt;TextView android:id=""@android:id/empty""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/no_notes""/&gt;&lt;/LinearLayout&gt;</code></pre><p>my custom 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=""horizontal""  android:padding=""6dp""&gt; &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""2dp""&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/viewNameText""            android:id=""@+id/viewNameId""&gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:gravity=""center_horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""1.0""        android:padding=""2dp""&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""start Date""            android:layout_gravity=""right""            android:id=""@+id/DateId""&gt;        &lt;/TextView&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""start Time""            android:layout_gravity=""right""            android:id=""@+id/TimeId""&gt;        &lt;/TextView&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:gravity=""right""            &gt;     &lt;CheckedTextView           android:id=""@+id/title""           android:layout_width=""fill_parent""           android:layout_height=""wrap_content""           android:checked=""false""          android:focusable=""false""          android:clickable=""true""          android:textAppearance=""?android:attr/textAppearanceLarge""           android:checkMark=""?android:attr/listChoiceIndicatorMultiple""           /&gt;     &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;        </code></pre>","316843","","316843","","2010-10-13 18:55:31","2010-12-13 06:36:13","Checkbox state problem in ListView","<android>","1","0","","",""
"3925794","1","3925906","","2010-10-13 16:20:54","1","3684","<p>Please help! I tried everything! :(</p><p>I've got a schedule Class, which is simply a custom ViewGroup (with custom onMeasure() and onLayout()), which enables me to place childs(=events) with LayoutParams for column/row start and column/row end. The number of childs and their LayoutParams depend on database entries.</p><p>Now I'm trying to add childs (events) from my database. I'd have to use a Cursor Adapter, so my schedule Class has to extend ListView, right? I tried that but the newView() method of the adapter is never called. Why not??My custom ListView doesn't ask the adapter for childs, no childs are added. I also can't add the childs by hand calling schedule.addView() if I extend from AdapterView.</p><p>I'd be really (really) happy if someone could help!</p><p>Regards,cody</p><p>This is my custom ViewGroup:</p><pre><code>public class Schedule extends ViewGroup {private int columns;private int rows;private float preferredCellWidth;private float preferredCellHeight;private String[] rowTimes;private Paint paint;public Schedule(Context context, int columns, int rows, float preferredCellWidth, float preferredCellHeight, String[] rowTimes) {    super(context);    this.columns = columns;    this.rows = rows;    this.preferredCellWidth = preferredCellWidth;    this.preferredCellHeight = preferredCellHeight;    this.rowTimes = rowTimes;    init(context);}private void init(Context context) {    Log.i(""Schedule"", ""initSchedule..."");    setPaint();    setWillNotDraw(false);}private void setPaint() {    paint = new Paint();    paint.setTextSize(preferredCellHeight*2/3);    paint.setStyle(Paint.Style.STROKE);    paint.setColor(getResources().getColor(R.color.white));}public Schedule(Context context, AttributeSet attrs) {    super(context, attrs);    readAttr(context, attrs);    init(context);}public Schedule(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);    readAttr(context, attrs);    init(context);}private void readAttr(Context c, AttributeSet attrs) {    android.content.res.TypedArray a = c.obtainStyledAttributes(attrs, R.styleable.ScheduleLayout);    this.columns = a.getInt(R.styleable.ScheduleLayout_columns, 1);    this.rows = a.getInt(R.styleable.ScheduleLayout_rows, 1);    this.preferredCellWidth = a.getDimension(R.styleable.ScheduleLayout_preferredCellWidth, 1);    this.preferredCellHeight = a.getDimension(R.styleable.ScheduleLayout_preferredCellHeight, 1);    a.recycle();}@Overrideprotected void onDraw(Canvas canvas) {    //Log.i(this.toString(),""onDraw ...""+"" this.getLeft()=""+this.getLeft()+"", this.getWidth()=""+this.getWidth());    super.onDraw(canvas);    for (int i = 0; i &lt; rows; i++) {        int line = (int) Math.round(this.getTop()+ (i+1) * preferredCellHeight);        canvas.drawText(this.rowtimes[i], this.getLeft()+5, line-3, paint);        canvas.drawLine(this.getLeft(), line, this.getWidth(), line, paint);    }}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    Log.i(""Schedule"", ""onMeasure..."");    float width = (MeasureSpec.getSize(widthMeasureSpec) - getPaddingLeft() - getPaddingRight()) / columns;    float height = (MeasureSpec.getSize(heightMeasureSpec) - getPaddingTop() - getPaddingBottom()) / rows;    float cellWidth = preferredCellWidth;    float cellHeight = preferredCellHeight;    if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY) {        cellWidth = width;    } else if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.AT_MOST) {        cellWidth = Math.min(preferredCellWidth, width);    }    if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY) {        cellHeight = height;    } else if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST) {        cellHeight = Math.min(preferredCellHeight, height);    }    for (int i = 0; i &lt; getChildCount(); i++) {        View child = getChildAt(i);        if (child.getVisibility() != GONE) {            LayoutParams lp = (LayoutParams) child.getLayoutParams();            int cwidth = (int) Math.round(cellWidth * lp.getWidth());            int cheight = (int) Math.round(cellHeight * lp.getHeight());            child.measure(                    MeasureSpec.makeMeasureSpec(cwidth, MeasureSpec.EXACTLY),                    MeasureSpec.makeMeasureSpec(cheight, MeasureSpec.EXACTLY)            );        }    }    setMeasuredDimension(            (int) Math.round(cellWidth * columns + getPaddingLeft() + getPaddingRight()),            (int) Math.round(cellHeight    * rows + getPaddingTop() + getPaddingBottom())    );}@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {    if (!changed)        return;    int cellWidth = ((r-l) - getPaddingLeft() - getPaddingRight()) / columns;    int cellHeight = ((b-t) - getPaddingTop() - getPaddingBottom()) / rows;    for (int i = 0; i &lt; getChildCount(); i++) {        View child = getChildAt(i);        if (child.getVisibility() != GONE) {            LayoutParams lp = (LayoutParams) child.getLayoutParams();            int cl = (int) Math.round(getPaddingLeft() + lp.columnStart    * cellWidth);            int cr = (int) Math.round(getPaddingLeft() + lp.columnEnd * cellWidth);            int ct = (int) Math.round(getPaddingTop() + lp.rowStart    * cellHeight);            int cb = (int) Math.round(getPaddingTop() + lp.rowEnd * cellHeight);            child.layout(cl, ct, cr, cb);        }    }}protected boolean checkLayoutParams(android.view.ViewGroup.LayoutParams p) {    Log.i(""Schedule"", ""checkLayoutParams..."");    if (p instanceof LayoutParams) {        LayoutParams lp = (LayoutParams) p;        if (lp.columnEnd &gt; columns || lp.columnStart &lt; 0)            return false;        if (lp.rowEnd &gt; rows || lp.rowStart &lt; 0)            return false;        return lp.columnEnd &gt; lp.columnStart &amp;&amp; lp.rowEnd &gt; lp.rowStart;    } else        return false;}public android.widget.AbsListView.LayoutParams generateLayoutParams(AttributeSet attrs) {    return new android.widget.AbsListView.LayoutParams(getContext(), attrs);}public static class LayoutParams extends android.view.ViewGroup.LayoutParams {    public int columnStart;    public int columnEnd;    public int rowStart;    public int rowEnd;    public LayoutParams(int columnStart, int rowStart, int columnEnd, int rowEnd) {        super(WRAP_CONTENT, WRAP_CONTENT);        this.columnStart = columnStart;        this.columnEnd = columnEnd;        this.rowStart = rowStart;        this.rowEnd = rowEnd;    }    public LayoutParams(Context c, AttributeSet attrs) {        super(WRAP_CONTENT, WRAP_CONTENT);        android.content.res.TypedArray a = c.obtainStyledAttributes(attrs, R.styleable.EventLayout);        this.columnStart = a.getInt(R.styleable.EventLayout_event_columnStart, 0);        this.columnEnd = a.getInt(R.styleable.EventLayout_event_columnEnd,    this.columnStart + 1);        this.rowStart = a.getInt(R.styleable.EventLayout_event_rowStart, 0);        this.rowEnd = a.getInt(R.styleable.EventLayout_event_rowEnd, this.rowStart + 1);        a.recycle();    }    public int getWidth() {        return columnEnd - columnStart;    }    public int getHeight() {        return rowEnd - rowStart;    }}</code></pre><p>And this is the event-layout - event.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;LinearLayoutandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_centerInParent=""true""android:orientation=""vertical""android:gravity=""center"" &gt;    &lt;TextView android:id=""@+id/text_event_name""    style=""@style/Event_TextView1"" /&gt;    &lt;TextView android:id=""@+id/text_event_name2""    style=""@style/Event_TextView2"" /&gt;&lt;/LinearLayout&gt;&lt;TextView android:id=""@+id/text_event_weeks""style=""@style/Event_TextView2""android:layout_alignParentBottom=""true""android:layout_alignParentLeft=""true"" /&gt;&lt;TextView android:id=""@+id/text_event_room""style=""@style/Event_TextView2""android:layout_alignParentBottom=""true""android:layout_alignParentRight=""true"" /&gt;</code></pre><p></p><p>In my Activity I've got that code:</p><pre><code>Schedule schedule = new Schedule(this, 4, rowTimes.length, 15, 15, rowTimes);</code></pre><p>Cursor cursor = dbManager.getEvents(day);MySimpleCurserAdapter adapter = ... ??// schedule.setAdapter not working...</p><p>How can I add events to the schedule with the data from the cursor?</p>","474326","","474326","","2010-10-13 19:27:29","2010-10-13 19:27:29","Android: How can I add childs to my custom ViewGroup with a CursorAdapter?","<android>","1","0","","",""
"3925813","1","3926761","","2010-10-13 16:21:44","4","29562","<p>EDIT: Problem solved, FileOutputStream defined uncorrectly, change to:</p><p>fos = new FileOutputStream( root + ""/"" + saveFileName );</p><p>Hello, I have a problem writing to the SD card, here is the code:(Sorry about the layout of the code, just copy pased it )</p><pre><code>public class SaveAndReadManager { private String result; private String saveFileName = ""eventlist_savefile""; public String writeToFile( ArrayList&lt;Event&gt; arrlEvents ){  FileOutputStream fos = null;  ObjectOutputStream out = null;  try{   File root = Environment.getExternalStorageDirectory();   if( root.canWrite() ){    fos = new FileOutputStream( saveFileName );    out = new ObjectOutputStream( fos );    out.writeObject( arrlEvents );    result = ""File written"";    out.close();   }else{    result = ""file cant write"";   }  }catch( IOException e ){   e.printStackTrace();   result = ""file not written"";  }  return result; } public boolean readFromFile(){  return false; }}</code></pre><p>I have not implemented the readFromFile() yet. The problem is that root.canWrite() returns false all the time.Here is the manifest file:</p><p></p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".InfoScreen""           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;</code></pre><p></p><pre><code>    &lt;activity android:name="".EventCalendar""              android:label=""@string/app_name"" /&gt;    &lt;activity android:name="".MakeEvent""              android:label=""@string/app_name"" /&gt;    &lt;activity android:name="".ViewEvent""              android:label=""@string/app_name"" /&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""8"" /&gt;</code></pre><p></p><p>I've asked for the permission to write, and on my avd, if i go to settings -> SD card and phone storage, it tells me i have 1 gb on the sd card to write on. Please help.</p><p>Thanks:)</p>","466303","","466303","","2010-10-13 23:40:07","2010-10-13 23:40:07","Permission to write on SD card android","<android><permissions><sd-card>","4","0","5","",""
"3926056","1","","","2010-10-13 16:55:21","0","953","<p>Hi here there is a interesting problem!</p><p>I have this service:</p><pre><code>public class SensorService extends Service implements SensorEventListener {private static final String TAG = ""MyService"";private MyServiceBinder myServiceBinder = new MyServiceBinder();private SensorManager mSensorManager;          ...........private PowerManager.WakeLock wl;private Handler mPeriodicEventHandler;  //Per interrompere la trasformata a tempoprivate int PERIODIC_EVENT_TIMEOUT = 5000;private int x=0,mediacount=0;@Overridepublic IBinder onBind(Intent intent) {    return myServiceBinder; // object of the class that implements Service interface.}public class MyServiceBinder extends Binder implements IMyService {    public void set(String tr, int cp, int sd) {        ......    }}@Overridepublic void onCreate() {    Log.d(TAG, ""onCreate"");    // Get the Wake Lock    PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);    wl = pm.newWakeLock(            PowerManager.PARTIAL_WAKE_LOCK,            ""wlTag"");    wl.acquire();    // Get the SensorManager     mSensorManager= (SensorManager) getSystemService(SENSOR_SERVICE);        mSensorManager.registerListener(this,            mSensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER).get(0),            sDelay);        recc =  new recClass(this);    recc.open();    // To execute every PERIODIC_EVENT_TIMEOUT seconds    mPeriodicEventHandler = new Handler();    mPeriodicEventHandler.postDelayed(doPeriodicTask, PERIODIC_EVENT_TIMEOUT);}@Overridepublic void onDestroy() {    Log.d(TAG, ""onDestroy"");    mIsStarted = false;    mPeriodicEventHandler.removeCallbacks(doPeriodicTask);    recc.close();    wl.release();}@Overridepublic void onSensorChanged(SensorEvent event) {    // SensorEventListener    Sensor sens = event.sensor;    if ((sens.getType() == Sensor.TYPE_ACCELEROMETER) &amp;&amp; mIsStarted){            fft.add((float)Math.sqrt((event.values[0]*event.values[0])+(event.values[1]*event.values[1])+(event.values[2]*event.values[2])));   // Add value to the fft            dataBuffer = fft.calculate();            if (dataBuffer != null){                for (int i=0; i&lt;(fft.camp/2);i++)                        recc.addValue(toRec, dataBuffer[i]);                x++;                Toast.makeText(this, ""FFT: ""+x, Toast.LENGTH_SHORT).show();                mIsStarted = false;                // mIsStarted will be true again after PERIODIC_EVENT_TIMEOUT milliseconds                mPeriodicEventHandler.postDelayed(doPeriodicTask, PERIODIC_EVENT_TIMEOUT);            }    }}@Overridepublic void onAccuracyChanged(Sensor sensor, int accuracy) {}private Runnable doPeriodicTask = new Runnable(){    public void run()     {         mIsStarted = true;    }};</code></pre><p>}</p><p>How you can see i get a PARTIAL_WAKE_LOCK and i take count of how many FFT trasformation it do by the x variable.</p><p>So after starting the service, i turn black the screen pressing the red phone button, and after a while i try to see how many FFT have it done, but the last value of x is the same of when i turned black the screen.</p><p>After some experiment i discovered that if i try the PARTIAL_WAKE_LOCK, without passing from the onSensorChanged method it runs good, but it seems that when the screen go black, everithing continue running except for the sensor listener. How can i repair at this?</p><p>Tnks</p><p>Valerio</p>","314554","","314554","","2010-10-13 18:26:01","2010-10-13 20:25:52","Read sensors while screen is black","<android><listener><sensor><android-wake-lock>","1","0","","",""
"3926135","1","3926427","","2010-10-13 17:05:58","0","699","<p>I'm very very new on Android.</p><p>I want to put a TextView inside a LinearLayout that fills the 80% of LinearLayout's height.</p><p>How can I do that? or How can assign percentage on Widht and Height?</p><p>Thanks.</p>","68571","","","","","2010-10-13 17:44:42","TextView fills the 80% of the screens","<android><design><layout>","1","0","1","",""
"3926138","1","","","2010-10-13 17:06:25","0","269","<p>I am wondering what the best way to render a tournament draw (scrollable) might be for Android. </p><p>Since I am new to this, I was not sure whether to invest time creating a <code>ListView</code> sort of thing or dynamically building HTML pages and rendering them with <code>WebView</code>. Or I could plop everything into a regular scrollable text view, perhaps. </p><p>The main requirement is that I would need the tournament participants to be individually clickable.</p><p>Any thoughts?</p>","474791","","688393","","2011-12-10 15:14:58","2011-12-10 15:14:58","Listview, Webview or ? to create a tournament draw","<android><listview><webview><tournament>","1","0","","",""
"3926228","1","","","2010-10-13 17:16:48","0","1292","<p>I get that the android application is supposed to follow the Activity lifecycle, and I'm sure I'll get to fully implementing it. For starters though, I'm just trying to close the application when the user selects quit from an options menu, without crashing. Can someone help me out? I have a </p><pre><code>public boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId()){    case R.id.quit:        quit();        return true;    default:        return super.onOptionsItemSelected(item);    }}</code></pre><p>Right now R.id is underlined red, saying R.id cannot be resolved, event though i import us.gravebook.geomessage.R.</p>","387405","","","","","2010-10-13 18:43:04","Quitting an android application","<android>","3","0","","",""
"3926367","1","3928452","","2010-10-13 17:33:29","8","11289","<p>I have to parse some complex xml files inside my Android application. Is there any good library for doing that like there is TouchXMl for iPhone? </p>","343679","","28843","","2012-03-27 03:07:21","2012-11-08 11:15:58","Android: Best XML Parsing Library?","<android><xml><android-xml>","3","0","2","",""
"3926395","1","3926520","","2010-10-13 17:38:46","13","9524","<p>I am trying to use a ProgressBar as a metering like display.  I thought it was going to be an easy task and thought that ProgressBar had a property to set to be vertical, but I'm not seeing anything.</p><p>Additionally I'd like to be able to show ruler like indicator along the side of the bar to clearly indicate the current level.</p><p>Pointers appreciated - Thanks!</p>","418714","","","","","2013-02-02 05:06:14","Android - set a ProgressBar to be a vertical bar instead of horizontal?","<android>","4","0","8","",""
"3926540","1","3926607","","2010-10-13 17:58:22","0","4585","<p>I implemented the GPS in my app, in one Activity like this:</p><pre><code> LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        LocationListener mlocListener = new MyLocationListener();        mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mlocListener);public class MyLocationListener implements LocationListener    {        public void onLocationChanged(Location location)        {            if (location != null) { //do something}         ...        }</code></pre><p>This is working fine. After evolving the app more I realized that I need to use the GPS in more than one activity. I need to be able to check if gps is active and what location does it return from 3 activities. </p><p>Imagine this scenario: the user starts the app. In background the GPS is trying to get satellite connection while the user selects some options. When I get to an activity that requires Location info I ask for it. </p><p>How can I achieve this ? Should this be running in another thread ? Please advise me. Thank you</p>","379865","","","","","2011-02-02 09:57:28","Android GPS Listener always running","<android><gps>","2","0","2","",""
"3926553","1","","","2010-10-13 17:59:40","1","1482","<p>I want store a file audio in my personal content provider.i save record:</p><p>Uri uri = getContentResolver().insert(CONTENT_URI, values);OutputStream os =  getContentResolver().openOutputStream(uri);</p><p>but getContentResolver().openOutputStream(uri); throws:</p><p>10-13 19:44:53.903: ERROR/TAB(5679): No files supported by provider at content://com.memento.data.provider.MementoProvider/audionotes/610-13 19:44:53.903: ERROR/TAB(5679): java.io.FileNotFoundException: No files supported by provider at content://com.memento.data.provider.MementoProvider/audionotes/610-13 19:44:53.903: ERROR/TAB(5679):     at android.content.ContentProvider.openFile(ContentProvider.java:585) </p><p>I have a column named _data for that purpose.</p>","271889","","","","","2013-12-03 01:18:41","getContentResolver().openOutputStream(uri) No files supported by provider","<android><android-contentprovider>","1","0","","",""
"3926586","1","3928424","","2010-10-13 18:03:44","0","1350","<p>So I can see Logcat working with no problems in my eclipse IDE. However, when I try to run it in a command prompt, i get a bunch of logcat data for about a second, and then the whole thing freezes.</p><p>Any ideas on how to fix this?</p><p>Thanks</p>","425962","","","","","2010-10-13 22:05:52","Logcat not working on command prompt. It only works in eclipse IDE","<android><logcat>","2","2","","",""
"3926595","1","7155086","","2010-10-13 18:05:39","3","1478","<p>In my MFC user interface programming days you could purchase all kinds of cool screen widgets from 3rd party vendors to integrate into your Visual Studio and use in creating your screens.  Fancy buttons, meters, control knobs, etc...  I can't seem to find anyone doing that for Android.  Does anyone know of any vendors selling stuff like that for programmers to use in Android projects?</p><p>Thanks!</p>","418714","","","","","2011-08-23 00:26:32","Android third party GUI widget vendors","<android>","1","2","2","",""
"3926629","1","3934131","","2010-10-13 18:10:30","2","2323","<p>How is the DownloadListener supposed to work? Probably I miss something. I did the following:</p><ul><li>Register a DownloadListener at a WebView.</li><li>Open a WebView with a HTML page, containing a link (works).</li><li>If I click on the link, the DownloadListener is not called.</li></ul><p>Here is a short portion of the code.</p><pre><code>package rene.android.learnit;import android.app.*;import android.os.Bundle;import android.webkit.*;public class ShowWeb extends Activity     implements DownloadListener{    public static Lesson L;    WebView WV;    @Override    public void onCreate (Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.showweb);        WV=(WebView)findViewById(R.id.showweb);        WV.setDownloadListener(this);        WV.loadUrl(""http://android.rene-grothmann.de/courses.html"");    }    public void onDownloadStart (String url, String agent, String disposition,            String mimetype, long size)    {        Main.log(url+"" ""+mimetype+"" ""+size);    }}</code></pre><p>The logging works (I am using this everywhere to check my program), but nothing is logged, so the callback is not called. What happens is: The view tries to download the file, and fails, since zip files are not supported on my Android.</p><p>The link goes to a zip-file. It is a usual  </p><pre><code>&lt;a href=...&gt;...&lt;/a&gt;</code></pre><p>link.</p><p>I tried to figure out the alternative method of registering an intent for zip files. But the documentation is so sparse, I could not do that. If I have to, is there an example?</p><p>Any ideas?</p><p>Thanks, R.</p>","447111","","447111","","2010-10-13 18:23:11","2011-05-05 20:44:05","downloadlistener not working","<android>","2","0","","",""
"3926648","1","3926868","","2010-10-13 18:13:00","0","1207","<p>I have been developing a project app to learn about android, I can upload my app to my htc desire on my desktop using linux ubuntu and eclipse, I have the same setup on my laptop but I cannot upload apps to my phone.  When I try to install the app to the phone it shows up in avd manager as ??????? ????? Unknown, I've googled this and the general advice is to setup a script which I have tried but I get an error message saying path does not exist, when I try to kill the adb server it says no such command even though I am in root and can see the adb file in the sdk folder, I am completely lost here anyone help with this.....</p><p>Thanks in advance</p>","445174","","","","","2010-10-13 18:38:28","Setting up android phone with eclipse","<android><eclipse><adb>","1","1","1","",""
"3926921","1","","","2010-10-13 18:44:48","0","517","<p>I need help from someone of professional android developers.I develop softkeyboard for android 2.2. I wanted to use LatinIME.git as example.</p><p>An Eclipse project is correct and can be compiled, but after installing app and setting keyboard as input method on device(I use HTC Desire on 2.2) I have a runtime error:10-13 16:31:03.809: ERROR/AndroidRuntime(4917): FATAL EXCEPTION: main10-13 16:31:03.809: ERROR/AndroidRuntime(4917): android.view.InflateException: Binary XML file line #43: Error inflating class 10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at com.android.inputmethod.latin.LatinIME.onCreateCandidatesView(LatinIME.java:410)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:1317)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:1285)10-13 16:31:03.809: ERROR/AndroidRuntime(4917):     at android.inputmethodservice.InputMethodService$InputMethodImpl.showSoftInput(InputMethodService.java:388)</p><p>...After force closing keyboard works but KeyboardView  is showing something wrong (pls. see pictures:<a href=""http://i.piccy.info/i5/84/38/593884/latin1.png"" rel=""nofollow"">http://i.piccy.info/i5/84/38/593884/latin1.png</a>http://i.piccy.info/i5/85/38/593885/latin2.png).</p><p>Thanks a lot.</p><p>Best Regards, Vitaliy.</p>","474913","","","","","2010-10-14 07:02:26","runtime error on softkeyboard using LatinIME.git example","<android><android-softkeyboard>","1","0","","",""
"3926935","1","3927769","","2010-10-13 18:46:15","3","2816","<p>Can you please tell me how can I route audio to bluetooth ear when a bluetooth ear piece is paired?</p><p>I have set my audio manager to be MODE_IN_CALL.</p><pre><code>audioManager.setMode(AudioManager.MODE_IN_CALL);</code></pre><p>I read <a href=""http://stackoverflow.com/questions/2119060/android-getting-audio-to-play-through-earpiece"">Android - Getting audio to play through earpiece</a>, but I am not sure if that apply to my case, since it refers to some deprecated methods. Plus, doesn't android detects if there bluetooth ear piece is paired and routed to ear piece on phone or bluetooth ear piece automatically?</p><p>Thank you.</p>","286802","","112705","","2012-09-05 14:03:40","2012-09-05 14:03:40","How can I route audio to bluetooth ear piece when a bluetooth ear piece is paired","<android>","1","0","","",""
"3927086","1","3927216","","2010-10-13 19:04:22","0","351","<p>How would I go about putting a transparent bar along the top of a scrollview so that when the text scrolls up it kind of fades out towards the top?  I am talking about the kind of thing that the Facebook and NFL mobile apps use.  I think it just makes the whole design look nicer and I was wondering how I could implement this.  Thanks for any suggestions or help!</p>","411224","","","","","2010-10-13 19:20:35","ANDROID: Question regarding overlaying a transparent bar to make layout more aesthetic","<android><design><layout><transparency>","1","0","","",""
"3927114","1","4010935","","2010-10-13 19:07:11","0","186","<p>I am creating an app which plays audio in the background. I have created a background service and a persistent notification to indicate that the music is currently playing.</p><p>However, when I create the notification it feels to strong (e.g. the same as when a new txt or email comes in.) and slides down in the status bar. Instead, I would like the notification to just appear in the status bar without anything fancy. I see other apps which do this, but I cannot figure out how it is done.</p><p>I have experimented with different notification flags, but I haven't found one that works. I also don't see anything in the NotificationManager which would help.</p><p>Anyone know how to do this?</p>","80617","","","","","2010-10-24 23:04:59","Android Quiet Notification","<android><notifications>","1","2","","",""
"3927176","1","3948156","","2010-10-13 19:15:22","0","2008","<p>I have an AutoCompleteTextView with a MatrixCursor as an adapter. The AutoCompleteTextView  has a OnItemClickListener as follows:</p><pre><code>public class AutoCompleteListClickListner implements OnItemClickListener{    private AutoCompleteTextView acView;    public AutoCompleteListClickListner(AutoCompleteTextView view)    {        this.acView = view;    }    @Override    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id)    {        /* tv is the selected view in the dropdown */        TextView tv = (TextView) ((LinearLayout) view).getChildAt(0);        Log.d(AndroidLogTag, ""Before:&gt;&gt;&gt;&gt;"" + this.acView.getText().toString());        this.acView.setText(tv.getText().toString());        Log.d(AndroidLogTag, ""After:&gt;&gt;&gt;&gt;"" + this.acView.getText().toString());    }}</code></pre><p>When an item is selected I see following in the log</p><pre><code>10-14 00:34:37.893: DEBUG/MyApp(19151): Before:&gt;&gt;&gt;&gt;android.database.MatrixCursor@4643e38810-14 00:34:37.912: DEBUG/MyApp(19151): After:&gt;&gt;&gt;&gt;Ankit V Jain</code></pre><p>If you see the log, the <code>Before</code> log entry, the <code>getText()</code> returns a <code>SpannableStringBuilder</code> object and <code>toString()</code> of it returns some object identifier.</p><p>How do I get actual text of the auto-complete view which was there just before clicking drop-down item?</p>","229106","","","","","2012-09-06 12:29:59","getText() on AutoCompleteTextView returns SpannableStringBuilder?","<android><autocompletetextview>","2","0","","",""
"3927198","1","","","2010-10-13 19:18:01","3","389","<p>Five years ago I used to program in SAS. Since then I've been doing software QA of various types. Mostly manual (video games + web apps) testing with a tiny bit of automation.</p><p>I'd really like to shift careers back into programming. Specifically the Android platform has caught my attention. These are the books I've been reading and working through.</p><ul><li>Learning Java, Third Edition - O'Reilly</li><li>Beginning Android 2 - Mark Murphy</li><li>Hello, Android - Ed Burnette</li></ul><p>However, I think I need something that looks at programming from a less language dependent standpoint. Something that takes a bird's eye view if that makes sense. </p><p>It's very easy to see how particular functions work, but I'm looking to get a better sense of how all the pieces fit together. How does one split up an app into individual classes and packages? Do I have a method in main that shuffles my deck of cards (object) or does the class deck of cards have a method I can call to shuffle itself?</p><p>I think I'm looking for a book on object oriented design?</p><p>I've also been working through the tutorials and examples at <a href=""http://developer.android.com/resources/index.html"" rel=""nofollow"">http://developer.android.com/resources/index.html</a> and also in the three books I've been reading so far.</p><p>Maybe I just need to spend more time coding though?</p>","474943","","49376","","2010-10-13 19:21:31","2010-12-02 11:31:05","Re-Teaching Myself to Program - Seeking Object Oriented Design Books","<java><android><oop><programming-languages>","5","2","2","",""
"3927314","1","","","2010-10-13 19:34:16","2","565","<p>I'm  trying to use group_concat to group some rows into one in Android, I get the cursor, but when I request it to move to first position, it crashes with error ""SQL Logic Error or Missing Database. If I remove group_concat() it works perfectly...</p><pre><code>String sql = ""SELECT group_concat(column2, '-') FROM myTable GROUP BY column1"";mCursor = mDb.rawQuery(sql, null);if (mCursor != null) {   mCursor.moveToFirst();}</code></pre><p>Am I doing something wrong???</p>","473744","","","","","2011-06-27 09:40:39","SQL Logic Error or Missing Database with group_concat()","<android><sqlite>","1","2","","",""
"3927369","1","3927682","","2010-10-13 19:43:02","0","2410","<p>This is what I'm doing:</p><pre><code>public static String htmlToText(String inString){String noentity=StringEscapeUtils.unescapeHtml(inString);return noentity;}</code></pre><p>This is where I'm invoking it:</p><pre><code>String html = ""&lt;html&gt;&lt;body&gt;string 1&lt;br /&gt;&amp;#8212;&lt;p&gt;string 2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"";    String nohtml = Utility.htmlToText(html);    Log.i(""NON HTML STRING:"",nohtml);</code></pre><p>And this is the output in the log:</p><pre><code>10-13 12:38:12.121: INFO/NON HTML STRING:(300): &lt;html&gt;&lt;body&gt;string 1&lt;br /&gt;â&lt;p&gt;string 2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>According to the reference at <a href=""http://www.w3.org/TR/html4/sgml/entities.html"" rel=""nofollow"">http://www.w3.org/TR/html4/sgml/entities.html</a> <code>&amp;#8212;</code> should be replaced by a ""—"" (which is the output I expect) and not a ""â"" (which is not what I want).</p><p>At first I was using JSoup and the same thing was happening. Thinking it to be a bug, I switched to org.apache.commons.lang and the same thing is happening.</p><p>Anyone else know what's going on here? Am I missing something obvious?</p>","392178","","","","","2012-05-02 14:32:09","StringEscapeUtils.unescapeHtml() problem in unescaping HTML entities for Android","<html><android><entity><stringescapeutils><lang>","1","1","","",""
"3927738","1","3927947","","2010-10-13 20:30:05","5","1784","<p>I have a LinearLayout layout with a ListView in it.  I've made the android:background of the LinearLayout (I've also tried it on the ListView) be an image that I would like for my background.</p><p>This works fine enough.  However, when I start scrolling through the ListView, the background often disappears and becomes black.  If I move it around some more I may be able to get it to appear again.  It would seem that Android is drawing over, or perhaps painting what's behind my background onto the items.</p><p>Any ideas/solutions?</p>","406790","","","","","2010-10-13 20:59:21","Custom ListView background problem","<android><listview><background>","1","0","3","",""
"3928051","1","","","2010-10-13 21:12:03","0","1762","<p>Hallo guys,im here in austria how are you doing?</p><p>i have startet developing android and writing my own small app that gets files from a server to display the information in a ListView. I really spent a day to look after the best and easiest way to get files from a server. However i wrote the program and tested it - and now i have a serious error message when running the virtual htc machine. </p><p>Its called: <strong>The application org.me.newspuler (process org.me.newspuler) has stopped unexpectedly. Please try again.</strong></p><p>Under this message is put a ""<strong>Force Close</strong>"" Button.</p><p>I really dont know how to get a hint to the problem, NewsPuler is my APP, - i think I need help from some more proffs</p><p>I have 2 classes - one for the download file(i think here is the mistake) - one for the Main ActivityWhen the compiler comes to the point in the code where the instance from ""DownloadFile"" is created... the error appears.</p><p>the download file class:</p><pre><code>package logik;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.net.MalformedURLException;import java.net.URL;import java.util.ArrayList;import java.util.logging.Level;import java.util.logging.Logger;/** * * @author raa */public class DownloadFile {    InputStream is = null;    String link = null;    BufferedReader d = null;    URL url = null;    String s;    ArrayList&lt;String&gt; al = new ArrayList&lt;String&gt;();    public  DownloadFile(String link) throws MalformedURLException{        this.link = link;        url = new URL(link);        try {            is = url.openStream();        } catch (IOException ex) {            Logger.getLogger(DownloadFile.class.getName()).log(Level.SEVERE, null, ex);        }        d = new BufferedReader(new InputStreamReader(is));        try {            while ((s = d.readLine()) != null) {                al.add(s);            }        } catch (IOException ex) {            Logger.getLogger(DownloadFile.class.getName()).log(Level.SEVERE, null, ex);        }    }    public ArrayList getArrayList(){        return al;    }}</code></pre><p>And here (<strong>it works correclty if you leave the commented code, but when you uncomment it - not</strong>)</p><p>package org.me.newspuler;</p><pre><code>import logik.DownloadFile;import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import java.net.MalformedURLException;import java.util.ArrayList;import java.util.logging.Level;import java.util.logging.Logger;/** * * @author raa */public class MainActivity extends Activity {    ArrayList&lt;String&gt; al;     DownloadFile df;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        ListView myListView = (ListView)findViewById(R.id.myListView);//        try {//            df = new DownloadFile(""http://www.google.at/"");////        } catch (MalformedURLException ex) {//            Logger.getLogger(MainActivity.class.getName()).log(Level.SEVERE, null, ex);//        }            //        al.add(""Test"");            //         final ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this,            //                android.R.layout.simple_list_item_1, al);            //            //         myListView.setAdapter(aa);    }}</code></pre><p>I would be really glad to get some help!Kindly Regards from Austria.</p>","475043","","","","","2010-10-14 16:38:01","android file download","<android><file><download><arraylist>","3","0","","",""
"3928071","1","3928324","","2010-10-13 21:15:14","6","27627","<p>Im trying to get an onClickListener to fire on a Spinner, but i get the following error:Java.lang.RuntimeException is ""Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead,"" the thing is, im sure I want to call onClickListener and NOT onItemClickListener. I found this question asked by someone else on stackOverflow, the question is here: <a href=""http://stackoverflow.com/questions/3523078/is-there-a-way-to-use-setonclicklistener-with-an-android-spinner"" title=""here"">link text</a></p><p>The answer stated there is:</p><blockquote>  <p>You will have to set the Click  listener on the underlying view  (normally a TextView with id:  android.R.id.text1) of the spinner. To  do so:</p>    <p>Create a custom Spinner In the  constructor (with attributes) create  the spinner by supplying the layout  android.R.layout.simple_spinner_item  Do a findViewById(android.R.id.text1)  to get the TextView Now set the  onClickListener to the TextView</p></blockquote><p>I have tried the answer noted there, but it doesnt seem to work, I get a null pointer to the TextView after I do the findViewById().</p><p>This is what im doing:</p><pre><code>Spinner spinner = (Spinner) findViewById(R.id.spinner);        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.layoutspinner,dataArray);    spinner.setAdapter(adapter);    TextView SpinnerText = (TextView)findViewById(R.id.spinnerText);    if(SpinnerText==null){        System.out.println(""Not found"");    }else{        SpinnerText.setOnClickListener(new View.OnClickListener(){            @Override            public void onClick(View arg0) {                //Do something            }                   });    }</code></pre><p>layoutspinner.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/spinnerText""              android:singleLine =""true""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:textSize=""6pt""              android:gravity=""right""/&gt;</code></pre><p>Any idea what am I doing wrong?I'm new to stack overflow, I didnt find any way to post an aditional question to the other thread (or comment since I have to little rep) so I started a new question.</p><p>Edit:</p><p>Per recomendation I tried this:</p><pre><code>int a = spinnerMes.getCount();        int b = spinnerMes.getChildCount();        System.out.println(""Count =""+a);        System.out.println(""ChildCount =""+b);        for (int i = 0; i &lt; b; i++) {            View v = spinnerMes.getChildAt(i);            if(v==null){                System.out.println(""View not found"");            }else{                v.setOnClickListener(new View.OnClickListener() {                    @Override                    public void onClick(View v) {                        //Click code                    }                });            }        }</code></pre><p>But logCat isnt showing promising results.</p><pre><code>10-14 16:09:08.127: INFO/System.out(3116): Count =710-14 16:09:08.127: INFO/System.out(3116): ChildCount =0</code></pre><p>I have tested this on API levels 7 and 8 with same results.</p>","474883","","474883","","2010-10-14 16:33:53","2014-04-02 09:09:41","Android: setting a spinner onClickListener()","<java><android><onclick><spinner>","5","0","3","",""
"3928193","1","3952137","","2010-10-13 21:29:01","118","32585","<p>In iOS, there is a very easy and powerful facility to animate the addition and removal of UITableView rows, <a href=""http://www.youtube.com/watch?v=VhSWE6_ieyA#t=1m10s"">here's a clip from a youtube video</a> showing the default animation.  Note how the surrounding rows collapse onto the deleted row.  This animation helps users keep track of what changed in a list and where in the list they were looking at when the data changed.</p><p>Since I've been developing on Android I've found no equivalent facility to animate individual rows in a <a href=""http://developer.android.com/reference/android/widget/ListView.html"">TableView</a>.  Calling <a href=""http://developer.android.com/reference/android/widget/BaseAdapter.html#notifyDataSetChanged%28%29""><code>notifyDataSetChanged()</code></a> on my Adapter causes the ListView to immediately update its content with new information.  I'd like to show a simple animation of a new row pushing in or sliding out when the data changes, but I can't find any documented way to do this.  It looks like <a href=""http://LayoutAnimationController"">LayoutAnimationController</a> might hold a key to getting this to work, but when I set a LayoutAnimationController on my ListView (similar to <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/LayoutAnimation2.html"">ApiDemo's LayoutAnimation2</a>) and remove elements from my adapter after the list has displayed, the elements disappear immediately instead of getting animated out.</p><p>I've also tried things like the following to animate an individual item when it is removed:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, final int position, long id) {    Animation animation = new ScaleAnimation(1, 1, 1, 0);    animation.setDuration(100);    getListView().getChildAt(position).startAnimation(animation);    l.postDelayed(new Runnable() {        public void run() {            mStringList.remove(position);            mAdapter.notifyDataSetChanged();        }    }, 100);}</code></pre><p>However, the rows surrounding the animated row don't move position until they jump to their new positions when <code>notifyDataSetChanged()</code> is called.  It appears ListView doesn't update its layout once its elements have been placed.</p><p>While writing my own implementation/fork of ListView has crossed my mind, this seems like something that shouldn't be so difficult.</p><p>Thanks!</p>","195691","","","","","2014-01-21 05:30:15","How to Animate Addition or Removal of Android ListView Rows","<android><listview><animation>","10","2","97","",""
"3928202","1","","","2010-10-13 21:29:45","1","5516","<p>How can I get the volume of the audio stream coming in through the android microphone?</p>","113911","","","","","2010-10-14 23:43:07","Get Microphone volume","<android>","2","4","2","",""
"3928221","1","","","2010-10-13 21:32:22","2","180","<p>I'm attempting to programmatically create an email with, potentially, multiple attachments but have run into some difficulty. I consulted <a href=""http://stackoverflow.com/questions/2264622/android-multiple-email-attachment-using-intent-question"">this similar question</a> and found that the answer was do create something like this:</p><pre><code>ArrayList&lt;Uri&gt; uris = new ArrayList&lt;Uri&gt;();for (String file : filePaths){    File fileIn = new File(file);    Uri u = Uri.fromFile(fileIn);    uris.add(u);}emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);context.startActivity(Intent.createChooser(emailIntent, ""Send mail...""));</code></pre><p>This solution seemed to yield mixed results for people, some claiming that it always worked for them and some, including me, getting an exception like this:<code>ClassCastException... putParcelableArrayListExtra requires a parcelable not an ArrayList.</code></p><p>Does anyone know if this is a limitation of a particular Android version? I'm using 1.6 right now, unfortunately, and I suspect that might be the source of the problem but I haven't been able to confirm this.</p><p>Thanks in advance</p>","415219","","","","","2010-10-13 21:32:22","Is there a limitation on number of email attachments that can be added programmatically?","<android><email><attachment>","0","0","","",""
"3928248","1","","","2010-10-13 21:35:59","4","2905","<p>I'm trying to create a simple program that scans for a bluetooth headset (I'm testing with a PS3 headset) and then connect to it.  I'm using the code from the <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">bluetooth chat program example</a>.  However I cannot get it to connect to anything.  It is giving me an I/O Exception when it gets to the connect().</p><pre><code>private static final UUID MY_UUID = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""); </code></pre><p>/**     * This thread runs while attempting to make an outgoing connection     * with a device. It runs straight through; the connection either     * succeeds or fails.     */    private class ConnectThread extends Thread {        private final BluetoothSocket mmSocket;        private final BluetoothDevice mmDevice;</p><pre><code>    public ConnectThread(BluetoothDevice device) {        mmDevice = device;        BluetoothSocket tmp = null;        // Get a BluetoothSocket for a connection with the given BluetoothDevice        try {            tmp = device.createRfcommSocketToServiceRecord(MY_UUID);        } catch (IOException e) {            Log.e(TAG, ""create() failed"", e);        }        if (tmp == null){            Log.i(TAG, ""tmp is NULL"");        }        mmSocket = tmp;    }    public void run() {        Log.i(TAG, ""BEGIN mConnectThread"");        setName(""ConnectThread"");        // Always cancel discovery because it will slow down a connection        mAdapter.cancelDiscovery();        Log.i(TAG, ""discovery is cancelled"");        // 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();  //Doesn't like something here???        } catch (IOException e) {            Log.e(TAG, ""IO error, "", 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            newTBluetoothService.this.start();            return;        }        // Reset the ConnectThread because we're done        synchronized (newBluetoothService.this) {            mConnectThread = null;        }        // Start the connected thread        connected(mmSocket, mmDevice);    }    public void cancel() {        try {            mmSocket.close();        } catch (IOException e) {            Log.e(TAG, ""close() of connect socket failed"", e);        }    }}</code></pre><p>Here is the logcat:</p><hr><p>10-13 16:07:45.544: ERROR/BluetoothService.cpp(1259): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)</p><p>10-13 16:07:45.544: DEBUG/newBluetoothService(2821): connect to: 00:22:A6:07:12:2B</p><p>10-13 16:07:45.544: DEBUG/newBluetoothService(2821): setState() 0 -> 2</p><p>10-13 16:07:45.552: INFO/newBluetoothService(2821): BEGIN mConnectThread</p><p>10-13 16:07:45.567: ERROR/BluetoothService.cpp(1259): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)</p><p>10-13 16:07:45.567: INFO/newBluetoothService(2821): discovery is cancelled</p><p>10-13 16:07:45.575: ERROR/BluetoothEventLoop.cpp(1259): onCreateDeviceResult: D-Bus error: org.bluez.Error.AlreadyExists (Device already exists)</p><p>10-13 16:07:45.583: INFO/BluetoothNew(2821): MESSAGE_STATE_CHANGE: 2</p><p>10-13 16:07:46.700: ERROR/BluetoothEventLoop.cpp(1259): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/2872/hci0/dev_00_22_A6_07_12_2B</p><p>10-13 16:07:47.036: DEBUG/BluetoothService(1259): updateDeviceServiceChannelCache(00:22:A6:07:12:2B)</p><p>10-13 16:07:47.059: DEBUG/BluetoothService(1259):     uuid(system): 0000111e-0000-1000-8000-00805f9b34fb 1</p><p>10-13 16:07:47.067: DEBUG/BluetoothService(1259):     uuid(system): 00001108-0000-1000-8000-00805f9b34fb 2</p><p>10-13 16:07:47.075: VERBOSE/BluetoothEventRedirector(1786): Received android.bleutooth.device.action.UUID</p><p>10-13 16:07:47.075: DEBUG/BluetoothService(1259): Cleaning up failed UUID channel lookup: 00:22:A6:07:12:2B 00001101-0000-1000-8000-00805f9b34fb</p><p>10-13 16:07:47.083: ERROR/newBluetoothService(2821): IO error, </p><p>10-13 16:07:47.083: ERROR/newBluetoothService(2821): java.io.IOException: Service discovery failed</p><p>10-13 16:07:47.083: ERROR/newBluetoothService(2821):     at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:377)</p><p>10-13 16:07:47.083: ERROR/newBluetoothService(2821):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:201)</p><p>10-13 16:07:47.083: ERROR/newBluetoothService(2821):     at com.nmtransfer.bluetooth.newBluetoothService$ConnectThread.run(newBluetoothService.java:347)</p><p>10-13 16:07:47.083: INFO/newBluetoothService(2821): Connection Failed</p><p>10-13 16:07:47.083: DEBUG/newBluetoothService(2821): setState() 2 -> 1</p><p>10-13 16:07:47.083: DEBUG/newBluetoothService(2821): start</p><p>10-13 16:07:47.083: INFO/BluetoothNew(2821): MESSAGE_STATE_CHANGE: 1</p><p>10-13 16:07:47.098: DEBUG/BluetoothService(1259): new handle 1000d</p><p>10-13 16:07:47.106: DEBUG/newBluetoothService(2821): setState() 1 -> 1</p><p>10-13 16:07:47.106: DEBUG/newBluetoothService(2821): BEGIN mAcceptThreadThread[Thread-13,5,main]</p><p>10-13 16:07:47.114: INFO/BluetoothNew(2821): MESSAGE_STATE_CHANGE: 1</p><p>10-13 16:07:51.036: ERROR/BluetoothEventLoop.cpp(1259): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/2872/hci0/dev_00_22_A6_07_12_2B</p><p>10-13 16:07:53.583: VERBOSE/BluetoothEventRedirector(1786): Received android.bleutooth.device.action.UUID</p><hr><p>Any help is much appreciated.</p><p>Thank youChris</p>","43712","","43712","","2010-10-14 17:12:49","2013-12-19 13:11:42","Connect/Pair Bluetooth Headset and Android","<android>","3","1","1","",""
"3928444","1","4039986","","2010-10-13 22:09:34","1","972","<p>I have written a custom preference class which contains a simple progress bar in it to allow setting things like volume.The preference worked great until I tried putting two of these preference in my preference screen. </p><p>When I did that the preference screen started to act wierdly » the two custom preferences switch locations constantly as i drag the seek bar. </p><p>Any one have any idea why this is happening?Thanks</p><p>EDIT:here is the code of the custom preference</p><pre><code>import android.content.Context; importandroid.content.SharedPreferences; import android.content.res.TypedArray; import android.graphics.Typeface; import android.preference.Preference; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView;public class SeekBarPreference extends Preference implements        OnSeekBarChangeListener {    private int mMaximum = 60;  private int mInterval = 1;  private int mMinimum = 1;    private int mDefault = 50;  private TextView monitorBox;    public SeekBarPreference(Context context)   {       super(context);     }    public SeekBarPreference(Context context, AttributeSet attrs)   {       super(context, attrs);      initValues(context, attrs);     }    public SeekBarPreference(Context context, AttributeSet attrs, int defStyle)     {       super(context, attrs, defStyle);        initValues(context, attrs);     }    private void initValues(Context context, AttributeSet attrs)    {       TypedArray styledAttributes = context.obtainStyledAttributes(attrs,                R.styleable.SeekBarPreference);         mMinimum = styledAttributes.getInt(                R.styleable.SeekBarPreference_barMinValue, 1);      mMaximum = styledAttributes.getInt(                R.styleable.SeekBarPreference_barMaxValue, 1);      mInterval = styledAttributes.getInt(                R.styleable.SeekBarPreference_barInterval, 1);      mDefault = styledAttributes.getInt(                R.styleable.SeekBarPreference_defaultValue, mMaximum);  }    @Override   protected View onCreateView(ViewGroup parent)   {        LinearLayout horizontalLayout = new LinearLayout(getContext());         horizontalLayout.setPadding(15, 5, 10, 5);      horizontalLayout.setOrientation(LinearLayout.HORIZONTAL);        LinearLayout verticalLayout = new LinearLayout(getContext());       verticalLayout.setOrientation(LinearLayout.VERTICAL);        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(                LinearLayout.LayoutParams.WRAP_CONTENT,                LinearLayout.LayoutParams.WRAP_CONTENT);        layoutParams.gravity = Gravity.LEFT;        layoutParams.weight = 0.5f;        LinearLayout.LayoutParams settingTitleLayoutParams = new LinearLayout.LayoutParams(                LinearLayout.LayoutParams.WRAP_CONTENT,                LinearLayout.LayoutParams.WRAP_CONTENT);        settingTitleLayoutParams.gravity = Gravity.LEFT;        settingTitleLayoutParams.weight =1.0f;        LinearLayout.LayoutParams seekbarLayoutParams = new LinearLayout.LayoutParams(                80, LinearLayout.LayoutParams.WRAP_CONTENT);        seekbarLayoutParams.gravity = Gravity.RIGHT | Gravity.CENTER_VERTICAL;        LinearLayout.LayoutParams selectedAmountLayoutParams = new LinearLayout.LayoutParams(                30, LinearLayout.LayoutParams.WRAP_CONTENT);        selectedAmountLayoutParams.gravity = Gravity.CENTER;        TextView titleTextView = new TextView(getContext());        titleTextView.setText(getTitle());      titleTextView.setTextSize(18);      titleTextView.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);      titleTextView.setGravity(Gravity.LEFT);         titleTextView.setLayoutParams(settingTitleLayoutParams);        TextView summeryTextView = new TextView(getContext());      summeryTextView.setText(getSummary());      summeryTextView.setTextSize(14);        summeryTextView.setTypeface(Typeface.SANS_SERIF);       summeryTextView.setGravity(Gravity.LEFT);       summeryTextView.setLayoutParams(settingTitleLayoutParams);        SeekBar bar = new SeekBar(getContext());        bar.setMax(mMaximum);           bar.setProgress(mDefault);      bar.setPadding(10, 0, 10, 0);       bar.setLayoutParams(seekbarLayoutParams);       bar.setOnSeekBarChangeListener(this);        this.monitorBox = new TextView(getContext());       this.monitorBox.setTextSize(12);        this.monitorBox.setTypeface(Typeface.MONOSPACE, Typeface.ITALIC);       this.monitorBox.setLayoutParams(selectedAmountLayoutParams);        this.monitorBox.setPadding(2, 5, 0, 0);         this.monitorBox.setText(bar.getProgress()+ """");        verticalLayout.addView(titleTextView);      verticalLayout.addView(summeryTextView);        horizontalLayout.addView(verticalLayout, layoutParams);         horizontalLayout.addView(bar);      horizontalLayout.addView(this.monitorBox);      horizontalLayout.setId(android.R.id.widget_frame);        return horizontalLayout;    }    public void onProgressChanged(SeekBar seekBar, int progress,            boolean fromUser)   {        progress = Math.round(((float) progress) / mInterval) * mInterval;      if (progress &lt; mMinimum)        {           progress = mMinimum;        }        if (!callChangeListener(progress))      {           seekBar.setProgress((int) this.mDefault);           return;         }        seekBar.setProgress(progress);      this.mDefault = progress;       this.monitorBox.setText(progress + """");         updatePreference(progress);        notifyChanged();    }    public void onStartTrackingTouch(SeekBar seekBar)   {   }    public void onStopTrackingTouch(SeekBar seekBar)    {   }    @Override   protected Object onGetDefaultValue(TypedArray ta, int index)    {        int dValue = (int) ta.getInt(index, 5);        return validateValue(dValue);   }    @Override   protected void onSetInitialValue(boolean restoreValue, Object defaultValue)     {       int temp = restoreValue ? getPersistedInt(5) : (Integer) defaultValue;        if (!restoreValue)          persistInt(temp);        this.mDefault = temp;   }    private int validateValue(int value)    {        if (value &gt; mMaximum)           value = mMaximum;       else if (value &lt; 0)             value = 0;      else if (value % mInterval != 0)            value = Math.round(((float) value) / mInterval) * mInterval;        return value;   }    private void updatePreference(int newValue)     {        SharedPreferences.Editor editor = getEditor();      editor.putInt(getKey(), newValue);      editor.commit();    }}</code></pre><p>EDIT: I have found that creating a second class with the excat same code but different name an using one of each solves the problem = worst soulution ever. I do not want to do this. anyone have any idea?</p>","407133","","407133","","2010-10-22 18:29:05","2010-10-29 06:28:53","Custom preference jumping all over screen","<android>","2","2","","",""
"3928488","1","3944236","","2010-10-13 22:17:07","5","10181","<p>I need to create an application with 4 view. I need to pass from a view to an other simply by a touch and a move to the left or to the right (no button). The effect I would like is the same that you see when you navigate in the main menu of android when you pass from a page to another.</p><p>I have tested the ViewFlipper, but I cannot use it: it seems not to catch the touch event correctly. I don't even know if it is the right component.</p><p>What is the right way to handle this?</p>","50455","","","","","2012-06-11 03:25:38","How can I create a sliding layout, like the main android menu?","<android>","4","1","4","",""
"3928562","1","3928796","","2010-10-13 22:31:21","2","2911","<p>I know this is been answered many times but i am unable to find any good resource for this.</p><p>Can any one tell how to create <strong>Custom Alert box</strong> for android??. What i want is a nice looking alert box with few images text etc which will be basically mu application info. I know how to create simple alert box. Please point me to any sample code if possible</p><p>ThanksPranay</p>","443694","","","","","2013-01-28 09:27:19","Creating Custom Alert box in android","<android><android-widget>","2","0","2","",""
"3928631","1","6008253","","2010-10-13 22:41:12","1","1152","<p>I have written a simple app widget that tries to display a time chart as a sparkline using the achartengine library.My renderer is:</p><pre><code>final XYMultipleSeriesRenderer multipleRenderer = new XYMultipleSeriesRenderer();final XYSeriesRenderer renderer = new XYSeriesRenderer();multipleRenderer.addSeriesRenderer(renderer);multipleRenderer.setShowAxes(false);multipleRenderer.setShowLabels(false);multipleRenderer.setShowLegend(false);multipleRenderer.setShowGrid(false);</code></pre><p>and after creating a dataset I draw to a bitmap using:</p><pre><code>final TimeChart tc = new TimeChart(dataset, multipleRenderer);final Bitmap image1 = Bitmap.createBitmap(INITIAL_WIDTH, INITIAL_HEIGHT, Bitmap.Config.ARGB_8888);final Canvas canvas = new Canvas(image1);tc.draw(canvas, 0, 0, INITIAL_WIDTH, INITIAL_HEIGHT);</code></pre><p>but annoyingly the chart I get has a thick border where the axes and labels would have been. </p><p>I would like to know if there is a better way using achartengine of plotting my sparkline so that it occupies the whole width of the bitmap.</p>","4389","","56338","","2010-11-14 09:17:29","2011-11-19 23:01:50","How can I draw a sparkline with achartengine without a border?","<android><charts><achartengine>","1","0","2","",""
"3928711","1","6174440","","2010-10-13 22:52:53","65","66159","<p>Can anyone tell me how to make an EditText not editable via XML? I tried setting android:editable to false, but (1) it is deprecated and (2) it didn't work.</p>","439836","","1765573","","2013-07-22 12:13:11","2014-02-06 17:28:00","How to make EditText not editable?","<android><android-edittext>","14","4","22","",""
"3928761","1","","","2010-10-13 23:02:27","0","211","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1510840/where-does-android-emulator-store-sqlite-database"">Where does Android emulator store SQLite database?</a>  </p></blockquote><p>I am doing database application in android.i need to know where the data base is store,whether in Emulator or in our application.</p><p>Thanks in advance...</p>","461972","","","","","2010-10-13 23:25:04","Database on Android","<android>","1","1","","2011-08-25 13:10:47",""
"3928779","1","3946056","","2010-10-13 23:06:41","8","9986","<p>Running Android 2.2 on a Galaxy S. Host is an OS X 10.6.4 machine. DDMS in Eclipse reports no devices being connected. <code>adb devices</code> -- nothing. </p><p>I've tried:</p><ol><li>Rebooting the phone</li><li>Toggling the USB development mode</li><li>Plugging/unplugging the cable</li><li>Restarting the server (<code>adb kill-server</code>).</li></ol><p>The weird thing is that sometimes computer will not detect the phone being attached (no growl notification, not syslog entries) and sometimes it will. Other android devices work.</p><p>Do you guys have any ideas what else I could try or is this a lost cause?</p><p>Thanks</p>","38753","","","","","2011-07-20 00:56:26","Android device not showing up in DDMS","<android><osx><ddms>","3","3","1","",""
"3928864","1","3930132","","2010-10-13 23:26:54","2","16386","<p>I have an object on my main.xml layout file called thefact that is TextView. I also have a string called sharefact. I want to save what text is in the TextView into the sharefact string. I can't do:</p><pre><code>sharefact = thefact</code></pre><p>Or anything similar to that because it would want me to convert sharefact into a textview.</p><p>Thanks!</p>","473903","","","","","2012-05-13 20:08:05","Converting TextView to String (kind of) Android","<android><string><textview>","2","0","1","",""
"3928901","1","","","2010-10-13 23:35:15","0","3038","<p>I have a widget that I've developed and it runs fine on my emulator. But when I go to and run it on my device it doesn't show up in the list</p><p>Here is what my console says:</p><pre><code>[2010-10-14 12:43:43 - MyWidget] No Launcher activity found![2010-10-14 12:43:43 - MyWidget] The launch will only sync the application package on the device!**[2010-10-14 12:43:43 - MyWidget] Performing sync[2010-10-14 12:43:43 - MyWidget] Automatic Target Mode: using device 'D70068f58fd3'[2010-10-14 12:43:43 - MyWidget] Uploading MyWidget.apk onto device 'D70068f58fd3'[2010-10-14 12:43:43 - MyWidget] Installing MyWidget.apk...[2010-10-14 12:43:45 - MyWidget] Success![2010-10-14 12:43:45 - MyWidget] /MyWidget/bin/MyWidget.apk installed on device[2010-10-14 12:43:45 - MyWidget] Done!</code></pre><p>I can see that indeed the application package is on my device via the Applications manager.</p><p>I've seen the other posts on SO:<a href=""http://stackoverflow.com/questions/3347569/android-sample-app-not-showing-up"">http://stackoverflow.com/questions/3347569/android-sample-app-not-showing-up</a>http://stackoverflow.com/questions/3888383/launching-android-widget/3936481#3936481and <a href=""http://stackoverflow.com/questions/2186758/first-android-test-project-does-not-start"">http://stackoverflow.com/questions/2186758/first-android-test-project-does-not-start</a></p><p>But I have a widget. Is that different?  And here is my AndroidManifest.xml, which does indeed have a Launcher defined.</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.widget""android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;receiver android:name="".MyWidget""              android:label=""Anything""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;</code></pre><p> </p>","469682","","469682","","2010-10-14 18:52:43","2014-02-13 16:55:03","No Launcher activity found! For a widget? Does it have to be an activity","<android><android-widget>","1","7","","",""
"3928940","1","3928987","","2010-10-13 23:42:51","0","618","<p>What's the correct way (if any) to redirect a received Intent to another BroadcastReceiver?</p><p>I have two BroadcastReceivers set to listen to the same intent.  It works in development, but in production, only the first one registered in the manifest gets the intent.</p><p>Can I call the other one's onReceive() method directly, passing the same context and intent?  Is there a better way to pass the intent along once the first receiver is done with it?</p><p><strong>EDIT</strong> - I never figured out how to do this generically, but I came up with a solution.  I wrote it up on my blog and it's pretty long so, <a href=""http://www.xn--w-mer-iza4o.com/2010/11/07/intercepting-google-analytics-referrer-tracking-on-android/"" rel=""nofollow"">insert shameless plug to my answer here</a>.</p>","205192","","205192","","2011-03-17 18:34:44","2011-03-17 18:34:44","Redirect BroadcastReceiver onReceive()","<android><android-intent><broadcastreceiver>","1","0","","",""
"3928951","1","4018290","","2010-10-13 23:45:40","0","1791","<p>I want to disable the button press on a 2nd click, so I have this code for the action handler of the button in my android code :</p><pre><code>      // do something when the button is clicked       public void onClick(View v) {        final Button button = (Button)findViewById(R.id.radio_red);        if(button.isPressed()==true &amp;&amp; rt1==true )         {            button.setPressed(false);            button.clearFocus();            //rt1=false;                    //do some processing !             }        else rt1=true;    }'</code></pre><p>However, button.setPressed(false);   doesnt work as expected. :(</p><p>Can anyone please help me out ?</p>","342925","","342925","","2010-10-14 00:16:56","2010-10-25 19:52:38","problem with using button.setPressed(false); in android java code","<java><android><user-interface><button>","2","2","1","",""
"3929189","1","3929870","","2010-10-14 00:41:32","1","1225","<p>In android, I'd like to include a database at the time of installation i.e. in the .apk file. Is it possible to do that? I have some data in a database that I would want to use in the app. I don't want to use OnCreate method to create a database. So, where should I keep my db file so that it is accessible to the app after installation? </p>","475175","","73488","","2010-10-14 00:43:27","2010-10-14 03:29:03","android-Include a database at the time of installation","<android>","2","0","","",""
"3929361","1","3929512","","2010-10-14 01:15:13","22","16646","<p>I can't use <code>shutdown()</code> and <code>awaitTermination()</code> because it is possible new tasks will be added to the ThreadPoolExecutor while it is waiting.</p><p>So I'm looking for a way to wait until the ThreadPoolExecutor has emptied it's queue and finished all of it's tasks without stopping new tasks from being added before that point.</p><p>If it makes any difference, this is for Android.</p><p>Thanks</p><p><strong>Update</strong>: Many weeks later after revisiting this, I discovered that a modified CountDownLatch worked better for me in this case.  I'll keep the answer marked because it applies more to what I asked.</p>","445348","","445348","","2013-09-27 13:56:45","2013-09-27 13:56:45","How to wait for all tasks in an ThreadPoolExecutor to finish without shutting down the Executor?","<java><android><multithreading><wait>","4","7","9","",""
"3929412","1","","","2010-10-14 01:28:31","14","12763","<p>I have seen numerous applications that use layering in their layouts. When I speak of layering I am referring to layers in the z-axis relative to the view of the user. One such app is the Craigslist Notification app where on top of the listView there is a plus sign near the bottom to allow user access to adding an additional list item.</p><p>In my case, I am successfully using a GestureListener to turn pages. Works well, but I would like to superimpose a transparent right and left arrow png on the edges of the pages if there are pages back or forward of the one the user is currently on.</p><p>I have searched, but not quite sure how to have 2 elements of a Layout consume the same space simultaneously. In this case you have the content of the page (layout), and the need for something on top of (z-axis) of that layout.</p><p>Can someone point me in the right direction?</p><p>Appreciate.</p><p>/r</p>","475238","","","","","2011-07-15 13:00:09","Android - Layout Layers? Z-Axis?","<android><layout><layering><z-axis>","2","0","4","",""
"3929415","1","4280678","","2010-10-14 01:29:11","1","1771","<p>I'm trying to update the project at <a href=""http://code.google.com/p/android-wheel/"" rel=""nofollow"">http://code.google.com/p/android-wheel/</a> to act like the iPhone spinner/Urban Spoon App. </p><p>I want to add acceleration/deceleration to scrolling, as well as a spinning animation. I just don't know where to start. I was able to get the whole control to slide with the built in android transitions by adding the effects to the onTouchEvent in the WheelView <a href=""http://code.google.com/p/android-wheel/source/browse/trunk/wheel/src/kankan/wheel/widget/WheelView.java"" rel=""nofollow"">here</a>. </p><p>Obviously that's not very useful and I don't think the transition animations are what I need. Can anybody take a look at this and at the very least suggest how to start modifying it to do what I want? Any help would be appreciated. I don't expect anybody to implement this and hand it to me but I'm confused and frustrated with this, so I would like some kind of guidance. </p><p>I've tried the webview method <a href=""http://stackoverflow.com/questions/2909249/how-can-we-create-iphone-like-spinners-in-android"">here</a> but it loads and runs kind of slow and it doesn't  animate either so I'd rather just use the customized Android controls if possible. </p><p>Thanks for any help. </p>","127704","","","","","2010-11-25 20:36:22","add animation to android-wheel","<android><android-widget><spinner>","1","0","1","",""
"3929429","1","","","2010-10-14 01:34:11","2","1325","<p>I'm working with a fairly complex data edit activity in Android that makes use of the bundle object a lot when saving form data.</p><p>In general this works pretty well and I haven't experienced any data loss. However I have a strange intermittent bug that I can't seem to find the direct cause of.</p><p>It happens when I send an intent to the gallery (using startActivityForResult) to enable the user to select a profile image. A small (96x96) bitmap is returned in the bundle, and I save this data to their profile. This works flawlessly about 90% of the time, however on some occasions instead of returning with the image saved in a bundle, it will return a bundle that cannot be parsed. This occurs fairly frequently if I leave the device sitting in the gallery select mode for several minutes. (>5 minutes of idling).</p><p>When I attempt to access any functionality of the bundle at all I get the following runtime exception:</p><p>java.lang.RuntimeException: Parcel android.os.Parcel@44a06078: Unmarshalling unknown type code -8913000 at offset 392</p><p>Things of note: o When this error occurs it appears that the edit activity has been destroyed and needs to be recreated. (Before the error occurs it progresses through onCreate, onStart and onRestoreInstanceState (Where the crash originates)).o This appears to cause it to skip the ""onActivityResult"" section (or at least never reaches that far.o The bundle object retrieved in onRestoreInstanceState is not null, but any other access to the object (including checking if its empty) result in this crash.o By checking the bundle source code, I found that the crash seems to originate from the bundle performing an internal type check using a stored int flag. The error occurs when the int flag comes up with a type not in the list (so far it consistently has been -8913000).o I've only seen this error on froyo so far (2.2)</p><p>Has anyone encountered a similar error to this? Does anyone have a suggestion on where to look next?</p><p>In the mean time I'm going to try to put together a slimmed down version of this section of code that might be post-able, and see if that still reproduces the problem in question.</p>","461367","","995926","","2012-05-05 13:59:26","2012-05-05 13:59:26","Android Bundle Error: Unmarshalling unknown type code","<android><bundle><android-2.2-froyo>","0","3","","",""
"3929482","1","4071846","","2010-10-14 01:51:39","0","756","<p>How to we setup scratchbox for android to do cross compilation?What type of target do we choose?</p>","275674","","","","","2010-11-01 18:23:28","scratchbox cross compilation for android","<android><cross-compiling>","1","0","","",""
"3929516","1","","","2010-10-14 02:01:39","0","632","<p>I am making a tile based game for Android.  For the sake of argument, let's say I want to have 6 tiles across the top of the screen and that I want the tiles to fill the screen regardless of the phone I am using.</p><p>The way I understand it, I want to be using Density Independent Pixels in my code to make sure that the images look the same size on each phone regardless of density, but this does not help me with actually getting 6 tiles to fig snugly in each row.  For this, I would need to do a calculation based on the actual pixels on the screen.  Further, if I do use DIP I am not guaranteed to have all 6 tiles fit in a row - I would be leaving it up to chance.  How do games on the Android handle this?  It seems like I cannot solve the problem in a ""DIP"" way.</p><p>Thanks.</p>","469106","","","","","2012-07-14 19:57:43","Android Image/DIP Questions","<android><dpi><dip>","0","4","","",""
"3929544","1","3929549","","2010-10-14 02:07:31","8","16108","<p>I have an error that says ""OnItemClickListener cannot be resolved to a type"" when I enter this code in:</p><pre><code>package com.funkystudios.android.facts;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;public class activity2 extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   String[] Facts = getResources().getStringArray(R.array.Facts_Array);   setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list, Facts));   ListView lv = getListView();   lv.setTextFilterEnabled(true);   lv.setOnItemClickListener(new OnItemClickListener() {      public void onItemClick(AdapterView&lt;?&gt; parent, View view,          int position, long id) {        // When clicked, show a toast with the TextView text        Toast.makeText(getApplicationContext(), ((TextView) view).getText(),            Toast.LENGTH_SHORT).show();      }    }); }}</code></pre><p>It occurs right at the ""lv.setOnItemClickListener(new OnItemClickListener() {"". I'm not sure what I'm doing wrong.</p>","473903","","","","","2012-02-01 10:46:30","OnItemClickListener","<android>","2","1","1","",""
"3929583","1","3938750","","2010-10-14 02:15:07","0","787","<p>I tried to connect to a server through a SOCKS server in an Android client app (Android OS 1.5 and 1.6) with below snippet code: </p><pre><code>    Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(Constants.SOCKS_PROXY_HOST, Constants.SOCKS_PROXY_PORT));    socket = new Socket(proxy);    InetSocketAddress dest = new InetSocketAddress(targetHost,targetPort);    socket.connect(dest);</code></pre><p>However it gave out an exception on the last line:</p><pre><code>W/System.err(  507): java.net.SocketException: SOCKS connection failed: java.net.SocketException: Bad socketW/System.err(  507):    at org.apache.harmony.luni.net.PlainSocketImpl.socksConnect(PlainSocketImpl.java:389)W/System.err(  507):    at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)W/System.err(  507):    at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:521)W/System.err(  507):    at java.net.Socket.connect(Socket.java:1019)W/System.err(  507):    at java.net.Socket.connect(Socket.java:960)</code></pre><p>Anyone might have an idea where did i do wrong?Thanks in advance.</p>","460176","","","","","2010-10-15 01:07:04","Android, Bad Socket Exception (SOCKS)","<android><client-server><socks>","1","0","","",""
"3929634","1","4527579","","2010-10-14 02:28:32","7","2679","<p>I have basically finished developing an android app that makes use of SQLite databases that I copy to the user data area on the device eg /data/data/com.company.app/databases/users.db</p><p>I am unsure how the marketplace app update procedure takes place and am also unsure as to how I could test it.</p><p>I currently check whether the database exists on the device and copy it if it doesn't (generally only occurs on first ever launch). What happens if I have a new version of the database in my updated app? Will an marketplace update wipe user data so that it will copy my new database in on next launch?</p><p>What happens in the future if I make database changes/add records/etc and package this with the new app? Will this database not overwrite the old database?</p><p>Otherwise, to avoid copying and overriding the databases from the app bundle on every launch is there a way to check the size and date of the database files and only copy if the database in the bundle is newer?</p><p>If anyone needs clarification please ask.</p>","387317","","","","","2010-12-24 17:37:16","Android handle app updates and database changes","<android><database><marketplace>","1","0","4","",""
"3929666","1","","","2010-10-14 02:36:40","0","530","<p>We have an activity which requires additional authentication.  During onCreate and onResume (never both) showDialog is called and a custom dialog is created in onCreateDialog to request a password.  The information on the Activity screen is sensitive so before showDialog is called we call Activity.setVisible(false).  If the password from the dialog is valid, setVisible is called again and the activity is displayed.  This all works fine.</p><p>If there is an error while processing the activity another activity which is styled android:style/Theme.Dialog displays error information and is user dismissed.  onResume for the original activity is called which processes the password dialog again...</p><p>The screen goes blank - no visible activity or dialog.  The application is still running and I can still navigate the dialog with the keyboard and mouse (""blind"") from memory.  I enter the password, press enter and the activity is visible again.</p><p>Why is the dialog not visible the second time but still navigable?  I suspect a screen draw issue or something to do with using Activity.setVisible controlling what is displayed.</p><p>Android 1.6</p>","285701","","285701","","2010-10-15 13:01:48","2010-10-15 13:01:48","Dialog not visible but still interactive","<android><dialog>","0","3","","",""
"3929748","1","","","2010-10-14 02:55:21","3","3697","<p>I'm making an http request. I'm on a platform (android) where network operations often fail because the network connection might not be immediately available. Therefore I'd like to try the same connection N times before completely failing. Was thinking of something like this:</p><pre><code>DefaultHttpClient mHttp = ...;public HttpResponse runHttpRequest(HttpRequestBase httpRequest)     throws IOException{    IOException last = null;    for (int attempt = 0; attempt &lt; 3; attempt++) {        try {            HttpResponse response = mHttpClient.execute(httpRequest);            int statusCode = response.getStatusLine().getStatusCode();            if (statusCode == 200) {                return response;            }        } catch (IOException e) {            httpRequest.abort();            last = e;        }    }    throw last;}</code></pre><p>I'm mostly worried about the connection being in some state which is invalid on subsequent retries. In other words, do I need to completely recreate 'httpRequest', should I avoid calling httpRequest.abort() in the catch block, and only call it in the final failure?</p><p>Thanks</p>","291701","","291701","","2010-10-14 03:02:55","2013-03-24 07:13:05","Retrying an http connection","<java><android>","3","0","","",""
"3929891","1","","","2010-10-14 03:34:12","1","83","<p>I have heard that a processor without graphics card will take a lots of time to produce a graphical entity,than one with graphics card.So is there anything like that if we use Open Gl in android application??will my application become slow ??</p>","474166","","596219","","2011-12-08 13:38:40","2011-12-08 13:38:40","Will using open GL in android application reduce the system efficiency?","<android>","1","0","","",""
"3929984","1","4005684","","2010-10-14 04:01:19","3","4746","<p>I am trying out the record outgoing call using mic written this code but not working, i tested the code for simple audio record it works fine, I am not sure when to start media record i putted start in broadcast receiver may be problem is there.</p><p>Here Audiorecoder is another class is created where i have implemented MediaRecoder</p><pre><code>public void onReceive(Context context, Intent intent) {        // TODO Auto-generated method stub        audrec = new AudioRecorder(""newcall"");        this.context = context;        if (intent.getAction().equalsIgnoreCase(Intent.ACTION_DIAL))         {            try {                audrec.start();                recordstarted = 1;                telManager= (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }        final PhoneStateListener phoneListener = new PhoneStateListener()        {            @Override            public void onCallStateChanged(final int state, final String incomingNumber)            {                getTelephonyOverview(telManager);            }        };        telManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);    }    public void getTelephonyOverview(final TelephonyManager telManager)    {        int callState = telManager.getCallState();        switch (callState)        {        case TelephonyManager.CALL_STATE_IDLE:        {            if (recordstarted==1)            {                try {                    audrec.stop();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                recordstarted =0;            }            break;        }        case TelephonyManager.CALL_STATE_OFFHOOK:        {            try {                audrec.start();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            recordstarted =1;            break;        }        case TelephonyManager.CALL_STATE_RINGING:               {            try {                audrec.start();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            recordstarted =1;            break;        }        }    }   </code></pre><p>Another Code that i am trying out that create 3Gp file but not playing</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;public class androidrec extends Activity{   Button btn_start;   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState)    {      super.onCreate(savedInstanceState); setContentView(R.layout.main);      btn_start = (Button) findViewById(R.id.btn_start);      UpdateRecorderState();      btn_start.setOnClickListener(new View.OnClickListener()       {         public void onClick(View v)          {                          //          Toast.makeText(getBaseContext(),""Please enter both phone number and message."",             //          Toast.LENGTH_SHORT).show();            if(!SharedData._Started) { StartServicesAtStartUp.Start_CallRec(getBaseContext()); }            else { StartServicesAtStartUp.Stop_CallRec(getBaseContext()); }            UpdateRecorderState();         }      });           }   private void UpdateRecorderState()    {      if(SharedData._Started)      {btn_start.setText(""Stop Recording"");}      else      {btn_start.setText(""Start Recording"");}   }}[/code]import java.io.File;import java.io.IOException;import java.text.SimpleDateFormat;import java.util.Date;import android.media.MediaRecorder;import android.telephony.PhoneStateListener;import android.telephony.TelephonyManager;import android.util.Log;//import com.lumitrend.netlogger.Logger;public class CallStateListener extends PhoneStateListener {   public void onCallStateChanged(int state, String incomingNumber)   {      super.onCallStateChanged(state, incomingNumber);      switch(state)      {      case TelephonyManager.CALL_STATE_IDLE:         if(SharedData._Recording)          { Recorders_Stop(); }         break;      case TelephonyManager.CALL_STATE_RINGING:         break;      case TelephonyManager.CALL_STATE_OFFHOOK:         String CallDate = SanityDate();         String CallNum = SanityNum(incomingNumber);         String RootDir = SharedData._Path ;           String CallDir = SharedData._Path + CallNum + ""/"" ;         String CallFile = SharedData._Path +  CallNum + ""/"" + CallNum + CallDate ;         if(!SharedData._Recording)         {            SharedData._Recording = true;            String med_state = android.os.Environment.getExternalStorageState();            if(!med_state.equals(android.os.Environment.MEDIA_MOUNTED))            { break; }            File directory = null;            directory = new File(RootDir + ""text.txt"" ).getParentFile();            if (!directory.exists() &amp;&amp; !directory.mkdirs())            { break; }            directory = new File(CallDir + ""text.txt"" ).getParentFile();            if (!directory.exists() &amp;&amp; !directory.mkdirs())            { break; }            Recoders_Init(CallFile);            Recorder_Prepare();         }         Log.v(""DEBUG"", TelephonyManager.CALL_STATE_OFFHOOK + "" ITS.CallRecorder - Recording Started "" + state);         break;      }   }   private String SanityDate() {      SimpleDateFormat formatter = new SimpleDateFormat(""yyMMdd-HHmmss"");      Date currentTime_1 = new Date();      return formatter.format(currentTime_1);   }   private void Recorders_Stop() {      try {          SharedData._recorder.stop(); SharedData._recorder.reset();         //SharedData._recorder_down.stop(); SharedData._recorder_down.reset();         //SharedData._recorder_up.stop();       SharedData._recorder_up.reset();       }      catch (IllegalStateException e) {}      SharedData._Recording = false;   }   private void Recorder_Prepare() {      try {         SharedData._recorder.prepare(); SharedData._recorder.start();          //SharedData._recorder_down.prepare(); SharedData._recorder_down.start();          //SharedData._recorder_up.prepare(); SharedData._recorder_up.start();       }      catch (IllegalStateException e) { e.printStackTrace(); }      catch (IOException e) { e.printStackTrace(); }   }   private void Recoders_Init(String path) {      String _ext = "".3gp"";      int out_format = MediaRecorder.OutputFormat.THREE_GPP;      SharedData._recorder.setAudioSource(SharedData._Rec_Type);      SharedData._recorder.setOutputFormat(out_format);      SharedData._recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);      SharedData._recorder.setOutputFile(path + ""both"" + _ext);      /*                SharedData._recorder_down.setAudioSource(MediaRecorder.AudioSource.VOICE_DOWNLINK);                SharedData._recorder_down.setOutputFormat(out_format);                SharedData._recorder_down.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);                SharedData._recorder_down.setOutputFile(path + ""-down"" + _ext);                SharedData._recorder_up.setAudioSource(MediaRecorder.AudioSource.VOICE_UPLINK);                SharedData._recorder_up.setOutputFormat(out_format);                SharedData._recorder_up.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);                SharedData._recorder_up.setOutputFile(path  + ""-up"" + _ext);       */   }   private String SanityNum(String numstr)   {      String out = """";      for(char ch : numstr.toCharArray())      {         switch(ch)         {         case ' ':             break;         case '~':             break;         case '!':             break;         case '@':             break;         case '#':             break;         case '$':             break;         case '%':             break;         case '^':             break;         case '&amp;':             break;         case '*':             break;         case '(':             break;         case ')':             break;         case '-':             break;         case '_':             break;         case '=':             break;         case '|':             break;         default:            out = out + ch;         }      }      return out;   }} import android.media.MediaRecorder;final public class SharedData{   static int _Rec_Type = android.media.MediaRecorder.AudioSource.VOICE_CALL;   static String _Path = android.os.Environment.getExternalStorageDirectory().getAbsolutePath() + ""/ITS-CallRecorder/"";   static boolean _Started = false;   static boolean _AutoStart = true;   static boolean _Recording = false;   static MediaRecorder _recorder = new MediaRecorder();   static MediaRecorder _recorder_down = new MediaRecorder();   static MediaRecorder _recorder_up = new MediaRecorder();   SharedData() {    }}import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.telephony.PhoneStateListener;import android.telephony.TelephonyManager;import android.util.Log;import android.widget.Toast;public class StartServicesAtStartUp extends BroadcastReceiver{   public static Intent phoneStateListener;   public void onReceive(Context context, Intent intent)   {      Log.d(""DEBUG"", ""com.its.CallRecorder Initiated ..."");      Start_CallRec(context);   }   public static void Start_CallRec(Context context)   {      if(!SharedData._Started )      {         if(SharedData._AutoStart)         {            phoneStateListener = new Intent(context, CallStateListener.class);            phoneStateListener.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            context.startService(phoneStateListener);            Log.d(""DEBUG"", ""com.its.CallRecorder Call Recorder Started ..."");            TelephonyManager tManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);            CallStateListener callStateListener = new CallStateListener();            tManager.listen(callStateListener,PhoneStateListener.LISTEN_CALL_STATE);            SharedData._Started = true;            Toast.makeText(context,"" Call Recording Started ... "", Toast.LENGTH_SHORT).show();         }             }      else      {         Toast.makeText(context,"" Call Recording Already Active.. "", Toast.LENGTH_SHORT).show();      }   }   public static void Stop_CallRec(Context context)   {      if(SharedData._Started )      {         context.stopService(phoneStateListener);         Toast.makeText(context,"" Call Recording Stopped  ... "", Toast.LENGTH_SHORT).show();         SharedData._Started = false;                          }      else      {         Toast.makeText(context,"" Call Recording Already Stopped  ... "",  Toast.LENGTH_SHORT).show();      }   }}</code></pre>","430556","","430556","","2010-10-18 07:24:49","2012-03-21 08:47:56","Recording Call help needed","<android><call><phone>","2","4","2","",""
"3930045","1","","","2010-10-14 04:16:04","1","8977","<p>is there any list which HTML5 features the WebView supports and which not? I am interested mainly in:</p><p>1) localStorage/sessionStorage</p><p>2) offline manifest</p><p>3) web sockets</p><p>4) web workers</p><p>Prior there was lack of those features (http://www.mail-archive.com/android-developers@googlegroups.com/msg60143.html), but in Android 2.1, first two should be supported, but I am not sure about 3 and 4. Is there any list of supported features or we have to test it on our own?</p><p>Thanks a lotBRSTeN</p>","384115","","","","","2012-09-19 04:31:05","Android webkit.WebView and HTML5","<android><html5><webkit><webview><websocket>","3","4","5","",""
"3930207","1","3930238","","2010-10-14 05:02:06","0","2118","<p>I want to parse the value of xml string in android  my values are comine like this 2  give example</p><p>Thanks</p>","426344","","","","","2010-10-14 05:07:30","how to parse xml string in android","<android>","1","0","","",""
"3930248","1","3930359","","2010-10-14 05:10:58","2","3091","<p>I have a little idea of the Utility Classes with a slight doubt on demand.</p><p>If I use a Utility class in my Application than to use that class in my main Activity do I have to create the object of that class or I can directly Import that class in my main activity?</p><p>I am Sorry if I am not making a clear sense. </p><p>In the nutshell, all I want to be clear about is that basically how can I use the utility class in my Main Activity?</p><p>Thanks,david</p>","422859","","","","","2010-10-14 05:53:09","Using utility classes in the android programming","<android><class><import><utility>","5","1","1","",""
"3930256","1","3930298","","2010-10-14 05:12:20","2","2526","<p>Someone told me hashmaps are rather slow. So I am just wondering whether to use a hashmap or simply a switch case logic.</p><p>My requirement is this. I have a set of CountryNames and CountryCodes. My ListView displays the names of the countries. When an country name item is clicked, I must Toast the CountryCode.</p><p>In such a scenario, should I maintain a HashMap of CountryNames and Codes and access this to get the corresponding Code?:</p><pre><code>myMap.put(""US"", 355);myMap.put(""UK"", 459);//etc</code></pre><p>Or is it better to write a switch case like so</p><pre><code>switch (vCountryNamePos):{case 0:   //USvCountryCode = 355;break;case 1:   //UKvCountryCode = 459;break;//etc}</code></pre><p>Which is faster? If not Hashmaps, then in what practical scenarios would a Map be used?</p><p>-Kiki</p>","454660","","","","","2010-10-14 05:21:37","Android: Why to use a hashmap?","<android><listview><switch><hashmap>","1","1","","",""
"3930375","1","3930396","","2010-10-14 05:37:58","2","673","<p>Since basic auth has been deprecated, is the official android twitter app using OAuth?It still asks for my userid &amp; password &amp; I'm wondering how they are retrieving the oauth token ?</p>","450278","","","","","2011-12-21 11:41:27","Is the Twitter client for Android using OAuth?","<android><twitter><oauth>","2","0","2","",""
"3930421","1","4740102","","2010-10-14 05:45:37","2","6164","<p>Hi,I am developing one game, In this game, I have to move an object image from one point to another in any direction not only vertical/horizontal.<br>How can i move that image.<br> please help me any one.</p>","247921","","1139398","","2012-09-16 14:23:08","2013-01-04 15:11:50","moving an image from one point to another in android on canvas","<android>","1","2","1","",""
"3930423","1","3935318","","2010-10-14 05:45:53","0","329","<p>I'm working on an Android program for my research.</p><p>It needs to find out the angle while user using my mobile phone.</p><p>The angle here is like a rotation angle of entire mobile phone, not the widgets in layout.</p><hr><p>I've tried keyword ""angle"" on <a href=""http://developer.android.com/reference/packages.html"" rel=""nofollow"">http://developer.android.com/reference/packages.html</a></p><p>And I found a method ""onSensorChanged"" under public interface SensorListener</p><p>But the description there is too hard to me to understand :Q</p><p>Is it the function I want?</p>","475324","","","","","2011-07-09 06:09:14","Angle of mobile while using","<android>","1","0","0","",""
"3930476","1","3930522","","2010-10-14 05:57:31","1","509","<p>Is there a way we can access the android phone app and move it's hold button to Right  down instead of left top currently? Basically is it a non-open source google app (I see contacts is one) or can we download the source and modify it? </p><p>Thanks for pointers!</p>","207552","","","","","2010-10-14 06:07:48","Moving the hold button on Android phone app","<android>","1","0","1","",""
"3930507","1","3934716","","2010-10-14 06:04:25","5","588","<p>I have converted a few of my Processing sketches into Android apps, but they seem to run really slowly in the emulator and on <a href=""http://www.motorola.com/Consumers/XW-EN/Consumer-Products-and-Services/Mobile-Phones/Motorola-MILESTONE-XW-EN"" rel=""nofollow"">my device</a>.</p><p>Are there any tips on how to increase the speed and performance of my sketch running as an Android app? Are there things or parts of the Processing API I should avoid?</p>","78782","","78782","","2010-10-18 06:15:26","2013-10-28 22:53:17","How to get performance increases using Processing for Android?","<java><android><performance><processing.org>","2","3","1","",""
"3930569","1","","","2010-10-14 06:16:12","0","90","<p>HelloIn my android application i am playing live rtsp links.The issue is at times if the player gets struck somewhere then the videoplayer doesnot exit even if we press back.The only option will be to close the program from task manager.</p><p>Is there any way that i can make it better?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2010-12-19 08:44:10","Videoplayer issue in android","<android>","1","0","","",""
"3930591","1","3932755","","2010-10-14 06:20:42","0","1888","<p>Is Android MediaPlayer supported the MJPEG format.</p><pre><code>1                        path = ""http://cif12.nfreeway.gov.tw/live-view/mjpg/video.cgi camera=187&amp;1168226466841"";2               mPreview = (SurfaceView) findViewById(R.id.camsurface);3               holder = mPreview.getHolder();4               holder.addCallback(this);5               holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);6               mMediaPlayer = new MediaPlayer();7               mMediaPlayer.setDisplay(holder);8               mMediaPlayer.setDataSource(path);9               mMediaPlayer.prepare();10              mMediaPlayer.setOnBufferingUpdateListener(this);11              mMediaPlayer.setOnCompletionListener(this);12              mMediaPlayer.setOnPreparedListener(this);13              mMediaPlayer.setOnVideoSizeChangedListener(this);14              mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);</code></pre><p>on line number 9 code exit without any exception.</p>","309990","","","","","2010-10-14 11:48:02","Android MediaPlayer supported MJPEG","<android>","1","0","","",""
"3930592","1","","","2010-10-14 06:20:53","0","194","<h2>ListView</h2><h2>[Text] [Button 1][Button 2]</h2><h2>[Text] [Button 1][Button 2]</h2><p>... (and so on) ...</p><p>Button 1 should be like Check Box and other button which allows to redirect on other page</p><p>Is above mentioned thing possible??</p><p>Thanks in advance..</p>","457146","","","","","2010-10-14 09:14:16","Is it possible to place 2 buttons in List view","<java><android>","2","1","","",""
"3930658","1","","","2010-10-14 06:32:28","0","384","<p>Depending upon the user i may need to move it to right ,left,top or bottom.Should i use animation for the purpose?Or is there any method to move image dynamically?I meant the things in android application</p>","474166","","","","","2010-10-14 06:59:32","I need to move an image dynamically,depending upon the input from the user..What should i use?","<android>","1","1","","",""
"3930689","1","3934782","","2010-10-14 06:37:04","0","141","<p>I have a business requirement, and after lot of googling came to a point that android (as compared to iPhone) would be the platform to go for</p><p>I have a requirement wherein lets say an App 'X' that comes built-in with OS (firmware) needs to be replaced with some App 'Y'.</p><p>Of course, i understand that there would be something that i would need to change at firmware level (correct me), and of course i have no idea how to do that</p><p>So, is such a kind of thing even possible ?</p><p>Any links where i could look for more.</p><p>Yogurt</p>","475243","","","","","2010-10-14 15:23:25","Change screen preferences","<android>","2","0","","",""
"3930810","1","3931074","","2010-10-14 07:00:15","0","277","<p>Suppose Screen1 is the main screen of an Android application MyAndroid. Now if another screen, Screen2 has to be opened from Screen1, then which of the following are true?</p><ol><li>Screen2 has to be a part of MyAndroid.</li><li>Screen2 can exist in any other Android application installed on the device.</li><li>Screen2 will always be launched asynchronously.</li><li>Screen2 can be launched synchronously.</li><li>Screen2 can return a result code to Screen1 if launched with startActivity.</li><li>Screen2 can return a result code to Screen1 if launched with startSubActivity.</li></ol>","461386","","1193333","","2013-03-19 22:02:29","2013-03-19 22:02:29","Screen launching in Android","<android>","1","0","1","",""
"3930942","1","4434707","","2010-10-14 07:20:23","4","5422","<p>I have some Android code to stream an audio file from the internet and play the stream after 10 seconds.</p><p>I am using a SeekBar to view the buffering status and playing status. I want to play the audio starting from the middle of the buffered stream. For that, I move the SeekBar point to the middle, but I cannot play the audio from the middle; it will go back and start from the beginning. How can I get the seeked position and how can I play the audio from that particular position?</p><p>Here is my SeekBar code. How can I make this code use the OnSeekBarChangeListener properly?</p><pre><code>seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {    @Override    public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {        // TODO Auto-generated method stub        if (arg2 &amp;&amp; mediaPlayer.isPlaying()) {            //myProgress = oprogress;            arg1=mediaPlayer.getCurrentPosition();            mediaPlayer.seekTo(arg1);        }    }    @Override    public void onStartTrackingTouch(SeekBar seekBar) {        // TODO Auto-generated method stub    }    @Override    public void onStopTrackingTouch(SeekBar seekBar) {        // TODO Auto-generated method stub    }});</code></pre>","468952","","496830","","2011-09-21 17:40:24","2011-09-21 17:40:24","How can I use SeekBar's OnSeekBarChangeListener to seek to a specific point in a MediaPlayer object?","<android>","2","0","2","",""
"3930957","1","","","2010-10-14 07:23:12","2","798","<p>I read a lot about Dalvik and Google's Android OS when it first came out. One of the things that I don't quite understand though is why Java is used. The way I understand it is this:</p><pre><code>Java code -&gt; Java bytecode -&gt; Dalvik bytecode</code></pre><p>What I don't understand is why I have yet to see anything compile to straight Dalvik code or any other front end than Java for the Dalvik VM. Is there any work being done on a straight compiler or way to work with Android without Java? </p><p>To clarify I'm looking for languages that do not compile to Java bytecode. And also I'm not concerned with dynamic languages, I've read a few questions about them already. And also I'm aware of the NDK, I'm looking for information about Dalvik-compiled languages, not actual native-compiled languages. </p>","69742","","69742","","2010-10-14 07:33:10","2010-10-14 15:03:51","Is there a particular reason Java is the only way to program Android?","<java><android><dalvik>","4","1","3","",""
"3930990","1","3931094","","2010-10-14 07:28:48","17","31728","<p>Using the Connectivity Manager Class we can get access to either wifi or Internet Network:  </p><pre><code>ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);// ARE WE CONNECTED TO THE NETif ( connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED ||  connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED ) {  // ...}</code></pre><p>where <code>0</code> and <code>1</code> respectively refers to mobile and wifi connection</p><p>If my Android device is connected to both, can we switch between any of the network or can we disable any of the network? Like using a function:</p><pre><code>connec.getNetworkInfo(0).setState(NetworkInfo.State.DISCONNECTED);</code></pre>","467592","","18768","","2011-04-01 11:11:20","2014-01-20 17:39:31","Android: How to Enable/Disable Wifi or Internet Connection Programmatically","<android>","6","0","14","",""
"3931056","1","3931166","","2010-10-14 07:39:08","0","4813","<p>I understand when an activity closes, onDestroy() is called. But this is not done always right? Sometimes, onPause() is called.</p><p>So suppose I want to clear some memory when an activity closes, where exactly do I do it? Since onDestory may not be called, I cannot keep it there either right?</p><p>Elaborating:I have 2 activities A1 and A2. A1 is hsown in the startup of the app. A1 calls A2 later. Suppose I create a class object in onCreate() of Activity A1. This object must be deleted when the I exit the app, i.e when the app is no longer visible. Is the best place to do this onDestroy() or onStop() of A1?I guess onPause() may not be the right place, because onPause() will be called when A1 calls A2 and I dont want to delete the object then.</p><p>-Kiki</p>","454660","","454660","","2010-10-14 08:47:46","2010-10-14 08:47:46","Android : On application exit?","<android><memory><activity><exit>","3","2","1","",""
"3931110","1","","","2010-10-14 07:48:48","0","1984","<p>I have a listview which populates the data using CheckedTextView. Here is the xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:textSize=""14dp""    android:paddingTop=""5dp""    android:paddingBottom=""5dp""    android:paddingRight=""5dp""    android:paddingLeft=""5dp""    android:textColor=""@color/blue""    android:checked=""false""    android:id=""@+id/listviewsubview_textview"" &gt;&lt;/CheckedTextView&gt;</code></pre><p>On item click listener, show tick on the right of the item, but not only that item shows tick other multiple items also show tick. Wierd thing is all are ticks after same number of row. I dont know where I am doing wrong.</p><p>Here is the code </p><pre><code>package com.chegg.android.account;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import org.json.JSONArray;import org.json.JSONException;import org.json.JSONObject;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.Window;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.CheckedTextView;import android.widget.ListView;import android.widget.AdapterView.OnItemClickListener;import com.chegg.android.R;import com.chegg.android.api.RestClient;import com.chegg.android.objects.StudentInfo;import com.chegg.android.util.Util;public class MajorActivity extends MainActivity {    public ListView majorsListView;    public String url;    public HashMap&lt;String, String&gt; majorMap = new HashMap&lt;String, String&gt;();    public JSONArray resultArray = new JSONArray();    public JSONObject resultObj = new JSONObject();    public ArrayList&lt;String&gt; majorNameArray = new ArrayList&lt;String&gt;();    public RestClient restClient = null;    public StudentInfo studentInfo = null;    public HashMap majors = null;     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.majors);        Object campusObj =  this.getIntent().getStringExtra(""campus_id"");        restClient = new RestClient();        if(campusObj!=null) {            String campusId = campusObj.toString();            url = ""school/majors/""+campusId;        } else {            url = ""school/majors"";        }        String result = restClient.connect(url);        try {            JSONArray jsonArray = new JSONArray(result);            for(int i=0;i&lt;jsonArray.length();i++) {                JSONObject jsonObj = jsonArray.getJSONObject(i);                String name = jsonObj.getString(""name"");                majorMap.put(name,jsonObj.getString(""id""));                majorNameArray.add(name);            }        } catch (JSONException e) {            e.printStackTrace();        }        majorsListView = (ListView)findViewById(R.id.majors_listview);        majorsListView.setChoiceMode(ListView.CHOICE_MODE_NONE);        majorsListView.setAdapter(new ArrayAdapter&lt;String&gt;(MajorActivity.this, R.layout.list_view_subview,majorNameArray));        studentInfo = (StudentInfo)this.getIntent().getSerializableExtra(""studentInfo"");        if(studentInfo.getMajors()!=null) {            majors = (HashMap)studentInfo.getMajors();        } else {            majors = new HashMap();        }        //majorsListView.setAdapter(new MajorsAdapter(MajorActivity.this, R.layout.list_view_subview,majorNameArray,majors));        majorsListView.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,                    long id) {                CheckedTextView selectedView = (CheckedTextView)view;                Drawable chevron = getResources().getDrawable(R.drawable.chevron);                chevron.setBounds( 0, 0, chevron.getMinimumWidth(), chevron.getMinimumHeight() );                String text = selectedView.getText().toString();                if(!selectedView.isChecked()) {                    selectedView.setChecked(true);                    selectedView.setCheckMarkDrawable(R.drawable.chevron);                    majors.put(text, majorMap.get(text));                } else {                    selectedView.setChecked(false);                    selectedView.setCheckMarkDrawable(null);                    if(majors.containsKey(text)) {                        majors.remove(text);                    }                }                JSONObject jsonFinalResult = new JSONObject();                try {                     Iterator it = majors.entrySet().iterator();                        while (it.hasNext()) {                            Map.Entry pairs = (Map.Entry)it.next();                            JSONObject jsonObj = new JSONObject();                            System.out.println(pairs.getKey() + "" = "" + pairs.getValue());                            jsonObj.put(""name"", pairs.getKey());                            jsonObj.put(""id"",pairs.getValue());                            resultArray.put(jsonObj);                        }                    jsonFinalResult.accumulate(""majors"", resultArray);                } catch (JSONException e) {                    e.printStackTrace();                }                String url = ""account?access_token=""+ accessToken;                Log.i(""json *****"",jsonFinalResult.toString());                String result = restClient.connectHttpsPostPutJson(url, jsonFinalResult.toString(), ""PUT"");                Log.i(""*******"",result);                String checkError = Util.checkResponseForError(result);                if(checkError.equals("""") || checkError == null) {                    studentInfo = StudentInfo.getObjectFromJson(result);                    cacheData(studentInfo, ""studentInfo"", ""update"");                } else {                    alertbox.setMessage(checkError);                    alertbox.setNeutralButton(""ok"", null);                    alertbox.show();                }            }        });     } }</code></pre><p>Any help is appreciated</p>","441730","","","","","2010-10-14 11:51:49","list view setChecked() selects multiple items instead of one","<android>","1","0","","",""
"3931136","1","","","2010-10-14 07:54:11","0","2326","<p>I have an Activity which also has t olisten to a specific broadcast from a self-made service.I have noticed though that when I add that as an action to my Androidmanifest file the app won't actually start whilst debugging.The Activity is also my MAIN activity :</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;&lt;/intent-filter&gt;</code></pre><p>But when I add my own extra action to it it simply wont pick up the broadcast and it won't start up out of itself whilst debugging ????</p><pre><code>&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=""development.android.service.musicServiceUpdate""&gt;&lt;/intent-filter&gt;</code></pre><p>Any idea whats wrong here or why my activity wont be catching the broadcast ?Is it possible to have two action's specified to a .MAIN action ?</p><p>/edit :</p><p>Tried the following :</p><pre><code>&lt;activity android:name="".nowPlayingGUI""                  android:label=""@string/app_name""                  android:screenOrientation=""portrait""                    android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""                    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;        &lt;receiver android:name="".nowPlayingGUI""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""development.android.service.musicServiceUpdate""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;</code></pre><p>That won't work and will throw a :</p><p>10-14 11:57:04.412: ERROR/AndroidRuntime(11947): java.lang.RuntimeException: Unable to instantiate receiver development.android.myPlayer.nowPlayingGUI: java.lang.ClassCastException: development.android.myplayer.nowPlayingGUI </p><p>10-14 11:57:04.412: ERROR/AndroidRuntime(11947): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2520)</p>","162147","","162147","","2010-10-14 10:07:12","2010-11-01 15:43:47","Intent_Filter Action won't work in AndroidManifest","<android><action><android-manifest><intentfilter>","3","0","","",""
"3931268","1","","","2010-10-14 08:14:07","2","530","<p>I want to create an application which permits to the user to download media files and play them, but only with my application. So first of all I thought that encrypting files will be a good solution, but it takes to much. Now I'm thinking to create a custom codec for my media files. I didn't work until now with codecs so how complicated is to make one for Android? Can be made in java or only in C and used via JNI? Also can you recomand me some useful books for understanding how are codecs created?</p><p>Thanks in advance!</p>","475480","","","","","2010-10-14 08:20:38","Android custom codec or encrypt media file?","<android>","1","0","1","2012-09-13 14:27:18",""
"3931313","1","","","2010-10-14 08:18:53","1","1029","<p>I am able to connect 2 phones through Bluetooth. But is it possible to connect through the wireless network?</p><p>Any help will be appreciated!</p><p>ThanksPradeep</p>","363659","","","","","2010-10-14 10:49:36","Is it possible to establish a P2P connection between two Android phones?","<android><android-wifi>","1","0","","",""
"3931479","1","","","2010-10-14 08:45:37","1","2096","<p>HI all,</p><p>Im having a strange thing. Im having a code that was working that doesnt anymore. To me, I think i didnt make any changes...Can someone give me an idea what is wrong ??I'm trying to publish a text with an image and a link using the attachment method of stream.publish.</p><p>here is the code :</p><pre><code>            Bundle myParams = new Bundle();            myParams.putString(""message"", ""Je publie un TEST."");            String attachment=""{\""name\"":\""Gran Turismo 5\"",\""href\"":\""http://www.unknown.com/?lang=fr\"",\""caption\"":\""Sony Computer Entertainment\"",\""description\"":\""Une vidéo proposée par Cedemo.\"",\""media\"":[{\""type\"":\""image\"",\""src\"":\""http://www.unknown.com/prepicture//thumb_title/15/15061_1.jpg\"",\""href\"":\""http://www.unknown.com/?lang=fr\""}],\""properties\"":{\""Autre lien\"":{\""text\"":\""Cedemo\"",\""href\"":\""http://www.unknown.com\""}}}"";            myParams.putString(""attachment"",attachment);            mFacebook.dialog(Example.this,""stream.publish"",myParams, new PostSampleDialogListener());</code></pre><p>What is happening is that I am getting only the ""Message"" text published on facebook and nothing about my attachment... There is no error code returned by the function. I dont understand, this code has been working before...</p><h2>THE SOLUTION</h2><p>You have to You have to use the function URLEncoder.encode to encode your parameters.Example :myParams.putString(""attachment"", URLEncoder.encode(""{\""name\"":\""""..... ))</p>","429222","","429222","","2010-11-04 07:43:10","2010-12-16 06:12:53","android & facebook stream.publish problem... help!","<android><facebook><stream><publish>","1","0","","",""
"3931518","1","3932561","","2010-10-14 08:49:41","1","14134","<p>I'm very new on Android.</p><p>I want to show a modal pop up window with a TextView and two buttons when the user ""clicks"" on a ListView item.</p><p>How can I do that?</p><p>Thanks.</p>","68571","","","","","2010-10-14 11:16:28","Openning a Modal Pop Up window","<android><modal-dialog>","1","0","","",""
"3931802","1","3932737","","2010-10-14 09:28:34","0","83","<p>I have a issue about spinner. I have many images in spinner when I select some image it shows the image and if I change the orientation like change to landscape its selected item list starts pointing the top one in the list. How shall I prevent to do that?</p>","397901","","251122","","2010-10-14 09:34:05","2010-12-23 09:49:21","How to select the previous selectedItem when Configurations changes?","<android><spinner>","1","0","","",""
"3931840","1","","","2010-10-14 09:34:34","1","227","<p>Actually for what purpose is menu used?</p>","474166","","","","","2010-10-14 09:37:58","What is the concept of menu?","<android>","1","0","","2011-06-30 21:53:37",""
"3931971","1","","","2010-10-14 09:52:10","1","510","<p>I have this contacts that needs to be imported directly to a particular group that i created in which AFAIK that adding of contacts in an Account ,in the api seems to be broken(can't add other fields) so i implemented my own Activity to add accounts.</p><p>how do i add them directly to a group? </p>","279560","","","","","2013-10-22 14:43:19","How to add contacts directly to a group without creating an account?","<java><android>","1","0","","",""
"3932075","1","3932401","","2010-10-14 10:08:11","2","294","<p>I wonder where to place the AsyncTask in the Application? Can I place it in onCreate Method of my Main Activity?</p><p>Can anybody please tell me where I can place the Asynctask method in the Application?</p><p>Thanks,david</p>","422859","","","","","2012-07-19 11:28:04","Where to place the Asynctask in the Application","<android><android-asynctask>","1","0","1","",""
"3932129","1","","","2010-10-14 10:15:26","4","9558","<p>I'm working in android application. I create a web service in Java. Now i want to refer a web service using HTTP. But i got <code>Permission Denied</code> error while the debugger reached the last line. The Code is:</p><pre><code>HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); HttpGet httpGet = new HttpGet(""http://192.168.0.102:8282/SampleWebProj/services/Converter""); response = httpClient.execute(httpGet, localContext); </code></pre><p>Plz Give me a solution..</p>","475626","","56763","","2012-12-29 16:04:59","2012-12-29 16:04:59","Permission denied error while call webservice using HTTP in android application","<android>","3","0","1","",""
"3932228","1","","","2010-10-14 10:32:16","4","3974","<p>How can I list all connected bluetooth devices on android ?</p><p>thanks!</p>","445548","","","","","2014-04-03 06:55:36","list connected bluetooth devices?","<android><bluetooth>","5","0","1","",""
"3932257","1","","","2010-10-14 10:37:15","0","281","<p>im testing to add 300 contacts in my app and it was doing fine with desire but in galaxy it crashes and does not show my 300 contacts and they erased the contacts after the crash . </p><p>anyone saw this?</p>","279560","","445312","","2010-10-14 10:57:04","2010-10-15 09:46:27","StringIndexOutOfBoundsException while adding 300 contacts to group in Samsung Galaxy S","<java><android><exception-handling>","2","1","1","",""
"3932302","1","3932358","","2010-10-14 10:44:52","0","300","<p>I have 3 activity in my application.My first activity (Main) has 2 button that starts other activities (One &amp; Two).The One Activity starts a countdown timer on UI.When I click back button Android closes this activity and when I re-open activity, my timer is resetted.</p><p>I try also overriding:</p><pre><code>    public boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode == KeyEvent.KEYCODE_BACK) {        moveTaskToBack(true);        return true;    }    return super.onKeyDown(keyCode, event);}</code></pre><p>and it's works correctly but when I re-open the Main Activity, Android shows me my timer activity.How can I resolve this problem?</p>","353030","","","","","2010-10-14 10:53:12","Activity problem","<android><activity><stack>","1","0","","",""
"3932368","1","4476896","","2010-10-14 10:53:55","1","418","<p>I am developing a puzzle game.  This application I am using one drawable image (r.drawable.image1).  This drawable image crop in to nine number of pieces.  It will display in random order How can its implemented?</p>","254790","","1288","","2011-03-28 12:36:26","2011-03-28 12:36:26","in puzzle game purpose one drawable image crops in to nine number of pieces how can implemented in android","<android>","1","0","2","",""
"3932392","1","3932974","","2010-10-14 10:57:01","0","1113","<p>How can i change the image of image button when mouse or finger is over it</p>","474166","","","","","2010-10-14 14:44:54","Change picture of image button when mouse is over it(android)","<android>","2","2","","",""
"3932480","1","3933313","","2010-10-14 11:06:31","0","1282","<ol><li><p>Is it a good solution or not?</p></li><li><p>How to implement?</p></li><li><p>When should I shutdown properly? I shutdown it onDestroy() in the Activity, then relaunch my app as soon as possible. It causes a <code>java.util.concurrent.RejectedExecutionException</code>, why? Does anyone know its lifecycle?</p></li></ol><p>Any idea? Thanks.</p>","428022","","428022","","2010-10-15 01:30:26","2010-10-15 02:57:45","How should I use Executor insteand of AsyncTask or IntentService for queueing task on Android?","<android><concurrency><service><android-asynctask><executor>","2","1","","",""
"3932486","1","","","2010-10-14 11:07:02","2","1456","<p>I'm using lazy-loading for images in a listview. The weird thing is, the first row and the last row visible on the screen seem to have the same image(of the last row onthe screen).I'm using following class for image loading:</p><pre><code>public class ImageLoader {    //the simplest in-memory cache implementation. This should be replaced with something like SoftReference or BitmapOptions.inPurgeable(since 1.6)    private HashMap&lt;String, Bitmap&gt; cache=new HashMap&lt;String, Bitmap&gt;();    private File cacheDir;    public ImageLoader(Context context){        //Make the background thead low priority. This way it will not affect the UI performance        photoLoaderThread.setPriority(Thread.NORM_PRIORITY-1);        //Find the dir to save cached images        if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))            cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),""LazyList"");        else            cacheDir=context.getCacheDir();        if(!cacheDir.exists())            cacheDir.mkdirs();    }    final int stub_id=R.drawable.default_user_pic;    public void DisplayImage(String url, Activity activity, ImageView imageView)    {        if(cache.containsKey(url))            imageView.setImageBitmap(cache.get(url));        else        {            queuePhoto(url, activity, imageView);            imageView.setImageResource(stub_id);        }        }    private void queuePhoto(String url, Activity activity, ImageView imageView)    {        //This ImageView may be used for other images before. So there may be some old tasks in the queue. We need to discard them.         photosQueue.Clean(imageView);        PhotoToLoad p=new PhotoToLoad(url, imageView);        synchronized(photosQueue.photosToLoad){            photosQueue.photosToLoad.push(p);            photosQueue.photosToLoad.notifyAll();        }        //start thread if it's not started yet        if(photoLoaderThread.getState()==Thread.State.NEW)            photoLoaderThread.start();    }    private Bitmap getBitmap(String url)     {        //I identify images by hashcode. Not a perfect solution, good for the demo.        String filename=String.valueOf(url.hashCode());        File f=new File(cacheDir, filename);        //from SD cache        Bitmap b = decodeFile(f);        if(b!=null)            return b;        //from web        try {            Bitmap bitmap=null;            InputStream is=new URL(url).openStream();            OutputStream os = new FileOutputStream(f);            HeaderController.CopyStream(is, os);            os.close();            bitmap = decodeFile(f);            return bitmap;        } catch (Exception ex){           ex.printStackTrace();           return null;        }    }    //decodes image and scales it to reduce memory consumption    private Bitmap decodeFile(File f){        try {            //decode image size            BitmapFactory.Options o = new BitmapFactory.Options();            o.inJustDecodeBounds = true;            BitmapFactory.decodeStream(new FileInputStream(f),null,o);            //Find the correct scale value. It should be the power of 2.            final int REQUIRED_SIZE=70;            int width_tmp=o.outWidth, height_tmp=o.outHeight;            int scale=1;            while(true){                if(width_tmp/2&lt;REQUIRED_SIZE || height_tmp/2&lt;REQUIRED_SIZE)                    break;                width_tmp/=2;                height_tmp/=2;                scale++;            }            //decode with inSampleSize            BitmapFactory.Options o2 = new BitmapFactory.Options();            o2.inSampleSize=scale;            return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);        } catch (FileNotFoundException e) {}        return null;    }    //Task for the queue    private class PhotoToLoad    {        public String url;        public ImageView imageView;        public PhotoToLoad(String u, ImageView i){            url=u;             imageView=i;        }    }    PhotosQueue photosQueue=new PhotosQueue();    public void stopThread()    {        photoLoaderThread.interrupt();    }    //stores list of photos to download    class PhotosQueue    {        private Stack&lt;PhotoToLoad&gt; photosToLoad=new Stack&lt;PhotoToLoad&gt;();        //removes all instances of this ImageView        public void Clean(ImageView image)        {            for(int j=0 ;j&lt;photosToLoad.size();){                if(photosToLoad.get(j).imageView==image)                    photosToLoad.remove(j);                else                    ++j;            }        }    }    class PhotosLoader extends Thread {        public void run() {            try {                while(true)                {                    //thread waits until there are any images to load in the queue                    if(photosQueue.photosToLoad.size()==0)                        synchronized(photosQueue.photosToLoad){                            photosQueue.photosToLoad.wait();                        }                    if(photosQueue.photosToLoad.size()!=0)                    {                        PhotoToLoad photoToLoad;                        synchronized(photosQueue.photosToLoad){                            photoToLoad=photosQueue.photosToLoad.pop();                        }                        Bitmap bmp=getBitmap(photoToLoad.url);                        cache.put(photoToLoad.url, bmp);                        if(((String)photoToLoad.imageView.getTag()).equals(photoToLoad.url)){                            BitmapDisplayer bd=new BitmapDisplayer(bmp, photoToLoad.imageView);                            Activity a=(Activity)photoToLoad.imageView.getContext();                            a.runOnUiThread(bd);                        }                    }                    if(Thread.interrupted())                        break;                }            } catch (InterruptedException e) {                //allow thread to exit            }        }    }    PhotosLoader photoLoaderThread=new PhotosLoader();    //Used to display bitmap in the UI thread    class BitmapDisplayer implements Runnable    {        Bitmap bitmap;        ImageView imageView;        public BitmapDisplayer(Bitmap b, ImageView i){bitmap=b;imageView=i;}        public void run()        {            if(bitmap!=null)                imageView.setImageBitmap(bitmap);            else                imageView.setImageResource(stub_id);        }    }    public void clearCache() {        //clear memory cache        cache.clear();        //clear SD cache        File[] files=cacheDir.listFiles();        for(File f:files)            f.delete();    }}</code></pre><p>Here is the my Expandable listview adapter code:</p><pre><code>import java.util.List;import java.util.Map;import android.app.Activity;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.ImageView;import android.widget.SimpleExpandableListAdapter;import android.widget.TextView;public class NearbyAdapter extends SimpleExpandableListAdapter {    private List&lt;? extends List&lt;? extends Map&lt;String, ?&gt;&gt;&gt; mChildData;    private String[] mChildFrom;    private int[] mChildTo;        NearbyActivity currentActivity;    public ImageLoader imageLoader;    public NearbyAdapter(Activity activity,Context context,            List&lt;? extends Map&lt;String, ?&gt;&gt; groupData, int groupLayout,                    String[] groupFrom, int[] groupTo,                    List&lt;? extends List&lt;? extends Map&lt;String, ?&gt;&gt;&gt; childData,                    int childLayout, String[] childFrom, int[] childTo) {            super(context, groupData, groupLayout, groupFrom, groupTo,                            childData, childLayout, childFrom, childTo);            mChildData = childData;            mChildFrom = childFrom;            mChildTo = childTo;            currentActivity = (NearbyActivity)activity;            imageLoader=new ImageLoader(activity.getApplicationContext());    }    public View getChildView(int groupPosition, int childPosition,            boolean isLastChild, View convertView, ViewGroup parent) {        View v;        if (convertView == null) {                v = newChildView(isLastChild, parent);        } else {                v = convertView;        }        bindView(v, mChildData.get(groupPosition).get(childPosition),mChildFrom,                        mChildTo, groupPosition, childPosition);        return v;    }    private void bindView(View view, Map&lt;String, ?&gt; data,            String[] from, int[] to, int groupPosition, int childPosition) {                if(from[3] != null)                    view.setTag(data.get(from[4]));                ImageView imageView = (ImageView) view.findViewById(to[3]);                if (imageView != null) {                    imageView.setTag((String) data.get(from[3]));                    imageLoader.DisplayImage((String) data.get(from[3]), currentActivity, imageView);                }    }    public boolean isChildSelectable(int groupPosition, int childPosition) {        return true;    }    public boolean isGroupSelectable(int groupPosition) {        return true;    }    public boolean hasStableIds() {        return true;    }}</code></pre>","278194","","","","","2012-02-14 19:58:10","Duplicate ImageView in ListView while using Lazy Loading","<android>","2","0","","",""
"3932583","1","","","2010-10-14 11:20:42","1","2235","<p>I would like to integrate speech recognition into my Android application. </p><p>I am aware google provides two language models (free form for dictation and web search for short phrases).</p><p>However, my app will have a finite number of possible words (maybe a few thousand). Is it possible to specify the vocabularly; limiting it to these words, in the hope of achieving more accurate results?</p><p>My immediate thoughts would be to use the web search language model and then check the results of this against my vocabulary.</p><p>Any thoughts appreciated.</p>","475684","","","","","2011-10-05 01:44:48","Speech recognition language model","<android><speech-recognition>","3","0","","",""
"3932732","1","","","2010-10-14 11:44:25","-2","258","<p>I want to ask how to open the outlook in the android device. how can i send the mail with the android outlook. i want to create the android application in which user select the email address after selecting the E-Mail address android outlook will open in the device after that he write the message in the message body. and after clicking on the send option mail will send to the user.</p>","339116","","51382","","2010-10-14 11:45:15","2010-10-15 10:44:33","Android Outlook","<android><outlook>","1","2","","",""
"3932736","1","3932822","","2010-10-14 11:45:10","0","2365","<pre><code>final String [] tmp =  new String[]{""Android"", ""Google};ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(getApplicationContext(),android.R.layout.simple_expandable_list_item_1,tmp);final ListView lv = new ListView(getApplicationContext());lv.setAdapter(spinnerArrayAdapter);lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,   int arg2, long arg3) {  int i = lv.getSelectedItemPosition();   Toast toast = Toast.makeText(getApplicationContext(), arg0.toString(),Toast.LENGTH_SHORT);         toast.show(); }});</code></pre><p>I don't know how to get the right element by onItemClick....the var i is allways -1</p>","469511","","","","","2010-10-14 12:55:02","How to Accsess Strings in List View","<android>","2","2","","",""
"3932829","1","3932915","","2010-10-14 11:57:28","7","2309","<p>I want to sell an application developed by me, but this service is not supported in my country (Romania).So I want to ask a friend of mine who lives in a country (France or US) where selling paid applications is possible to help me with this.Now I don't know exactly what to tell him about the process:What is required by his side ? A bank account or a credit card ? How the money are transferred to him ? What exactly Google checks to verify if the developer is in one of the supported countries ?Please help me to understand the process as I'm new in the Android world :)</p>","467780","","21234","","2011-02-22 14:05:33","2011-12-01 19:14:03","How to sell paid application from an unsupported country","<android><google-play>","1","1","3","",""
"3932832","1","3932943","","2010-10-14 11:57:38","0","838","<p>Hello In my android application i am using the below code to make sure that network exists.</p><p>But am receiving error at the very first line.Do i need to check any permission other than those listed.</p><pre><code>public static boolean haveInternet(Context ctx) { NetworkInfo info = (NetworkInfo) ((ConnectivityManager) ctx         .getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo(); if (info == null || !info.isConnected()) {     return false; } if (info.isRoaming()) {     // here is the roaming option you can change it if you want to     // disable internet while roaming, just return false     return false; } return true; </code></pre><p>Permissions in manifest</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;   &lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.CHANGE_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name= ""android.permission.CHANGE_NETWORK_STATE""&gt;&lt;/uses-permission&gt;</code></pre>","420261","","","","","2010-10-14 12:14:19","To check wifi or 3G exist in android","<android>","1","0","1","",""
"3932876","1","","","2010-10-14 12:05:26","0","70","<p>I have a releative layout which contain 2 arrows after that i kept sliding drawer.when i press on slidingdrawer its coming only upto relativelayout.it has to occupy entire screen.can anyone help me on this</p>","446010","","","","","2010-10-14 13:13:53","sliderbar is not coming on top of other layouts","<android>","1","1","","",""
"3932951","1","3933081","","2010-10-14 12:15:05","1","1420","<p>I have an app that contains a custom view, and in it I want to use a custom font. Unfortunately, this results in really ugly text being rendered.</p><p>My custom view extends Surface (and just realized: is this a bad idea), and I draw the text with the following code:</p><pre><code>// p = new Paint();Typeface font = Typeface.createFromAsset(parent.getAssets(), ""komtit.ttf"");p.setColor(Color.BLACK);p.setTypeface(font);c.drawText(this.text, x + width / 2 - p.measureText(this.text) / 2, y + height / 2, p);</code></pre><p>The result looks like this:</p><p><img src=""http://img.skitch.com/20101014-rxw8j8igj1jci2fx9ui32ejcp.jpg""/></p><p>Not fun. I'm using p.setFlags(Paint.ANTI_ALIAS_FLAG) but even with that the result is just fudgly.</p><p>So, is there a way to improve custom TTF rendering, or should I just stick to the system fonts?</p>","251455","","","","","2010-10-14 12:29:57","Using a custom TTF in Android makes for really ugly text","<android><fonts>","1","1","","",""
"3932965","1","3933127","","2010-10-14 12:17:01","1","670","<p>I am trying to make a set of measurements of signal strength, so i want to make a delay between same method (that return needed value) execution - value1...delay....value2....delay.... Currently i am using</p><pre><code>Thread.sleep(DELAY);</code></pre><p>Such way of creating the delay seems to work, but as I understood it makes the whole app to stop. I have looked through Android Developers website and found some other ways using Timer and ScheduledExecutorService. But i do not fully understand how to create a delay using those 2 ways. May be someone will be some kind and give me some ideas or directions to start with?</p>","458024","","","","","2010-10-14 12:41:33","Creating delay between measurements","<java><android><delay>","5","0","2","",""
"3933007","1","3935124","","2010-10-14 12:21:41","0","1177","<p>we've got some legacy hardware which connects to cell phones over Bluetooth using the DUN profile. It then issues AT commands to read SMS for monitoring purposes.</p><p>Android phones do not support AT over DUN. That's why I'm writing this application. The problem is: while the legacy hardware will connect to the phone, it will not accept my responses to its commands. Specifically, it seems not to accept my answer to the AT+CGMI command. I assume there is something wrong with my usage of the CR and LF control characters, but I can't figure out what's going on.</p><p>Here's an example chat log:</p><pre><code>10-14 14:14:49.674: DEBUG/PROG(2663): Server started, object is android.bluetooth.BluetoothServerSocket@44f102f810-14 14:17:07.264: DEBUG/PROG(2663): From Device:ATE010-14 14:17:07.264: DEBUG/PROG(2663): To Device: 10-14 14:17:07.264: DEBUG/PROG(2663): OK10-14 14:17:07.868: DEBUG/PROG(2663): From Device:ATE010-14 14:17:07.868: DEBUG/PROG(2663): To Device: 10-14 14:17:07.868: DEBUG/PROG(2663): OK10-14 14:17:10.774: DEBUG/PROG(2663): From Device:AT+CGMI10-14 14:17:10.774: DEBUG/PROG(2663): To Device: 10-14 14:17:10.774: DEBUG/PROG(2663): ""Sony Ericsson""10-14 14:17:10.774: DEBUG/PROG(2663): 10-14 14:17:10.774: DEBUG/PROG(2663): OK10-14 14:17:11.434: DEBUG/PROG(2663): From Device:ATE010-14 14:17:11.434: DEBUG/PROG(2663): To Device: 10-14 14:17:11.434: DEBUG/PROG(2663): OK10-14 14:17:12.025: DEBUG/PROG(2663): From Device:ATE010-14 14:17:12.025: DEBUG/PROG(2663): To Device: 10-14 14:17:12.025: DEBUG/PROG(2663): OK10-14 14:17:14.827: DEBUG/PROG(2663): From Device:AT+CGMI10-14 14:17:14.827: DEBUG/PROG(2663): To Device: 10-14 14:17:14.827: DEBUG/PROG(2663): ""Sony Ericsson""10-14 14:17:14.827: DEBUG/PROG(2663): 10-14 14:17:14.827: DEBUG/PROG(2663): OK10-14 14:17:15.454: DEBUG/PROG(2663): From Device:ATE010-14 14:17:15.454: DEBUG/PROG(2663): To Device: 10-14 14:17:15.454: DEBUG/PROG(2663): OK10-14 14:17:16.084: DEBUG/PROG(2663): From Device:ATE010-14 14:17:16.084: DEBUG/PROG(2663): To Device: 10-14 14:17:16.084: DEBUG/PROG(2663): OK10-14 14:17:18.444: DEBUG/PROG(2663): IOException: all aboard the failboat!10-14 14:17:18.444: DEBUG/PROG(2663): java.io.IOException: Connection reset by peer10-14 14:17:18.444: DEBUG/PROG(2663):     at android.bluetooth.BluetoothSocket.readNative(Native Method)10-14 14:17:18.444: DEBUG/PROG(2663):     at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:307)10-14 14:17:18.444: DEBUG/PROG(2663):     at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96)10-14 14:17:18.444: DEBUG/PROG(2663):     at java.io.InputStreamReader.read(InputStreamReader.java:275)10-14 14:17:18.444: DEBUG/PROG(2663):     at java.io.BufferedReader.fillBuf(BufferedReader.java:155)10-14 14:17:18.444: DEBUG/PROG(2663):     at java.io.BufferedReader.readLine(BufferedReader.java:404)</code></pre><p>The exception happens as the device resets the connection.</p><p>Here's some code:</p><pre><code>private static final String REPLY_OK = ""\r\nOK\r\n"";private static final String REPLY_MANUFACTURER = ""\r\n\""Sony Ericsson\""\r\n\r\nOK\r\n"";private static final String ECHO_OFF = ""ATE0"";private static final String GET_MANUFACTURER = ""AT+CGMI"";public static String handleCommand(String command) {if (command.equals(ECHO_OFF)) {   return REPLY_OK;} else if (command.equals(GET_MANUFACTURER)) {   return REPLY_MANUFACTURER;}// base casereturn REPLY_OK;}// bts is a BluetoothSocket instanceOutputStream out = this.bts.getOutputStream();InputStream is = this.bts.getInputStream();InputStreamReader isr  = new InputStreamReader(is);BufferedReader br = new BufferedReader(isr);String currentLine = null;while ((currentLine = br.readLine()) != null) {    Log.d(LOGTAG, ""From Device:"" +  currentLine);    String response = handleCommand(currentLine);    Log.d(LOGTAG, ""To Device: "" + response);    out.write(response.getBytes(""ASCII""));    //out.flush();}</code></pre>","475705","","","","","2010-10-14 15:57:05","Mobile Phone AT command set emulator: proper syntax for response codes","<android><bluetooth><gsm>","1","0","","",""
"3933035","1","","","2010-10-14 12:25:07","2","4679","<p>Unable to launch App in telephone device. Device is visible (ADB devices), debug USB on(in phone). In Eclipse I get the following timeout error:</p><pre><code>[2010-10-14 14:07:30 - TA] Android Launch![2010-10-14 14:07:30 - TA] adb is running normally.[2010-10-14 14:07:30 - TA] Performing com.xxxxx.ta.TA activity launch[2010-10-14 14:08:00 - TA] Uploading TA.apk onto device 'HTXXXXXX'[2010-10-14 14:08:05 - TA] Failed to upload TA.apk on device 'HTXxXXXXXX'[2010-10-14 14:08:05 - TA] com.android.ddmlib.TimeoutException[2010-10-14 14:08:05 - TA] Launch canceled!</code></pre><p>I installed/reinstalled drivers delivered in phone (HTC Wildfire) a couple of times..At present the explorer hangs when trying to open the phone file system.Running SDK-eclipse on Vista. Any ideas would be appreciated.</p>","437162","","180538","","2010-10-14 12:28:55","2010-10-21 09:36:21","USB debug with eclipse","<android><eclipse><usb><adb>","1","4","","",""
"3933238","1","","","2010-10-14 12:49:21","7","4016","<p>I am not able to use <a href=""http://www.igniterealtime.org/projects/smack/"" rel=""nofollow"">Smack</a> on Android whereas <a href=""http://asmack.org"" rel=""nofollow"">aSmack</a> works perfectly? When compared the source code it looks somewhat similar, where does the difference comes from?</p><p><strong>What is the difference between Smack and aSmack?</strong> </p>","375061","","194894","","2013-07-17 16:15:01","2013-11-19 10:16:27","What is the difference between Smack and aSmack?","<android><xmpp><smack><asmack>","4","0","3","",""
"3933384","1","","","2010-10-14 13:04:50","1","227","<p>I am wanting to make an transparent menu strip bar at the bottom of the screen that when you press anyone button on that strip, it will then show your options in a pop-up window like what they use in the new version of the ""camera"" application  for the droid 1 running 2.2... Also I am wanting it to be over top of an background (meaning like an overlay)(basically will always show over top the activity and then when your done it closes by itself or when you tap the screen somewhere away from it, it will close)</p><p>It shows icons that seem to have a bit of transparency to them or could just be white (not to sure)</p><p>If anyone can help get me started as to how to go about this, It would be greatly appreciated... whether it is the XML or the actual Java coding...</p>","471180","","437","","2012-05-01 17:56:33","2012-05-01 17:56:33","Transparent menu in Android","<android>","0","0","","",""
"3933387","1","","","2010-10-14 13:05:09","2","1228","<p>I'm getting an AAC stream from a HTTP server and using that as the datasource for the <code>MediaPlayer</code> in Android.<br>It plays perfectly fine, but when I try to execute <code>mediaPlayer.seekTo(int position)</code> I get the following errors about a million times:<br><code>WARN/AACDecoder(13889): AAC decoder returned error -1, substituting silence<br> WARN/AACDecoder(13889): AAC decoder returned error 10, substituting silence<br> WARN/AACDecoder(13889): AAC decoder returned error 1, substituting silence</code></p><p>This error happens on Android 2.2 but it does not seem to work on earlier versions either. Support for seeking is a must in my application, and I would like it to work for Android 1.5 - 2.2.</p><p>Is there any good solution on how to seek in AAC streams?</p>","367101","","","","","2012-12-28 19:38:29","Seeking in AAC streams on Android","<android><media-player><aac><seek>","1","0","1","",""
"3933476","1","","","2010-10-14 13:15:29","1","1237","<p>I've found through research on google that that I can read a text file by storing it in my res/raw folder and then accessing it through getResources().openRawResource(R.raw.words);</p><p>In a class WordHelper I the constructor provides throws an InvocationException on this line of code: </p><p>istream = getResources().openRawResource(R.raw.words);</p><p>Which is the one most examples seem to use without a problem, I will then go on to do this  isreader = new InputStreamReader(istream);  myReader = new BufferedReader(isreader);once everything is working and then use the readLine() method.</p><p>All descriptions of InvocationException such as getCause are null, I definately have the file in the res/raw/words.txt. </p><p>Thanks for reading. </p>","469033","","","","","2011-09-13 19:37:38","Android Reading Text File Line-by-Line From Res/Raw In Emulator, InvocationException On OpenRawResource","<android>","1","0","","",""
"3933694","1","","","2010-10-14 13:35:03","0","222","<p>I kinda confused about the ""latest"" version of the Android platform vs. APIs and SDK.</p><p>as far as I read in the Android web site the latest Android SDK is 2.2</p><p>I also have an HTC developer Phone, and when I go to the htc to update its firmware and Android Image (from page: <a href=""http://developer.htc.com/adp.html"" rel=""nofollow"">http://developer.htc.com/adp.html</a>); I found that the latest radio and recovery images are for Android 1.6 </p><p>what does it mean? 1. Do I have to wait until platform 2.2 is released for HTC Dev Phone? 2. or if I have the latest 1.6 images instaled on my device it will run whatever I build using SDK 2.2</p><p>can anyone please clarify this for me.</p><p>thanks in advance.</p>","475824","","","","","2010-10-14 15:50:13","Android Radio and Image version for HTC Developer Phone Device","<android>","1","0","","",""
"3933696","1","3933754","","2010-10-14 13:35:09","0","139","<p>I want to place an <code>ImageButton</code> on another <code>ImageView</code> in android.</p><p>How should I do it?</p>","461972","","119895","","2010-10-14 13:41:14","2010-10-14 15:50:12","Layout in android","<android>","2","0","","",""
"3933768","1","","","2010-10-14 13:42:37","2","405","<p>Is there a way to increase the text size for a <code>TextView</code> when selected?</p>","460611","","119895","","2010-10-14 13:48:14","2011-10-05 10:57:13","Change text size when selected","<android>","1","3","","",""
"3933774","1","","","2010-10-14 13:43:51","1","599","<p>Client given me an url to download sqlite file.I written following code to read sqlite file bt im not able to read file</p><pre><code>`public void DownloadFromUrl(String sqlFileURL) {        try {            HttpURLConnection httpCon = null;            InputStream myInput = null;            URL url = new URL(sqlFileURL);            long startTime = System.currentTimeMillis();            httpCon = (HttpURLConnection) url.openConnection();            httpCon.setRequestMethod(""GET"");            httpCon.setDoOutput(true);            myInput = httpCon.getInputStream();            int status = httpCon.getResponseCode();            if (status == HttpURLConnection.HTTP_OK) {                myInput = httpCon.getInputStream();            }            String outFileName = DB_PATH + DB_NAME;            OutputStream myOutput = new FileOutputStream(outFileName);            byte[] buffer = new byte[1024];            int length;            while ((length = myInput.read(buffer)) &gt; 0) {                myOutput.write(buffer, 0, length);            }            myOutput.flush();            myOutput.close();            myInput.close();            Log.d(TAG, ""download ready in""                    + ((System.currentTimeMillis() - startTime) / 1000)                    + "" sec"");        } catch (IOException e) {            Log.d(TAG, ""Error: "" + e);        }    }`</code></pre><p>is there any mistake in this code?. or is there any other way to read sqlite file from url.?</p><p>Please let me know</p><p>Thanks</p>","341443","","135152","","2011-05-25 03:09:28","2011-05-25 03:09:28","How to read sqlite file from url","<android><sqlite>","0","2","","",""
"3933787","1","3934307","","2010-10-14 13:45:17","3","3823","<p>I keep getting top, bottom, left, right = 0.  I guess I am doing this wrong, what is the correct way? TIA</p><p></p><p>in onCreate()</p><pre><code>    ImageView trash = (ImageView) findViewById(R.id.dropTarget_trash);    trash.setOnTouchListener(this);    Rect trashHit = new Rect();    trash.getHitRect(trashHit);    Log.d(TAG,""Trash left:"" + trashHit.left + "" right: "" + trashHit.right + ""  top: "" + trashHit.top + "" bottom: "" + trashHit.bottom);</code></pre>","465199","","","","","2010-10-14 14:35:51","gethitRect() , I am doing it wrong, how does this work?","<android><image>","1","0","","",""
"3933800","1","5428257","","2010-10-14 13:46:33","1","667","<p>I am having trouble getting the following code to render as I expect it to:</p><pre><code>var img = Titanium.UI.createImageView({  top: 0,  left: 0,  width: 140,  height: 92,  image: 'http://cdn.monmotors.com/tn_' + imgr,  defaultImage: 'car.png'});post_view.add(img);var lbl = Titanium.UI.createLabel({  text: desc,  left: 160,  width: 'auto',  top: 0,  height: 92,  textAlign: 'left',  color: '#ffffff',  font: {    fontSize: 12,    fontWeight: 'bold'  },});post_view.add(lbl);</code></pre><p>This is how it is rendering:</p><p><img src=""http://i.stack.imgur.com/ybRDK.png"" alt=""Android Screenshot""></p><p>I've set top: 0 and I assumed this would put the label at the top, but this is obviously not the case.</p><p>Anyone have any idea how I can achieve this? Thanks in advance.</p>","280515","","","","","2011-04-21 03:08:32","How do I fix how my Titanium Developer app Label is rendering on a TableView?","<javascript><android><appcelerator-mobile>","2","0","1","",""
"3933802","1","6869102","","2010-10-14 13:46:46","0","534","<p>I've got listview that in a row it contain 3elements: imageview, textvie and another imageview. I've set my listview to setItemsCanFocus(true) and every item is set setFocusable(false). Screen: </p><p><img src=""http://img252.imageshack.us/img252/4042/zrzutekranue.png"" alt=""""></p><p>I can navigate on the screen (click on text/image, I have those fields set to clickable and focusable), but there is no visible focus. I'd like to have the default focus style, when background changes.</p><p>I can add sth like:setBackgroundColor(xxx)but I'd like to have that fancy background that is lighter in the middle and darker at the ends.</p><p>The upper row on the pic is what I've got, and lower is the ideal focus notification, of course it should be narrow so it would only be background of the text view.</p><p>Sorry for my English. </p><p>PS I also used for textviewandroid:layout_height=""fill_parent""to fill for height which isn't the best piece of coding.</p>","475837","","1405330","","2014-03-03 12:12:50","2014-03-03 12:12:50","Setting visible focus on text view","<android><android-layout><android-listview>","1","0","","",""
"3933804","1","","","2010-10-14 13:46:59","1","397","<p>i want to add a caption which looks like the default text below an app icon to the widget of my app. Is there any common way to achieve this?</p>","314597","","","","","2011-04-25 10:44:48","Android adding caption to widget","<android><android-widget>","2","0","","",""
"3933807","1","3934560","","2010-10-14 13:47:30","0","934","<p>How do I create an activity which supports certain file types clicked in the web browser?</p><p>Here's what I tried:</p><p><strong>AndroidManifest.xml</strong>:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""net.sf.asap"" android:versionCode=""212"" android:versionName=""2.1.2""&gt;    &lt;application android:label=""@string/app_name"" android:icon=""@drawable/icon""&gt;        &lt;activity android:name="".FileSelector"" 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="".Player"" android:label=""@string/playing""&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"" android:host=""*"" /&gt;                &lt;data android:scheme=""http"" android:host=""*"" /&gt;                &lt;data android:scheme=""https"" android:host=""*"" /&gt;                &lt;data android:pathPattern="".*\\.sap"" /&gt;                &lt;data android:pathPattern="".*\\.cmc"" /&gt;                &lt;data android:pathPattern="".*\\.cm3"" /&gt;                &lt;data android:pathPattern="".*\\.cmr"" /&gt;                &lt;data android:pathPattern="".*\\.cms"" /&gt;                &lt;data android:pathPattern="".*\\.dmc"" /&gt;                &lt;data android:pathPattern="".*\\.dlt"" /&gt;                &lt;data android:pathPattern="".*\\.mpt"" /&gt;                &lt;data android:pathPattern="".*\\.mpd"" /&gt;                &lt;data android:pathPattern="".*\\.rmt"" /&gt;                &lt;data android:pathPattern="".*\\.tmc"" /&gt;                &lt;data android:pathPattern="".*\\.tm8"" /&gt;                &lt;data android:pathPattern="".*\\.tm2"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Fragment of <strong>Player.java</strong>:</p><pre><code>Uri uri = getIntent().getData();InputStream is = getContentResolver().openInputStream(uri);</code></pre><p>When I enter an URL in the browser (Android 1.6) I get:</p><pre><code>E/AndroidRuntime(12026): Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: No content provider: http://asap.sourceforge.net/X_Ray_2.sapE/AndroidRuntime(12026):    at net.sf.asap.Player.onCreate(Player.java:109)E/AndroidRuntime(12026):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)E/AndroidRuntime(12026):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)</code></pre>","475838","","","","","2012-06-28 09:47:51","How to read files clicked in the Android web browser?","<android><web-browser>","1","0","1","",""
"3934014","1","","","2010-10-14 14:07:18","0","5237","<p>I am new in Android app. development, now I have encountered a strange problem with the Menu button. Here is the thing:</p><p>I have two activities, ""ActivityOne"" and ""ActivityTwo"", where ""ActivityTwo"" is the child Activity of ""ActivityOne"". In both activity, I have defined the menu button options like following:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    MenuItem insertMenuItem = menu.add(0, INSERT_ID, 0, R.string.menu_insert);    insertMenuItem.setIcon(R.drawable.ic_menu_add);    MenuItem settingMenuItem = menu.add(0, SETTING_ID, 0, R.string.menu_setting);    settingMenuItem.setIcon(R.drawable.ic_menu_settings);    MenuItem aboutMenuItem = menu.add(0, ABOUT_ID, 0, R.string.menu_about);    aboutMenuItem.setIcon(R.drawable.ic_menu_about);    logPrinter.println(""creating menu options..."");    return true;}@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {        case INSERT_ID:            doInsert();            return true;        case SETTING_ID:         return true;        case ABOUT_ID:         showAbout();         return true;    }    return super.onMenuItemSelected(featureId, item);}</code></pre><p>In ""ActivityOne"", when I click the physical Menu button, there is no menu options pop up from screen bottom, when I checked the LogCat console, there are two <strong>warning</strong> messages, which are ""<strong>No keyboard for id 0</strong>"" and ""<strong>Using default keyMap:/system/usr/keychars/qwerty.kcm.bin</strong>"" . </p><p>BUT, in ""ActivityTwo"", the menu button works fine, it shows me those menu options I defined.</p><p>Why the menu button does not work in ""ActivityOne"" ?? What does the warning msg mean???</p>","475850","","475850","","2010-10-14 14:12:44","2014-03-29 00:43:09","""No keyboard for id 0""?","<android>","1","3","","",""
"3934111","1","3934447","","2010-10-14 14:18:42","1","573","<p>Friend's     Is there any possibility to assign WebView text content to ordinary String variable?if it so,please help me.</p><p>Thanks in advance.</p>","393953","","","","","2010-10-14 14:49:08","How to assign an webView text content to String Variable","<android>","1","0","","",""
"3934176","1","3935016","","2010-10-14 14:24:24","1","3139","<p>Hey, I checked tons of tutorials and guides but somehow can't find it...</p><p>I need to include multiple images in my Android app. It's like an image viewer/slideshow.Currently I switch between pictures from /drawable-mdpi dir simply with ImageView and adapter, using gestures to left/right. Works but nothing impresive :/</p><p>Basically I could use something like Android (2.1) gallery with some image show animation.</p><p>1st question: what's the best way to include many (50-100) fullscreen images in App?</p><p>2nd: is it possible to use ViewFlipper animations directly to images? or do i have to somehow populate Views?</p>","475861","","","","","2011-04-11 11:57:37","Android: ViewFlipper & multiple images?","<android><image>","1","0","","",""
"3934184","1","","","2010-10-14 14:25:05","0","7533","<p>I was browsing the web and I saw an application that claimed to scan for user's fingerprints so I thought I should give it a try, the app worked well and I was amazed! does anyone know how this app reads user's fingerprint? how is this possible on android? any tutorial or hints or any open source project? I think this will help a lot of developers thanks maxsap.</p>","234898","","","","","2013-05-18 22:53:39","android fingerprint scanner application","<android>","2","0","","",""
"3934276","1","","","2010-10-14 14:33:27","1","387","<p>I m calling an webservice which is soap based in my android application. It is returning me the XML response. how can i parse it?? I checked the XML parsing its asking for the URL. I m confused which URL I need to pass?? </p><p>Here is the code:</p><pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);  request.addProperty(""pStrType"", type);request.addProperty(""pIntPageNo"", PageNo) request.addProperty(""pIntPageSize"", PageSize);           //Log.v(LOG_TAG,"" value:=""+name);           //Log.v(LOG_TAG,"" value:=""+pass);           SoapSerializationEnvelope envelope =            new SoapSerializationEnvelope(SoapEnvelope.VER11);           envelope.dotNet = true;           envelope.setOutputSoapObject(request);           AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);           try           {           androidHttpTransport.call(SOAP_ACTION, envelope);           SoapObject resultstring = (SoapObject) envelope.bodyIn;            Log.v(LOG_TAG,"" value:=""+resultstring);           String Result=resultstring.toString();</code></pre><p>What to do after dis?? m getting the string of response in (resultString)</p><p>pls pls help me its very urgent.</p>","383597","","1041044","","2012-05-21 13:15:45","2012-05-21 13:23:50","Access Soap based Web Service in Android.","<java><android><xml><parsing>","3","0","","",""
"3934331","1","3934409","","2010-10-14 14:38:12","11","18505","<p>I am working on an Android app and have a couple strings that I would like to encrypt before sending to a database.  I'd like something that's secure, easy to implement, will generate the same thing every time it's passed the same data, and preferably will result in a string that stays a constant length no matter how large the string being passed to it is.  Maybe I'm looking for a hash.</p>","475901","","114066","","2010-10-14 14:47:09","2014-04-10 11:38:09","Android - how to encrypt a string?","<java><android><encryption><hash>","9","2","8","",""
"3934502","1","3941377","","2010-10-14 14:53:37","0","1571","<p>I've got an application which records audio from the microphone and then performs some post-processing on the audio in realtime, so I must use the <code>AudioRecord</code> class instead of the standard <code>MediaRecorder</code>.  My code for recording is as such:</p><pre><code>DataOutputStream dataOutputStreamInstance = new DataOutputStream(bufferedStreamInstance);android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);int bufferSize = AudioRecord.getMinBufferSize((int)sampleRate, channelConfiguration, DEFAULT_AUDIO_ENCODING) * 2;short[] microphoneBuffer = new short[bufferSize];float[] processingBuffer = new float[bufferSize];short[] outputBuffer = new short[bufferSize];AudioRecord microphoneRecorder = new AudioRecord(MediaRecorder.AudioSource.MIC, 44100, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);microphoneRecorder.startRecording();while(isRecording) {  synchronized(mutex) { ... check for pause condition, wait, etc. ... }  int numSamplesRead = microphoneRecorder.read(microphoneBuffer, 0, bufferSize);  // Convert 16-bit short data to floating point  getFloatingPointBufferFromPcmData(microphoneBuffer, processingBuffer, bufferSize);  doProcessingStuff(processingBuffer, bufferSize);  if(numSamplesRead == AudioRecord.ERROR_INVALID_OPERATION) {    throw new IllegalStateException(""read() returned AudioRecord.ERROR_INVALID_OPERATION"");  }  else if(numSamplesRead == AudioRecord.ERROR_BAD_VALUE) {    throw new IllegalStateException(""read() returned AudioRecord.ERROR_BAD_VALUE"");  }  try {    // Dump the output to the target file in 16-bit short format    getShortPcmBufferFromFloatingPointData(processingBuffer, outputBuffer, bufferSize);    for(int bufferIndex = 0; bufferIndex &lt; numSamplesRead; bufferIndex++) {      dataOutputStreamInstance.writeShort(outputBuffer[bufferIndex]);    }  }  catch(Exception e) {    Log.e(""MyApp"", ""Error while writing audio data to file: "" + e.getMessage());    e.getStackTrace();  }}microphoneRecorder.stop();</code></pre><p>The above code works fine, and I can actually record audio from the device, and I hear my voice and such.  The problem is that after some seconds, a very strange pattern of distortion starts to emerge until the entire signal is drowned out.  Here's a screenshot of a recording of silence which I made by putting some tape over the mic and let the app record for a minute or so:</p><p><img src=""http://i.stack.imgur.com/uMpMY.png"" alt=""Screenshot of distortion in wave file""></p><p>The original wave file can be <a href=""https://docs.google.com/leaf?id=0B9iN4SmlkA6uYzg3NjUyODItZDM5MC00MTUzLThhM2EtNzAxYzgwYmUyYzc4&amp;hl=en"" rel=""nofollow"">downloaded here</a>.</p><p>The problem is definitely <strong>not</strong> due to my effect processing code, as I have tried commenting it out and get the same results in both cases.  I have scoured the web for other code or people who might be experiencing similar problems, but haven't found anything.</p>","14302","","","","","2010-10-15 10:26:52","Strange distortion while recording from microphone in Android 2.2","<android><audio><audiorecord>","3","0","1","",""
"3934653","1","7215944","","2010-10-14 15:07:44","1","545","<p>I have an Android service that runs in background.I need it to recieve feedback (and stop, for example) just when user did something, no matter if it's only touch event on homescreen of somewhere else or key press.</p><p>Is it possible to handle global touch and key events?</p>","475938","","","","","2011-08-27 16:51:36","Global control handler","<android>","1","0","","",""
"3934674","1","","","2010-10-14 15:10:54","1","1830","<p>I have written a program that uses the Intent for the image capture to get a photo using the application in the phone.Using MediaStore.EXTRA_OUTPUT, I get a URI to the image, wich converted to a path results in something like ""/external/images/media/NN"" where NN is the number of the photo.</p><p>Now, in my program, after I read and manipulated the image, I want to delete that image.</p><p>How should I do that ??</p><p>(File image = new File(path); image.delete(); // returns false, so doesn't work)</p><p>Thanks.</p>","475947","","","","","2011-04-12 18:58:07","How to delete photo just taken in android program","<android><file><delete><camera>","2","0","1","",""
"3934709","1","","","2010-10-14 15:15:46","0","336","<p>i have a question: is it possible to set the position of a shortcut inside the wallpaper?i have done some search but i don't found nothing relevant.</p><p>Thanks </p>","451247","","","","","2010-10-14 15:29:49","Android shortcut position","<android><shortcut>","1","0","","",""
"3934986","1","3935215","","2010-10-14 15:42:18","3","6033","<p>I have an android app, where in a list view for each element in list, I load an image from web in a separate thread. So if there are 8 items displayed in list view, activity will try to fire 8 different threads, one for each list item to load an image. As you scroll down the list, the number of threads may increase if the previous threads haven't finished executing.</p><p>I am curious to know how many simultaneous threads can a single android app execute in parallel? Is there a limit? I wouldn't expect these threads to cause a ANR over slow internet connection as they are independent? But it seems that ANR does happen and may be it's because app/device run low on resources, so spawning a new activity in UI takes more than 5 seconds which results in an ANR? </p><p>Any clues to how I can make responsiveness better on a slow internet connection will be appreciated.  </p>","57847","","","","","2010-10-22 01:43:24","Multiple threads in Android activity/service","<android><multithreading><service><activity><unresponsive>","2","0","","",""
"3935009","1","3935362","","2010-10-14 15:44:48","10","9222","<p>I am trying to open up Gmail Compose screen when a button is clicked in my Android App.Do I need some API key for this from Google? or what do I need to do in my button onClickListener?</p><p>Any kind of insight is much appreciated.</p>","447886","","","","","2013-01-24 06:50:10","How to open Gmail Compose when a button is clicked in Android App?","<android><gmail>","4","0","3","",""
"3935055","1","3936773","","2010-10-14 15:50:35","7","19220","<p>I can create a shape that is a rectangle with all edges rounded.  However, what I'm wanting is a rectangle shape with only 2 of the edges rounded.  Is this possible?</p><p>I'm essentially hacking together a ListView that looks like a bubble with rounded edges.  I'm looking to add a header that has the two top edges rounded and a footer with the two bottom edges rounded.</p>","406790","","","","","2012-08-18 08:22:50","Creating a rectangle shape with only two rounded edges","<android><shape>","7","0","4","",""
"3935168","1","","","2010-10-14 16:02:42","0","1187","<p>Hi all I need some help here I have gone through the tutorial for WebView and I get it to load my url and it loads fine. I run a site that offers .pkg files to my users for download to there device. The issue is instead of downloading the .pkg file it just displays the raw code of the .pkg file in the webview. How can I get this to force download to the root of the sd card? Here is what I have </p><pre><code>package com.ps3brew.view;import com.ps3brew.view.R;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class WebViewExample extends Activity {    @Override    public 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://www.myurl.com/phone.html"");        webView.setWebViewClient(new HelloWebViewClient());    }}</code></pre><p>Any help would be great I am 100% new to this android dev and im just stuck everything I have tried has failed any help would be great. Thanks in advance</p>","475994","","475994","","2010-10-14 16:55:38","2011-02-07 08:12:05","WebView displays .pkg file instead of downloading it","<android><webview><android-webview>","2","0","1","",""
"3935182","1","3935349","","2010-10-14 16:03:48","0","306","<p>When i click home button and then come back to to my application it doesn't show the last values on the listview or any other view it just look same with when i started the application.I believe it is can be done with onResume and onPause but i couldn't find how .</p>","458678","","","","","2010-10-14 18:13:59","How to restore last values of listview and other views after coming app from foreground?","<android><listview><foreground><onresume>","3","0","","",""
"3935193","1","3939707","","2010-10-14 16:05:14","2","8053","<p>I have tested my application on the Android SDK on everything from 1.5 to 2.2 and the camera code in my activity works fine. Running it on a device with 2.1 is also working. But the same app does not work with 2.2 on HTC Desire and Nexus One and the app crashes. Any ideas why they might be happening?</p><p>Am using <strong>import android.hardware.Camera;</strong>.</p><p>Inside onCreate I have this:</p><pre><code>preview = (SurfaceView) findViewById(R.id.preview);        previewHolder = preview.getHolder();        previewHolder.addCallback(surfaceCallback);        previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);</code></pre><p>And the callback is</p><pre><code>SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {    @Override    public void surfaceDestroyed(SurfaceHolder holder) {        camera.stopPreview();        camera.release();        camera = null;    }    @Override    public void surfaceCreated(SurfaceHolder holder) {        camera = Camera.open();        try {            camera.setPreviewDisplay(previewHolder);        } catch (Throwable t) {            Log.e(TAG, ""Exception in setPreviewDisplay"", t);            Toast.makeText(CameraActivity.this, t.getMessage(),                    Toast.LENGTH_LONG).show();        }    }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {        Camera.Parameters parameters = camera.getParameters();        parameters.setPreviewSize(width, height);        camera.setParameters(parameters);        camera.startPreview();    }};</code></pre>","48066","","995926","","2012-05-05 13:59:54","2013-01-24 11:43:58","Camera crashes in Android 2.2","<android><camera><android-2.2-froyo>","3","2","","",""
"3935321","1","12342315","","2010-10-14 16:20:43","5","9918","<p>I am unable to get my BroadcastReceiver onReceive method called using the BOOT_COMPLETED intent.</p><p><strong>AndroidManifest.xml</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.jerrellmardis.umbrella""      android:versionCode=""4""      android:versionName=""1.0.3""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""             android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;activity android:name="".activities.Umbrella"" 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;activity android:name="".activities.Preferences"" android:label=""@string/app_name"" android:screenOrientation=""portrait"" /&gt;        &lt;receiver android:name=""com.jerrellmardis.umbrella.receiver.WeatherStartupReceiver""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;        &lt;service android:name="".service.WeatherUpdateService""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.jerrellmardis.umbrella.service.WeatherUpdateService"" /&gt;            &lt;/intent-filter&gt;        &lt;/service&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.VIBRATE"" /&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_BOOT_COMPLETED"" /&gt;&lt;/manifest&gt;</code></pre><p><strong>WeatherStartupReceiver.java</strong></p><pre><code>package com.jerrellmardis.umbrella.receiver;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.provider.Contacts.People;import android.util.Log;import com.jerrellmardis.umbrella.R;public class WeatherStartupReceiver extends BroadcastReceiver {       private NotificationManager mNotificationManager;       private int SIMPLE_NOTFICATION_ID;       @Override       public void onReceive(Context context, Intent intent) {                // Do something interesting here...       }}</code></pre>","476005","","","","","2013-11-24 12:58:27","My BroadcastReceiver is not receiving the BOOT_COMPLETED intent after my N1 boots. Help Please!","<android><service><broadcastreceiver><android-intent><intentfilter>","2","1","1","",""
"3935443","1","3935810","","2010-10-14 16:36:07","14","18450","<p>The app I am developing has many activities organized into seven java packages. Originally I wrote all the coding and stuff for each group of activities in a java package as different projects.</p><p>Now I'm at the point where I want to put all the packages together into one project. When I add a new package to the src folder, I get an error for all my R.id.* values (""R cannot be resolved""). </p><p>My instinct tells me that there is something fancy I have to put in the project manifest, but I can't find any resource online to tell me how.</p><p>(Note: I have read <a href=""http://stackoverflow.com/questions/2925529/multiple-packages-in-an-android-app"">this</a> and <a href=""http://blog.javia.org/android-package-name/"">this</a> and I still couldn't figure out how to add additional packages to my project.)</p>","444454","","","","","2012-10-26 09:16:36","Android: Including multiple Java Packages to Manifest","<android><package><manifest>","3","8","6","",""
"3935494","1","","","2010-10-14 16:42:22","0","723","<p>I'm trying to learn how to use Networking API in Android (or how to make the app network enabled).</p><p>I looked in the following places:<br>1. Coder-Darcey book ""Android: wireless application development"" has a short chapter on this. But it is for an older version, 1.5, of Android. I'd like to refer to a more recent &amp; more detailed information.<br>2. Strangely the <a href=""http://developer.android.com"" rel=""nofollow"">developer.android.com </a> site has nothing at all on this.<br>3. Searched SOF on this, &amp; found <a href=""http://stackoverflow.com/questions/623533/android-java-network-programming-resources"">this question</a>. The link it refers to is WAY too complex for me to understand.</p><p>Anyone happen to know a good reference/website/tutorial for this important topic?</p><p>Thanks!</p>","289918","","","","","2012-06-27 15:38:27","Programming Resources on using Android Networking APIs","<android>","1","3","","",""
"3935753","1","3935969","","2010-10-14 17:19:58","6","3165","<p>I'm working with Android at the moment, trying to avoid using Eclipse (for which I have an irrational hatred).</p><p>I need to include an external <code>.jar</code> file (used in my <code>Activity</code>)and have no idea how to link it for <code>ant debug</code>...</p><p>I've read up on <code>build.xml</code> files but adding <code><code>&lt;</code>path id=""compiler.classpath""<code>&gt;</code>...<code>&lt;</code>/...<code>&gt;</code></code> or <code><code>&lt;</code>classpath<code>&gt;</code></code> nodes to the XML doesn't help fix it.</p><p>Hope someone can help me out!</p>","384638","","","","","2010-10-14 17:44:44","Android: Include External Jar in Build (Without Eclipse)","<java><android>","1","0","","",""
"3935806","1","3936344","","2010-10-14 17:26:05","2","2807","<p>I want to create a ArrayAdapter for one spinner. So each element contain one string (which will be displayed in the spinner/list) and one value (e.g. an ID). How I can easily store a second value beside each string without implementing a new Adapter class?</p><p>SincerelyxZise</p>","473890","","","","","2010-10-14 18:30:17","Assign value to each string in the ArrayAdapter","<android><android-widget>","2","0","1","",""
"3935821","1","3936173","","2010-10-14 17:27:27","0","1311","<p>HI, i am doing a HttpUrlConnection in android application with an URL. The uRL is giving me response in the browser but in the android code InputStream returning zero. this is my code.....</p><p>URL url = new URL(""https://certify.securenet.com/payment.scrnt"");</p><pre><code>    HttpURLConnection httpCon = (HttpURLConnection)url.openConnection();    InputStream in = httpCon.getInputStream();    byte content[] = new byte[in.available()];    in.read(content,0,content.length);    String receivedString = new String(content);    Log.d(""Received Stringggggg"",receivedString)</code></pre>","307585","","307585","","2010-10-14 20:14:20","2010-10-14 20:14:20","HttpUrlConnection problem in android","<android><httpurlconnection>","2","1","","",""
"3935830","1","3935904","","2010-10-14 17:28:39","1","456","<p>I am trying to determine the city in USA the user is in using their current location from an Android App. I want to use the GPS as the location provider but how accurately can I determine the name of the city from the Locale or Latitude / Longitude data.</p><p>For instance I noticed the twitter app determines you are in Manhattan when tweeting from Manhattan, but is it possible to retrieve New York City instead of Manhattan from the location data and likewise Los Angeles instead of Beverly Hills.</p><p>This is because all I need to determine is which city the user is in as per the current location.</p><p>Thanks for all the help.</p>","447886","","","","","2010-10-14 17:36:26","Is there a way to accurately determine which city in US the user is in using Android Location Manager?","<java><android><geolocation><geocoding><reverse-geocoding>","1","0","1","",""
"3935997","1","4177386","","2010-10-14 17:47:36","2","2320","<p>I'm switching between different Activities using Intents. For one Activity, I would like it to clear the history stack so when the user presses the back button, it takes them Home instead of previous activities in my application.</p>","23528","","213269","","2010-12-21 16:38:24","2010-12-21 16:38:24","Set root activity/intent in Android","<android><activity><android-intent>","2","0","2","",""
"3936090","1","7820036","","2010-10-14 17:59:02","1","2643","<p>I am building a tabbed application.  Things work wonderfully with TabHost.  Unfortunately, my team lead does not like the look of the tabs.  He doesn't like the tiny icon and the gaps between the tabs.  So, I either need to modify TabHost or use an ActivityGroup.</p><p>My first attempt was at changing TabHost.  </p><p>Here is the drawable for one of my tabs:</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_timeline_grey""          android:state_selected=""true"" /&gt;    &lt;!-- When not selected, use white--&gt;    &lt;item android:drawable=""@drawable/ic_tab_timeline_white"" /&gt;    &lt;!-- This is a state-list drawable, which you will apply as the tab image. When the tab state changes, the tab icon will automatically switch between the images defined here.  --&gt;&lt;/selector&gt;</code></pre><p>I initialize the tab in my main activity:</p><pre><code>// Initialize a TabSpec for each tab and add it to the TabHostintent = new Intent().setClass(this, TimelineActivity.class);spec = tabHost.newTabSpec(""timeline"") .setIndicator("""",                  res.getDrawable(R.drawable.ic_tab_timeline))              .setContent(intent);tabHost.addTab(spec);</code></pre><p>(Note that I set the Indicator to blanks.)</p><p>Then, I set the background image:</p><pre><code>TabWidget tw = getTabWidget();//changeTabWidgetStyle(tw);View tempView = tabHost.getTabWidget().getChildAt(0);tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.timeline_on));</code></pre><p>This successfully sets the background to my desired image.  However, my tab still has the tiny icon, which overlays my background image.  How can I get rid of the icon?  I tried setting the Drawable to null when I initialize the tab, but this causes my app to crash.</p><p>Even if I can get this to work, it looks like I will still have spaces between the tabs.  How can I get rid of those?</p><p>If this doesn't work, I may have to go with an ActivityGroup.  I would rather not, though, because that seems more complicated.  </p><p>I'm using this example: <a href=""http://stackoverflow.com/questions/3265265"">android: using ActivityGroup to embed activities</a></p><pre><code>LocalActivityManager mgr = getLocalActivityManager(); Intent i = new Intent(this, SomeActivity.class); Window w = mgr.startActivity(""unique_per_activity_string"", i); View wd = w != null ? w.getDecorView() : null; if(wd != null) {     mSomeContainer.addView(wd); } </code></pre><p>I can get the ""tabs"" to change and inflate layouts, but I can't add the local activity.  I'm not sure what sort of ""container"" to add the view to.  What should my xml layout look like?</p>","359519","","1","","2010-12-10 08:16:04","2013-07-15 11:04:50","Customized Tabs/Views - TabHost or ActivityGroup?","<android><android-tabhost>","2","1","1","",""
"3936236","1","","","2010-10-14 18:17:09","1","468","<p>I want to connect my users to signin in facebook through my app. I did some google and some people are saying use fbrocket where as some <a href=""http://github.com/facebook/facebook-android-sdk.git"" rel=""nofollow"">http://github.com/facebook/facebook-android-sdk.git</a>. I want suggestions1) which one is easy to implement?2) what is the difference between them?3) Why I need to install a jar. Can I achieve this using some Facebook Api?</p><p>Any suggestion is much appreciated. </p><p>Thanks rachana.</p>","441730","","","","","2010-10-14 21:23:17","facebook through android","<android>","4","0","","",""
"3936396","1","","","2010-10-14 18:36:42","3","4600","<p>I'm a beginner in Android programming.</p><p>I have been write an application to list all video file in a folder and display information of all videos in the folder. But when i try to get the video duration it return null and i can't find the way to get it.</p><p>Any one can help me?</p><p>Below is my code:</p><pre><code>Uri uri = Uri.parse(""content://media/external/video/media/9"");Cursor cursor = MediaStore.Video.query(res, data.getData(), new String[]{MediaStore.Video.VideoColumns.DURATION});if(cursor.moveToFirst()) {    String duration = cursor.getString(0);    System.out.println(""Duration: "" + duration);}</code></pre>","315082","","","","","2013-07-30 10:20:24","How to get duration of an video file?","<android>","4","1","1","",""
"3936402","1","","","2010-10-14 18:37:21","3","1050","<p>can anyone tell me how to random access a file beyond 2GB with android SDK. I was trying to seek to a position > 2147483647 and got the exception: ""Value too large for defined datatype"". That is odd as the parameter for the seek command is type ""long"". See the code example for details:</p><pre><code>RandomAccessFile    BigFile;BigFile = new RandomAccessFile(sMyFileName, ""r"");BigFile.seek(2147483648);   --&gt; Exception</code></pre><p>Thanks for any help,Michael</p>","476157","","","","","2010-10-14 20:53:52","Random Access files > 2GB with Android SDK","<android><file-io>","1","0","","",""
"3936469","1","","","2010-10-14 18:45:09","0","573","<p>I have a ViewAnimator setup to go through a few normal views (buttons, text, etc) and then to a glSurfaceView.  When animating between the normal views it behaves as expected, however when trying to flip to the glSurfaceView it just appears.  Perhaps it is not possible to animate a glSurfaceView.</p><p>Here is how I setup the ViewAnimator</p><pre><code>&lt;ViewAnimator xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/flipper""android:layout_width=""fill_parent""android:layout_height=""fill_parent"" &gt;        &lt;include android:id=""@+id/first""  layout=""@layout/mainmenu"" /&gt;    &lt;include android:id=""@+id/second""  layout=""@layout/otherscreen"" /&gt;    &lt;include android:id=""@+id/third""  layout=""@layout/glview"" /&gt;&lt;/ViewAnimator&gt;</code></pre><p>Here is the problematic glSurfaceView</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;android.opengl.GLSurfaceView                         android:id=""@+id/glsurfaceview""                         android:layout_width=""fill_parent""                         android:layout_height=""fill_parent""/&gt;     &lt;/LinearLayout&gt;</code></pre><p>How I setup the views in code</p><pre><code>    setContentView(R.layout.main);    glSurface = (GLSurfaceView)findViewById(R.id.glsurfaceview);    renderer = new Renderer(this);    glSurface.setRenderer(renderer);</code></pre><p>Beyond that I just use showNext() and showPrevious off the ViewAnimator, and it works great, until I try and switch to that glSurfaceView.  Thanks for any input, i've been banging my head on this for longer than I would care to admit :)</p>","476164","","","","","2010-10-14 18:55:30","Using a ViewAnimator with a glSurfaceView does not animate","<android>","1","0","","",""
"3936536","1","3937382","","2010-10-14 18:53:25","3","4679","<p>I have one main activity and one preferenceActivity. On my first activity I call menu and go on preferenceActivity by calling startActivityForResult.</p><pre><code>                case R.id.settings:                startActivityForResult(new Intent(this, SettingsActivity.class), LAUNCH_SETTINGS);                return true;</code></pre><p>Then I change my settings and want to return on main activity and see main activity with new settings applyed. In onPause() method do following (as I right understand this method will be called when I press back button, right?)</p><pre><code>   @Override     protected void onPause() {         super.onPause();         setResult(RESULT_OK, new Intent(this, MainActivity.class));         finish();     }</code></pre><p>On main activity</p><pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (requestCode == LAUNCH_SETTINGS) {            if (resultCode == RESULT_OK) {                new RefreshList().execute(ACTION_SELECT);                Log.d(TAG, ""On activity result"");            }        }    }</code></pre><p>But my acyncTask do not called and log not printed. How correctly I can do this? Thanks!</p>","423868","","","","","2010-10-14 20:43:36","How to return from preference screen to main activity?","<android><activity><settings><preferences><android-preferences>","1","0","","",""
"3936715","1","3940248","","2010-10-14 19:16:42","0","369","<p>i have a android service running in the background which receives the coordinates from the server every few seconds. i am not sure how do i display the coordinates on a map every time the service receives a response from the server. kindly help or give an idea.</p><p>thanks</p>","377337","","","","","2010-10-15 07:25:09","service displays points on map android","<android><activity><gps>","2","0","2","",""
"3936787","1","3969911","","2010-10-14 19:26:09","0","178","<p>I've been messing with some layouts for my ListActivity's ListView and found a problem:</p><p>When I click a list item it starts a new Activity.  Unfortunately, when I click the back button to go back to my ListActivity, the scrollbar of the ListView is all the way at the top.</p><p>It used to be that, when I clicked the back button, the user would be scrolled to the same place in the list as they were before they selected the list item to launch a new screen.</p><p>I'm pretty sure I've removed all of the code I've changed, but the problem is still occurring.  Any ideas?</p>","406790","","","","","2010-10-19 15:18:57","Backing to ListActivity causing undesirable behavior","<android><listview><scrolling>","2","0","","",""
"3937006","1","3937360","","2010-10-14 19:56:37","0","461","<p>I've got an activity for which I've defined an intent filter statically in AndroidManifest.xml.  I'd like to register additional intents dynamically to that same intent filter in the activity's onStart() method.  Is this possible?  I'm trying to avoid having to implement a separate intent receiver class.</p>","467085","","467085","","2010-10-14 20:05:55","2010-10-14 20:40:27","Adding intent to activity dynamically","<android>","1","0","","",""
"3937010","1","3937078","","2010-10-14 19:57:11","4","4385","<p>Hey there. My app is going to be using an array of 64 ImageButtons (8x8), and they're all already declared in my XML Layout with names like one1, two5, eight8, etc. Rather than declare these each individually in my Java I thought it might be smart to declare them all in some for loops. I have</p><pre><code>ImageButton musicGrid[][] = new ImageButton [8][8];</code></pre><p>Then I have my nested for loops that basically create a string that will be in place of R.id.whatever. It's just that last line in my loops, that is supposed to do the assigning. What would the correct syntax for that be, or is this not even possible to do (and if so, how better would I handle a 64 button grid?). Thanks!</p><pre><code>for (int i = 0; i &lt; 8; i++) {        for (int j = 0; j &lt; 8; j++) {            String btnID = ""R.id."";            switch(i) {            case 0: btnID.concat(""one""); break;            case 1: btnID.concat(""two""); break;            case 2: btnID.concat(""three""); break;            case 3: btnID.concat(""four""); break;            case 4: btnID.concat(""five""); break;            case 5: btnID.concat(""six""); break;            case 6: btnID.concat(""seven""); break;            case 7: btnID.concat(""eight""); break;            }            switch(j) {            case 0: btnID.concat(""1""); break;            case 1: btnID.concat(""2""); break;            case 2: btnID.concat(""3""); break;            case 3: btnID.concat(""4""); break;            case 4: btnID.concat(""5""); break;            case 5: btnID.concat(""6""); break;            case 6: btnID.concat(""7""); break;            case 7: btnID.concat(""8""); break;            }            musicGrid[i][j] = (ImageButton) findViewById(btnID);        }    }</code></pre>","468498","","","","","2010-10-14 20:19:47","Array of ImageButtons, assign R.view.id from a variable","<android><arrays><imagebutton>","3","1","3","",""
"3937061","1","","","2010-10-14 20:03:18","0","870","<p>I have an ImageView that contains a bitmap. Now the bitmap can change size within a known range. This makes the surrounding views to relocate which I want to prevent. I've tried setting margins and padding for the ImageView but without success. Any ideas?Thanks,Christian</p>","360674","","","","","2012-11-08 17:08:00","How to change the size of a bitmap contained in an ImageView without affecting surrounding view's position in Android?","<android>","2","0","","",""
"3937066","1","3937871","","2010-10-14 20:03:51","0","823","<p>I have four groups in a listview each with four url's I want to load in a webView.  When the user select a url to goto I set a value like so;</p><pre><code> if (position == 0) webb = webb +2; {       Intent intent = new Intent(this, official.class);       startActivity(intent); }</code></pre><p>I then carryout the intent to move to the webView class  where I have given each url a value like so;</p><pre><code>if (webb == 2) mWebView.loadUrl(""http://yahoo.com"");if (webb == 3) mWebView.loadUrl(""http://www.bbc.co.uk"");</code></pre><p>But the screen stays blank, if I state the value inside the official.class it works.</p><p>How can I get this value to pass to another class based on the selection the user makes from the listview.  Sorry if this is hard to understand.</p>","445174","","442558","","2010-10-14 20:30:30","2010-10-14 21:48:47","Passing a Int value to another class","<java><android>","3","6","","",""
"3937238","1","3937368","","2010-10-14 20:24:49","1","3620","<p>I have a WebView that I've added to a view group:</p><pre><code>webView = new WebView(context);addView(webView, ViewGroup.LayoutParams.WRAP_CONTENT);</code></pre><p>This lives in my viewgroup's constructor.</p><p>Then on layout, I want to do this:</p><pre><code>webView.measure(View.MeasureSpec.makeMeasureSpec(getWidth(),View.MeasureSpec.EXACTLY),                  View.MeasureSpec.makeMeasureSpec(3000, View.MeasureSpec.AT_MOST));</code></pre><p>Unfortunately, unless I specify <code>EXACTLY</code>, the webView.getMeasuredHeight() always returns <code>0</code>. What I want to do, is determine how big the webview wants to be so that I can lay other elements around it. I specified that I want the webview to be big enough to encompass it's content and I provided generous amount of space. So why is it still 0?</p><p>Thanks</p><h1>Update 1</h1><p>By the time webView gets measure() request, it should know how much data it has, no?</p><pre><code>webView = new WebView(context);webView.loadData(""&lt;html&gt;&lt;/html&gt;"",""text/html"", ""utf-8"");addView(webView, new ViewGroup.LayoutParams(getWidth(), 1000));</code></pre>","38753","","38753","","2010-10-14 21:02:55","2010-10-14 21:02:55","Android: View.measure(int,int) always wants to be (0,0)","<android><layout><views><webview>","2","0","1","",""
"3937241","1","3937302","","2010-10-14 20:25:07","4","4942","<p>I'm playing video on Android using media player via RTSP.  The player takes about 12s to buffer before it starts playing.  Anyone know how I can convince the player to buffer less?  I have full control over the RTSP server and the SDP it returns.</p>","405814","","1288","","2011-04-09 12:30:45","2013-05-05 05:14:17","Reduce video buffering","<android><video-streaming><media-player><rtsp><buffering>","1","0","5","",""
"3937244","1","","","2010-10-14 20:25:15","0","58","<p>The following code was copied from project one and pasted into project two. No errors in project one. In project two I get: </p><blockquote>  <p>The method <code>onClick(View)</code> of type <code>new View.OnClickListener((){}</code> must override a superclass method  implements <code>androd.view.View.OnClickListener.onClick</code></p></blockquote><p>The project settings look the same, but I must be missing something.</p><pre><code>private Button mCompany = null;public class About extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.about);    setTitle(R.string.title_about);    mCompany = (Button)findViewById(R.id.about_company_button);    mCompany.setOnClickListener( new OnClickListener() {        @Override        public void onClick(View arg0) {             Intent intent = new Intent(Intent.ACTION_VIEW);                             intent.setData(Uri.parse(getResources().getString(R.string.app_company_website)));            startActivity(intent);         }    });</code></pre>","471230","","387076","","2012-06-28 08:39:47","2012-06-28 08:39:47","Code works in one Android project but won't compile in another","<android>","1","0","","",""
"3937531","1","","","2010-10-14 21:00:08","3","684","<p>In the lunar lander example, if I add the following two lines to the top of the doDraw method, the app crashes immediately with a NullPointerException:</p><pre>Matrix m = canvas.getMatrix();canvas.setMatrix( null );</pre><p>Stack trace is:</p><pre>FATAL EXCEPTION: Thread-8java.lang.NullPointerException    at android.graphics.Matrix.preConcat(Matrix.java:233)    at android.view.Surface$CompatibleCanvas.setMatrix(Surface.java:259)    at com.example.android.lunarlander.LunarView$LunarThread.doDraw(LunarView.java:617)    at com.example.android.lunarlander.LunarView$LunarThread.run(LunarView.java:360)</pre><p>The canvas documentation for setMatrix states that <code>If the matrix parameter is null, then the current matrix is reset to identity</code>, so there's no reason this should crash.</p><p>Also, if I do <b>not</b> call getMatrix before calling setMatrix(null), then setMatrix(null) is <b>successful</b>.  So somehow it is the combination of the two calls that are causing a problem.</p><p>Whats going on here?!</p>","476305","","1043882","","2012-11-22 05:28:52","2012-11-22 05:28:52","Android canvas setMatrix(null) crashes (if preceded by a getMatrix)","<android>","0","0","3","",""
"3937546","1","","","2010-10-14 21:02:13","3","1206","<p>I'd like to make my Android app responsive, even when the network connection is not.  </p><p>For certain calls, the data doesn't change that often, so I'd like to be able to retrieve the most recent XML response for a given call.</p><p>Ideally, I'd like to do this similar to how web caching works, hash the call/params, set rules as to expiry, etc.</p>","357951","","","","","2010-10-14 22:17:09","android caching web service data","<java><android><web-services><caching><mobile>","2","0","2","",""
"3937588","1","","","2010-10-14 21:07:14","0","80","<p>I have a app that is started by a received intent (calendar alert).</p><p>It may be started multiple times just one after a other (with a few sec between them).</p><p>Now i want it to stack the screens from the top down..</p><p>So first start of my app gets the view...if it's fired again while first is still shown..but this one below so when user has handled alert 1 it will show this one..</p><p>Thnks..</p>","368598","","","","","2010-10-14 22:09:03","How to put a screen behind the current one?","<android><screen>","2","0","","",""
"3937604","1","","","2010-10-14 21:09:28","0","685","<p>Instead of using in my layout ImageView and TextView I am now adding the image like this:</p><p><code>text.setCompoundDrawablesWithIntrinsicBounds(0, mImagesId[position], 0, 0); </code></p><p>In order to add border to the ImageView I defined a shape xml that I am using as a BackgroundResource.How can I now add the shape to the TextView image up compound ? </p><p>Thanks</p>","474643","","","","","2010-10-14 22:00:05","How to add shape to a TextView CompoundDrawables","<android>","1","0","","",""
"3937610","1","","","2010-10-14 21:10:08","2","1595","<p>My simple audio streaming app works perfectly in 1.6 and 2.1 does not work in 2.2. I have no clue as to why. It works fine on the emulator, on actual 2.2 devices the audio stops unexpectedly after about 10 minutes or so.  When I looked at logcat on my phone (HTC EVO) I see this:</p><pre><code>I/HTTPStream(   65): 1358 Bytes read, progress 34346/65536I/HTTPStream(   65): 1358 Bytes read, progress 35704/65536I/HTTPStream(   65): 1359 Bytes read, progress 37063/65536I/HTTPStream(   65): 1358 Bytes read, progress 38421/65536I/HTTPStream(   65): 1358 Bytes read, progress 39779/65536I/HTTPStream(   65): 1359 Bytes read, progress 41138/65536I/HTTPStream(   65): 2716 Bytes read, progress 43854/65536I/HTTPStream(   65): 1359 Bytes read, progress 45213/65536I/HTTPStream(   65): 1358 Bytes read, progress 46571/65536</code></pre><p>and then all of a sudden:</p><pre><code>E/HTTPStream(   65): recv failed, errno = 11 (Try again)I/HTTPDataSource(   65): Retry ... 0 times leftW/HTTPStream(   65): Calling connect()...I/AudioHardwareQSD(   65): AudioHardware pcm playback is going to standby.D/StreamProcess(   65): OutputStreamProcess::ResetAOLC()W/HTTPStream(   65): Returned from connect()...E/HTTPDataSource(   65): retrying connection failedV/MediaPlayerService(   65): [2] notify (0x355d0, 4, 0, 0)I/MediaPlayer( 1719): MediaPlayer handleMessage what=4I/Prefetcher(   65): [0x3db60] cache below low water mark, filling cache.W/HTTPStream(   65): Calling connect()...W/HTTPStream(   65): Returned from connect()...V/MediaPlayerService(   65): [2] notify (0x355d0, 4, 0, 0)I/MediaPlayer( 1719): MediaPlayer handleMessage what=4I/Prefetcher(   65): [0x3db60] cache below low water mark, filling cache.E/HTTPStream(   65): recv failed, errno = 9 (Bad file number)V/MediaPlayerService(   65): [2] notify (0x355d0, 4, 0, 0)I/MediaPlayer( 1719): MediaPlayer handleMessage what=4I/Prefetcher(   65): [0x3db60] cache below low water mark, filling cache.E/HTTPStream(   65): recv failed, errno = 9 (Bad file number)V/MediaPlayerService(   65): [2] notify (0x355d0, 4, 0, 0)I/MediaPlayer( 1719): MediaPlayer handleMessage what=4I/Prefetcher(   65): [0x3db60] cache below low water mark, filling cache.</code></pre><p>The code is basically directly from Google's own docs ""Playing from a file or stream"" here: <a href=""http://developer.android.com/guide/topics/media/index.html"" rel=""nofollow"">http://developer.android.com/guide/topics/media/index.html</a>.</p><p>Again it works perfectly on 1.6 and 2.1 and the 2.2 <em>emulator</em>, but fails like above on 2.2 <em>devices</em>.</p><p>This is driving me crazy, any ideas?  Thanks.</p><p>EDIT: Here's another example of the logcat on my phone when it runs, all of a sudden receive fails, and the server is ""gone"":</p><pre><code>I/HTTPStream( 65): 29329 Bytes read, progress 29329/65536I/HTTPStream( 65): 1448 Bytes read, progress 30777/65536 I/HTTPStream( 65): 1448 Bytes read, progress 32225/65536 I/HTTPStream( 65): 2896 Bytes read, progress 35121/65536 I/HTTPStream( 65): 1448 Bytes read, progress 36569/65536 I/HTTPStream( 65): 2896 Bytes read, progress 39465/65536 I/HTTPStream( 65): 5792 Bytes read, progress 45257/65536 I/HTTPStream( 65): 1448 Bytes read, progress 46705/65536 I/HTTPStream( 65): 4344 Bytes read, progress 51049/65536 I/HTTPStream( 65): 7240 Bytes read, progress 58289/65536 I/HTTPStream( 65): 5792 Bytes read, progress 64081/65536 I/HTTPStream( 65): 1448 Bytes read, progress 65529/65536 I/HTTPStream( 65): 7 Bytes read, progress 65536/65536 I/HTTPStream( 65): 21713 Bytes read, progress 21713/65536 I/HTTPStream( 65): 1448 Bytes read, progress 23161/65536 I/HTTPStream( 65): 5792 Bytes read, progress 28953/65536 I/HTTPStream( 65): 4344 Bytes read, progress 33297/65536 I/HTTPStream( 65): 1448 Bytes read, progress 34745/65536 I/HTTPStream( 65): 5792 Bytes read, progress 40537/65536 I/HTTPStream( 65): 1448 Bytes read, progress 41985/65536 I/HTTPStream( 65): 5792 Bytes read, progress 47777/65536 I/HTTPStream( 65): 5792 Bytes read, progress 53569/65536 I/HTTPStream( 65): 1448 Bytes read, progress 55017/65536 I/HTTPStream( 65): 2896 Bytes read, progress 57913/65536 I/HTTPStream( 65): 4344 Bytes read, progress 62257/65536 I/HTTPStream( 65): 1448 Bytes read, progress 63705/65536 I/HTTPStream( 65): 1831 Bytes read, progress 65536/65536 I/HTTPStream( 65): 31473 Bytes read, progress 31473/65536 I/HTTPStream( 65): 1448 Bytes read, progress 32921/65536 I/HTTPStream( 65): 23168 Bytes read, progress 56089/65536 I/HTTPStream( 65): 1448 Bytes read, progress 57537/65536 I/HTTPStream( 65): 4344 Bytes read, progress 61881/65536 I/HTTPStream( 65): 2896 Bytes read, progress 64777/65536 I/HTTPStream( 65): 759 Bytes read, progress 65536/65536 I/HTTPStream( 65): 36889 Bytes read, progress 36889/65536 I/HTTPStream( 65): 1448 Bytes read, progress 38337/65536 I/HTTPStream( 65): 4344 Bytes read, progress 42681/65536 I/HTTPStream( 65): 10136 Bytes read, progress 52817/65536 I/HTTPStream( 65): 12719 Bytes read, progress 65536/65536 I/HTTPStream( 65): 3209 Bytes read, progress 3209/65536 E/HTTPStream( 65): recv failed, server is gone, total received: 3209 bytes</code></pre><p>Again, works fine in 1.6 and 2.1 and the 2.2 <em>emulator</em>, just fails on a 2.2 <em>device</em>, specifically my HTC EVO 4G. Note this is using Wi-Fi with an excellent signal.</p>","403146","","995926","","2012-05-05 14:00:19","2012-05-05 14:00:19","Basic streaming audio works in 2.1 but not in 2.2","<android><audio-streaming><android-2.2-froyo>","0","3","2","",""
"3937626","1","","","2010-10-14 21:12:01","0","2214","<p>How can I call a Webservice with a byte[] parameter?  Tried using the namedvaluepairs, but they take strings only.  I am not using the Ksoap2, we decided to use the HttpClient / HttpPost method.</p><p>Anyone have any ideas?</p><p>Here is my code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // WORKS WITH JPEG FILE -- String existingFileName = ""/sdcard/dcim/Camera/1225231027592.jpg"";    String existingFileName = ""/sdcard/dcim/0217175.jpg"";    String mMyFilename = ""0217175.jpg"";    //  /sdcard/Music/kryptonite.mp3""; //DOES NOT WORK WITH MP3 FILE    File uploadFile = new File(existingFileName);    FileInputStream fileInputStream = null;    try {        fileInputStream = new FileInputStream(uploadFile);    } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary = ""*****"";    String mTest;    String Method = null;    try    {        //********************************************************************        //  Create the HttpClient and the HttpPost        //      Note:  Need to use HttpPost because of arguments/parameters        //********************************************************************        HttpClient client = new DefaultHttpClient();        HttpPost request = new HttpPost();        fileInputStream = new FileInputStream(uploadFile);        // create a buffer of maximum size        int bytesAvailable = fileInputStream.available();        int maxBufferSize = 1024;        int bufferSize = Math.min(bytesAvailable, maxBufferSize);        byte[] buffer = new byte[bufferSize];        // read file and write it into form...        int bytesRead = fileInputStream.read(buffer, 0, bufferSize);        //*************************************************************        //Add Value Pairs for Parameters to pass to the Webservice        //*************************************************************        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);         //nameValuePairs.add(new BasicNameValuePair(buffer));         nameValuePairs.add(new BasicNameValuePair(""filename"", mMyFilename));     }    catch (MalformedURLException ex) {        // Log.e(Tag, ""error: "" + ex.getMessage(), ex);    }    catch (IOException ioe) {        String s = """";        //Log.e(Tag, ""error: "" + ioe.getMessage(), ioe);    }}</code></pre><p>}</p><p>The Web Service:</p><pre><code>[WebMethod]public void PutFile(byte[] buffer, string filename){    string serverpath;    //serverpath = @""\\63.237.52.201\UploadFiles\Incoming\"";    serverpath = @""C:\Temp\"";    //BinaryWriter binWriter = new BinaryWriter(File.Open(Server.MapPath(filename), FileMode.CreateNew, FileAccess.ReadWrite));    BinaryWriter binWriter = new BinaryWriter(File.Open(serverpath + filename, FileMode.CreateNew, FileAccess.ReadWrite));    binWriter.Write(buffer);    binWriter.Close();}</code></pre>","467045","","","","","2010-10-14 21:14:14","Android - How do you pass a byte[] to a .net Webservice using HttpClient / HttpPost?","<android><web-services><arrays><httpclient><http-post>","1","0","","",""
"3937647","1","","","2010-10-14 21:14:14","2","865","<p>I would like to modify the background of the title bar of the dropdown dialog associated to a spinner.</p><p>If this is not possible I would like to know what resource is used to draw this background android.R.drawable.* ?</p><p>This is an effort of uniformity for my various pop ups in my application.</p><p><img src=""http://i.stack.imgur.com/muWJo.png"" alt=""alt text""></p>","271395","","271395","","2010-10-15 17:56:15","2011-04-04 19:35:06","Spinner pop up window title background","<android><styles><spinner>","1","0","","",""
"3937665","1","3951888","","2010-10-14 21:17:12","0","208","<p>I'm finding the need to lay out a fairly complex UI manually, by giving the dimensions and position of most all of the sub views.  My plan is to code the XML initially for a 480x320 display, get it all working right to demo for the client on a given device, then modify it for production by programmatically adjusting the size and position of the views to adapt it to whatever screen size it's running on.</p><p>First...I know this is not the recommended approach.  I have spent forever trying to get the automated layouts to work right (along with animations).  Honestly I don't think they were made for the way the client wants this, and I just don't have any more time to mess around with it. (nor to learn to make a flexible custom layout)</p><p>Given that, where should I do the measuring/positioning?  I can do onMeasure() to set the sizes (ignoring the incoming parameters and basing them instead on my knowledge of the screen resolution which is measure when the Activity starts), but where do I set the position of each the view?  In onLayout()?  Assume all views will be subclasses anyway (as opposed to using components out of the box)</p><p>Ideally, I'd like to have one place where I measure the screen res, then grab each view and set its x, y, width and height.  Is that possible?  If so how?</p><p>Edit: now offering a bounty.  Note that I also did a sketch of one simple problem I'm trying to solve -- <a href=""http://karmalita.com/stuff/layout.png"" rel=""nofollow"">http://karmalita.com/stuff/layout.png</a> -- which if you can do it the ""correct"" way (say, using a relative layout), the bounty is yours.</p>","226507","","226507","","2010-10-17 01:46:32","2010-10-17 03:27:43","explicitly lay out UI","<android>","2","2","","",""
"3937698","1","3937839","","2010-10-14 21:21:48","1","835","<p>I find the force close Report option very useful as a developer- the stack trace is really useful to see and I've been able to solve many bugs by using it. </p><p>However, there are places in my app where (quite rightly) I've used a try/catch statement to handle Exceptions. The problem being, that this prevents a force close and so I can't get the data of the error, which would be helpful for bug fixing or even just giving better error messages. Is there any way to report an Exception which has been handled?</p><p>And which version of Android did the Report option come about in?</p>","428665","","","","","2011-02-23 11:24:27","Force close report error option- use in handled exceptions?","<android><exception><reporting-services><exception-handling>","1","0","","",""
"3937709","1","3937763","","2010-10-14 21:23:48","8","2217","<p>I'm trying to user the LayoutInfator to create a view. One of the options I'm thinking about is using the default android.R.layout files. However I'm finding it difficult to locate these files/how they look. It would be great if I could get some help in locating the source. I need to find the id's of the individual elements within those xml files.</p><p>Thanks</p>","431435","","","","","2014-03-14 12:22:55","How do I find out what android.R.layout xml files look like / get the source?","<android><layout>","2","0","1","",""
"3937718","1","3937903","","2010-10-14 21:25:28","1","3469","<p>How to detect if there is a front camera and if there is how to reach and use front camera ? </p>","476324","","15168","","2012-05-04 21:17:44","2012-05-04 21:17:44","How to detect if there is front camera and if there is how to reach and use front camera?","<android><camera>","2","1","1","",""
"3937982","1","","","2010-10-14 22:06:09","1","233","<p>I develop app for time alerting ( for example when you need to drink medicine - it repeats at time intervals ). How can I implement that service runs forever in background ? Is that possible at all ?</p>","476353","","","","","2010-10-14 22:11:25","Time alert problem - Android","<android>","2","0","","",""
"3938088","1","","","2010-10-14 22:24:32","2","2235","<p>I've got TCP client app which successfully negotiates connection to server and receives buffered output, but what I need to know is how to read server responses without waiting to buffer to fill out or server to end connection.<br>In this loop:</p><pre><code>BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));String inputLine;while ((inputLine = in.readLine()) != null) {   ...some code here...         }</code></pre><p>mine app just freezes.<br>How to read just one line or empty string if buffer is empty and continuing to execute a program?<br>Is it possible to timeout this reading, to give server some time to respond?</p>","476364","","","","","2010-10-14 22:55:47","How to read data from socket connection - android","<android><sockets>","1","0","0","",""
"3938100","1","","","2010-10-14 22:27:43","0","959","<p>i'm (newbie) working on android platform 2.1 and i want to estimate my location using WiFi Access Point. i tried with GPS_Provider and Network_Provider but i want to estimate it specifically with WiFi AP in Network_Provider and not through Cell towers. is there any way to get my location through WiFi AP? if yes then how? </p><p>thanks all for ur help.</p>","443565","","","","","2010-10-14 22:37:33","How to estimate my position using Wifi Access Point","<android>","1","0","2","",""
"3938130","1","3938541","","2010-10-14 22:32:49","2","572","<p>Im asking because Im trying to debug a SQL query problem and adb only seems to show part of the SQL string and chops off the end.</p><p>Im getting an ""unrecognized token"" error when running a query:</p><pre><code>W/System.err(18917): android.database.sqlite.SQLiteException: unrecognized token: ""931C6752DF97CFDACD130A06CAE0E7DA6320DE2945FFFA0A65629BC687256DE3"": , while compiling: SELECT COUNT(*) FROM products WHERE (id IN (9781101134801,9781429535823,9780806532318,9781440609404,9781440644474,9781101184554,2940000052358,9780071633574,9781429516105,9781411433250,9781586488581,9780786537624,9781101188705,9781440697661,9780199717569,9781429580397,9781429979436,9781101187739,9781429959810,9781420119053,9781429954419,9781101218457,9781569757468,9780802196262,9781101213339,9781411428942,9781411428232,2940011807343,9780307272119,2940000248775,2940000273708,2940000278932,2940000274514,2940000400104,2940000336878,2940000281062,2940000400081,2940000281017,9780316005050,2940000336113,2940000367278,9781426847585,2940000244647,9780137058549,2940000248768,9780077422318,9781426833533,2940000244609,2940000274552,2940000244692,2940000336908,2940000400142,2940000277621,2940000400111,2940000392300,2940000228241,9780345464927,2940000336144,2940000807224,2940000277249,9780345515667,2940000336076,2940000336137,9780316086134,2940000273463,9780061429347,2940000392355,9781416549833,9780061998065,9780321700704,2940000400159,9781426806421,9781426840562,2940000273470,9781416587187,9781428507326,2940000313640,2940000277669,2940000336915,2940000338131,2940000244654,9780791487655,2940000277676,2940000392331,2940000273449,2940000313633,9781411431645,9780316040341,2940000248782,9780077395469,2940000248850,2940000336083,2940000367261,2940000273494,2940000228623,2940000228302,9780061959936,2940000367247,2940000244623,2940000274538,2940000280942,2940000336861,2940000367216,2940000277645,2940000228388,2940000338124,9780321703477,2940000248812,9780061962066,2940000338100,2940000277225,2940000392324,2940000278925,2940000248348,2940000277713,2940000273487,2940000336120,2940000367223,9780877797753,2940000274569,2940000336922,2940000336106,2940000313671,9780307264725,9780385533133,2940000248393,2940003039615,2940000336090,9780061916458,2940000338087,2940000244678,2940000277638,2940000281079,2940000400128,2940000338049,2940000367186,2940000313695,9780321702067,2940000248867,2940000277652,2940000400135,2940000338094,2940000248805,2940000277201,2940000248836,2940000982556,2940000228340,2940000367209,9780307593672,2940000336052,2940000278918,2940000277706,2940000336069,2940000248355,2940000277232,2940000280966,2940000338117,2940000248379,2940000277218,2940000313657,2940000341599,2940000248829,9780062002945,2940000313664,2940000274521,2940000367230,9780786955916,2940000277690,2940000248362,2940000362396,2940000244685,9780307272300,2940000273500,2940000313688,2940000281147,9781101443552,2940000248843,2940000273456,2940000228043,2940000274545,2940000392317,9780743258241,2940000982303,9781439168035,9780132103206,9781596916715,2940000313718,2940000392348,2940000244661,2940000400098,2940000400166,9780307271341,2940000313701,2940000367193,2940000277683,9781605043739,9780440334408,2940000338070,2940000244630,2940000338063,9780307719607,2940000336939,9780345464453,2940000336885,2940000367254,2940000336892,2940000338056,2940000244616,2940000392294,2940000313626,2940000093559,931C6752DF97CFDACD130A06CAE0E7DA6320DE2945FFFA0A65629BC687256DE3,88F21F69943935F0C31A803A6C3A639F242CDF18DC0570113888FE00569BAE45,9781411433786)) AND (id IN (2940000697375,9781423140344,9781101134801,9781433671074,9781101152140,9781429535823,9780806532318,9781429516174,9781440609404,9781440644474,9781101184554,2940000052358,9780071633574,9780761148340,9781429516105,2940000147467,9781411428485,9781411433250,9781586488581,9781414346304,9781101136775,9780786537624,9781101188705,9781440697661,9781429543637,9781414346311,9781101190111,9781565125858,9780199717569,9781596917248,9781429580397,9780786025145,9780786564743,9781429979436,9781101187739,2940000754603,9781420119053,9781429954419,9781101213339,9781440668890,9780307272119,2940000248775,2940000273708,2940000278932,2940000274514,2940000400104,2940000336878,2940000281062,2940000244562,2940000400081,2940000281017,9780316005050,2940000336113,29400W/System.err(18917):  at android.database.sqlite.SQLiteProgram.native_compile(Native Method)W/System.err(18917):  at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:117)W/System.err(18917):  at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:66)W/System.err(18917):  at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)W/System.err(18917):  at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:59)W/System.err(18917):  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1286)W/System.err(18917):  at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1259)</code></pre><p>As you can see the query above appears truncated.</p>","246793","","","","","2010-10-15 19:40:30","Does the Android debugger truncate debug messages?","<android><sqlite><debugging><adb><truncation>","1","3","1","",""
"3938220","1","","","2010-10-14 22:52:12","0","444","<p>I develop app and I need to store and read ( read every 60 seconds, store rare ) data. What is the most easy way to achieve this? Does anybody have code sample to help me  ? </p>","476353","","","","","2010-10-14 23:01:54","Reading and storing values - Android","<android>","1","2","","",""
"3938249","1","3938336","","2010-10-14 22:59:19","0","954","<p>Using <a href=""http://blogs.adobe.com/air/2010/05/air_android_prerelease.html"" rel=""nofollow"">AIR for Android</a>, is it possible to call from Flex into an NDK library?  If so, how can this be done?</p><p>I have a large C library that I need to use.  I know that I can do this from an Android Java app (through JNI), but I have a large Flex codebase that I'd like to reuse.</p>","89218","","89218","","2010-10-14 23:04:51","2012-01-06 14:47:58","Can an Android AIR app call an NDK library?","<android><flex><air><android-ndk>","2","0","","",""
"3938272","1","3938289","","2010-10-14 23:04:07","1","320","<p>We are migrating to a new Android developer account and I was wondering if anyone had any suggestions about the best way to transition apps to the new account.</p><p>From what I can find, the only suggestions I've seen were to publish an update to the old app notifying the user of the new updated app. This requires us to publish the apps under a new package name which we would like to avoid if possible.</p><p>Has anyone else been in this situation and if so, what did you do?</p>","476382","","","","","2010-10-14 23:07:56","How can I publish an update to Android application with a different developer account?","<android>","1","0","","",""
"3938322","1","","","2010-10-14 23:15:01","2","52","<p>Basically, I am trying to write a benchmark application to test the responsiveness of different Android devices' touchscreens.  I figured the best way to go about doing this is to write an application that counts the number of samples returned from the touchscreen whenever it is touched.  Unfortunately, I have no idea if this is possible and so far haven't found anything relevant to this idea.</p><p>I will most likely be using the MotionEvent class to determine when the touch screen is pressed, but what classes are available to determine the samples returned?</p><p>This is how I imagine my app to function:</p><ul><li>Start app</li><li>Brief description screen, then button to begin testing</li><li>User touches an area of the screen</li><li>I haven't really determined how to do the output yet, but either part of the screen updates a real time graph, or the user just touches for some time and after he releases his finger from the screen, the app will output a new graph in a different activity.</li></ul><p>Any help would be useful.Thanks!</p>","476387","","","","","2010-10-14 23:15:01","Is it possible for Android to return the number of samples per some X time from the touch screen?","<android>","0","2","","",""
"3938477","1","","","2010-10-14 23:58:12","1","1697","<p>I am getting the following info log in GAE's console:""POST /xxx HTTP/1.1"" 200 133 - ""Apache-HttpClient/UNAVAILABLE (java 1.4),gzip(gfe)""</p><p>I can not understand if the servlet is not available, why is ""200"" being returned. I checked web.xml file for servlet mapping and they seem fine. What else could be causing it. Is it even an error on GAE or is it due to client error.</p>","476415","","","","","2011-02-26 14:43:56","Servlet unavailable in AppEngine with Android Client","<android><apache><google-app-engine>","1","0","","",""
"3938494","1","3938562","","2010-10-15 00:00:38","1","847","<p>What I'm trying to do is set the text of the item I click on into the myEditText. Not sure how to access the specific item in ListView though...</p><pre><code>    ListView myListView = (ListView)findViewById(R.id.myListView);    final EditText myEditText = (EditText)findViewById(R.id.myEditText);    ...    myListView.setAdapter(aa);    myListView.setOnClickListener(new OnClickListener(){        public void onClick(View v){            myEditText.setText(""You clicked something!"");        }    });</code></pre>","177389","","","","","2011-08-08 09:45:05","In Android, how do you capture the text value of the item clicked in a ListView?","<android><listview><click>","3","0","","",""
"3938523","1","4017560","","2010-10-15 00:07:23","3","3852","<p>I need to bring up a few different keyboards: a 'standard' keyboard with Ctrl and Alt keys; maybe a cursor pad; and so on.</p><p>I have found the <code>Keyboard</code> class, which would let me define a keyboard in an XML resource. I have found that the <code>KeyboardView</code> class has a <code>setKeyboard</code> method ... and, so far, I have not found any other class that takes a <code>Keyboard</code> instance.</p><p>How am I supposed to use the <code>KeyboardView</code>? I tried adding one to my activity's XML; finding it at runtime with <code>findViewById</code>; and then calling <code>setKeyboard</code> ... but all this did was mess up my layout and <strong>not</strong> bring up the special keyboard.</p>","476250","","995926","","2012-05-05 14:00:33","2012-05-05 14:00:33","How does an Android app load a keyboard?","<android><keyboard><android-2.2-froyo>","4","0","","",""
"3938599","1","","","2010-10-15 00:30:00","2","2693","<p>So I made a project with 2 source directories: one for actual code and the other for tests.It worked well in eclipse but then I decided to start using command line and the ant tool.</p><p>Android has a built-in function of generating build.xml, so I used the command 'android update project -p ProjectName'</p><p>This build.xml for installing works fine and I can run the application on the emulator. However, it only compiles the files from my source directory and the files from my test directory are not compiled. That means that I cannot run my unit tests from the command line and if I do I get class not found exceptions.</p><p>Is there any way to include another source directory so that it would compile my unit tests as well?</p><p>This is the build.xml that was generated (the rest is comments and not added here):</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8"" ?&gt; &lt;project name=""ProjectNameActivity"" default=""help""&gt;&lt;property file=""local.properties"" /&gt;&lt;property file=""build.properties"" /&gt;&lt;property file=""default.properties"" /&gt;&lt;path id=""android.antlibs""&gt;&lt;pathelement path=""${sdk.dir}/tools/lib/anttasks.jar"" /&gt; &lt;pathelement path=""${sdk.dir}/tools/lib/sdklib.jar"" /&gt; &lt;pathelement path=""${sdk.dir}/tools/lib/androidprefs.jar"" /&gt; &lt;/path&gt;&lt;taskdef name=""setup"" classname=""com.android.ant.SetupTask"" classpathref=""android.antlibs"" /&gt; &lt;setup /&gt; &lt;/project&gt;</code></pre>","476427","","476427","","2010-10-15 01:07:51","2010-10-15 03:11:42","android build.xml multiple source directories","<android><ant><build.xml>","1","5","","",""
"3938641","1","","","2010-10-15 00:38:10","0","4974","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3824613/facebook-your-link-could-not-be-shared"">facebook: Your link could not be shared</a>  </p></blockquote><p>I'm adding the ability to share scores from my app using android's share intent:</p><pre><code>Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);shareIntent.setType(""text/plain"");shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""My Score"");shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""I scored ""+score+"" on ""+difficultyString+"" difficulty."");context.startActivity(Intent.createChooser(shareIntent, ""Share your score""));</code></pre><p>When i click the link to facebook, it says, ""Your link could not be shared"" on the facebook page. Any help?</p>","473903","","","","","2012-05-23 19:16:34","Share to Facebook, ""your link could not be shared""","<android><share>","0","3","2","2012-05-23 19:55:04",""
"3938714","1","3951632","","2010-10-15 00:55:50","2","1474","<p>I'm developing an app using android 2.1.</p><p>I have a problem with using session cookies to login to a RESTful web service. The code works fine on the emulator, but when I run it on my HTC Magic, the cookie logic doesn't work. I've confirmed that the magic is receiving cookies in the headers by listing them (see attached). Can anyone say why the cookie store would be empty even tho they are in the headers?</p><pre><code>  public HttpProvider() {    Scheme http = new Scheme(""http"", new PlainSocketFactory(), 80);    SchemeRegistry registry = new SchemeRegistry();    registry.register(http);    client = new DefaultHttpClient(new ThreadSafeClientConnManager((new BasicHttpParams()), registry), new BasicHttpParams());  }  public void get(Request request) {    try {      HttpGet get = new HttpGet(request.url);      HttpResponse response = client.execute(get);      debugListHeaders(response, request.ticket);      debugListCookies();    }   }  void debugListHeaders(HttpResponse response, int ticket) {    Header[] headers = response.getAllHeaders();    Log.d(LOG, ""Printing all headers"" + "" ("" + ticket + "")"");    for (Header header : headers) {      Log.d(LOG, ""Header name: "" + header.getName() + "", value: "" + header.getValue() + "" ("" + ticket + "")"");    }    Log.d(LOG, ""All headers have been printed"" + "" ("" + ticket + "")"");  }  void debugListCookies() {    Log.d(LOG, ""List cookies for connection"");    for (Cookie cookie : client.getCookieStore().getCookies()) {      Log.d(LOG,         ""Domain: "" + cookie.getDomain() +         "" Name: "" + cookie.getName() +         "" Path: "" + cookie.getPath() +         "" Value: "" + cookie.getValue() +         "" Expires: "" + cookie.getExpiryDate().toString() +         "" IsExpired: "" + (cookie.isExpired(new Date()) ? ""true"" : ""false""));    }    Log.d(LOG, ""All cookies have been listed"");  }Thru the emulator:&lt;snipped header list as it's obviously working&gt;D/SessionProvider(  257): List cookies for connectionD/SessionProvider(  257): Domain:&lt;snip&gt; Name: S Path: / Value: 75XGSMR3BLLGYM0J Expires: Tue Oct 12 20:24:09 America/Barbados 2010IsExpired: falseD/SessionProvider(  257): Domain: &lt;snip&gt; Name: lang Path: / Value: en Expires: Tue Oct 12 20:24:09 America/Barbados 2010 IsExpired: falseD/SessionProvider(  257): All cookies have been listedThru HTC Magic:D/HttpProvider(  983): Printing all headers (-192275970)D/HttpProvider(  983): Header name: Date, value: Thu, 14 Oct 2010 22:44:38 GMT (-192275970)D/HttpProvider(  983): Header name: Server, value: Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.5 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0 (-192275970)D/HttpProvider(  983): Header name: Set-Cookie, value: S=S41GM85A675Z8YQU; path=/; expires=Thu, 14-Oct-2010 23:14:38 GMT (-192275970)D/HttpProvider(  983): Header name: Set-Cookie, value: U=nibor.yarrum%40gmail.com; path=/; expires=Thu, 14-Oct-2010 23:14:38 GMT (-192275970)D/HttpProvider(  983): Header name: Set-Cookie, value: lang=en; path=/; expires=Thu, 14-Oct-2010 23:14:38 GMT (-192275970)D/HttpProvider(  983): Header name: Vary, value: Accept-Encoding (-192275970)D/HttpProvider(  983): Header name: Keep-Alive, value: timeout=15, max=100 (-192275970)D/HttpProvider(  983): Header name: Connection, value: Keep-Alive (-192275970)D/HttpProvider(  983): Header name: Transfer-Encoding, value: chunked (-192275970)D/HttpProvider(  983): Header name: Content-Type, value: text/html (-192275970)D/HttpProvider(  983): All headers have been printed (-192275970)I/HttpProvider(  983): Request completed (-192275970)D/SessionProvider(  983): List cookies for connectionD/SessionProvider(  983): All cookies have been listed</code></pre>","476436","","115145","","2010-10-15 01:04:39","2010-10-17 01:44:53","session cookies work on emulator, but not real device","<android><session><cookies><httpclient><cookiestore>","1","1","0","",""
"3938793","1","3938845","","2010-10-15 01:21:16","0","584","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3456034/how-to-start-an-activity-from-a-service"">How to start an Activity from a Service?</a>  </p></blockquote><p>Could some one please tell me how to invoke an activity from a service when the service receives some content from a server. the service keeps getting the data and the activity needs to update itself.</p><p>I am unable to find a good tutorial for broadcast intents stuff.</p>","377337","","244296","","2010-10-15 01:23:14","2010-10-15 01:46:16","how to invoke an activity from a service","<android><android-intent>","1","0","","2011-09-26 06:40:12",""
"3938926","1","4021052","","2010-10-15 01:53:21","3","4621","<p>In my application I am downloading and saving an apk to the sdk card and then I want to start the installation of the apk. I'm using the following code to attempt this:</p><pre><code>Intent intent =new Intent();intent.setAction(Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse(file), ""application/vnd.android.package-archive"");activity.startActivity(intent);</code></pre><p>But when I do this it tells me there is no activity to start the intent. What I am attempting to do is install a new update for the currently running application. How do I start an Intent to run an apk file?</p>","304795","","","","","2011-09-14 14:30:19","Android start intent to view apk","<android><android-intent><apk>","1","2","10","",""
"3939057","1","","","2010-10-15 02:28:10","0","491","<p>I'm getting all kinds of errors when using res/menu/menu_home.xml, and my project won't build. That's when I remembered that there was a way to create menus from java code instead of declaring it via xml. Does someone remember how to do that?</p>","387405","","","","","2010-10-15 02:35:56","How to create a context menu from code","<android>","1","0","","",""
"3939071","1","","","2010-10-15 02:31:23","0","281","<p>I have a SharedPreference that I need to reset itself to its initial value after the phone reboots... any ideas?</p>","476477","","","","","2010-10-15 02:39:34","Android: How to make a specific SharedPreference reset itself after the system reboots?","<android>","1","0","","",""
"3939331","1","3939405","","2010-10-15 03:39:00","5","6672","<p>How can I pass a Object: ArrayList from one Activity to another?</p><p>Seems that intent cannot hold custom ones except ArrayList.</p><p>As a kind of hack, I use a static member:</p><pre><code>staticResultList = new ArrayList&lt;SingleExamResult&gt;(m_examResults);</code></pre><p>and Get it in the following Activity by:</p><pre><code>m_examResults = DoExam.staticResultList;</code></pre><p>It's not the correct way obviously, any 'common' approaches? Thanks a lot!</p>","354459","","","","","2010-10-15 04:00:06","Android: How to pass ArrayList<customObject> between Activities?","<android><activity><android-intent>","1","0","","",""
"3939478","1","3939632","","2010-10-15 04:19:52","0","547","<p>How do I keep track of the runtime of an application.</p>","310678","","","","","2010-10-15 05:13:41","Android application Internal timer","<android><timer>","2","0","0","",""
"3939579","1","","","2010-10-15 04:53:22","0","436","<p>I want to know what is the actual use of starting window in android?</p><p>What does the functions addStartingWindow and removeStartingWindow does?</p><p>Is it a kind of fake window that will be shown to the user till the application dispalys the proper window?</p><p>Is it created for every application?</p><p>What will happen if i dont do a addStartingWindow() call in the application launch process?</p><p>Pleae help me with ur inputs.</p><p>Thanks in advance.</p><p>Regards,Revathi Ramanan</p>","436668","","","","","2012-12-07 02:45:18","Starting window in android","<android>","2","1","1","",""
"3939637","1","3940348","","2010-10-15 05:07:51","2","3545","<p>I am writing my first Android application and have some problems with handing around context objects. A lot of methods/constructors seem to require the current context (activity) which causes me some problems in my action listeners. Instead of having all my listeners and handlers as anonymous classes in the activity class I have created classes for each event I would like to handle. For example a button buttonRegister would be initialized as:  </p><pre><code>buttonRegister.setOnClickListener(new RegisterButtonClickAction());</code></pre><p>However when doing this I have no access to the current context object inside my listener. I could hand over a current context as a constructor parameter but I am not sure whether this is the best choice. What is the ""best practice"" for creating handler/listeners in Android or working with context objects in general? </p><p>Thanks,<br>b3n</p>","395377","","","","","2010-10-15 07:41:54","How to access context in non activity classes","<android><android-context>","1","1","1","",""
"3939993","1","","","2010-10-15 06:35:01","0","1817","<p>the request processing code </p><pre><code>  while($op=db_fetch_object($result))  {    $data[$i++]=array($op-&gt;name,$op-&gt;age,$op-&gt;dept);  }  echo json_encode($data);</code></pre><p>$data contains </p><blockquote>  <p>[[""Aadidev"",""23"",""division1""],[""Ragman"",""35"",""division3""],[""Sahlaad"",""27"",""division1""],[""Maraadhak"",""21"",""division2""],[""Arya"",""48"",""division1""],[""Shank"",""25"",""division1""],[""Aatmaj"",""54"",""division1""],[""Abhay"",""46"",""division2""],[""Bhinatha"",""37"",""division2""],[""Abhineet"",""29"",""division3""],[""Srita"",""47"",""division1""]]</p></blockquote><p>Android code </p><pre><code>String nameop=""""; try{    JSONObject json=new JSONObject(page);    JSONArray namearr=json.names();    JSONArray valarr=json.toJSONArray(namearr);    for(int i=0;i&lt;valarr.length();i++)    {     nameop+=namearr.getString(i)+"" ""+valarr.getString(i)+""\n"";    }    result.setText(nameop);    }catch(Exception e){     Toast.makeText(this,e.toString(), Toast.LENGTH_LONG).show();    }</code></pre><p>which results an exception </p><blockquote>  <p>org.json.JSONException: A JSONObject  text must begin with '{' at character 1  of  [[""Aadidev"",""23"",""division1""],[""Ragman"",""35"",""division3""],[""Sahlaad"",""27"",""division1""],[""Maraadhak"",""21"",""division2""],[""Arya"",""48"",""division1""],[""Shank"",""25"",""division1""],[""Aatmaj"",""54"",""division1""],[""Abhay"",""46"",""division2""],[""Bhinatha"",""37"",""division2""],[""Abhineet"",""29"",""division3""],[""Srita"",""47"",""division1""]].</p></blockquote>","166476","","750987","","2011-06-17 16:39:15","2011-06-17 16:39:15","Android decoding json response","<android><json><exception><json-decode>","3","0","","",""
"3940044","1","","","2010-10-15 06:44:04","1","508","<p>I'm writing an Android App that loads in data from an RSS Feed and lists the available items, and their description.  There are 2 instances in which I use ArrayAdaptor. One works and one does not.  The first one lists available feeds (right now the feed URLs are hard coded), and that one works.MainActivity.java</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.setContentView(R.layout.main);    UpdateDisplay();}private void UpdateDisplay(){    ListView itemlist = (ListView) findViewById(R.id.itemlist);    java.util.ArrayList&lt;String&gt; channels = new java.util.ArrayList&lt;String&gt;();    for(int i=0;i&lt;RSS_FEEDS.length;i++){        channels.add(RSS_FEEDS[i][0]);    }    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, channels);    itemlist.setAdapter(adapter);    itemlist.setOnItemClickListener(this);}</code></pre><p>The second ArrayAdaptor is used in another Activity that the first generates by selecting a feed to view.  The RSSFeed is parsed, and it returns valid data (I have tested it outside of teh android environment, and it worked, recompiled it in android, and it still works, so the RSSParser is not the issue). RSSFeed.java </p><pre><code>public void onCreate(Bundle b){    super.onCreate(b);    setContentView(R.layout.feedlayout);    UpdateDisplay();}private void UpdateDisplay(){    String feedUrl = null;    Intent startingIntent = getIntent();    if(startingIntent != null){        Bundle args = startingIntent.getBundleExtra(""android.intent.extra.INTENT"");        if(args != null){            feedUrl = args.getString(""URL"");            feedTitle = args.getString(""title"");        }else{            feedTitle = ""No Available RSS Feed"";        }    }else{        feedTitle = ""Error finding parent Intent"";    }    ListView lv = (ListView)findViewById(R.id.storylist);    if(feedUrl != null){        // Get Feed Items        RSSFeed feed = getFeed(feedUrl);        ArrayList&lt;String&gt; values = loadItems(feed);        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,values);        lv.setAdapter(adapter);        lv.setOnItemClickListener(this);    }    TextView title = (TextView)this.findViewById(R.id.feedtitle);    title.setText(feedTitle);    Button backbutton = (Button)findViewById(R.id.backbutton_2);    backbutton.setOnClickListener(new Button.OnClickListener() {        public void onClick(View v) {            finish();        }    });}</code></pre><p>I'm using the android.R.layout.simple_list_item_1 layout in both places, but it only works in the first.  The backbutton Button also isn't displayed for some reason.Here's the feedlayout.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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView    android:id=""@+id/feedtitle""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;&lt;ListView    android:id=""@+id/storylist""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;&lt;Button    android:id=""@+id/backbutton_2""    android:text=""Back""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    /&gt;&lt;/LinearLayout&gt;</code></pre>","476581","","","","","2010-10-18 02:00:42","When using ArrayAdaptor in Android, The data isn't shown","<java><android><android-arrayadapter>","1","2","","",""
"3940127","1","5811630","","2010-10-15 06:59:30","28","22758","<p>I have the activity with several input fields. When activity started soft keyboard is shown. When back button pressed soft keyboard closes and to close activity I need to press back button one more time. </p><p>So the question: is it possible to intercept back button to close soft keyboard and finish activity in one press of back button without creating custom <code>InputMethodService</code>?</p><p>P.S.: I know how intercept back button in other cases: <code>onKeyDown()</code> or <code>onBackPressed()</code> but in this case it doesn't works: only second press of back button is intercepted.</p>","436938","","436938","","2012-03-28 18:29:49","2012-03-28 18:29:49","Intercept back button from soft keyboard","<android>","7","0","12","",""
"3940298","1","","","2010-10-15 07:33:18","0","344","<p>i can't seem to view map in the android emulator, it keeps showing me a screen dialog to choose an action to complete the viewing, but when i choose anyone, nothing happens. Here is the screen dialog:<img src=""http://i.stack.imgur.com/KtnQO.jpg"" alt=""alt text""></p>","447570","","302328","","2010-10-15 07:51:25","2010-10-15 07:51:25","can't view map in emulator","<android><android-maps>","0","6","","",""
"3940404","1","3940461","","2010-10-15 07:51:42","0","750","<p>I'm writing an android program to check available space of internal phone memory or external sd card. But i don't know how to do this. Any one can help me how to do it in Android?</p>","315082","","","","","2010-10-15 08:02:33","How to get internal/external available space in Android Application?","<android><memory><phone>","1","0","","",""
"3940507","1","","","2010-10-15 08:10:14","0","217","<p>I would like to access xml data which contains Questions ans there 4 objective type answersand I want to access them in 5 textViews which access each question and there related answer on every next button click.its like an online examination.</p>","476645","","","","","2010-10-15 12:27:21","how to access xml data in TextView in Android","<java><android>","1","0","","",""
"3940632","1","3940660","","2010-10-15 08:29:52","0","171","<p>I need to make an app available for just one particular device model (or alternatively for just tablets) on the Android Market.Is that possible?</p><p>Thanks for any hints.</p>","289463","","","","","2010-10-15 08:32:55","Android Market to list my app on just one particular device or just on tablets. How?","<android><model><google-play><restrict><tablet>","1","0","","",""
"3940650","1","","","2010-10-15 08:32:06","1","306","<p>i have a problem with sliding drawer.look at the layout i added.1) i added viewflipper which contains two customized views.2) next i added two arrows in realtaive layout3) now i added sliding drawer my problem is sliding drawer is not coming full screen .its coming only upto the space which is lefer after relative layout .</p><p></p><pre><code>&lt;ViewFlipper android:id=""@+id/ViewFlipper01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;</code></pre><p></p><p></p><p>  </p><pre><code>&lt;RelativeLayout  android:id=""@+id/RelativeLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;ImageView android:id=""@+id/ImageView_over_left_1""  android:layout_alignParentLeft=""true"" android:background=""@drawable/left""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;    &lt;ImageView android:id=""@+id/ImageView_over_right_1"" android:layout_alignParentRight=""true"" android:background=""@drawable/right""   android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/RelativeLayout&gt;</code></pre><p> </p><p></p><p>             android:paddingTop=""1px"" android:paddingLeft=""4px"">    <br>   </p>","446010","","446010","","2010-10-19 05:19:27","2010-10-19 05:19:27","SlidingDrawer is not coming on top of viewflipper.(Dying situation please help)","<android>","0","2","","",""
"3940671","1","","","2010-10-15 08:34:36","0","93","<p>Is there a way of getting the android:tabs view of the current TabActivity? I tried using the findViewById(int) method but it's no use.</p><p>Best Regards!</p>","460611","","","","","2010-10-15 08:34:36","Get the android:tabs view","<android>","0","2","","",""
"3940711","1","3941366","","2010-10-15 08:42:13","0","3118","<p>Friend's,       I want to know how to change currently using android sdk to another,(i.e) i'm using   android-sdk_r04-windows in my eclipse,suppose if i need to change it for android-sdk_r07-windows,how can i proceed,whether simply delete android-sdk_r04-windows from drive and to download and paste android-sdk_r07-windows,is't enough or something i need to do.</p><p>Thanks in advance,</p>","393953","","","","","2010-10-15 10:25:13","Updating Android SDK Version","<android>","1","0","","",""
"3940864","1","5803957","","2010-10-15 09:08:07","0","1947","<p>Following up on this question:</p><p><a href=""http://stackoverflow.com/questions/3754217/android-manage-contacts-with-lookup-key"">Android: Manage contacts with lookup key</a></p><p>(see below)</p><p>I have the same problem. However, it shows with Android 2.1 Update 1, But is OK with Android 2.2.</p><p>It seems that the lookup key changes with contact's name change with Android 2.1, but does not change with Android 2.2.</p><p>Did anybody else experience this? Any suggested workaround for Android 2.1?</p><p>Thanks</p><p>Original question by chromate</p><blockquote>  <p>Hi everybody,</p>    <p>I'm currently writing a application that allows to save drafts (using android version >= 2.0). Each draft is connected to a contact via the ContactsContract.Contacts.LOOKUP_KEY. My problem is that if I change the name of my contact the lookup key changes also. Is that the way this works?</p>    <p>So for what do I need a lookup key? I thought that the lookup key does never change and now it changes anyway. I'm confused about that behavior ...</p>    <p>Can someone explain to me how to link permanently to a contact? Should I use IDs instead of the lookup key?</p>    <p>Thanks in advance.</p></blockquote>","406090","","","","","2012-11-08 10:02:49","Android: Manage contacts with lookup key","<android><contacts>","2","0","","",""
"3940926","1","3941173","","2010-10-15 09:17:36","0","434","<p>i am a newbie.Please explain what all things are passed through a context.Like when constructing an object for the following class..</p><p>public class myclass{</p><p>public myclass (Context context){....}}</p>","465834","","465834","","2010-10-15 09:33:43","2010-10-15 09:56:16","Context in android","<java><android>","1","1","0","",""
"3940937","1","","","2010-10-15 09:18:48","1","395","<p>I have 5 buttons in a layout forming a cross structure.Now I want that the background of this layout should be circle so that it should look as if the buttons are on the circle like you see buttons on TV remote.I will really appreciate your any answer.Thank you.</p>","392675","","","","","2010-10-15 13:13:10","Circular background of a layout in android","<android>","1","0","","",""
"3940978","1","3988472","","2010-10-15 09:25:24","1","1590","<p>hi i am new to android.what i did is implementing the search with the edit text for that i am writing the code as fallows.</p><pre><code>((EditText)findViewById(R.id.EditText01)).setOnKeyListener(new OnKeyListener() {                public boolean onKey(View v, int keyCode, KeyEvent event) {                        if(event.getAction() == KeyEvent.ACTION_UP){                String enteredText = ((EditText)findViewById(R.id.EditText01)).getText().toString();                if(enteredText.length() &gt; 0 ) {                String str1 =""""+ enteredText.charAt(0);                str1 = str1.toUpperCase();                String str2 =""""+ enteredText.substring(1);                str2 = str2.toLowerCase();                enteredText = str1 + str2;                }                 id=0;                 Iterator&lt;String&gt; strIt = strList.iterator();                 Log.v("""", ""Total items in the list****""+strList);                ((LinearLayout)findViewById(R.id.LinearLayout02)).removeAllViewsInLayout();                if(strIt.next().startsWith(enteredText))                {                    Log.v("""", ""hi u r enterd letter is there in list"");                }                else                {                    ((LinearLayout)findViewById(R.id.LinearLayout02)).removeAllViewsInLayout();                    Toast.makeText(MyShoppingList.this, ""There is no item In the List Start with Letter ""+enteredText+"" Click Add Item to Add New Item"" ,06 ).show();                    Log.v("""", "" u enterd letter is no there in list""+enteredText);                    additem();                }                count = 0;                while(strIt.hasNext()){                    String str = strIt.next();                    if(str.startsWith(enteredText)){                        //count++;                    matchingLetters(str);                }                }                }                        return false;       }            });</code></pre><p>it works fine,but i am getting problem when key pad of device in active.it doee implement when keypad in active while minimizing the key pad code then only it runs. what's problem i can n't understand pls help me.post some code or link.Thank u  in advance.</p>","699226","","842150","","2011-10-11 11:57:25","2011-10-11 11:57:25","how to implement quick search function with edit text","<android>","1","0","1","",""
"3941121","1","","","2010-10-15 09:49:08","0","238","<p>is it possible to get notified every time a new image,video is inserted on the sd card of your android device and how? I have looked at the Media Scanner class which indexes files but I can't find how to do get notified from that only how to notify Media Scanner of a new image I have created. </p>","234898","","","","","2010-10-15 12:08:31","android is it possible to get notified when a new image,video is inserted,deleted from sd?","<android>","1","0","1","",""
"3941142","1","","","2010-10-15 09:51:32","0","569","<p>I have two ListViews, each of them containing a String[] that I created locally. I wanted to show both of them on the same screen, but still maintaining their properties (List 1 having its background color, while List 2 has its). Can this be accomplished?</p><p>Also, I'm trying to add a locally created TextView to the screen; I've tried addHeaderView() but it throws a Source not Found exception, with a BlockLayoutRequest set to false. I don't know what this means nor what's causing the error, can anyone point out what's wrong?</p><p>Here's my code:</p><pre><code>Resources r = getResources();String[] horarios_ida = r.getStringArray(R.array.horarios_b_1_dragao);String[] aplicaveis_ida = HorariosAplicaveis(horarios_ida);String[] horarios_volta = r.getStringArray(R.array.horarios_b_2_dragao);String[] aplicaveis_volta = HorariosAplicaveis(horarios_volta);ListView ida = new ListView(this);ListView volta = new ListView(this);TextView header = new TextView(this);header.setText(""DASS"");ida.addHeaderView(header); //throws error        //displays the first array correctly, but I don't know what to do for the 2nd oneif(aplicaveis_ida.length&gt;0){    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.b_dragao, aplicaveis_ida));}        ida = getListView();        ida.setTextFilterEnabled(true);setContentView(ida);</code></pre>","476736","","12707","","2010-10-15 09:53:19","2011-07-01 17:14:27","Two independent ListViews on the same screen + TextView header","<android><listview><textview><android-arrayadapter>","1","0","","",""
"3941177","1","3941210","","2010-10-15 09:56:50","6","6132","<p>I've followed the steps given in <a href=""http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html"">the Android Developer Blog</a> to generate a build.xml for building releases for an Android Application. I need to do a custom compiling so I have overwritten the target compile of the ant_rules_r3.xml as it is said in the generated build.xml.</p><pre><code> &lt;target name=""compile"" depends=""-resource-src, -aidl, -pre-compile"" ...</code></pre><p>The script works fine and generates the apk, but the problem is that Eclipse shows an error because it cannot find targets -resource-src, -aidl and -pre-compile (which are loaded when executing the script but are not really present on the build.xml). As there are these errors I cannot work with the project in Eclipse.</p><p>How can I skip the validation of this single file in Eclipse?</p>","249699","","244296","","2010-12-10 04:19:18","2013-01-02 15:26:56","Skip Eclipse validation of build.xml","<java><android><eclipse><validation><ant>","5","0","5","",""
"3941197","1","3942664","","2010-10-15 09:59:34","0","97","<p>I developed my application and tested it on android emulator 1.6, 2.1 &amp; 2.2 and on HTC Magicits running PERFECTLY and the gui components look very neat...</p><p>However, when I tested it on Sony Ericsson Xperia X10 the gui components are looking fuzzy :S...please have a look</p><p><img src=""http://i.stack.imgur.com/bklie.png"" alt=""alt text""></p><p>...Have anyone faced such a problem? Any suggestions to solve it?!</p><p>Thanks!</p>","445548","","","","","2010-10-15 13:29:36","weird gui component edges!","<android><gui><edges>","1","0","","",""
"3941257","1","3942047","","2010-10-15 10:10:34","4","850","<p>I want to provide different resource files to users. But I don't know how to load strings from a resource file other than strings.xml?</p>","476747","","","","","2010-12-16 19:55:34","Can we load string resources from a resource file other than strings.xml in Android?","<android><string><resources>","1","0","1","",""
"3941303","1","","","2010-10-15 10:16:54","0","2344","<p>How can I drag a marker on the map?How to handle it in onTouchEvent()?</p><p>I had written one code that actually drags. But it feels like the map is moving instead of the marker. That code is written below:</p><pre><code>public boolean onTouchEvent(MotionEvent event, MapView mapView) {   /*Action to be taken on ACTION_UP(value=1) and ACTION_DOWN(value=0)*/   if(event.getAction() == 0 || event.getAction() == 1){      mapView.displayZoomControls(true);   }     /*Action to be taken on ACTION_MOVE(value=2)*/   if(event.getAction() == 2){        for(int i = 0; i &lt; mOverlays.size() ; i++){        mOverlays.remove(i);      }      GeoPoint point = mapView.getProjection().fromPixels((int) event.getX(),(int)                   event.getY());      OverlayItem overlayItem = new OverlayItem(point, """", """");      addOverlay(overlayItem);       mapView.getController().setCenter(point);   }   return true;}</code></pre><p>Is there any solution for this?</p>","391238","","391238","","2010-10-15 10:23:02","2011-01-10 09:15:57","Drag marker on map","<android>","1","0","","",""
"3941306","1","","","2010-10-15 10:17:10","5","4673","<p>I am working on layout in android XML in which I would like to set a buttons height to match it's width when setup to fill parent.  Obviously this number will change based on screen size, so I cannot use a set pixel size.  Can someone help me with getting the button width based on screen size and then passing that to the height setting?</p><p>Thank You,Josh</p>","453305","","379693","","2010-10-30 08:43:01","2010-10-30 08:43:01","Android: Setting button height in XML based on it's width","<android><xml><button><android-sdk-2.2>","2","0","1","",""
"3941357","1","3941485","","2010-10-15 10:24:11","27","31166","<p>I have a string that contains the date/time returned from a web service like so:</p><pre><code>String dtStart = ""2010-10-15T09:27:37Z""</code></pre><p>How do I get this into an object such as Time or Date? I initially want to output it in a different format, but will need to do other stuff with it later (i.e. maybe use in a different format).</p><p>Cheers</p>","67419","","","","","2010-10-15 10:55:41","String to Date/Time object in Android","<java><android>","2","0","4","",""
"3941362","1","","","2010-10-15 10:24:44","4","618","<p>I have three TextView elements within a RelativeLayout container:<br>@+id/name, @+id/message, @+id/time</p><p>The @+id/message is positioned by layout to right of @+id/name and @+id/time is to the right of @+id/message. It renders fine as long as the three elements don't take up the width of the screen, but when it does, it bounces up the last element. </p><p>I want it to overflow below if this happenens. The best way I can think of it would be having 3 html divs</p><pre><code>&lt;div style='float:left;'&gt;name&lt;/div&gt;&lt;div style='float:left'&gt;message&lt;/div&gt;&lt;div style='float:left;'&gt;time&lt;/div&gt;</code></pre>","461631","","469983","","2011-02-18 14:15:59","2013-07-16 12:57:23","Display android TextViews like html would floating divs","<android><xml><android-xml>","2","1","","",""
"3941516","1","","","2010-10-15 10:48:43","1","365","<p>friend's,   I am working in Facebook,here i need to change the image url value string has dynamic one,here my code</p><pre><code>intent    .putExtra(            ""attachment"",            ""{\""name\"":\""""                    + Html.fromHtml(title)                    + ""\"",\""href\"":\""""                    + Html.fromHtml(url_val)                    + ""\"",\""description\"":\""""                    +  Html.fromHtml(desc_val)                    + ""\"",\""media\"":[{\""type\"":\""image\"",\""src\"":\""http://www.naicu.edu/imgLib/20070913_small_seal.jpg\"",\""href\"":\""http://alumni.brown.edu/\""}]}"");    this.startActivityForResult(intent, MESSAGEPUBLISHED);</code></pre><p>here image source given in code has static,but i need to assign an simple string variable in the place of double quoted image url,for example i want to place string <strong>temp_url</strong> in the place of **src\"":\""http://www.naicu.edu/imgLib/20070913_small_seal.jpg**,how can i get it.</p><p>Thanks in advance.</p>","393953","","393953","","2010-10-15 16:54:08","2010-10-15 16:54:08","FaceBook dynamic Image URL","<android>","0","1","","",""
"3941523","1","3941587","","2010-10-15 10:49:28","1","2071","<p>How do I display Greek characters in Android?</p>","461972","","869912","","2012-08-15 19:19:09","2013-04-15 19:16:42","How do I display Greek characters in Android?","<android>","1","2","","",""
"3941601","1","","","2010-10-15 11:03:51","0","510","<p>As you can see in this screenshoot ListView doesn't show all item separator, seems that the problem is setting textSize for textView, if i remove textSize all work fine.</p><p>Thanks in advance for any replay!</p><p>This is a little testcase:</p>","476795","","","","","2011-04-22 14:14:35","Item separator line are not shown all in ListView! maybe textSize is the reason or Bug?","<android>","1","0","","",""
"3941723","1","3942326","","2010-10-15 11:20:14","1","17664","<p>I have the following code in 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=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;    &lt;EditText android:hint=""@string/feed_url""        android:id=""@+id/feedUrl"" android:textSize=""14dp"" android:inputType=""textUri""        android:layout_marginRight=""45dp"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;    &lt;/EditText&gt;    &lt;Button android:id=""@+id/getGraph""        android:text=""@string/get""        android:layout_toRightOf=""@id/feedUrl""         android:layout_alignParentRight=""true""                  android:layout_height=""wrap_content"" android:width=""45dp"" android:layout_width=""wrap_content""&gt;    &lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;WebView android:id=""@+id/wv1"" android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In the eclipse Plugin layout creator, the EditText and button are shown properly. (see the below screenshot) </p><p><img src=""http://i.stack.imgur.com/652fU.png"" alt=""alt text""></p><p>But on the device and emulator, the button is not hidden. (see the below screenshot)</p><p><img src=""http://i.stack.imgur.com/S3HaB.png"" alt=""alt text""></p><p>Any idea why the button is getting hidden in the device?</p>","24949","","","","","2010-10-15 13:30:36","Nesting Relative layout inside Linear Layout","<android><layout><android-linearlayout><relativelayout>","3","0","","",""
"3941745","1","3941884","","2010-10-15 11:23:22","3","3156","<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>I think its a very interesting question:What is the ""context"" meaning/concept in Android ?</p><p>Almost any things/object need context to working properly.What is the ""context"" represented? An integer ? a block of memory ?? or .....</p>","206630","","","","","2010-10-15 11:44:21","What is the ""context"" meaning in Android?","<android>","1","0","","2011-10-30 13:35:07",""
"3941792","1","3942240","","2010-10-15 11:30:01","1","1598","<p>Is there any way to put an extra into the intent launched by a shortcut?</p>","314597","","","","","2010-10-15 12:34:25","Android shortcut intent with extra","<android><shortcut>","1","2","","",""
"3941869","1","3943395","","2010-10-15 11:42:21","0","1875","<p>Hi friends          I am passing parameter to new activity using tab host in android but it showing illegal exception</p><pre><code> Intent homeintent;       // Create an Intent to launch an Activity for the tab (to be reused)     homeintent = new Intent();     Bundle bundle=getIntent().getExtras();     String strusername=bundle.get(""strUserName"").toString();     String strPassWord=bundle.getString(""strPassword"").toString();     String questGroupId=bundle.getString(""questGroupId"").toString();     homeintent.putExtra(""strUserName"", strusername);     homeintent.putExtra(""strPassword"",strPassWord );     homeintent.putExtra(""questGroupId"",questGroupId);      homeintent.setClass(this, HomeActivity.class);        spec = tabHost.newTabSpec(""home"").setIndicator(""Home"",res.getDrawable(R.drawable.home_tab_bar_icon)).setContent(homeintent);    tabHost.addTab(spec); </code></pre><p>can anybody tell how to pass parameter using intent with tabhost in android</p>","426344","","426344","","2010-10-15 11:54:14","2010-10-15 14:54:21","how to pass parameter to new activity with tab host","<android>","1","0","","",""
"3941969","1","4033822","","2010-10-15 11:54:20","3","8203","<p>I want a HTML/javascript application, running in a WebView, to make AJAX calls that are handled by the Java code. Ideal would be to just intercept the call (easy, just use <code>shouldOverrideUrlLoading()</code>) and 'return' some data. However, I don't find a way to 'return' a response to the WebView, other than calling a javascript function using <code>loadUrl()</code>. This will not work for me, as the HTML/js app is a drop-in application which I don't control. As far as the HTML/js app concerns, it just does an AJAX call and receives some data back.</p><p>Any thoughts on this?</p>","419625","","227536","","2013-06-14 13:08:10","2013-06-14 13:08:10","Android: Intercept AJAX call from WebView","<android><ajax><webview>","2","0","1","",""
"3941983","1","3942039","","2010-10-15 11:56:23","3","2795","<p>I am wondering where android emulator keeps all its data and itself? inside the SDK folder or somewhere else ?</p><p>cheers,/Marcin</p>","193400","","302328","","2010-10-15 12:42:52","2013-12-04 09:39:11","Android emulator Mac OSX location","<android><osx><osx-snow-leopard><avd>","1","0","","",""
"3941987","1","","","2010-10-15 11:56:39","0","102","<p>When i try to compile and build the application, a red mark is appearing on my application,but there is no error description ..what will be the reason?</p>","474166","","","","","2012-03-28 13:11:21","Showing Error !!! Android","<android>","2","2","1","",""
"3942075","1","","","2010-10-15 12:08:41","2","991","<p>i have tried many things but not getting how to  do conferencing in android.i can receive incoming call and make another outgoing call...but not able to combine those calls as ""menu option merge do""...if i can take object reference of phone or call class(internal class of android) i can  use conference method available theres</p>","476849","","1065190","","2012-07-11 15:06:02","2012-07-11 15:06:02","How to make call conferencing of two calls?","<android>","1","0","","",""
"3942124","1","3942285","","2010-10-15 12:16:34","1","1102","<p>I've accidentally inserted the string datetime() into my database (in stead of the result of the function), and never saw my mistake until i did a listing of the data. The string ""datetime()"" is in the date field of all the records, yet the field type is datetime!</p><p>Is this normal for the sqllite that is on Android?? What's the point of field types then?</p>","181098","","442558","","2010-10-15 12:42:44","2010-10-15 12:42:44","Android: String value in DateTime field?","<android><sqlite>","1","0","","",""
"3942227","1","4603440","","2010-10-15 12:31:29","1","261","<p>I have an app that launches a browser with a VIEW intent pointing at a URL containing DRMed content (which the browser should then download into the DrmStore). This works perfectly the first time, but on subsequent attempts to download the same file, the browser opens, pops up a dialog saying the content has previously been downloaded and prompting for overwrite and <em>immediately</em> drops into the background, bringing the original app back to the foreground.</p><p>Why does this happen in this very specific case, and is there any way of working around it (ie. leaving the browser in the foreground)?</p><p>Edit: This has been observed on an HTC Desire; it seems like the text in the dialog is an HTC message rather than a core Android one, so the issue may be HTC specific.</p>","39368","","39368","","2010-10-18 11:47:03","2013-01-28 05:47:01","Launched browser intent for DRM content immediately jumps to background","<android><browser><android-intent>","1","0","","",""
"3942230","1","3952156","","2010-10-15 12:32:18","0","855","<p>I have designed a 3D model in .obj format and imported using min3d framework. Its a cube with different colors. I want to give a Toast with a message for a particular color when the side of that particular color is touched. How do I do this in android 1.6 ?</p>","368084","","44729","","2010-10-16 14:42:39","2010-10-17 05:30:11","How to detect the area of touch in open gl es in android?","<android><opengl-es>","1","0","1","",""
"3942244","1","3942523","","2010-10-15 12:35:00","0","618","<p>Is there any way to get the origin of a link to an app on Android Market after the app is installed?</p><p>Let's say I have three different web pages that link to the same Android Market app, can I get the origin of the link after the app is installed so I can use it for statistics and such?</p><p>Any solution to this is very much appreciated!</p>","367101","","114066","","2010-10-16 13:47:05","2010-10-16 13:47:05","Get origin of Android Market link after install","<android><google-play><origin>","2","0","","",""
"3942253","1","3942318","","2010-10-15 12:35:55","0","255","<p>I want to customize the android OS for my specific needs.What i want to do exactly is eg:-remove the access to android market, remove contacts, calendar.etc.</p><p>basically I want to have apps that I permit.Even if removing the icon is all right.</p>","476861","","","","","2010-10-15 15:23:47","Removing features from android OS","<android>","1","0","","",""
"3942349","1","3942453","","2010-10-15 12:49:53","0","461","<p>I want to check the network connectivity in android application.so i inserted the following code</p><pre><code>public boolean isNetworkAvailable() {     Context context = getApplicationContext();     ConnectivityManager connectivity = (ConnectivityManager)         context.getSystemService(Context.CONNECTIVITY_SERVICE);      NetworkInfo[] info = connectivity.getAllNetworkInfo();      if (info != null)      {       for (int i = 0; i &lt; info.length; i++)        {        if (info[i].getState() == NetworkInfo.State.CONNECTED)         {         return true;        }       }      }     return false;    }</code></pre><p>when i removed network cable in my computer the program crashed.but when i disable Airplane Mode in Emulator,it correctly shows ""NETWORK NOT AVAILABLE"".How to we actually check?</p>","461972","","","","","2010-10-15 13:02:06","Network checking in android","<android>","1","1","","",""
"3942393","1","3942615","","2010-10-15 12:56:32","0","2902","<p>I have an Android application which has four tabs (I use a main TabActivity with TabHost and TabSpecs).In one of my sub activity (activity opened in a tab), i need to open a tab not by clicking on the tab title and i don't know how to do this.For example, i have a button in my activity and when i click on it, it opens a different tab.For the moment, it is what i do:<br><code><br>Intent intent = new Intent(myActivity.this, myTabActivity.class);<br>intent.putExtra(""ComeFrom"", true);<br>intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);<br>startActivity(intent);<br></code><br>Then in the TabActivity, if i get true reading the ""ComeFrom"" extra i open the wished tab but the problem is that it kills all the other activies.  So, if someone knows a better (cleaner) way to do that trick, please tell me...</p>","476875","","","","","2014-04-01 16:40:34","Android:How to change opened tab dynamically","<android><activity><tabs><dynamic>","4","0","","",""
"3942430","1","3946226","","2010-10-15 12:59:31","2","5641","<p>ok am having a funny problem here, scenario is like this:</p><p>Intent i of Activity ""B"" calls Activity ""A"" and the method in onCreate() of Activity ""A"" runs; </p><p>intent j of activity ""B"" calls Activity ""A"" and puts an ""Int"" extra which i can use to call a method in Activity ""A""</p><p>intent x, y and z of TabActivity ""C"" calls Activity ""A"" and puts a ""String"" Extra in other to start a different method in Activity ""A"";</p><p>problem am having is that, regardless of what i put in the intent of Activity ""C"", the method from intent j keeps executing.</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                          fillData(); // intent i of Activity B            HandleIntent(getIntent()); // other intents    }    public void HandleIntent(Intent intent){        getIntent();        if(getIntent().getExtras() != null){    int priorityrequest = intent.getIntExtra(""com.MyApp.PriorityRequestCode"" PRIORITY_REQUEST_CODE);        if(priorityrequest == 1){            PSData(); //  from intent j of Activity B this keeps executing        }  int homerequest = intent.getIntExtra(""com.MyApp.HomeRequestCode"", HOME_REQUEST_CODE);         if(homerequest == 3){             HomeData(); // doesn't execute keeps executing PSData();         }          }    }    public void onNewIntent(Intent newIntent){        HandleIntent(getIntent());        super.onNewIntent(newIntent);       }</code></pre><p>From the code, PSData() keeps executing regardless of if i send another intent from another activity with the HOME_REQUEST_CODE. or is it possible to get Intent from a specific class or activity?...</p>","447570","","447570","","2010-10-15 15:49:00","2010-10-15 21:17:33","get Intent from specific class or Activity because PutExtras() from Intents not resolving","<android>","1","6","","",""
"3942633","1","3942702","","2010-10-15 13:25:31","0","1344","<p>I am developing an android app w/ Eclipse.  Whenever I run the app on my phone or the emulator, four application icons are installed on the device.  I am guessing it is related to my manifest file which has three activities (3 are for tabs).</p><p>When I uninstall the app, all of the icons are removed from the phone.  Upon a reinstall, all four show back up.</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.seebergers.navyprtcalculator""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application         android:icon=""@drawable/app_icon""         android:label=""@string/app_name""         android:debuggable=""true""&gt;        &lt;activity android:name="".NavyPRTCalculator"" 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="".BcaActivity"" 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="".PrtActivity"" 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="".BcaTapeActivity"" 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;/application&gt;&lt;/manifest&gt; </code></pre><p>Thoughts?</p>","473347","","","","","2013-07-17 04:11:29","Multiple Application Icons Are Installed On Phone When Running Androids App","<android>","3","0","","",""
"3942640","1","3945379","","2010-10-15 13:26:50","2","759","<p>I want to write an app that will stream MP3s from a server to any of the three major smartphone operating systems in the US (iPhone, Blackberry, and Android).</p><p>Here is the tradeoff I'm concerned with: if I write the app natively, it will make for the best user experience and give me the capability to add many more features if I want, but I will have 3 separate codebases, which violates the DRY principle. </p><p>If I use one of the frameworks out there to write it in Javascript/HTML (e.g. <a href=""http://rhomobile.com/products/rhodes/"" rel=""nofollow"">Rhomobile Rhodes</a>), then I have one codebase for all the major platforms, so I'm not violating DRY and the development process is simpler in that respect, but a) the user experience will suffer, and b) I did some simple tests using <a href=""http://www.schillmania.com/projects/soundmanager2/"" rel=""nofollow"">SoundManager</a> to play MP3 files with Javascript on the iPhone, and it started sucking right away (e.g. the second phase of the experiment after ""cool, I can play an MP3"" was ""I have no access to ID3 tags? That sucks."").</p><p>I'm wondering if someone experienced in developing for multiple mobile platforms could confirm or dis-confirm my impression: is cross-platform development with Javascript and HTML viable (particularly for a multimedia app)? Or is ""developing and maintaining three separate native codebases"" the way to go here?</p><p>Thanks in advance.</p><p><strong>Edit:</strong> this question assumes that I have to do this as an app. I understand that it may be much better to just serve up mp3s and let the users iPhone/Android/Blackberry Media Player handle them, but for my purposes those solutions are outside of the framework of this question.</p>","15486","","15486","","2010-10-15 13:42:30","2010-10-15 19:20:02","Writing a mobile phone radio station app - is Javascript/HTML/CSS viable, or do we need to go native?","<javascript><iphone><android><blackberry><rhodes>","3","2","","",""
"3942860","1","3944008","","2010-10-15 13:53:57","0","186","<p>I am trying to figure out how to load different groupviews dynamically.I am creating application that will have menu with 4 categories and each category will have several sub-menu items. I have created four LinearLayouts with sub-menu buttons inside (they are separate xml files).Now I want to display appropriate sub-menu in my main view every time the category is changed. </p><p>So far I have:HorizontalScrollView sView = (HorizontalScrollView)findViewById(R.id.CustomScrollView);LinearLayout ll = (LinearLayout)findViewById(R.id.category1_menu_layout);sView.removeAllViews();sView.addView(ll);</p><p>However this doesn't work because the ll for some reason is null(category1_menu_layout is the id of the LinearLayout inside the category1_menu.xml)</p><p>Do you have any ideas why that doesn't work? Maybe there is another ways of doing this?</p><p>Thanks</p>","400493","","","","","2010-10-15 16:05:36","Android: Loading groupviews dynamically","<android><menu><view><dynamic>","1","0","","",""
"3943130","1","","","2010-10-15 14:20:37","1","967","<p>""Basic YWRtaW46YWRtaW4=""is right code for my address.I check on j2me project.</p><p>And on android my getbase64 method returns ""Basic YWRtaW46YWRtaW4="" its true.</p><p>and i use it on:</p><p>httpConnection.setRequestProperty(""Authorization"",getBase64Encode());</p><p>Finally responce code is 401</p><p>any idea???    </p><pre><code>protected void connect() {  InputStream is = null;  OutputStream os = null;  try {   url = new URL(getUrl());   System.out.println(getUrl());// duzelt   queryString = encodeURL(queryString);   byte postmsg[] = queryString.getBytes(""UTF-8"");   conn = url.openConnection();   if (!(conn instanceof HttpURLConnection))    throw new IOException(""Not an HTTP connection"");   httpConnection = (HttpURLConnection) conn;   HttpOptions options=new HttpOptions();   httpConnection.setDoInput(true);   httpConnection.setDoOutput(true);   httpConnection.setRequestMethod(""GET"");   httpConnection.setRequestProperty(""Authorization"",     getBase64Encode());   httpConnection.connect();   os = httpConnection.getOutputStream();// ///////////////////baglantinin   System.out.println(""response code: ""+ httpConnection.getResponseCode());   // connect olup olmadigini   // kontrol et   for (int i = 0; i &lt; postmsg.length; i++) {    os.write(postmsg[i]);   }   if (!cancel) {    onReturn(httpConnection.getResponseCode(), httpConnection      .getInputStream());   }   os.close();   // httpConnection.close();  } catch (Exception e) {   System.out.println(e.getMessage());   try {    httpConnection.disconnect();    Thread.sleep(60);    // cancel=true; eklenmesi gerekebilir   } catch (Exception ie) {   }   onError(e);  }</code></pre>","463888","","463888","","2010-10-22 11:26:01","2010-10-22 11:26:01","Authentication Problem..!! ON ANDROID WITH HTTPURLCONNECTION","<java><android><http><http-status-codes>","1","0","0","",""
"3943182","1","","","2010-10-15 14:28:21","30","29624","<p>I want to connect 3 devices via bluetooth (My Droid must connect to 2 bluetooth devices). I 've connected my Droid to 1 device using Bluetooth chat How should I modify it for multiple bluetooth devices? Could you help me please?</p>","448147","","597657","","2012-04-26 17:18:05","2013-12-11 23:22:06","Multiple bluetooth connection","<android><bluetooth>","5","0","16","",""
"3943204","1","3943642","","2010-10-15 14:31:02","0","2029","<p>According to <a href=""http://developer.android.com/reference/android/graphics/Color.html#RGBToHSV%28int,%20int,%20int,%20float%5b%5d%29"" rel=""nofollow"">the document</a>, android.graphics.Color has a method called <code>RGBToHSV</code> which can convert RGB values to HSV, this is what the document tells me:</p><pre><code>public static void RGBToHSV (int red, int green, int blue, float[] hsv)</code></pre><blockquote>  <h3>Convert RGB components to HSV.</h3>    <ul>  <li><code>hsv[0]</code> is Hue [0 .. 360)</li>  <li><code>hsv[1]</code> is Saturation [0...1]    </li>  <li><code>hsv[2]</code> is Value [0...1]</li>  </ul>    <h3>Parameters</h3>    <ul>  <li><em>red</em>:  red component value [0..255]</li>  <li><em>green</em>:    green component value [0..255]</li>  <li><em>blue</em>: blue component value [0..255]</li>  <li><em>hsv</em>:  3 element array which holds the resulting HSV components.</li>  </ul></blockquote><p>But when I write a program to test it, it doesn't work any way.</p><pre><code>float[] hsv = new float[3];RGBToHSV(255, 255, 0, hsv);Log.i(""HSV_H"", """" + hsv[0]);   // always output 0.0</code></pre><p>Is it a bug ? </p>","325241","","325241","","2010-10-15 14:43:33","2013-06-25 01:30:06","Android's RGBToHSV method doesn't work","<android>","2","0","","",""
"3943305","1","3945839","","2010-10-15 14:44:23","0","274","<p>In my layout I have in the upper part three views in a horizontal linear layout. When I enter the activity, one of these views must be selected depending on the pressed button in the previous activity. The selection is made using an ImageView indicator that must be centered below the selected view. Could anyone tell me what is the best way to do this?</p><p>Best Regards</p>","460611","","","","","2010-10-15 20:34:07","ImageView aligned with other views","<android>","2","0","","",""
"3943432","1","","","2010-10-15 14:58:29","0","1022","<p>I am drawing some overlays on google map. If i move around the map too much, I get this error :</p><p>10-15 14:43:43.020: ERROR/dalvikvm-heap(299): 32768-byte external allocation too large for this process.10-15 14:43:43.020: ERROR/GraphicsJNI(299): VM won't let us allocate 32768 bytes10-15 14:43:43.260: ERROR/AndroidRuntime(299): FATAL EXCEPTION: main10-15 14:43:43.260: ERROR/AndroidRuntime(299): java.lang.OutOfMemoryError: bitmap size exceeds VM budget10-15 14:43:43.260: ERROR/AndroidRuntime(299):     at android.graphics.Bitmap.nativeCreate(Native Method)10-15 14:43:43.260: ERROR/AndroidRuntime(299):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)</p><p>In my heap, I can see that less than 30% has been used.</p><p>Can anyone help me out ? Is there a way out ? Thanks.</p><p>///////////////////////////////////////////////</p><p>public void draw(Canvas canvas, MapView mapv, boolean shadow){</p><pre><code>    BusLoc.myMapView.destroyDrawingCache ();    super.draw(canvas, mapv, shadow);    Paint mPaint = new Paint();    mPaint.setDither(true);    mPaint.setColor(Color.RED);    mPaint.setStyle(Paint.Style.FILL_AND_STROKE);    mPaint.setStrokeJoin(Paint.Join.ROUND);    mPaint.setStrokeCap(Paint.Cap.ROUND);    mPaint.setStrokeWidth(2);    /////////////////////////////get the lat/long info/////////////////////////////////////    BusLoc.mapCenter= BusLoc.myMapView.getMapCenter();    int latCenter = BusLoc.mapCenter.getLatitudeE6();    int longCenter = BusLoc.mapCenter.getLongitudeE6();    int latSpan = BusLoc.myMapView.getLatitudeSpan();    int longSpan = BusLoc.myMapView.getLongitudeSpan();    int latMax = latCenter + (latSpan / 2);    int latMin = latCenter - (latSpan / 2);    int longMax = longCenter + (longSpan / 2);    int longMin = longCenter - (longSpan / 2);    ///////////////////////////////////////////////////////////////////////////////////////    Log.d(""MyOverlay"",""OnDraw"");    int in=0;    for(in=0;in&lt;ind-1;in++)    {        if (ah1[in][0] ==0 ||(ah1[in+1][0]==0)) break;        if((ah1[in][0] !=0) &amp;&amp;(ah1[in+1][0]!=0))        {            GeoPoint gP1 = new GeoPoint((int)(ah1[in][0]*1e6),(int)(ah1[in][1]*1e6)); //lat,lng            GeoPoint gP2 = new GeoPoint((int)(ah1[in+1][0]*1e6),(int)(ah1[in+1][1]*1e6));            Point p1 = new Point();            Point p2 = new Point();            Path path = new Path();            Projection projection = BusLoc.myMapView.getProjection();            projection.toPixels(gP1, p1);            projection.toPixels(gP2, p2);            path.moveTo(p2.x, p2.y);            path.lineTo(p1.x,p1.y);            if((((ah1[in][0]&lt;=latMax)&amp;&amp;(ah1[in][0]&gt;=latMin))&amp;&amp;((ah1[in][1]&lt;=longMax)&amp;&amp;(ah1[in][1]&gt;=longMin))) || (((ah1[in+1][0]&lt;=latMax)&amp;&amp;(ah1[in+1][0]&gt;=latMin))&amp;&amp;((ah1[in+1][1]&lt;=longMax)&amp;&amp;(ah1[in+1][1]&gt;=longMin))) )            {                canvas.drawPath(path, mPaint);            }            Log.d(""MyOverlay"",""drawn: ""+gP1.toString()+"":""+gP2.toString());        }    }   // BusLoc.myMapView.destroyDrawingCache ();}</code></pre>","342925","","342925","","2010-10-15 18:02:57","2010-10-15 18:02:57","memory problem with google map and overlays !","<android><memory><google-maps><overlay>","1","7","1","",""
"3943468","1","3944274","","2010-10-15 15:01:59","3","1138","<p>I'm writing a graphic design application for Android where the user can add several images to a document, where each image is stored as a Bitmap object. Each bitmap has roughly a dimension of 800x400 pixels and uses ARGB8888 pixel format (i.e. ~1.5Mb each).</p><p>I'm aware that most of the first generation Android devices have a 16Mb heap limit and this limit is 24Mb and larger for newer phones. I'm also aware that bitmap memory is allocated externally, but I'm confused and what the implications of this is.</p><p>My question is: How can I tell at runtime when adding a new Bitmap will get me too close to the memory limit?</p><p>Before someone suggests ""don't use that much memory"", I know that one option I have is to limit how many Bitmaps the user can create such that I know this limit is safe for the most basic Android phones. However, I'd like for phones with a bigger memory limit to support more bitmaps and/or bigger bitmaps.</p><p>I know to check for OutOfMemory exceptions when allocating bitmaps. However, there will be some situations where I've only got just enough memory left to allocate one more bitmap. After this point, the whole application will be unstable because even allocating small things like strings could cause an OutOfMemory exception. This is something I want to avoid.</p><p>I'm not sure how to define ""too close to the memory limit"", but I suspect something like ""don't allocate more than half of your available memory to bitmaps"" would work OK as my other data structures I store in memory are small in comparison.</p>","477028","","477028","","2010-10-15 15:10:17","2010-10-19 01:01:03","How to tell how close your activity is to reaching its memory limit?","<java><android><memory><mobile>","2","1","3","",""
"3943747","1","","","2010-10-15 15:34:19","0","1952","<p>I'm calling soap webservice in android app. its working fine and getting the response in SOAP object. I don't know what to do after that. I'm searching for tutorial but I didnt find any. I'm really very fed up. I need to parse the reponse. Can anybody please help me in this case. </p><pre><code>    filter.setOnClickListener(new OnClickListener() {  @Override  public void onClick(View v)   {   //sign_up.setImageResource(R.drawable.signuphover);    //Intent i = new Intent();          //i.setClassName(""com.android.istock"",""com.android.istock.signup"");          //startActivity(i);    int type=0;    int PageNo=1;    int PageSize=10;      SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);      request.addProperty(""pStrType"", type);      request.addProperty(""pIntPageNo"", PageNo);      request.addProperty(""pIntPageSize"", PageSize);      //Log.v(LOG_TAG,"" value:=""+name);      //Log.v(LOG_TAG,"" value:=""+pass);      SoapSerializationEnvelope envelope =       new SoapSerializationEnvelope(SoapEnvelope.VER11);      envelope.dotNet = true;      envelope.setOutputSoapObject(request);      AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);      try      {      androidHttpTransport.call(SOAP_ACTION, envelope);      SoapObject resultstring = (SoapObject) envelope.bodyIn; </code></pre>","383597","","13070","","2010-10-15 17:16:20","2012-12-18 13:56:41","Android Webservice SOAP","<android><web-services><soap>","1","3","1","",""
"3943759","1","","","2010-10-15 15:35:54","0","200","<p>I've created a tabs using tabhost (Let's called tab ""A"")</p><p>Tab ""A"" is the originator for activity 1</p><p>In activity 1, it is containing a button widget</p><p>Question is ....</p><p>Is it possible for A to handle more than 1 activities (switching), this is done by pressing the button appeared in activity 1 (I need the switched activity is still appeared under tab ""A"")</p>","471595","","","","","2011-03-16 08:14:02","TabHost Problem on Android","<android>","2","0","","",""
"3943898","1","","","2010-10-15 15:54:06","2","3048","<p>I'm making a remote-app, so I need a varying number of buttons, grouped by tableviews and tablerows.</p><p>I can create the fix ones (that must alwasy be available) at designtime via xml, making use of the layouts making all buttons fit on every resolution.</p><p>But there are buttons I have to create at runtime.To make them behave the same way as the fixed ones, I need to assign the layout width, -height and -weight values.</p><p>I was searching the whole documentation, but there it is always done in XML, no word about runtime / matching routines.</p><p>Is this even possible??How else could I create a to-all-sides-fitting grid of buttons?</p><p>Thanks a lot!</p>","477100","","67097","","2012-05-30 02:08:24","2012-05-30 02:08:24","how to set button's layout width at runtime?","<android><layout>","1","0","","",""
"3943900","1","4490860","","2010-10-15 15:54:12","0","4901","<p>Admob code cant see on device.</p><p>i followed the instructions here: <a href=""http://www.admob.com/docs/AdMob_Android_SDK_Instructions.pdf"" rel=""nofollow"">http://www.admob.com/docs/AdMob_Android_SDK_Instructions.pdf</a></p><p>everything ok, but the 6. not clear for me</p><blockquote>  <p>""  Step 6 </p>    <p>When integrating AdMob ads into your application it is  recommended to use test mode. In test mode test, ads are always  returned. Test mode is enabled on a per-device basis. To enable test  mode for a device, first request an ad, then look in LogCat for a line  like the following: To get test ads on the emulator use  AdManager.setTestDevices... Once you have the device ID you can enable  test mode by calling AdManager.setTestDevices:</p></blockquote><pre><code>AdManager.setTestDevices( new String[] { AdManager.TEST_EMULATOR, //    Android emulator ""E83D20734F72FB3108F104ABC0FFC738"", // My T-Mobile G1 Test Phone } ); }</code></pre><p>""</p><p>what is that long number on the code? how i get that number?</p><p>in the oncreate method i put this code:</p><pre><code>AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR } );</code></pre><p>(into the help activity, not into the main activity)</p>","472537","","432903","","2012-09-12 18:03:20","2012-12-07 06:06:41","Android admob cant see","<android><admob>","4","0","1","",""
"3943962","1","","","2010-10-15 16:00:41","0","324","<p>I want to load bitmaps into ImageViews in Android, but I don't want to use the R.drawable syntax because I have a lot of images with a standard naming convention so it's much easier to get the image with some logic. For example, all my images are named:</p><p>img1.pngimg2.pngimg3.png</p><p>So if a user selects a value, let's say x, I show ""img"" + x + "".png"" in the ImageView. Looks like Bitmap.decodeFile is what I need, but I need to know the syntax of how to get to my drawables folder since that's where the images are. Or if there's perhaps a better way.</p><p>I realize I could do this with a switch statement instead of concatenating the image name but that would be a lot of lines since I have so many images.</p>","462440","","","","","2010-10-17 14:26:05","Android Bitmap syntax","<android><bitmap><imageview>","3","0","","",""
"3944080","1","3944716","","2010-10-15 16:16:06","5","3526","<p>In a start activity of our android application we're using a linearlayout with an background image for whole space. </p><p>The image size is 320x480 - the same as device resolution, we're using for testing.</p><p>The problem is, the image will be scaled und looks not so nice.</p><p>I tried to use imageview instead, but I've got black borders.</p><p>Some ideas, how to avoid scaling or how to get the proper size for background image?!</p><p>Thank you in advance.</p><p>Mur.</p>","408780","","","","","2010-10-16 07:22:11","Android. Avoid scaling of background","<android>","1","0","4","",""
"3944205","1","3945559","","2010-10-15 16:30:25","2","703","<p>I just finished my App and is now in the market, so far so good, in fact the name is DopeWars Underground (just in case you wanted to see it) my question is, there is another place to promote that App outside of the Android Market to advertise this App ?</p>","493723","","","","","2012-07-13 05:16:12","Android App alternate Market or place","<android><google-play>","4","0","6","2012-07-13 07:23:19",""
"3944207","1","3947381","","2010-10-15 16:30:50","8","7749","<p>I have a large C/C++ library that I need to use as part of an Android NDK project.  This library needs to be able to intelligently process UTF8 strings (for example, conversion to lowercase/uppercase).</p><p>The library has conditional compilation to punt to an OS API to do the conversion, but there don't seem to be any Android APIs for UTF8.  (mbstowcs, etc)</p><p><a href=""http://groups.google.com/group/android-ndk/browse_thread/thread/2100acf0c89dcc17"" rel=""nofollow"">This thread</a> says to use JNI methods to do it (!), which is a rather heavy-weight solution.</p><p>I was thinking about building <a href=""http://site.icu-project.org/"" rel=""nofollow"">ICU</a>, but as it uses GNU Autotools I'm not sure I can make it work with the NDK toolchain. :/</p><p>Has anyone else confronted this problem and done something other than use JNI?</p><p><strong>EDIT:</strong> My attempts to get ICU to compile fail at the configure step:</p><pre><code>checking wchar.h usability... nochecking wchar.h presence... yesconfigure: WARNING: wchar.h: present but cannot be compiledconfigure: WARNING: wchar.h:     check for missing prerequisite headers?configure: WARNING: wchar.h: see the Autoconf documentationconfigure: WARNING: wchar.h:     section ""Present But Cannot Be Compiled""configure: WARNING: wchar.h: proceeding with the preprocessor's resultconfigure: WARNING: wchar.h: in the future, the compiler will take precedencechecking for wchar.h... yeschecking for library containing wcscpy... none requiredchecking size of wchar_t... 0configure: error: There is wchar.h but the size of wchar_t is 0</code></pre>","89218","","185799","","2012-03-20 15:48:58","2012-03-20 15:48:58","unicode support in android ndk","<android><unicode><utf-8><android-ndk><icu>","1","5","4","",""
"3944344","1","3945678","","2010-10-15 16:49:35","0","2544","<p>I am writing a app for which i need to display the Time elapsed when user presses a button in UI screen . So please guide me in writing the code in Android. I need to display the time in seconds, mins and hours.</p><p>Thanks in anticipation.</p>","477185","","142162","","2011-09-27 13:08:24","2011-09-27 13:08:24","How to Display the time elapsed onto UI Screen of the Android","<android><user-interface><time><timer>","2","1","","",""
"3944366","1","3944388","","2010-10-15 16:53:26","0","120","<p>Hallo, there are a lot of stuff with ""bitmap size exceeds VM budget"".but where can I check the problems to see when it happens. I programm a sprite based game and use a lot of picture (not too big but a lot). The game works fine on the htc desire but on a hero i get this  bitmap size exceeds vm budget problms. So where can I chek how much is already allocated or in use? The DDMS? and when where? Is there an Overview how much memory each telephon can use for pictures?  So i need an overview when i prepare mycode that I can chek the result of my efforts. HopeI was clearly, sorry for mybad english.</p><p>Thank You for response</p>","372021","","","","","2010-10-15 16:56:55","VM Budget Android checkouts Problems","<android>","1","0","","",""
"3944555","1","4011650","","2010-10-15 17:25:01","2","3376","<p>I've seen a number of similar questions, but so far I've not been able to get anything working.</p><p>I'm trying to playback a video (.MP4) from the res/raw folder and only get audio, no video.  The video is short (about 3 seconds), small (350KB) and if I put the video on the device (Motorola Droid) directly, it plays fine.  It also plays fine if I modify the app to read it from the SD card rather than the resource folder.  The behavior is the same on both the emulator and the actual device.</p><p>Unfortunately, I need this video to be an intro shown just prior to the main screen for my app, so it has to be part of the package.  Additionally, one of the app requirements is that the app is available offline, so I can't stream from a web server.  I've tried a VideoView, SurfaceView and MediaPlayer, none of them work.  </p><p>Is it possible to playback video from the resource folder?  I've read something about compression possibly screwing the video up, is it possible to manually decompress the video and then play it, and if so, how would that work?  This seems like it should be a pretty basic operation, am I just missing something?</p>","477231","","","","","2012-07-12 12:27:15","Playing .MP4 video from raw resource folder","<android>","1","0","0","",""
"3944653","1","3945403","","2010-10-15 17:38:52","1","1429","<p>Here is some xml for a row in a ListView:</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:padding=""6dip""&gt;&lt;ImageView android:id=""@+id/cover"" android:layout_width=""64dip""    android:layout_height=""64dip"" android:layout_alignParentTop=""true""    android:layout_alignParentBottom=""true"" android:layout_marginRight=""6dip"" /&gt;&lt;TextView android:id=""@+id/loan"" style=""@style/DetailsLabel.Small""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/cover"" android:layout_alignParentRight=""true"" /&gt;&lt;TextView android:id=""@+id/title"" style=""@style/DetailsLabel.Small""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/cover"" android:layout_alignParentRight=""true""    android:layout_alignParentTop=""true"" android:layout_above=""@id/loan""    android:layout_alignWithParentIfMissing=""true"" android:gravity=""center_vertical""    android:singleLine=""true"" android:ellipsize=""end"" /&gt;&lt;RatingBar android:id=""@+id/ratingBarIndicator"" style=""?android:attr/ratingBarStyleSmall""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/cover"" android:layout_below=""@id/title""    android:layout_alignParentRight=""true"" android:gravity=""center_vertical"" /&gt;</code></pre><p></p><p>And here is the result:<img src=""http://i.stack.imgur.com/tFnS7.png"" alt=""alt text""></p><p>(That's a plain Donut 1.6).</p><p>What I'm trying to achieve is a cover on the left, followed by a title, rating bar, and optional loan status on the right. As you can see the RatingBar is repeating endlessly (it should only have five stars); and whenever there IS a loan status set, the title disappears. How can I fix my XML to achieve the effect I want?</p>","213345","","","","","2010-10-15 19:23:27","Repeating RatingBar wonkiness in a ListView using RelativeLayout","<android><listview><rating><relativelayout>","2","0","","",""
"3945082","1","3945575","","2010-10-15 18:36:11","1","1647","<p>How do I re size the datepicker widget in android (the default one)</p>","383677","","","","","2010-10-15 19:47:32","How to resize DatePicker android widget","<android><android-widget>","1","1","1","",""
"3945138","1","3945287","","2010-10-15 18:44:25","-2","1207","<p>I added test ads, and everything ok, but how to add REAL ADS on my program?</p>","472537","","","","","2010-10-15 19:07:15","How to add REAL ADS for admob? Android","<android><admob>","1","0","","",""
"3945143","1","","","2010-10-15 18:45:00","0","1641","<p>I am trying to create a ""hidden edit view"" which will give me the functionality of text editing within a 3rd party GUI on Android. I figured that the easiest way to make it not draw would be to just override onDraw() with a no-op; however it's having no effect. I've added a log statement to check that it is being called. Does anyone have an idea why it's still being drawn?</p><pre><code>    private class HiddenEditText extends EditText{    public HiddenEditText(Context context)    {        super(context);    }    @Override    protected void onDraw(Canvas canvas)    {        Log.e(""DBG"", ""onDraw()"");    }}    // ...    EditText EditTextGreen = new HiddenEditText(this);    EditTextGreen.setFocusable(true);    EditTextGreen.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));    layout.addView(EditTextGreen, 0);</code></pre>","145164","","","","","2010-10-16 07:30:30","Overriding onDraw() for an EditText widget with a blank implementation has no effect","<android><gui>","2","0","","",""
"3945212","1","3957530","","2010-10-15 18:56:21","0","1175","<p>Our Android app does a lot of image decoding.  We fetch a lot of images from the internet, local storage caches, etc.</p><p>Up to now, these images are being decoded on the UI thread (using BitmapFactory.decodeX() methods).  It's been causing some timeout crashes because the UI doesn't respond quickly enough to user input.</p><p>I could write a little AsyncTask that encapsulates decoding, but I'm not sure that's a good idea.  Spawning threads is expensive, and that would be spawning and tearing down a ton of them.</p><p>So what's the best way to put this on another thread?  Do I need to go to the extent of writing a Service?  That seems a little heavy-weight.  Are there any solutions for this already out there?</p>","205192","","","","","2010-10-18 08:28:36","Android - Threaded BitmapFactory image decoding","<android><multithreading><image-processing><asynchronous>","2","2","","",""
"3945256","1","","","2010-10-15 19:02:00","0","314","<p>This is the source to Locale section that's in the Settings</p><p><a href=""http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;a=blob_plain;f=src/com/android/settings/LocalePicker.java;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;a=blob_plain;f=src/com/android/settings/LocalePicker.java;hb=HEAD</a></p><p>Does anyone know what is the full package name for the <code>R</code> class?? Oddly enough its not in the import list NOR is it in the <strong>com / android / settings</strong> package</p><p>I want <code>R.array.special_locale_codes</code> for my own needs.</p><p>Thanks!</p>","450741","","1232277","","2013-01-05 03:12:14","2013-01-05 04:56:01","android Locale app - R's full package name","<android><resources>","1","2","","",""
"3945263","1","","","2010-10-15 19:03:00","0","230","<p>I'm still really new at this, but this should hopefully be a simple question and answer.  I'm trying to just make a button and I've done so in the layout manager.  I'm trying to implement it in code, but MotoDev won't recognize the Button class that's part of the android.widget package.  I imagine I just have to do something similar to an import but I can't track down what that is.  Any help would be appreciated.</p><pre><code>package com.androidbook.myfirstandroidapp;import android.app.Activity;import android.content.Intent;import android.util.Log;import android.media.MediaPlayer;import android.net.Uri;import android.os.Bundle;import android.location.Location;import android.location.LocationManager;import android.graphics.drawable.ColorDrawable;public class MyFirstAndroidApp extends Activity {    private static final String DEBUG_TAG= ""MyFirstAppLogging"";    private MediaPlayer mp;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String myString = getResources().getString(R.string.hello);        int myColor = getResources().getColor(R.color.Red);        float myDimen = getResources().getDimension(R.dimen.textPointSize);        ColorDrawable myDraw = (ColorDrawable)getResources().getDrawable(R.drawable.redDrawable);        //Log.i(DEBUG_TAG, ""Info about MyFirstAndroidApp"");        setContentView(R.layout.buttons);        final Button basic_button = (Button) findViewById(R.id.basic_button);    }    public void callThisNumber()    {        Uri number = Uri.parse(""tel:3045555555"");        Intent dial = new Intent(Intent.ACTION_DIAL, number);        startActivity(dial);    }    public void forceError()     {        if(true)        {            throw new Error(""Whoops"");        }    }    public void playMusicFromWeb()    {        try        {            Uri file = Uri.parse(""http://www.perlgurl.org/podcast/archives/podcasts/PerlgurlPromo.mp3"");            mp = MediaPlayer.create(this, file);            mp.start();                 }        catch(Exception e)        {            Log.e(DEBUG_TAG, ""Player failed"", e);        }    }    public void getLocation()    {        try        {            LocationManager locMgr = (LocationManager)getSystemService(LOCATION_SERVICE);            Location recentLoc = locMgr.getLastKnownLocation(LocationManager.GPS_PROVIDER);            Log.i(DEBUG_TAG, ""loc: "" + recentLoc.toString());                   }        catch(Exception e)        {            Log.e(DEBUG_TAG, ""Location Failed"", e);        }    }    @Override    protected void onStop() {        // TODO Auto-generated method stub        if(mp != null)        {            mp.stop();            mp.release();        }        super.onStop();    }} // End Class</code></pre>","477337","","","","","2010-10-16 03:28:30","MotoDev not recognizing Button class?","<android><button>","2","0","","",""
"3945565","1","3945836","","2010-10-15 19:46:21","3","127","<p>Is there any functionality baked into Android SDK that will give user visual clue that menu is available? Or has anybody worked on this problem?</p><p>Currently, I need to rely on user clicking Menu button and sometimes it's just not so obvious that certain Activity has Menu.</p><p>So, any suggestions?</p>","237858","","","","","2010-10-15 20:21:57","Android - give indication that menu is available","<android>","1","0","","",""
"3945595","1","3946304","","2010-10-15 19:50:29","1","1509","<p>I don't understand why Eclipse doesn't know how to resolve the color resources I've defined. Am I doing something wrong?</p><p>R.color.notepad_lines cannot be resolved MyNewTextView.java </p><p>I've had problems before too with eclipse being able to find images in my /res/drawable directory</p><p>/res/values/colors.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt; &lt;color name=""notepad_paper""&gt;#AAFFFF99&lt;/color&gt; &lt;color name=""notepad_lines""&gt;#FF0000FF&lt;/color&gt; &lt;color name=""notepad_margin""&gt;#90FF0000&lt;/color&gt; &lt;color name=""notepad_text""&gt;#AA0000FF&lt;/color&gt;&lt;/resources&gt;</code></pre><p>MyNewTextView.java</p><pre><code>... private Paint marginPaint; private Paint linePaint; private int paperColor; private float margin;  private void init(){  //Get Reference to Resource Table  Resources myRes = getResources();  //Create paint brushes  marginPaint = new Paint(Paint.ANTI_ALIAS_FLAG);  marginPaint.setColor(myRes.getColor(R.color.notepad_margin));  linePaint = new Paint(Paint.ANTI_ALIAS_FLAG);  linePaint.setColor(myRes.getColor(R.color.notepad_lines));  paperColor = myRes.getColor(R.color.notepad_paper);  margin = myRes.getDimension(R.dimen.notepad_margin); }...</code></pre><p>Eclipse keeps saying it can't find any of the R.* resources =/ </p><p>R.java</p><pre><code>public final class R {    public static final class attr {    }public static final class color {    public static final int notepad_lines=0x7f040001;    public static final int notepad_margin=0x7f040002;    public static final int notepad_paper=0x7f040000;    public static final int notepad_text=0x7f040003;}public static final class dimen {    public static final int notepad_margin=0x7f050000;}public static final class drawable {    public static final int ic_menu_add=0x7f020000;    public static final int ic_menu_cut=0x7f020001;    public static final int ic_menu_king=0x7f020002;    public static final int icon=0x7f020003;}...</code></pre>","177389","","177389","","2010-10-15 22:42:34","2012-07-04 04:31:52","Why arent my new resources added in the res/ sub-folders showing up in the R class?","<android><resources><paint>","4","7","","",""
"3945765","1","","","2010-10-15 20:13:14","0","925","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3937066/passing-a-int-value-to-another-class"">Passing a Int value to another class</a>  </p></blockquote><p>I have been trying to get ""getExtra"" to work but without success,  I have a listview with 4 choices which launch a webpage within a webView class, when the user selects the option lets say option 3 I want to pass the value of 3 to the webView class so that it will load the correct webpage, at the moment all I get is errors, can somebody help with where I am going wrong.</p><p>This is my intent</p><pre><code>         if (position == 0)  {                Intent intent = new Intent(this, official.class);                startActivity(intent);intent.putExtra(webb = 3);}</code></pre><p>This is the getextras code in the official class with the webpages I want to load</p><pre><code>Bundle webb = getIntent().getExtras(),</code></pre><p>variableGet = webb.getInt(webb);</p><pre><code>if (webb == 2)      mWebView.loadUrl(""http://bcafc.livewwware.co.uk/viewforum.php?f=7&amp;sid=009c462b00069f307ef6dcd09e747f7c"");  if (webb == 3)   mWebView.loadUrl(""http://www.bbc.co.uk"");  mWebView.setWebViewClient(new HelloWebViewClient());</code></pre><p>Thanks in Advance</p>","445174","","210226","","2010-10-15 20:35:12","2010-10-15 20:36:03","How to pass an int value to another class","<java><android><android-intent>","3","4","","2012-04-16 13:46:45",""
"3945803","1","","","2010-10-15 20:17:59","0","423","<p>what parameters do I pass to this function ?</p><p>invalidate(left, top, right, bottom)</p><p>for use with google map on android ?</p><p>thanks</p><p>-ahsan</p>","342925","","245205","","2010-10-15 23:30:39","2010-10-15 23:30:39","what parameters to pass to invalidate(left, top,right,bottom) for google map on android?","<android><overlay><android-mapview><invalidate>","1","1","1","",""
"3945805","1","3945846","","2010-10-15 20:18:02","0","2878","<p>A piece of code to update DB raw:</p><pre><code>private EditText et;//...private void updateRecipe(){  SQLiteDatabase db=recipes.getWritableDatabase();  ContentValues values=new ContentValues();    values.put(RECIPE, et.getText().toString());  db.update(RECIPES_TABLE, values, ""id=?"", new String[]{id});}</code></pre><p>When ran, an error occures:</p><pre><code>Error updating recipe=Efrerer using UPDATE recipes SET recipe=? WHERE id=?android.database.sqlite.SQLiteException: no such column: id: , while compiling: UPDATE    recipes SET recipe=? WHERE id=?</code></pre><p>These are my SQL queries:</p><pre><code>  @Override  public void onCreate(SQLiteDatabase db){      db.execSQL(""CREATE TABLE ""+CATEGORY_TABLE+"" (""+_ID+"" INTEGER PRIMARY KEY AUTOINCREMENT, ""+              CATEGORY_NAME+"" TEXT NOT NULL);"");          db.execSQL(""CREATE TABLE ""+RECIPES_TABLE+"" (""+_ID+"" INTEGER PRIMARY KEY AUTOINCREMENT, ""+              RECIPE_NAME+"" TEXT NOT NULL, ""+CATEGORY_ID+"" INTEGER, ""+ RECIPE+"" TEXT NOT NULL);"");  }  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){      db.execSQL(""DROP TABLE IF EXISTS ""+CATEGORY_TABLE);      db.execSQL(""DROP TABLE IF EXISTS "" +RECIPES_TABLE);  }</code></pre>","468311","","56338","","2011-11-09 02:36:43","2011-11-09 02:39:24","Android SQLiteDatabase update error","<android><sqlite>","2","0","","",""
"3946126","1","","","2010-10-15 21:05:43","0","164","<p>i am a new android and not much familiar with all the libraries. i am trying to acces a simple web page(google.com) through my android app. i have made the http requst but i am not able to see anything after i click the button</p><pre><code>public void onClick (View viewParam)      {       EditText usernameEditText = (EditText) findViewById(R.id.txtuser);       EditText passwordEditText = (EditText) findViewById(R.id.txtpass);       String aUserName = usernameEditText.getText().toString();       String aPassword = passwordEditText.getText().toString();       if(aUserName.length() == 0 || aPassword.length() == 0){        //Toast.makeText(getApplicationContext(),""Not Found"",Toast.LENGTH_SHORT).show();       }       else{        Toast.makeText(getApplicationContext(),""Username: "" + aUserName + ""Password: "" + aPassword ,Toast.LENGTH_SHORT).show();        String URL = ""http://www.google.com/"";        HttpClient httpclient = new DefaultHttpClient();        try {     HttpResponse response = httpclient.execute(new HttpGet(URL));     StatusLine statusLine = response.getStatusLine();     if(statusLine.getStatusCode() &gt;1){            ByteArrayOutputStream out = new ByteArrayOutputStream();            response.getEntity().writeTo(out);            out.close();            String responseString = out.toString();            //..more logic        }     else{            //Closes the connection.            response.getEntity().getContent().close();            throw new IOException(statusLine.getReasonPhrase());        }    } catch (ClientProtocolException e) {     // TODO Auto-generated catch block     e.printStackTrace();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }</code></pre>","477469","","234039","","2010-10-15 21:15:38","2013-10-30 01:21:12","can not display webpage after making http request in android","<android>","1","2","","",""
"3946361","1","","","2010-10-15 21:41:44","1","87","<p>My project downloads lots of xml (as text) and images then I parse the xml and interpret the data there. When I check some of the xml downloaded some of them are getting truncated only showing a partial part of it. The beginning parts of it is gone. I use:</p><pre><code>   InputStream in;       in = OpenHttpConnection(url);   SAXParserFactory spf = SAXParserFactory.newInstance();   SAXParser sp = spf.newSAXParser();   XMLReader xr = sp.getXMLReader();   xr.setContentHandler(this);   xr.parse(new InputSource(in));</code></pre><p>Edited:</p><pre><code>@Override    public void startElement(String namespaceURI, String localName,            String qName, Attributes atts) throws SAXException {        if (localName.equals(""quiz"") ) {            parsedQuizTitle = new QuizTitle();            in_quiztitle = true;    }}@Overridepublic void endElement(String namespaceURI, String localName, String qName)throws SAXException {    if (localName.equals(""category"") || localName.equals(""quiz"") ) {        in_quiztitle = false;        quiztitleSet.add(parsedQuizTitle);    }}@Overridepublic void characters(char ch[], int start, int length) {    if (in_quiztitle) {        String quiz_item = new String(ch, start, length);        String[] quiz_item_parsed = null;        String expression = ""\\|\\|"";        quiz_item_parsed = quiz_item.split(expression);        if(quiz_item_parsed.length == 2) {            parsedQuizTitle.setQuizTitleName(quiz_item_parsed[1]);            parsedQuizTitle.setQuizTitleID(quiz_item_parsed[0]);        }        else {            //add to title            parsedQuizTitle.addtoQuizTitleName(quiz_item);        }    }}</code></pre>","477517","","1232277","","2013-01-08 00:41:04","2013-01-08 00:41:04","Data/XML being trucated when displayed","<android><xml><saxparser>","0","3","","",""
"3946375","1","3947032","","2010-10-15 21:43:09","0","2100","<p>I am writing an application that will behave similar to the existing Voice recognition but will be sending the sound data to a proprietary web service to perform the speech recognition part. I am using the standard MediaRecord (which is AMR-NB encoded) which seems to be perfect to speech recognition. The only data provided by this is the Amplitude via the <em>getMaxAmplitude()</em> method.</p><p>I am trying to detect when the person starts to talk so that when the person stops talking for about 2 seconds I can proceed to send the sound data to the web service. Right now I am using a threshold for the amplitude that if its goes over a value (i.e. 1500) then I assume the person is speaking. My concern is that the amplitude levels may vary by device (i.e. Nexus One v Droid), so I am looking for a more standard approach to this that can be derived from the amplitude values.</p><p>P.S.I looked at <a href=""http://stackoverflow.com/questions/2448670/graphing-amplitude"">graphing-amplitude</a> but it doesn't provide a way to do it with just the amplitude.</p>","302048","","","","","2010-12-15 10:45:36","Voice Activity Detection in Android","<android><speech-recognition><voice><voice-recognition><amplitude>","3","0","","",""
"3946466","1","3947589","","2010-10-15 21:59:40","0","386","<p>I am using AdWhirl for my ads and they aren't showing in my app when I run it in the emulator. I heard it sometimes takes a while, so i left it for 10 minutes but still nothing. I have disabled AdSense just to see if it would work with just AdMob, but it didn't help.</p><p>In my DDMS it shows this:</p><p><img src=""http://i.stack.imgur.com/l823q.png""></p><p>It shows the same when AdSense is enabled except it says ""AdSense Failure"". Has anyone any ideas as to why they aren't showing?</p>","348261","","","","","2010-10-16 03:47:07","Ads aren't showing in android app","<android><adsense><admob><ads><adwhirl>","1","0","","",""
"3946527","1","","","2010-10-15 22:15:05","1","910","<p>I'm developing a side-scrolling android game and I've come across one hiccup.</p><p>The game is rendering graphics on the Canvas object. The game features about 6 scrolling layers, the main ground layer, a collision layer, a foreground layer, and two background layers, which all scroll with variable speed for camera depth.</p><p>Now, the problem resides here:The game's graphics feature huge unique levels that are drawn out in their entirety. It is not tilebased, no graphics are repeated. However, when loading an entire graphic layer, I receive an out of memory exception. To remedy this, I've sliced up all my layers to 200 x 300 unique rectangular tiles, and the game only loads what's visible when it is visible. It can't load all the tiles at once, again because it will throw an Out of Memory exception. So of course, that requires that I dispose from memory tiles when they are no longer visible, otherwise i'll just keep adding these tiles to the memory and again hit that Out of Memory exception. This means that I have to use BitmapFactory to create a new bitmap from a resource within the game loop for every tile that becomes visible. Of course, with these tile bitmaps initialized within the game loop, whenever tiles leave visibility I have to deal with Garbage Collector lag. </p><p>Is there a better way to go about this solely using Canvas and keeping my unique ""macro"" tiles and not resorting to reusable micro tiles? Would it benefit using OpenGL instead? How or why?</p>","477531","","","","","2011-01-12 20:25:03","Android: Huge multi-layer scrolling backgrounds","<android><canvas><scrolling><bitmap>","1","0","","",""
"3946664","1","","","2010-10-15 22:42:41","0","667","<p>How can I populate a gallery with a selection of images on my SD card. For example: All files beginning with  'A' in the directory /sdcard/example/</p>","477554","","72882","","2012-12-19 15:32:15","2012-12-19 15:32:15","Populate gallery with selection of images","<android>","1","0","1","",""
"3946812","1","3946819","","2010-10-15 23:16:37","0","98","<pre><code>private final static int L1_MAX_SCORE = 30;private final static int L2_MAX_SCORE = 150;public void UpdateLevel(int score) {   double progress;   //returns 0.0   progress = score / (L2_MAX_SCORE  - L1_MAX_SCORE) * 100;      //works correctly.   progress = (double) score / (L2_MAX_SCORE  - L1_MAX_SCORE) * 100;  </code></pre><p>Thanks.</p>","432209","","106224","","2010-10-15 23:27:11","2010-10-15 23:57:56","Why I have to cast this statement in order to get a result?","<java><android><casting>","3","0","","",""
"3946852","1","3946887","","2010-10-15 23:26:12","2","83","<p>I found a typo on the guide section at developer.android.com, but I can't find a link/email to report the typo to.</p><p>I don't want to report it on the Android Developers Google group, as its a typo and not a technical question.</p><p>Anyone have an email address or link I can use to report typos?</p>","435519","","","","","2010-10-15 23:35:42","Where do you report typos at developer.android.com?","<android>","1","0","","",""
"3947052","1","","","2010-10-16 00:22:37","7","3465","<p>In my Android application, I overload the Application class, and I updated the  tag in my manifest. This application also creates an Android Service.I have put some logs in the onCreate of my Application class, and I see it being called twice.The first time is when my application gets launched (this is expected) and then, it's usually right after the Service is being created.the log also shows that a second instance of the Application is being created.(I print the ""this"" value and they are different).</p><p>I thought the Application would be created as a singleton.Is that happening because I create a Service?</p>","477602","","","","","2011-06-17 04:26:00","Android Application class being called twice","<android>","3","0","4","",""
"3947080","1","3947331","","2010-10-16 00:28:54","22","7307","<p>I just tried to implement a progressdialog and I have some issues to change the text during my long and complex calculations.</p><pre><code>for (String aString:myStringArray){    Log.v(TAG, aString);    mProgressDialog.incrementProgressBy(1);    mProgressDialog.setMessage(aString);}</code></pre><p>I can clearly see the incrementProgressBy working and my dialog updating, but the message does not change.</p><p>Any idea on how to make that work?</p><p>Thank a lot.</p>","327402","","126562","","2010-10-16 01:56:51","2012-03-12 13:04:50","ProgressDialog does not want to update the message","<android><progressdialog>","1","0","8","",""
"3947081","1","3947092","","2010-10-16 00:29:09","0","84","<p>This is kind of hard to explain, so i'll try the best I can to inform you on my problem. I have a variable that changes every now and then. In the main app activity i have</p><pre><code>int count = 0;</code></pre><p>(count is the variable) I would like to only set that at the very beginning. The first time a viewer opens it up I want to set it to 0. After that, I want to save it every time the viewer leaves, and load it when the viewer opens the app back up. </p>","473903","","","","","2010-10-16 00:32:25","Setting a Variable Once... I don't Know How to Explain (Android Projgramming)","<android><variables>","1","1","","",""
"3947082","1","","","2010-10-16 00:29:15","4","2844","<p>I have an application that needs to read images from a folder created by the application on the sdcard(sdcard/""foldername""/""filename.jpg"". I have no idea what the names of the files are because the user specifies the names of the files. I need to read the images from the folder and make something like the default image viewer. Im thinking read them into a grid view first but 1) cant figure out how to dynamically read them from a folder 2) how would I implement the image options like the default viewer? If there was a way to open the default viewer on a certain folder that would help.any input would be amazing been working on it for a while.Thanks </p>","477604","","","","","2011-03-29 07:25:35","Images from folder on sd card","<android>","1","0","4","",""
"3947145","1","3948036","","2010-10-16 00:50:48","11","2857","<p>I need to capture the absolute positions of some ImageViews to use as drop targets.  I can't seem to find what event I need to put my code in to read the screen and get the Left(), Top() .. positions. I do not want monitor the inflation of each individual view.  There must be some sort of onScreenFinsihed type of event, but I can't find it. onMeasure and onDraw seem to fire at the start of their work, I need to know when they are done.  TIA.</p>","465199","","","","","2010-10-16 07:26:15","What event is fired after all views are fully drawn?","<android><android-layout>","1","0","2","",""
"3947148","1","3947165","","2010-10-16 00:51:15","3","2017","<p>I have a variable that I would like to save and be able to restore when the viewer opens the app back up. I call this variable, count</p><pre><code>private int count=0;</code></pre><p>It changes every now and then through out my main activity. How can I save this after editing and changing it and be able to restore it?</p>","473903","","","","","2010-10-16 02:39:23","Saving Variables (Android)","<android><variables>","2","0","1","",""
"3947238","1","","","2010-10-16 01:21:15","0","1506","<p>Greetings,</p><p>I'm having a bit of trouble with an Android app that I'm working on (mostly for practice and learning purposes) that uses the <code>AudioManager</code> object.  When defining the <code>AudioManager</code> as follows, however, the app crashes when I run it:</p><pre><code>//Import the AudioManagerimport android.media.AudioManager;public class RingtoneModeChanger extends Activity {    //Causes crash:    public AudioManager mManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);    /* Code for the rest of the app... */}</code></pre><p>When I simply comment out the AudioManager declaration, the app does not crash.  Any ideas as far as what I'm doing wrong? I'm a bit of a beginner to Android development, so I have a feeling that I'm missing something obvious.</p><p>I've also tried adding the <code>android.permission.MODIFY_AUDIO_SETTINGS</code> and <code>android.permission.MODIFY_PHONE_STATE</code> permissions to the <code>AndroidManifest.xml</code> file, but that has made no difference.</p><p>Thanks in advance for any suggestions!</p>","477632","","491044","","2012-01-30 10:36:01","2014-03-31 22:56:48","AudioManager Declaration Crashes Android App","<android><android-audiomanager>","1","1","","",""
"3947356","1","","","2010-10-16 02:04:26","1","793","<p>I'm working on an app that will (hopefully) be taking advantage of Android's gestures (as described here: <a href=""http://developer.android.com/resources/articles/gestures.html"" rel=""nofollow"">http://developer.android.com/resources/articles/gestures.html</a>)  Before I dive in though, I'm trying to find out if gestures can take the direction they were drawn into account.  Unfortunately I haven't found this information in the documentation.</p><p>For example, if the user draws a vertical line on my app, I would like the gesture to register differently depending on if they went from the top of the screen to the bottom compared to if they went from the bottom to the top.  Can I take the drawn direction into account with gestures?  Or is a vertical line a vertical line, regardless of how it was drawn?</p><p>Thanks!</p>","460105","","","","","2010-12-09 12:07:27","Android Gesture Directions","<android><gesture-recognition><gesture><android-2.1-eclair>","1","0","","",""
"3947360","1","3947683","","2010-10-16 02:04:41","7","11791","<p>Right now I am trying to save a variable when i close the app and get the variable back when i open the app back up. I have no idea if I'm doing this right. My variable is called count and would like to save and restore it. Is this right? If so, why isn't it working? If not, what do i need to change? (i'm obviously using SharedPreferences)</p><pre><code>protected void onPause(){   super.onPause();  SharedPreferences settings = getSharedPreferences(PREFS_COUNT, 0);  SharedPreferences.Editor editor = settings.edit();  editor.putInt(""count"", count);  editor.commit();}@Overrideprotected void onResume(){    super.onResume();    SharedPreferences settings = getSharedPreferences(PREFS_COUNT, 0);    count = settings.getInt(""count"", count);}</code></pre>","473903","","244296","","2010-10-16 02:25:02","2010-10-16 04:30:29","Problem saving shared preferences in Android","<android><variables><sharedpreferences>","1","3","2","",""
"3947451","1","3948950","","2010-10-16 02:40:23","0","761","<p>As I've been researching another problem online, I've seen references to folks modifying the XML files contained inside the Android.jar.res.drawable folder and then copying them to their drawable folder for use in their project.</p><p>But I can't open these files, instead I get the following error.</p><p>Could not open the editor: org.eclipse.ui.PartInitException: Editor could not be initialized.</p><p>How do I open these files so I can use them?</p><p>Thanks.</p>","432209","","432209","","2010-10-16 02:48:04","2010-10-16 12:47:50","Getting at XML files inside Android.jar.res.drawable","<android><xml><eclipse><jar>","2","0","","",""
"3947537","1","","","2010-10-16 03:20:17","1","344","<p>I gotten a few very odd error reports from users recently showing a StringIndexOutOfBoundsException when I called Camera.Parameters.flatten().</p><p>I suppose the params object I had might have been null, and I dont check that before calling flatten, but I would have expected an NPE.</p><p>Has anyone else seen anything similar? I havent heard back from the user whether this was one time or every time and am starting to wonder how common this is with DroidX running 2.2.</p><pre><code>EXTRA INFO:Error setting cam params. Current op was:Setting camera orientationOp trace: Starting op: Setting camera orientationApp Version: Version 1.02 - build 31------------------------------------------------DEVICE INFO:Device: cdma_shadowManufacturer: motorolaModel: DROIDXOS Version release: 2.2------------------------------------------------STACK TRACEmobi.sense8.android.util.camera.CameraHelperExceptionat java.lang.AbstractStringBuilder.deleteCharAt0(AbstractStringBuilder.java:257)at java.lang.StringBuilder.deleteCharAt(StringBuilder.java:360)at android.hardware.Camera$Parameters.flatten(Camera.java:945)at mobi.sense8.android.util.camera.CameraHelper.setOrientation(CameraHelper.java:120)at mobi.sense8.android.iSnipeYou.iSnipeYou.initCameraNew(iSnipeYou.java:650)at mobi.sense8.android.iSnipeYou.iSnipeYou.surfaceChanged(iSnipeYou.java:630)at android.view.SurfaceView.updateWindow(SurfaceView.java:538)at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:206)at android.view.View.dispatchWindowVisibilityChanged(View.java:3891)at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)at android.view.ViewRoot.performTraversals(ViewRoot.java:753)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)Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1... 22 more</code></pre>","466319","","244296","","2010-10-16 03:43:57","2010-10-16 03:43:57","StringIndexOutOfBoundsException on Camera.Parameters.flatten() with DroidX","<android>","0","1","","",""
"3947553","1","3947580","","2010-10-16 03:27:00","0","50","<p>Just a simple question in onSharedPreferenceChanged you can do something based on if a change is made in a specific key which would look like, if (key.equals(Theme_Preference)). I want to do the same thing but instead of just a key I want it to be for a specific entryValue in that key. Hope this makes sense.</p>","435285","","","","","2010-10-16 03:40:55","Just a simple question","<android><sharedpreferences>","1","0","","",""
"3947641","1","4819572","","2010-10-16 04:10:51","34","5639","<p>In the process of porting an iPhone application over to android, I am looking for the best way to communicate within the app. Intents seem to be the way to go, is this the best (only) option? NSUserDefaults seems much lighter weight than Intents do in both performance and coding.</p><p>I should also add I have an application subclass for state, but I need to make another activity aware of an event.</p>","474005","","1402846","","2013-01-27 10:09:21","2013-01-27 10:09:21","Android equivalent to NSNotificationCenter","<android><iphone><ios><events><nsnotificationcenter>","3","0","17","",""
"3947726","1","","","2010-10-16 04:51:44","2","2639","<p>In my very simple app (based on the default Hello World app but with a button added) I try to open one of my phone's (a SE X10 Mini) preinstalled activities, like this:</p><pre><code>Intent calendarIntent = new Intent();calendarIntent.setClassName(""com.sonyericsson.calendar"",""com.sonyericsson.calendar.dayview.DayActivity"");startActivity(calendarIntent);</code></pre><p>However, it does not work, I get the following error in the log:</p><pre><code>E/AndroidRuntime( 2215): java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.sonyericsson.calendar/.dayview.DayActivity } from ProcessRecord{302cf238 2215:com.klibb.quickappointment/10079} (pid=2215, uid=10079) requires nullE/AndroidRuntime( 2215):    at android.os.Parcel.readException(Parcel.java:1246)E/AndroidRuntime( 2215):    at android.os.Parcel.readException(Parcel.java:1234)E/AndroidRuntime( 2215):    at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1157)E/AndroidRuntime( 2215):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1449)E/AndroidRuntime( 2215):    at android.app.Activity.startActivityForResult(Activity.java:2661)E/AndroidRuntime( 2215):    at android.app.Activity.startActivity(Activity.java:2705)E/AndroidRuntime( 2215):    at com.klibb.quickappointment.QuickAppointmentActivity$1.onClick(QuickAppointmentActivity.java:25)</code></pre><p>Is there anything I can do about this or is this type of code a no-no? When searching the web I see people changing the intent filters in what I assume is <em>their</em> own app, but I obviously cannot change anything in a preinstalled app.</p><p>Any ideas are welcome!</p><p>PS. What I am trying to achieve is to create a small program that directly launches the ""New Apppointment"" activity of my phone, to avoid going through two extra activities (start the default calendar, click a day, click an hour).</p>","387559","","501932","","2012-06-11 02:39:51","2012-06-11 02:39:51","Using a Intent to call an activity from another program results in Permission Denied","<android><android-intent><android-activity>","2","0","1","",""
"3947729","1","3948043","","2010-10-16 04:55:29","11","8951","<p>I would like to know whether is it possible to use my HTC wildfire (some links would be nice) for android development instead of the emulator.</p><p>I have tried to find the information by Google, but so far no useful results.</p><p>If I get more information, I'll update here.</p><p><img src=""http://i.stack.imgur.com/j3SVh.png"" alt=""alt text""></p><p>[When I used wildfire with eclipse, I got this.]</p><p>Thank you very much. </p>","16163","","16163","","2010-10-16 06:09:30","2012-01-10 12:01:48","Using HTC wildfire for android development","<android>","6","0","1","",""
"3947735","1","3948071","","2010-10-16 05:01:04","0","1385","<p>i was able to send an MMS using DK's code sample from <a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android"">here</a> and <a href=""http://stackoverflow.com/questions/3050749/sending-mms-using-httpconnection-android-2-1"">here</a>. I'd like to put an image into the MMSPart class. I think the mimetype will be ""image/jpeg"" (correct me if I'm totally worng on that), but how to I put an image into the Data parameter - do I need to read the image into a fileInputStream or bitmapfactory and set the .Data value to it?</p><p><strong>UPDATE</strong> - tried asahi's code and I think I'm getting closer, but now I'm getting an out of memory error. Here is the info from logcat..</p><p>--first this--</p><pre><code>Out of memory on a 3602732-byte allocation.</code></pre><p>--then this--</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.OutOfMemoryErrorat java.lang.AbstractStringBuilder.&lt;init&gt;(AbstractStringBuilder.java:85)at java.lang.StringBuilder.&lt;init&gt;(StringBuilder.java:69)at java.util.Arrays.toString(Arrays.java:2659)at com.market.mmsapp.HttpUtils.httpConnection(HttpUtils.java:88)at com.market.mmsapp.slimMmsActivity.UploadFile(slimMmsActivity.java:132)at com.market.mmsapp.slimMmsActivity.onCreate(slimMmsActivity.java:46)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)at android.app.ActivityThread.access$2100(ActivityThread.java:116)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4203)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Thanks for any help.</p>","477704","","367677","","2013-01-16 10:48:16","2013-01-16 10:48:16","Sending MMS using httpConnection - Add Image to PDU","<android><mms>","1","0","2","",""
"3947803","1","4060216","","2010-10-16 05:34:16","1","352","<p>I'm developing an Android application with a database. That database will have more than three tables.</p><p>Now I'm working on a class called <code>DBAdapter</code> to access the SQLite Database.</p><p>DBAdpater will have five methods for every table on database (<code>insertEntry, removeEntry, getAllEntries, getEntry</code> and <code>updateEntry</code>).</p><p>So, if I have five table, DBApadter will have more than twenty-five methods. I think is so huge.</p><p>How may DBAdapter classes should be?</p><p>Thanks.</p>","68571","","302328","","2010-10-16 07:03:46","2010-10-30 19:04:00","DBAdapter design question","<android><oop><sqlite3>","1","0","","",""
"3947837","1","","","2010-10-16 05:49:20","1","363","<pre><code>Uri uri = Uri.parse(""http://video.ted.com/talks/podcast/MichelleObama_2009P.mp4"");VideoView videoView = (VideoView) findViewById(R.id.surface);             videoView.bringToFront();    videoView.setVideoURI(uri);    mediaController = new MediaController(this);    mediaController.setAnchorView(videoView);    videoView.setMediaController(mediaController);    videoView.requestFocus();    videoView.start();</code></pre><p>Any help greatly appreciated ???Thanks...</p>","474358","","","","","2010-10-16 05:49:20","Android Video player not worke on device & emulator?","<android>","0","2","1","",""
"3947847","1","","","2010-10-16 05:55:54","1","1661","<p>Please suggest me where i can put my uninstallation password code in android application.So that at the time of uninstall the application ,The application manager should ask me to insert password to uninstall the application. </p>","477301","","","","","2011-06-26 03:16:01","How to assign uninstallation password, When we are uninstalling the application","<android>","2","0","","",""
"3947850","1","","","2010-10-16 05:57:34","2","2664","<p>I am trying to create a gradient drawable to depict a ratio of something.  As a general example, lets say you were looking at a listview containing a fleet of cars.  The background could be a fuel gauge - I don't want a smooth, wide transition.  I want a very tight transition, and I want to be able to set where that transition takes place.</p><p>Here's what I'm staring with, but I'm not getting very far.</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=""#D2E3D3""         android:endColor=""#E6E6E3""        android:angle=""0""     /&gt;    &lt;corners android:radius=""0dp"" /&gt;&lt;/shape&gt;</code></pre><p>Thanks!</p>","475275","","","","","2010-10-16 14:13:50","Android ""Advanced"" Gradients - 'thumb' positions?","<android><gradient>","1","0","1","",""
"3947997","1","4105698","","2010-10-16 07:04:57","0","964","<p>I want to build my own menu from the beginning so to be able to put more then 3 items on a raw and put a custom theme. I know it's possible because I saw in other applications, but I am new in Android and I don't know how to do this. Thanks in advance.</p>","477758","","12178","","2010-10-16 07:10:09","2010-11-05 12:07:35","Android create your own menu","<android><menu>","2","0","","",""
"3948017","1","","","2010-10-16 07:15:51","2","922","<p>Hi All One thing about Android development i would like to see some examples on are, separating responsibilities in Android, right now i have Activities and i feel its quite unpleasant, how i put all my event handling, UI construction/updating and communication with my data persistence into a single Activity. This makes my Activities extremly ""fat"", also because of the way eventlisteners are implemented, i have alot of classes inside other classes, (im used to the idea of one file => one class).I tried separating some of the communication to external webservice into Services, but now quite sure this is the best way to do it.</p><p>What patterns apply well when developing Android, and you want to separate responsibilities.Ive been working alot with Silverlight MVVM pattern, im looking for something similar that apply well to the android environment.  </p>","246234","","","","","2011-03-13 10:59:56","Android separate responsibilities examples","<android><design-patterns>","3","0","1","",""
"3948107","1","3948955","","2010-10-16 08:01:27","0","865","<p>Assume an application that has some locale-based raw resources. But the resources are not ""corrensponding"" to each other - one locale has less resources than another one. Application stores it's state when closed.</p><p>So, user can launch the application in one locale, close it (app remembers its state), then user changes phone locale, and restores the application. App tries to retrieve raw resource, but fails, because some information in that raw resource is missing due to another locale.</p><p>The question is: how to store current locale when closing the application?</p><p>I know about <code>java.util.Locale</code>, but how can I put Locale to the Bundle?Can I rely on <code>getLanguage()</code>?</p>","247904","","","","","2010-10-16 12:49:09","How to check if phone locale has changed?","<android><localization><bundle>","1","0","","",""
"3948171","1","3948218","","2010-10-16 08:37:20","0","778","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3937066/passing-a-int-value-to-another-class"">Passing a Int value to another class</a>  </p></blockquote><p>I have been trying to get ""getExtra"" to work but without success, I have a listview with 4 choices which launch a webpage within a webView class, when the user selects the option lets say option 3 I want to pass the value of 3 to the webView class so that it will load the correct webpage, at the moment I get no errors, but the app force closes when I select the option, could this be due to having to announce this in the manifest? can somebody help with where I am going wrong.</p><p>This is my intent</p><pre><code>public void onListItemClick(ListView l, View v, int position, long id) {         if (position == 0)  {         Intent intent = new Intent(this, official.class);         intent.putExtra(""weburl"", 3);         startActivity(intent);}</code></pre><p>This is the official class:</p><pre><code>public class official extends Activity {int number = getIntent().getIntExtra(""weburl"", 0);   @Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {        mWebView.goBack();        return true;    }    return super.onKeyDown(keyCode, event);}    WebView mWebView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.browser1);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);if (number == 2)    mWebView.loadUrl(""http://bcafc.livewwware.co.uk"");  if (number == 3)   mWebView.loadUrl(""http://www.bbc.co.uk"");  mWebView.setWebViewClient(new HelloWebViewClient());</code></pre>","445174","","","","","2010-10-16 08:54:37","Passing a int value from one class to another","<java><android><eclipse>","1","0","","2012-04-16 13:46:51",""
"3948252","1","","","2010-10-16 09:06:28","0","315","<p>i have tabs in a TabActivity that is being populated by a listview from a method in another Activity. when i click on the listview in the tab, i am trying to delete an item in the listview from onContextItemSelected and let the tab in the tabhost callback the same method in the Activity that populated the listview. please does anyone know how i can identify the tab where the action was performed from the Activity that has the listview method? </p><p>There seems to be know method like setTag() on the tabs in other to identify them. i tried this which works if i am in the TabActivity class but if i am in the other Activity, i want it to call fillAllData(). but am getting a warning from eclipse that the line is a dead code and its calling fillShopData() instead. Any ideas on how to go around this?.. i hope i have made myself clear. Thanks.</p><pre><code> /* code in activity class after delete is pressed in onContextItemSelected*/    if( Categories.SHOP_TAB_TAG == 1) { // tab in categories TabActivity identified as int        fillShopData(); // fill this data back in tab        }else {         fillAllData(); //  Dead Code from Activity}</code></pre>","316843","","316843","","2010-10-17 03:13:56","2011-07-26 06:06:35","How to identify Tabhost tabs ID from another activity","<android><tabactivity>","1","1","","",""
"3948319","1","3948364","","2010-10-16 09:24:42","2","725","<p>I am studying in Android programming and would like to develop an useful Android application for my project, but I still could't get any good ideas after searching on the internet.Any suggestions that an app is useful in our dailylife even achieve the society such as about public health, education, security?  </p>","477821","","","","","2013-10-01 08:40:17","Any ideas for useful(not for fun) Android applications?","<android>","2","0","0","",""
"3948425","1","","","2010-10-16 10:01:31","0","258","<p>I'm a junior iphone developer and got familiar with developing on <strong>xcode</strong> on top of Mac OS.I wanna build some <strong>Cross-Platform apps</strong> in the near future and wanna Use <strong>Ubuntu</strong> as my Operating system.I found many solutions that run only on Mac OS or need mac to build apps for iphone but this is not what i need . i need something which can keep me far from mac (for some reasons).I heard about AIR packager for iOS and that also AIR does apps for android but i'm not a flash guy (but can learn if it will do the job), so i wanna guidance from experience people like you about what is the suitable route should I take.</p><p>Thanks in advance</p>","452598","","","","","2010-10-16 11:17:01","Developign x-platform mobile apps on ubuntu","<iphone><android><symbian>","1","1","","",""
"3948431","1","3948480","","2010-10-16 10:04:30","0","676","<p>If I set text to my EditText and the text is bigger, the default behaviour is that the text is scrolled to right. Can I scroll it to left?</p><p>Example with EditText 8 characters long and text ""Sample text"":</p><p>Normal behaviour: [ple text]</p><p>What I want: [Sample t]</p>","243225","","302328","","2010-10-16 11:02:38","2010-10-16 11:02:38","Text that doesn't fit into EditText - scroll it to the left","<android><edittext>","1","0","","",""
"3948463","1","3948514","","2010-10-16 10:13:34","0","1038","<p>I've got the following main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ListView    android:id=""@+id/listview""    android:layout_width=""315px""    android:layout_height=""379px""    android:layout_x=""2px""    android:layout_y=""50px""    &gt;    &lt;/ListView&gt;    &lt;TextView    android:id=""@+id/title""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Select device:""    android:textSize=""17sp""    android:layout_x=""-2px""    android:layout_y=""1px""    &gt;    &lt;/TextView&gt;    &lt;Button    android:id=""@+id/refresh""    android:layout_width=""109px""    android:layout_height=""wrap_content""    android:text=""Refresh""    android:layout_x=""209px""    android:layout_y=""7px""    &gt;    &lt;/Button&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>The main class does nothing but drawing the layout.</p><p>I've got the following class and layout for the listitems:</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;package com.android.bluetoothp2p;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.TextView;import android.widget.Toast;public class BTListView extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));      ListView lv = getListView();      lv.setTextFilterEnabled(true);      lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,            int position, long id) {          // When clicked, show a toast with the TextView text          Toast.makeText(getApplicationContext(), ((TextView) view).getText(),              Toast.LENGTH_SHORT).show();        }      });    }</code></pre><p>Countries is just an array with a list of countries, some dummy values.</p><p>Now, how do I make the list items of the BTListView class go in the ListView (with @+id/listview) of the main class?</p><p>EDIT: Now my list works, but it isn't clickable anymore.This is the code:</p><pre><code>ListView lv = getListView();      lv.setTextFilterEnabled(true);      lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {          // When clicked, show a toast with the TextView text          Toast.makeText(getApplicationContext(), ""lolwat"", Toast.LENGTH_SHORT).show();        }      });</code></pre>","451847","","451847","","2010-10-16 11:09:10","2010-10-16 11:09:10","Displaying list items in ListView","<android><android-listview>","1","0","","",""
"3948547","1","","","2010-10-16 10:38:46","1","211","<pre><code>    Uri uri = Uri.parse(""http://64.250.238.26:1111/clips/Wailea.mp4"");    videoView = (VideoView) findViewById(R.id.surface);    videoView.bringToFront();    videoView.setVideoURI(uri);    mediaController = new MediaController(this);    mediaController.setAnchorView(videoView);    videoView.setMediaController(mediaController);    videoView.requestFocus();    videoView.start();</code></pre><p>Hello all ,   i am using this code for a video streaming of the application, In the same i am able to stream the required video but the video does not gets displayed on to my device or simulator. I believe that there would be some issues with the video API being used but am unable to check it out... It will be of great help if you share yours views on the above lines of code. </p><p>Thanks </p>","474358","","474358","","2010-10-18 07:23:34","2010-10-18 07:23:34","Android Video player not worke on device & emulator?","<android>","0","1","1","",""
"3948673","1","","","2010-10-16 11:18:56","0","1869","<p>i wish to find out the functionality for checking the default APN... i.e active APN on a handset .</p>","469853","","65500","","2013-10-11 18:08:12","2013-10-11 18:08:12","To find out the default APN programmatically?","<android><apn><access-point-name>","2","0","0","",""
"3948769","1","3948787","","2010-10-16 11:50:58","1","5812","<p>I developed a webservice in .net and I'm trying to call it in Android.To call the webservice I'm using ksoap2.</p><p>The WDSL's URL is: <a href=""http://localhost/Cidadaos_Cidade/Open.asmx?WSDL"" rel=""nofollow"">http://localhost/Cidadaos_Cidade/Open.asmx?WSDL</a></p><p>Here's the WSDL</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;wsdl:definitions xmlns:s=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://schemas.xmlsoap.org/wsdl/soap12/"" xmlns:mime=""http://schemas.xmlsoap.org/wsdl/mime/"" xmlns:tns=""http://Cidadaos_Cidade/Open/"" xmlns:s0=""http://www.outsystems.com"" xmlns:soap=""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:tm=""http://microsoft.com/wsdl/mime/textMatching/"" xmlns:http=""http://schemas.xmlsoap.org/wsdl/http/"" xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/"" targetNamespace=""http://Cidadaos_Cidade/Open/"" xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/""&gt;  &lt;wsdl:types&gt;    &lt;s:schema elementFormDefault=""qualified"" targetNamespace=""http://www.outsystems.com""&gt;      &lt;s:element name=""GetCategoriasFull""&gt;        &lt;s:complexType /&gt;      &lt;/s:element&gt;      &lt;s:element name=""GetCategoriasFullResponse""&gt;        &lt;s:complexType&gt;          &lt;s:sequence&gt;            &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""Out1"" type=""s0:ArrayOfWORCCategoriaSubcategoriaRecord"" /&gt;          &lt;/s:sequence&gt;        &lt;/s:complexType&gt;      &lt;/s:element&gt;      &lt;s:complexType name=""ArrayOfWORCCategoriaSubcategoriaRecord""&gt;        &lt;s:sequence&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""unbounded"" name=""WORCCategoriaSubcategoriaRecord"" nillable=""true"" type=""s0:WORCCategoriaSubcategoriaRecord"" /&gt;        &lt;/s:sequence&gt;      &lt;/s:complexType&gt;      &lt;s:complexType name=""WORCCategoriaSubcategoriaRecord""&gt;        &lt;s:sequence&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""ssENCategoria"" type=""s0:Categoria"" /&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""ssENSubcategoria"" type=""s0:Subcategoria"" /&gt;        &lt;/s:sequence&gt;      &lt;/s:complexType&gt;      &lt;s:complexType name=""Categoria""&gt;        &lt;s:sequence&gt;          &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""Id"" type=""s:int"" /&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""Nome"" type=""s:string"" /&gt;        &lt;/s:sequence&gt;      &lt;/s:complexType&gt;      &lt;s:complexType name=""Subcategoria""&gt;        &lt;s:sequence&gt;          &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""Id"" type=""s:int"" /&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""Nome"" type=""s:string"" /&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""Imagem"" type=""s:string"" /&gt;          &lt;s:element minOccurs=""1"" maxOccurs=""1"" name=""CategoriaId"" type=""s:int"" /&gt;        &lt;/s:sequence&gt;      &lt;/s:complexType&gt;      &lt;s:element name=""GetCategorias""&gt;        &lt;s:complexType /&gt;      &lt;/s:element&gt;      &lt;s:element name=""GetCategoriasResponse""&gt;        &lt;s:complexType&gt;          &lt;s:sequence&gt;            &lt;s:element minOccurs=""0"" maxOccurs=""1"" name=""Out1"" type=""s0:ArrayOfCategoria"" /&gt;          &lt;/s:sequence&gt;        &lt;/s:complexType&gt;      &lt;/s:element&gt;      &lt;s:complexType name=""ArrayOfCategoria""&gt;        &lt;s:sequence&gt;          &lt;s:element minOccurs=""0"" maxOccurs=""unbounded"" name=""Categoria"" nillable=""true"" type=""s0:Categoria"" /&gt;        &lt;/s:sequence&gt;      &lt;/s:complexType&gt;    &lt;/s:schema&gt;  &lt;/wsdl:types&gt;  &lt;wsdl:message name=""GetCategoriasFullSoapIn""&gt;    &lt;wsdl:part name=""parameters"" element=""s0:GetCategoriasFull"" /&gt;  &lt;/wsdl:message&gt;  &lt;wsdl:message name=""GetCategoriasFullSoapOut""&gt;    &lt;wsdl:part name=""parameters"" element=""s0:GetCategoriasFullResponse"" /&gt;  &lt;/wsdl:message&gt;  &lt;wsdl:message name=""GetCategoriasSoapIn""&gt;    &lt;wsdl:part name=""parameters"" element=""s0:GetCategorias"" /&gt;  &lt;/wsdl:message&gt;  &lt;wsdl:message name=""GetCategoriasSoapOut""&gt;    &lt;wsdl:part name=""parameters"" element=""s0:GetCategoriasResponse"" /&gt;  &lt;/wsdl:message&gt;  &lt;wsdl:portType name=""OpenSoap""&gt;    &lt;wsdl:operation name=""GetCategoriasFull""&gt;      &lt;wsdl:input message=""tns:GetCategoriasFullSoapIn"" /&gt;      &lt;wsdl:output message=""tns:GetCategoriasFullSoapOut"" /&gt;    &lt;/wsdl:operation&gt;    &lt;wsdl:operation name=""GetCategorias""&gt;      &lt;wsdl:input message=""tns:GetCategoriasSoapIn"" /&gt;      &lt;wsdl:output message=""tns:GetCategoriasSoapOut"" /&gt;    &lt;/wsdl:operation&gt;  &lt;/wsdl:portType&gt;  &lt;wsdl:binding name=""OpenSoap"" type=""tns:OpenSoap""&gt;    &lt;soap:binding transport=""http://schemas.xmlsoap.org/soap/http"" /&gt;    &lt;wsdl:operation name=""GetCategoriasFull""&gt;      &lt;soap:operation soapAction=""http://Cidadaos_Cidade/Open/GetCategoriasFull"" style=""document"" /&gt;      &lt;wsdl:input&gt;        &lt;soap:body use=""literal"" /&gt;      &lt;/wsdl:input&gt;      &lt;wsdl:output&gt;        &lt;soap:body use=""literal"" /&gt;      &lt;/wsdl:output&gt;    &lt;/wsdl:operation&gt;    &lt;wsdl:operation name=""GetCategorias""&gt;      &lt;soap:operation soapAction=""http://Cidadaos_Cidade/Open/GetCategorias"" style=""document"" /&gt;      &lt;wsdl:input&gt;        &lt;soap:body use=""literal"" /&gt;      &lt;/wsdl:input&gt;      &lt;wsdl:output&gt;        &lt;soap:body use=""literal"" /&gt;      &lt;/wsdl:output&gt;    &lt;/wsdl:operation&gt;  &lt;/wsdl:binding&gt;  &lt;wsdl:binding name=""OpenSoap12"" type=""tns:OpenSoap""&gt;    &lt;soap12:binding transport=""http://schemas.xmlsoap.org/soap/http"" /&gt;    &lt;wsdl:operation name=""GetCategoriasFull""&gt;      &lt;soap12:operation soapAction=""http://Cidadaos_Cidade/Open/GetCategoriasFull"" style=""document"" /&gt;      &lt;wsdl:input&gt;        &lt;soap12:body use=""literal"" /&gt;      &lt;/wsdl:input&gt;      &lt;wsdl:output&gt;        &lt;soap12:body use=""literal"" /&gt;      &lt;/wsdl:output&gt;    &lt;/wsdl:operation&gt;    &lt;wsdl:operation name=""GetCategorias""&gt;      &lt;soap12:operation soapAction=""http://Cidadaos_Cidade/Open/GetCategorias"" style=""document"" /&gt;      &lt;wsdl:input&gt;        &lt;soap12:body use=""literal"" /&gt;      &lt;/wsdl:input&gt;      &lt;wsdl:output&gt;        &lt;soap12:body use=""literal"" /&gt;      &lt;/wsdl:output&gt;    &lt;/wsdl:operation&gt;  &lt;/wsdl:binding&gt;  &lt;wsdl:service name=""Open""&gt;    &lt;wsdl:port name=""OpenSoap"" binding=""tns:OpenSoap""&gt;      &lt;soap:address location=""http://localhost/Cidadaos_Cidade/Open.asmx"" /&gt;    &lt;/wsdl:port&gt;    &lt;wsdl:port name=""OpenSoap12"" binding=""tns:OpenSoap12""&gt;      &lt;soap12:address location=""http://localhost/Cidadaos_Cidade/Open.asmx"" /&gt;    &lt;/wsdl:port&gt;  &lt;/wsdl:service&gt;&lt;/wsdl:definitions&gt;</code></pre><p>And here's the code to call it</p><pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        //soapEnvelope.dotNet = true; //tried with and without this flag        soapEnvelope.setOutputSoapObject(request);        AndroidHttpTransport aht = new AndroidHttpTransport(URL);        try{            //crashes in the following line with the exception:            //java.net.ConnectException: localhost/127.0.0.1:80 - Connection refused            aht.call(SOAP_ACTION, soapEnvelope);            SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;        }catch(Exception ex){            ex.printStackTrace();        }</code></pre><p>Can anyone help me? I already tried invoking it using a C#.net project and works perfectly.Sorry to put all the XML and code here but I'm desperate...</p>","320586","","","","","2012-12-13 19:22:08","Connection refused when calling SOAP Webservice using Android","<.net><android><web-services><soap><ksoap2>","3","0","","",""
"3948775","1","","","2010-10-16 11:52:51","1","1491","<p>I've tried editing android's skin layout in the emulator to be 1600x1200 and the emulator fails to bring up a window. It works fine for smaller resolutions like 1024x480 and such but not big resolutions. Although even with 1024x480, part of the emulator window is inaccessible and not visible. My question is whether anyone has made this work and if so what does their layout file or other changes look like?</p>","477882","","21234","","2011-01-14 23:40:28","2011-01-14 23:40:28","making android emulator work for 1600x1200","<android><emulator>","2","0","","",""
"3948934","1","3952629","","2010-10-16 12:41:50","59","27320","<p>I have 2 ScrollViews in my android layout. How can I synchronise their scroll positions?</p>","145598","","","","","2013-04-08 06:15:50","Synchronise ScrollView scroll positions - android","<android><scrolling>","3","0","60","",""
"3949041","1","","","2010-10-16 13:19:23","1","3986","<p>To display &amp; load images in my ListView I've created a custom ArrayAdapter, however it is really slow. Every time I scroll through the list it loads the images again.</p><p>Is there a caching mechanism which will cache my Views so I don't need to refill them every time? I know about the ViewHolder method, however this still is slow or am I just using it wrong?</p><p>My code:</p><pre><code>public class ImageArrayAdapter extends ArrayAdapter&lt;HashMap&lt;String, String&gt;&gt; {private int resourceId = 0;private LayoutInflater inflater;public ImageArrayAdapter(Context context, int resource,        List&lt;HashMap&lt;String, String&gt;&gt; objects) {    super(context, 0, objects);    this.resourceId = resource;    this.inflater = (LayoutInflater) context            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);}public static class ViewHolder {    public TextView title;    public TextView text;    public WebImageView image;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View view = convertView;    ViewHolder holder;    if (view == null) {        view = inflater.inflate(resourceId, parent, false);        holder = new ViewHolder();        holder.text = (TextView) view.findViewById(R.id.item_text);        holder.image = (WebImageView) view.findViewById(R.id.item_image);        holder.title = (TextView) view.findViewById(R.id.item_title);        view.setTag(holder);    } else {        holder = (ViewHolder) view.getTag();    }    HashMap&lt;String, String&gt; item = (HashMap&lt;String, String&gt;) getItem(position);    holder.text.setText(item.get(""text""));    holder.title.setText(item.get(""title""));    holder.image.setImageUrl(item.get(""image""));    holder.image.loadImage();    return view;}</code></pre><p>}</p>","477924","","","","","2010-10-16 13:47:21","Android ArrayAdapter & ListView slowness","<android><listview><caching><android-arrayadapter>","1","1","","",""
"3949042","1","4062302","","2010-10-16 13:19:31","2","2850","<p>I am trying to UNION two tables with the same fields to create a single cursor (through a content provider) that I am using to create my ListView. </p><pre><code>@Override public Cursor query(Uri uri, String[] projection, String selection,   String[] selectionArgs, String sortOrder) {  SQLiteQueryBuilder qb = new SQLiteQueryBuilder();  String groupBy = null;  switch (sUriMatcher.match(uri)) {  case LIST:   StringBuilder sb = new StringBuilder();   for (String s : projection)    sb.append(s).append("","");   String projectionStr = sb.toString();   projectionStr = projectionStr.substring(0,     projectionStr.length() - 1);   String[] subQueries = new String[] {     ""SELECT "" + projectionStr + "" FROM "" + Customer.TABLE_NAME,     ""SELECT "" + projectionStr + "" FROM ""       + IndividualCustomer.TABLE_NAME };   String sql = qb.buildUnionQuery(subQueries, sortOrder, null);   SQLiteDatabase db = mDatabaseHelper.getReadableDatabase();   Cursor mCursor = db.rawQuery(sql, null);   mCursor.setNotificationUri(getContext().getContentResolver(), uri);   return mCursor;</code></pre><p>Even if the two tables are empty, I get two null rows, which creates two rows in my listview. How do I get rid of this problem?</p><p>Additionally, when I delete a row from the ListView, the cursor is not getting updated in spite of setNotificationUri()</p><p>Any pointers, will be most appreciated</p>","356580","","","","","2010-10-31 08:07:19","Union of Tables with Cursor in Android","<android><sqlite><cursor><union>","1","0","","",""
"3949056","1","","","2010-10-16 13:25:19","0","1033","<p>I'm writing a JavaScript to inject a new CSS rule into pages in Android browser in order to display some text in a custom CSS font (after some replacement).</p><p>Here is how I tried to inject the CSS rule:</p><pre><code>var css = '@font-face {font-family:""font""; src:url(http://www.example.com/font.ttf);} si{font-family:""font""}';if(document.getElementsByTagName(""style"")[0]){   var style = document.getElementsByTagName(""style"")[0];} else {   var style = document.createElement(""style"");   style.type = ""text/css"";   document.getElementsByTagName(""HEAD"")[0].appendChild(style);}var sheet = style.sheet;sheet.insertRule(css, sheet.cssRules.length);</code></pre><p>Then the text is replaced using a JavaScript XPath implementation. Replacing lines are in this model:</p><pre><code>text = text.replace(/\'/g, ""&lt;si&gt;?&lt;/si&gt;"");</code></pre><p>The text replacement happens perfectly. But the injecting CSS rule part is not working. The replaced text is just shown as <code>&lt;si&gt;?&lt;/si&gt;</code> (with tags also printed).  :(</p><p>Can anyone please correct my code of injecting CSS rule or please suggest some other way to do this.</p><p>Thanks!</p><p><strong>Update: I'm emulating this in Android 2.2 which supports CSS fonts.</strong></p>","471349","","471349","","2010-10-16 15:36:03","2010-10-16 15:36:03","Injecting CSS rules into the page in Android Browser","<javascript><android><css><code-injection><custom-font>","1","0","","",""
"3949199","1","","","2010-10-16 14:07:39","0","2817","<pre><code>Thread thred = new Thread();        thred.run();    public void run() {        while (true)        {       try {                Thread.sleep(500);                Toast toast = Toast.makeText(getApplicationContext(), ""Sleep Over"", 100);            } catch (InterruptedException e) {                // TODO Auto-generated catch block                Toast toast = Toast.makeText(getApplicationContext(), ""Sleep NOT Over"", 100);            }        }</code></pre><p>This code don't work</p>","469511","","244296","","2010-10-16 14:15:51","2010-10-16 14:34:39","How to Send the Current Thread to Sleep","<android>","1","3","","",""
"3949206","1","3949626","","2010-10-16 14:09:58","2","2664","<p>I have a weird problem where I cannot run aapt from an sbt command as well as from the shell.</p><p>I run this command:</p><p><strong>sbt update package-debug</strong></p><p>And everything hums along until I get this error:</p><pre><code>java.io.IOException: Cannot run program ""/home/egervari/Programs/android-sdk-linux_x86/platforms/android-7/tools/aapt"": java.io.IOException: error=2, No such file or directory</code></pre><p>So I try running it manually, just for the heck of it:</p><pre><code>egervari@ken:~/Programs/android-sdk-linux_x86/platforms/android-7/tools$ ./aaptbash: ./aapt: No such file or directory</code></pre><p>This is pretty weird because it's right there:</p><pre><code>egervari@ken:~/Programs/android-sdk-linux_x86/platforms/android-7/tools$ ls -latotal 4660drwxr-xr-x 3 egervari egervari    4096 2010-10-16 09:13 .drwxr-xr-x 8 egervari egervari    4096 2010-10-16 09:13 ..-rwxrwxrwx 1 egervari egervari 3472673 2010-10-16 09:13 aapt-rwxrwxrwx 1 egervari egervari 1050328 2010-10-16 09:13 aidl-rwxrwxrwx 1 egervari egervari  213690 2010-10-16 09:13 dexdump-rwxrwxrwx 1 egervari egervari    2497 2010-10-16 09:13 dxdrwxr-xr-x 2 egervari egervari    4096 2010-10-16 09:13 lib-rw-r--r-- 1 egervari egervari   10800 2010-10-16 09:13 NOTICE.txtegervari@ken:~/Programs/android-sdk-linux_x86/platforms/android-7/tools$</code></pre><p>Help? :/</p>","331439","","","","","2014-01-20 12:49:56","Programs running aapt in android sdk from shell and from sbt","<android><scala><aapt>","2","2","1","",""
"3949261","1","3949385","","2010-10-16 14:24:36","0","3158","<p>I've turned on USB debugging.  I have the latest HTC Sync and android SDK components.  I'm using Eclipse 3.5 on windows XP.  I'm running Android 2.2, and am asking for 2.1 as the minimum in the debugger.  I work in Eclipse/Java just about every day, and have for several years.  I'm even writing an Eclipse plugin at work as I type this.... neither Eclipse nor Java are new to me by quite a stretch.</p><p>When I start a debug session for the ""Skeleton App"" sample project, I can see my Evo, and the activity launches (with any freshly saved changes), should I select it.</p><p><em>BUT</em>: my breakpoints are ignored<strike>, and <em>logCat</em> doesn't see my app's output</strike>(see comments below).</p><p>*<em>W</em>*hat a *<em>T</em>*errible *<em>F</em>*ailure (As the api so artfully puts it)!</p><p>(oh look... a formatting bug.  Looks like bold text wants <strong>white space</strong> to function properly 10/15/2010)</p><p>I have tried different android connection types (charge only, disk drive, HTC Sync, and USB tethering) to no avail.  I've tried Eclipse 3.6 for a bit before yielding to the inevitable and reinstalling 3.5.  I monkeyed with the emulator for a while but ran into a different set of issues (I had to reboot the emulator every time I wanted to make a change... Eclipse's auto-build/hot-swap has me spoiled).</p><p>Is there something I can add to (or remove from) the <code>AndroidManifest.XML</code> to deal with this?  A magical incantation perhaps?  Must I pray towards San Jose three times a day on a rug woven from kernel gurus' vast and scruffy beards?  Is my Evo not Kosher?  Must I be ""sky clad"" while debugging?  Shall I teach my laptop to genuflect?</p>","477771","","477771","","2010-10-21 16:27:36","2010-10-29 15:18:18","Android Debugging with Eclipse on my HTC Evo: Augh!","<java><android><eclipse><debugging>","3","2","","",""
"3949315","1","3949345","","2010-10-16 14:39:47","0","125","<p>Alright, I have a simple boolean at the top of this class, standing.  In the thread, I have the following code:</p><pre><code> @Overridepublic boolean onTouchEvent(MotionEvent event) {    if(event.getAction() == MotionEvent.ACTION_DOWN) {        if(standing == true){            player.handleActionDown((int)event.getX(), (int)event.getY());            standing = false;}        if(standing == false){            playerC.handleActionDown((int)event.getX(), (int)event.getY());            standing = true;}        //check if in the lower part of the screen we exit        if(event.getY() &gt; getHeight() -50 &amp;&amp; event.getX() &gt; getWidth() -50) {            thread.setRunning(false);            ((Activity)getContext()).finish();        }else {            Log.d(TAG, ""Coords: x="" + event.getX() + "",y="" + event.getY());        }    }    if(event.getAction() == MotionEvent.ACTION_UP){        //touch was released    }    return true;}@Overrideprotected void onDraw(Canvas canvas) {    canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.bg1),0, 0, null);    //canvas.drawColor(Color.BLACK)  if(standing == true){        player.draw(canvas);   }     if(standing == false){        playerC.draw(canvas);   }}</code></pre><p>Why won't it switch the dawing back to standing, that's all I want.  Click it once and it goes to crouching, click it again and it stands.  I know this is stupid simple, but I can't get it right for some reason.  Thanks in advance.</p>","436204","","244296","","2010-10-16 15:07:30","2010-10-16 15:08:52","Android - Brain Cramping","<android>","1","2","","",""
"3949348","1","3949412","","2010-10-16 14:46:49","0","162","<p>How to set Text for TextView so that it will appear from Top left through Code in Android not by XML.</p><p>Thanks in Advance?</p>","429501","","","","","2010-10-16 15:06:15","How to set Text for TextView so that it will appear from Top left through Code in Android","<android>","1","0","","",""
"3949437","1","3949616","","2010-10-16 15:12:16","0","532","<p>where do the tables created using SQlite database will be stored in Android?how to access them and see the data contained in them.</p>","429501","","","","","2010-10-16 15:59:16","where do the tables created using SQlite database will be stored in Android?","<android>","1","0","","",""
"3949469","1","3949620","","2010-10-16 15:19:43","0","360","<p>I'm developing an Android application.</p><p>I'm wondering if it really necessary to create objects that represent tables from a SQLite database.</p><p>I'm implementing insert method and instead using a specific object for a table, maybe I can use a HashMap. This Hashmap will be an argument for that method.</p><pre><code>public boolean insertEntry(HashMap entry) {   ...   String name = entry.get(Constants.COLUMN_NAME);   ...}</code></pre><p>What do you think?</p>","68571","","","","","2010-10-16 16:00:39","Create objects to represent database's tables","<android><sqlite3>","1","0","","",""
"3949492","1","","","2010-10-16 15:27:38","0","753","<p>If I have a list of numbers how can I send an sms message to them using Android SDK.</p><p>Thanks.</p>","143923","","","","","2011-06-20 05:18:12","How to send an SMS to several users in Android","<android>","2","0","","",""
"3949514","1","","","2010-10-16 15:34:06","2","488","<blockquote>  <p>10-15 14:43:43.020: ERROR/dalvikvm-heap(299): 32768-byte external allocation too large for this process. 10-15 14:43:43.020: ERROR/GraphicsJNI(299): VM won't let us allocate 32768 bytes 10-15 14:43:43.260: ERROR/AndroidRuntime(299): FATAL EXCEPTION: main 10-15 14:43:43.260: ERROR/AndroidRuntime(299): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 10-15 14:43:43.260: ERROR/AndroidRuntime(299): at android.graphics.Bitmap.nativeCreate(Native Method) 10-15 14:43:43.260: ERROR/AndroidRuntime(299): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)</p></blockquote><p>This is the error I am getting when I use overlaying on google map ! I have checked native heap usage using <a href=""http://stackoverflow.com/questions/3238388/android-out-of-memory-exception-in-gallery/3238945#3238945"">this code here</a>. </p><p>When I get the error I see a native heap usage of almost 50%  </p><blockquote>  <p>10-16 13:40:01.658: INFO/System.out(1661): alloc: 7.0171661376953125 : available: 7.10546875 </p></blockquote><p>Can anyone please help me out on this issue ? Thanks.</p><p>-ahsan</p>","342925","","342925","","2010-10-16 15:41:02","2010-11-01 13:56:57","how to reduce native heap usage in google map for android?","<android><google-maps-api-3><out-of-memory>","0","0","1","",""
"3949572","1","3949613","","2010-10-16 15:51:19","0","8869","<p>I'm developing an Android application.</p><p>I want to set size to a char array like this:</p><pre><code>public char[5] language;</code></pre><p>But it doesn't work. I have to delete number five to make it work.<br/><br/>I want to limit to five characters to language variable. How can I do that?</p><p>Thanks.</p>","68571","","68571","","2010-10-16 16:06:12","2010-10-16 17:46:21","Set size on char array in Java","<java><android><invariants><array-initialize>","5","3","","",""
"3949591","1","","","2010-10-16 15:54:38","3","4623","<p>I design a HTML5 canvas effects homepage on my site <a href=""http://catfan.me"" rel=""nofollow"">http://catfan.me</a></p><p>You can click the sky and add a cloud, and It`s able to show the fps.</p><p>It runs perfect on HTML5 supported browser, such as Chrome, FireFox, Safari, IE9..</p><p>But i do not know if it run on iPhone, iPad or Android mobile phone. I didn`t have this devices.</p><p>Can anyone to help me to test? Or is there any way to test the HTML5 effects running on iPad? Such as iOS or Android Emulator?</p>","478003","","","","","2011-06-03 21:34:23","Can my HTML5 canvas effects run on iPhone or Android?","<iphone><android><html5><canvas>","5","2","","",""
"3949604","1","3949940","","2010-10-16 15:57:28","1","239","<p>guys.I need an advice. What is the best way to implement in android a list of such UI elements (see the <a href=""http://maklab.users.photofile.ru/photo/maklab/115846343/xlarge/140337561.gif"" rel=""nofollow"">ref</a>)A list contains a lot of such elements (about 30-40). I'm using now relative layout and 4 text fields and I think it isn't a good way... I think it's too heavy (full list will contain: 30 relative layouts and 30*5 = 150 text fields).</p><p>Any suggestions how to make it more lightweight?</p><p>Thanks guys )</p>","477997","","","","","2010-10-16 17:25:14","best way to implement a list of special UI elements?","<android><gui>","1","0","0","2014-02-19 17:16:57",""
"3949606","1","3949694","","2010-10-16 15:57:49","7","4914","<p>I've been wondering if canvas has a limit boundary.</p><p>I mean if I use functions such as<code>drawline(), drawbitmap(), drawcircle(),</code>does android really draw something on the canvas and waste some CPU cycles??</p><p>because after all the drawing functions, the actual picture print on the screen is decidedby the screen size. And if I draw on something that is out of screen size, it doesn't show up.</p><p>I want to do some small detail on my canvas by calling lots of drawing functions and make my surface ""bling bling"". If it is out of bound I don't want to use them, if they make my drawing slow down. </p><p>I am working on a little game by the structure of surfaceview, Thanks for any advice.</p><p>for Example:</p><p>I have a robot walking from a &lt;-> b OUTSIDE the screen.</p><p>it takes 20 drawing functions to draw a robot walking picture on the canvas.If I scroll the screen, then I can see the robot.</p><p>So if the drawing function outside the screen really takes as much time as draw on screen.I have to detect that only if the robot's position can be seen by the user, then I draw.otherwise, i don't.</p><p>if the drawing function doesn't waste much CPU cycles, then I can just draw everytime even if the current screen cannot see the robot.</p>","408278","","408278","","2010-10-17 05:55:08","2010-10-17 05:55:08","The efficiency about android canvas drawing","<android><canvas><surfaceview>","2","0","8","",""
"3949609","1","","","2010-10-16 15:58:28","5","1810","<p>Can someone explain to me why the Android ""Catch"" handler will not initialize an Exception object? When an error occurs and my code is trying to initialize an Exception object it is ALWAYS NULL.</p><p>The above doesn't make sense to me because the exception should always initialize the Exception object period. It should never be null if an error occurs.</p><p>I am fairly new to the Eclipse Android IDE/SDK and I am sure I don't have everything setup 100%. However, this type of functionality would seem to me that it should work all the time, not after being setup.</p><p>Can someone please help me!</p>","478005","","","","","2011-06-11 07:08:54","Exception is NULL always","<android><handling>","1","7","","",""
"3949800","1","","","2010-10-16 16:49:40","1","313","<p>I'm developing an Android application that access many tables from a SQLite database.</p><p>I need an example to see how implement a database framework to access multiples tables. I've been looking for and I only find examples with one table.</p><p><strong>UPDATE</strong>:<br/></p><p>With one table I found only one class <code>DBAdpater</code> with object <code>SQLiteDatabase</code> and a <code>class myDbHelper extends SQLiteOpenHelper</code>.</p><p>With many tables I think I need one <code>DBAdapter</code> for each table. So, I think I need to share SQLiteDatabase object between each DBAdapter, isn't it? To open database, close, execute SQL stament...</p><p>I think I need one DBAdapter because I don't want a enormous DBAdapter class. </p><p>Any suggestions?</p><p>Thanks.</p>","68571","","68571","","2010-10-16 18:07:40","2010-10-16 18:07:40","Complex example about accessing multiples SQLite tables from Android","<android><sqlite><frameworks>","0","2","","",""
"3949868","1","","","2010-10-16 17:07:48","0","3016","<p>I have a context menu. The function v.getId() is supposed to return the id, but does not - instead it returns 'false'.</p><p>Here is my code:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {  super.onCreateContextMenu(menu, v, menuInfo);      menu.setHeaderTitle(""Options"");      menu.add(0, v.getId(), 0, v.getId());      menu.add(0, v.getId(), 0, ""Save Notification"");  }  @Override  public boolean onContextItemSelected(MenuItem item) {      if(item.getTitle()==""Save Ringtone""){function1(item.getItemId());}      else if(item.getTitle()==""Save Notification""){function2(item.getItemId());}      else {return false;}  return true;  }  public void function1(int id){      //Stuff} public void function2(int id){    if (id == R.raw.tedcake){        Toast.makeText(this, id, Toast.LENGTH_SHORT).show();    }</code></pre><p>The buttons were registered for a context menu elsewhere in the code.</p><p>Why is it returning false?</p><p>Thanks.</p>","420617","","1288","","2011-08-09 20:23:01","2012-10-31 11:18:56","Android - v.getId() in Context Menu returning 'false'","<android><contextmenu>","5","2","1","",""
"3949917","1","3951855","","2010-10-16 17:20:18","2","2862","<p>I'd like to keep the screen on whenever one of my Activities are running and the phone is plugged in to a power source.  I know that Wakelocks are tricky, so I'm looking for an example or some documentation on how to accomplish this specific goal.  </p>","23524","","","","","2010-10-17 03:08:16","How to keep android device from sleeping while plugged in","<android><power-management><wakelock>","2","0","","",""
"3949960","1","","","2010-10-16 17:29:04","2","358","<p>I have an Android app and some company is interested in using part of it and rebranding it for its customers. One of the options would involve licensing the code to them for use in this specific case.</p><p>Would you recommend doing that as a good option?What is the cost of licensing code in comparison to the cost of the original development.Should the license be for any use of the code, for using the codebase/year?</p><p>Any recommendation would be welcome.</p>","478048","","","","","2010-10-16 18:11:53","License source code of app","<iphone><android><licensing><smartphone><selling-software>","1","2","","",""
"3949980","1","3950022","","2010-10-16 17:33:05","18","95809","<blockquote>  <p><strong>Possible Duplicates:</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><br>  <a href=""http://stackoverflow.com/questions/3316801/which-programming-languages-can-be-used-to-develop-in-android"">Which programming languages can be used to develop in Android?</a>  </p></blockquote><p>What programming languages can one use to develop Android applications?</p><p>Also are there plans in the future to expand the amount of programming languages that Android will support?</p><p>UPDATE: There are really good answers over here </p><p><a href=""http://stackoverflow.com/questions/3316801/which-programming-languages-can-be-used-to-develop-in-android-closed"">http://stackoverflow.com/questions/3316801/which-programming-languages-can-be-used-to-develop-in-android-closed</a></p>","","pylonicon","","pylonicon","2010-10-17 00:09:32","2010-10-17 00:09:32","What programming languages can one use to develop Android applications?","<android><programming-languages><mobile>","1","1","3","2010-10-17 00:11:26",""
"3950015","1","3950045","","2010-10-16 17:40:10","2","2521","<p>Is this possible? I am trying to open a SQLite database cursor in one activity, and pass it to another activity.</p>","382252","","","","","2011-12-10 11:21:01","Passing a cursor to an activity?","<android><cursor>","3","0","2","",""
"3950025","1","3950067","","2010-10-16 17:41:43","2","4937","<p>I've been stuck on a little bug trying to implement a custom listview in Java for an Android application.</p><p>I'm trying to list a bunch words (typically, 100 &lt; n &lt; 500) and highlight a subset of those rows by changing the text color. The both sets of words (global and subset) are listed in a collection (currently an ArrayList)</p><p>The problem is that some words are missing. It seems random. I think it might be more likely that the words intended for 'highlighting' are missing. (I.e.I've tried a couple different variations of code, but here is what I've currently got:</p><pre><code> public class ResultsAdapter&lt;T&gt; extends ArrayAdapter&lt;String&gt; { private ArrayList&lt;String&gt; mHighlightSet; private ArrayList&lt;String&gt; mGlobalSet; private Context mContext; public ResultsAdapter(   Context context,    int textViewResourceId,   ArrayList&lt;String&gt; globalSet,    ArrayList&lt;String&gt; highlightSet) {  super(context, textViewResourceId, globalSet);  mContext = context;  mGlobalSet = globalSet;  mHighlightSet = highlightSet; } @Override public View getView(int position, View convertView, ViewGroup parent) {  // return super.getView(position, convertView, parent);  final String text = mGlobalSet.get(position);  TextView view = new TextView(mContext);  view.setText(text);  if(mHighlightSet.contains(text))   view.setTextColor(Color.RED);  else   view.setTextColor(Color.WHITE);  return view; }</code></pre><p>This custom adapter gets instantiated and assigned by the following code:</p><pre><code>  if (mSummaryList != null &amp; mAllWords != null &amp; foundWords != null) {   ArrayList&lt;String&gt; globalSet = new ArrayList&lt;String&gt;(mAllWords.keySet()); // mAllWords is a TreeMap   ArrayList&lt;String&gt; subset = hud.getFoundWords();   mResultsAdapter = new ResultsAdapter&lt;String&gt;(this, R.layout.simplerow, globalSet, subset);   mSummaryList.setAdapter(mResultsAdapter);   mSummaryList.setOnItemClickListener(onWordListItemClickListener);   }</code></pre><p>It appears that there's some disconnect between the data variables, and what shows up on the screen. I'm lost, please help.</p><p>Thanks in advance!</p>","478044","","234039","","2010-10-16 17:44:17","2010-10-19 18:23:14","Custom ListView Adapter [Android]","<android><listview>","2","0","1","",""
"3950026","1","4007889","","2010-10-16 17:41:44","2","532","<p>I tried to write some AR app. For now I wrote some code that display camera prewiew and gets data from sensors on the device (acceleromentr, compas, gps reciver).</p><p>When I run the code in separate app (like camera preview as one app and application that gets gps data as a second) everything is OK. But when I try to integrate this two modules - GPS stop working; it looks like the listener doesn't get any data. Did You had some similar problems?</p><p>The code looks like this:</p><pre><code>public void onResume(){    super.onResume();    mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);    mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,                                            1000, 0.0f,                                             mLocationListener);}public void onPause(){    super.onPause();    mLocationManager.removeUpdates(mLocationListener);}private LocationListener mLocationListener = new LocationListener(){    public void onLocationChanged(Location pLocation) {        double lLatitude = pLocation.getLatitude();        double lLongitude = pLocation.getLongitude();        mGpsTextView.setText (""Longitude"" + Double.toString(lLongitude) + "" Latitude: "" + Double.toString(lLatitude));    }    public void onProviderDisabled(String pProvider) {        mGpsTextView.setText (""Provider disabled"");    }    public void onProviderEnabled(String pProvider) {        mGpsTextView.setText (""Provider enabled"");    }    public void onStatusChanged(String pProvider, int pStatus, Bundle pExtras) {        switch (pStatus)        {         case LocationProvider.OUT_OF_SERVICE:             mGpsTextView.setText(""GPS out of service"");             break;         case LocationProvider.TEMPORARILY_UNAVAILABLE:             mGpsTextView.setText(""GPS temorarily unawalible"");             break;         case LocationProvider.AVAILABLE:             mGpsTextView.setText(""GPS avalible"");             break;         default:             mGpsTextView.setText(""EEE"");        }   }};</code></pre><p>I tried to register/unregister listener in onCreate/onPause but the behaviour is the same.</p><p>The cameraPreview code looks like:</p><p>private SurfaceHolder.Callback mSurfaceHolderCallback = new SurfaceHolder.Callback()    {        private Camera mCamera;</p><pre><code>    public void surfaceCreated (SurfaceHolder pSurfaceHolder)    {        stopAndReleaseCamera();        mCamera = Camera.open();        try {            mCamera.setPreviewDisplay(pSurfaceHolder);        }        catch (Exception imLazy) {            stopAndReleaseCamera();            imLazy.printStackTrace();        }    }    public void surfaceChanged (SurfaceHolder pSurfaceHolder, int pFormat, int pWidth, int pHeight)    {        Parameters lCameraParams = mCamera.getParameters();        lCameraParams.setPreviewSize (pWidth, pHeight);        mCamera.setParameters (lCameraParams);        mCamera.startPreview();    }    public void surfaceDestroyed (SurfaceHolder pSurfaceHolder)    {        stopAndReleaseCamera();    }    private void stopAndReleaseCamera()    {        if (mCamera != null)        {            try            {                mCamera.stopPreview();                mCamera.release();            }            catch (Exception imLazy)            {                //ignore                imLazy.printStackTrace();            }            mCamera = null;        }    }};</code></pre><p>And this is registered in onCreate:</p><pre><code>    SurfaceView lSurfaceView = (SurfaceView)findViewById(R.id.CameraSurface);    lSurfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    lSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);    lSurfaceView.getHolder().addCallback (mSurfaceHolderCallback);</code></pre><p>R.id.CameraSurface is defined in layout.xml as</p><pre><code>SurfaceView android:id=""@+id/CameraSurface""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""</code></pre><p>Any ideas what is wrong?</p><p>The code was tested on three different phones</p>","210807","","","","","2011-05-02 16:12:35","Problem with getting GPS data when using CameraPreview","<android>","2","1","","",""
"3950104","1","","","2010-10-16 18:00:30","2","1480","<p>I'm having an annoying issue with Android development. I have a webserver (Tomcat) running on my Macbook which is connected to the local network via wifi. I have my Sprint EVO connected to the same network using wifi. The only way I can connect to the Tomcat instance is by raw IP address. If I use the Macbook name with or without the "".local"" domain suffix it does not recognize the host name. The emulator behaves the same way. My iPhone can resolve the host name as can the iPhone simulator. So, I'm thinking either this is a bug in the Android platform or I've missed/accidentally tweak some hidden config somewhere in both the emulator and the device? Any idea?</p>","10631","","","","","2010-10-16 18:11:11","Android can't see devices on "".local"" domain","<android><network-programming>","1","0","2","",""
"3950160","1","3950226","","2010-10-16 18:11:08","1","458","<p>I have two activities. One loads all rows from a database, and the other saves to the database. When I have the second save in onStop and the first repull the data in onResume, they do it out of order (the first resumes and then the second saves). I managed to fix this by putting the saving data in onPause, but why was this happening? Was this the cleanest way to do it?</p>","210920","","","","","2010-10-16 18:33:43","Interactivity Coordination: onStop and onResume","<android><activity><lifecycle>","1","0","1","",""
"3950211","1","4518728","","2010-10-16 18:28:57","4","2700","<p>I have a gridview and i want its items to act different if user performs click or long click that is why i am using OnItemClickListener and OnItemLongClickListener but when long click happens both listeners react.I want to perform only OnItemLongClickListener.</p>","458678","","","","","2010-12-23 12:23:46","How to prevent OnItemClickListener work when long click performed?","<android><gridview><listview><onlongclicklistener>","3","0","","",""
"3950224","1","3950244","","2010-10-16 18:32:59","1","1999","<p>the Android phones in Slovakia have a custom locale - en_SK and cs_SK. Language is either Czech or English, location is Slovakia. Now I would like to have strings that target these locales. The default approach is to create a folder ""values-CountryCode"", for Czech Republic it's values-cs. </p><p>But I get a build error if I add a folder name values-en_SK or values-cs_SK:""invalid resource directory name""</p><p>What to do?</p>","420047","","","","","2014-02-16 10:16:55","Custom locale in Android","<android><localization><locale>","2","0","0","",""
"3950276","1","","","2010-10-16 18:47:00","1","175","<p>I have a .jar in my Android project which has many references and uses of the java.awt.* classes and other classes not available on Android. How can I provide my own implementations of these classes so that I can embed the unmodified .jar file (the only modification is being ran through dx) in my Android application and it will use my own class implementations?</p>","764272","","764272","","2010-10-16 18:56:35","2012-02-28 12:40:45","Android: provide own implementations of java.* classes for jar","<android><jar>","1","0","","",""
"3950279","1","3950307","","2010-10-16 18:47:51","2","4244","<p><br>I have ""java.lang.IllegalStateException: database not open"" - when I change the screen orientation when upgrading database is in progress.<br>When version of my database changes, onCreate() of my SQLiteOpenHelper subclass is called. In this method I'm simply dropping previous tables, creating new ones and populating them with data. Database is quite big and data is read from file, so I'm populating the data in AsyncTask subclass.</p><p>So, here are the most important parts of my code. <br><b>Activity:</b></p><pre> <code> public class MyActivity extends Activity {  ...  private MyOpenHelper dbHelper;  private SQLiteDatabase db;  public void onCreate(Bundle savedInstanceState) {  dbHelper = new MyOpenHelper(this);  db = dbHelper.getWritableDatabase();  ...   }  protected void onDestroy() {    if (null != db && db.isOpen() && !db.isDbLockedByOtherThreads()){      db.close();  ...  } ... } </code></pre><p><b>MyOpenHelper:</b></p><pre><code>public class MyOpenHelper extends SQLiteOpenHelper  ...  public void onCreate(SQLiteDatabase db) {    db.beginTransaction();    try {     //drop...      //create...      db.setTransactionSuccessful();    } finally {       db.endTransaction();    }            /* populate database with data */           SQLiteDatabaseInitializer dbInit = new SQLiteDatabaseInitializer(mContext, db, mDialogHost, ""db.txt"");   dbInit.execute();   }</code></pre><p>I know that the problem is that when I change the screen orientation, db instance gets closed - in Activity.onDestroy(). But I have to close it eventually. What is the best approach here? Anyone experienced the same problem?</p>","229697","","","","","2010-10-16 18:53:12","""IllegalStateException: database not open"" - on screen orientation change","<android><sqlite>","1","0","1","",""
"3950299","1","3951853","","2010-10-16 18:51:50","3","408","<p>guys, I wonder if you put images for each density type (low/medium/high) and there are quite a few of them, won't it increase the size of application footprint on internal memory?</p><p>I would hope that android will put only needed resource file from apk to the actual application folder. Can somebody confirm that?</p>","473725","","","","","2010-10-17 03:06:23","how drawables resources stored on device","<android><resources><drawable>","1","0","1","",""
"3950353","1","4193693","","2010-10-16 19:07:30","4","2485","<p>Hey, I have a problem with andriod programing when I try to record and then play the file that was just recored. I can both record and play the sound but the quality stinks. Its not just bad is really hard to listen to and sound abit like its a computer generated voice... I use the andriod SDK-emulator. The code that sets up the recording looks like this;</p><pre><code>MediaRecorder recorder = new MediaRecorder();recorder.setAudioSource(MediaRecorder.AudioSource.MIC);recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);recorder.setOutputFile(path);recorder.prepare();recorder.start();</code></pre><p>And the code playing the file later looks like this;</p><pre><code>MediaPlayer mp = new MediaPlayer();mp.reset();mp.setDataSource(path);mp.prepare();mp.start();</code></pre><p>I dont know what part that makes the audiofile sound really bad... or if its just the emulator that makes it bad and that it would work on a real phone. I would love some help with this.</p><p>/Nick</p>","478105","","","","","2012-06-06 04:58:13","Bad sound quality when recording/playing sounds - Android SDK","<android><android-emulator><audiorecord>","3","0","","",""
"3950366","1","3950549","","2010-10-16 19:13:40","2","289","<p>i am trying to process an MMS message with multiple attachments. For that I'm creating a HashMap as following (this is not the complete implementation but only the relevant part):</p><pre><code>    HashMap&lt;String, Integer&gt; hashAttachments = new HashMap&lt;String, Integer&gt;();    int c = 0;    if(atts != null) {        for(Attachment a : atts){            if(a.mimeType.startsWith(""image/"")){                            &lt;some code here&gt;                hashAttachments.put(a.fileName, indx);            }else if(a.mimeType.startsWith(""text/"")){                &lt;some code here&gt;                hashAttachments.put(""text_""+String.valueOf(c++)+"".txt"",indx);            }                    &lt;some more mime types&gt;        } /* for */</code></pre><p>the message I am trying to process has 4 attachments - two images and two texts, so I expect the hash map to contain 4 entries when the for loop is over. </p><p>What I actually see is that at some point one of the entries of the map is overwritten and I end up with 3 entries instead of 4. What could be a reason? (keys are unique, not null and not empty in all cases)</p><p>Thanks in advance</p><p><b>EDIT</B>: key set after each iteration (looks perfect, not what I saw inspecting keys in debugger):</p><pre><code>10-16 21:50:01.207: INFO/System.out(27593): ~~~~~~~10-16 21:50:01.207: INFO/System.out(27593): abc.jpg10-16 21:50:01.207: INFO/System.out(27593): ~~~~~~~10-16 21:50:01.217: INFO/System.out(27593): abc.jpg10-16 21:50:01.217: INFO/System.out(27593): 2010-06-18_12.47.50.jpg10-16 21:50:01.227: INFO/System.out(27593): ~~~~~~~10-16 21:50:01.227: INFO/System.out(27593): abc.jpg10-16 21:50:01.227: INFO/System.out(27593): 2010-06-18_12.47.50.jpg10-16 21:50:01.227: INFO/System.out(27593): text_0.txt10-16 21:50:01.237: INFO/System.out(27593): ~~~~~~~10-16 21:50:01.237: INFO/System.out(27593): abc.jpg10-16 21:50:01.237: INFO/System.out(27593): text_1.txt10-16 21:50:01.237: INFO/System.out(27593): 2010-06-18_12.47.50.jpg10-16 21:50:01.237: INFO/System.out(27593): text_0.txt</code></pre>","367677","","367677","","2010-10-16 19:56:30","2010-10-16 20:02:30","HashMap - correct usage?","<java><android><hashmap>","1","9","","",""
"3950386","1","","","2010-10-16 19:20:16","0","472","<p>I have 24 .png images and a ImageView. On user touch I change the ImageView to be one of the 24 images. I'm currently doing <code>setImageResource(R.drawable.hour_1);</code>, but there is a slight delay after I touch the screen and the ImageView actually changes. I figure the delay is the resource being loaded, but I can't find a better way to do this.</p>","471060","","","","","2010-10-16 19:48:18","Using many images in Android project","<android><imageview>","1","0","","",""
"3950478","1","","","2010-10-16 19:44:59","0","108","<p>I'm working in a group right now, writing an app that needs to be able to reference a file which is not written at runtime. Essentially, the file stores data which the app (a game) uses at certain points.</p><p>I don't have any trouble saving files at runtime and then referencing those files, but for some reason, I'm having trouble referencing files using a filepath.</p><p>The code which is giving me problems is this:</p><pre><code>    File abilityFile = new File(""/assets/xml/abilities.xml"");DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();DocumentBuilder builder = builderFactory.newDocumentBuilder();Document doc = builder.parse(abilityFile);</code></pre><p>On the last line in that block, I get an IOError. I'm assuming that either the way that I'm storing the file or the way I'm referencing it doesn't work on Android phones, but I don't know.</p><p>If I'm right, is there a way to store a file (which isn't written and saved at runtime) so it can be accessed by the app? How would I do that?</p><p>If I'm wrong, what am I doing wrong? It's probably something simple that I'm missing, but I've tried looking for solutions, and wasn't able to find much about this specific problem. I found a lot of information on writing files, or referencing files stored externally, but not on referencing files which are meant to be stored in a directory with the app.</p><p>Thank you.</p>","478130","","","","","2010-10-16 21:21:55","Having Trouble Referencing Files in Android","<java><android><file>","1","0","1","",""
"3950481","1","","","2010-10-16 19:45:37","4","5602","<p>I was trying to create a countdown timer from <a href=""http://helloandroidworld.com/2010/02/how-to-create-a-simple-android-countdown-timer/"" rel=""nofollow"">http://helloandroidworld.com/2010/02/how-to-create-a-simple-android-countdown-timer/</a> but I cannot get it to work with the format I want 00:00:00 as described in the article. The timer will start and allow me to pause it and it will run for two minutes but you cannot see it running. If you pause it you can see how much time is remaining but you I cannot get it to work. Without the formatting it works fine and counts down. Does anyone have this working or know of how to fix it? I have been searching around and cannot find anything covering a countdown timer like this with formatting. Any help would be appreciated.</p><pre><code>  TextView timeDisplay;  MyCount counter;  int state = 0;  int length = 120000;  long startTime = 0;  long currentTime = 0;  long timeElapsed = 0;  long timeRemaining = 0;  long prevTimeRemaining = 0;  Button control;    public String formatTime(long millis) {          String output = ""00:00:00"";          long seconds = millis / 1000;          long minutes = seconds / 60;          long hours = minutes / 60;          seconds = seconds % 60;          minutes = minutes % 60;          hours = hours % 60;          String secondsD = String.valueOf(seconds);          String minutesD = String.valueOf(minutes);          String hoursD = String.valueOf(hours);           if (seconds &lt; 10)            secondsD = ""0"" + seconds;          if (minutes &lt; 10)            minutesD = ""0"" + minutes;          if (hours &lt; 10)            hoursD = ""0"" + hours;          output = hoursD + "" : "" + minutesD + "" : "" + secondsD;          return output;        }  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.countdown);    timeDisplay = (TextView) findViewById(R.id.timer);    control = (Button) findViewById(R.id.control);    counter = new MyCount (length, 1000);  }  public void control(View view) {    switch (state) {    case 0:      startTime = System.currentTimeMillis();      counter.start();      control.setText(R.string.pause);      state = 1;      break;    case 1:      // pause      currentTime = System.currentTimeMillis();      timeElapsed = currentTime - startTime;      if (prevTimeRemaining == 0)        timeRemaining = length - timeElapsed;      else        timeRemaining = prevTimeRemaining - timeElapsed;      counter.cancel();      timeDisplay.setText("""" + formatTime(timeRemaining));      control.setText(R.string.resume);      prevTimeRemaining = timeRemaining;      // resume      counter = new MyCount(timeRemaining, 1000);      state = 0;      break;    case 2:      prevTimeRemaining = 0;      counter = new MyCount(length, 1000);      control.setText(R.string.start);      timeDisplay.setText(R.string.timer);      state = 0;    }  }  public class MyCount extends CountDownTimer {    public MyCount(long millisInFuture, long countDownInterval) {      super(millisInFuture, countDownInterval);    }    public void onFinish() {      timeDisplay.setText(""done!"");      state = 2;     control.setText(R.string.restart);    }    public void onTick (long millisUntilFinished) {      timeDisplay.setText (""Left: "" + formatTime(timeRemaining));    }  }}</code></pre>","478121","","","","","2012-06-19 10:34:46","Formatting countdown timer with 00:00:00 not working. Displays 00:00:00 until paused then displays the time remaining","<android>","1","2","2","2012-07-02 13:57:12",""
"3950504","1","","","2010-10-16 19:52:01","1","406","<p>I'm trying to create an app that will change a setting when the user holds the search button. It seems that the combination of the <code>WRITE_SETTINGS</code> permission and the fact that the activity is launched from another application using the long press makes the parent task crash. For example, if I'm looking at Google Maps and hold the search button, the SearchButtonPopup does not appear and Google Maps crashes.</p><p>I tried taking the Theme.Dialog out, but it didn't make any difference. Removing the permission makes it robust again, no crashes, but I need the permission! Any fixes or workarounds?</p><p>These are my manifest and java files:</p><h2>AndroidManifest.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""org.stathissideris.searchbuttonpopup"" android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;    &lt;application android:icon=""@drawable/logo"" android:label=""@string/app_name""        android:debuggable=""true"" android:permission=""android.permission.WRITE_SETTINGS""&gt;        &lt;activity android:name="".SearchButton"" android:theme=""@android:style/Theme.Dialog""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.SEARCH_LONG_PRESS"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><h2>SearchButton.java</h2><pre><code>package org.stathissideris.searchbuttonpopup;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class SearchButton extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(""SearchButtonPopup"", ""search held"");    }}</code></pre>","126906","","","","","2010-10-16 19:52:01","Any fixes for crash because of combination of WRITE_SETTINGS and SEARCH_LONG_PRESS?","<android>","0","0","","",""
"3950717","1","","","2010-10-16 20:45:54","0","132","<p>This is a really stupid question I imagine, but is there a way to search for hidden errors.  I'm working on a project in MotoDev's Eclipse environment, and it won't let me run suddenly stating that I need to fix errors first, but it won't show any errors in the log at all.</p>","477337","","","","","2010-10-17 04:30:47","MotoDev Says I Have Errors, but it won't show me them","<android><eclipse>","2","0","","",""
"3950862","1","4204051","","2010-10-16 21:24:39","5","12579","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3092424/parsing-ksoap2-response"">Parsing ksoap2 response</a>  </p></blockquote><p>So I managed to call a webservice using KSoap2 in android but I can't find a way to parse the response...</p><pre><code>So here's what I receive from the webserviceanyType{WORCCategoriaSubcategoriaRecord=anyType{ssENCategoria=anyType{Id=1; Nome=Problema na rua; }; ssENSubcategoria=anyType{Id=1; Nome=Falta de acesso; Imagem=anyType{}; CategoriaId=1; }; }; WORCCategoriaSubcategoriaRecord=anyType{ssENCategoria=anyType{Id=1; Nome=Problema na rua; }; ssENSubcategoria=anyType{Id=2; Nome=Falta de Passadeira; Imagem=anyType{}; CategoriaId=1; }; }; }</code></pre><p>And here's the code I'm using to call the webservice...</p><pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);        //request.addProperty(""Celsius"", ""32"");        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        //soapEnvelope.dotNet = true;        soapEnvelope.setOutputSoapObject(request);        soapEnvelope.dotNet = true;        AndroidHttpTransport aht = new AndroidHttpTransport(URL);        try{            aht.call(SOAP_ACTION, soapEnvelope);            //SoapPrimitive resultString = (SoapPrimitive)soapEnvelope.getResponse();            SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;            int elementCount = resultsRequestSOAP.getPropertyCount();            if(elementCount&gt;0){                SoapObject element;                for(int i = 0;i&lt;elementCount;i++){                    element = (SoapObject)resultsRequestSOAP.getProperty(i);                }            }        }catch(Exception ex){            ex.printStackTrace();        }</code></pre><p>Is there any way to parse it ""easily"" without having to so through every property ""manually""? something like a XML parser...</p>","320586","","","","","2012-04-17 07:28:40","Parse KSoap2 response in android","<android><web-services><parsing><response><ksoap2>","2","0","1","2012-04-17 08:30:48",""
"3950956","1","3951249","","2010-10-16 21:50:18","1","3106","<p>I'm trying to change the color of a horizontal progress bar (foreground).  I came across <a href=""http://stackoverflow.com/questions/2020882/how-to-change-progress-bars-progress-color-in-android"">this example</a> and am trying to model my XML file off it.  However, I get a compiler error at the following statement:</p><pre><code>myProgressBar.setProgressDrawable(R.drawable.progress_horizontal);</code></pre><p>The error is ""The method setProgressDrawable(Drawable) in the type ProgressBar is not applicable for the arguments (int).""</p><p>I believe the reason is inside the R.java file I see the following line:</p><pre><code>public static final int progress_horizontal=0x7f02002f;</code></pre><p>So, do I define this XML file as a drawable and not an integer, or is there another way to solve this?</p><p>Thanks.</p><p>Edit: Including XML file</p><p></p><pre><code>&lt;item android:id=""@android:id/background""&gt;    &lt;shape&gt;        &lt;corners android:radius=""5dip"" /&gt;        &lt;gradient                android:startColor=""#ff9d9e9d""                android:centerColor=""#ff5a5d5a""                android:centerY=""0.75""                android:endColor=""#ff747674""                android:angle=""270""        /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item android:id=""@android:id/secondaryProgress""&gt;    &lt;clip&gt;        &lt;shape&gt;            &lt;corners android:radius=""5dip"" /&gt;            &lt;gradient                    android:startColor=""#80ffd300""                    android:centerColor=""#80ffb600""                    android:centerY=""0.75""                    android:endColor=""#a0ffcb00""                    android:angle=""270""            /&gt;        &lt;/shape&gt;    &lt;/clip&gt;&lt;/item&gt;&lt;item android:id=""@android:id/progress""&gt;    &lt;clip&gt;        &lt;shape&gt;            &lt;corners android:radius=""5dip"" /&gt;            &lt;gradient                    android:startColor=""#ffffd300""                    android:centerColor=""#ffffb600""                    android:centerY=""0.75""                    android:endColor=""#ffffcb00""                    android:angle=""270""            /&gt;        &lt;/shape&gt;    &lt;/clip&gt;&lt;/item&gt;</code></pre><p></p>","432209","","","","","2014-01-02 21:52:30","Changing progress bar color using XML in Android app","<java><android><eclipse><colors><progress-bar>","2","0","","",""
"3951105","1","3951126","","2010-10-16 22:35:59","1","351","<p>I have a ListView that displays every item in an array called, ""Facts_Array"". What I would like to do is display the count of the item clicked on. Right now I have this:</p><pre><code>      lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {          Toast.makeText(getApplicationContext(), ((TextView) view).getText(),Toast.LENGTH_SHORT).show();        }</code></pre><p>When an item is clicked  in the listview, it displays it using Toast. What I would like to change is what the toast displays. I would like it to find the number in which the item comes. If I click on the second item in the list, I want it to display number 2. Thanks!</p>","473903","","","","","2010-10-16 22:41:09","Arrays and ListView in Android","<android><arrays><listview>","1","0","","",""
"3951274","1","3972592","","2010-10-16 23:28:21","4","9697","<p>I'm working on an Android app where some part of it gets JSON-formatted data from a web service. The basics of the class parsing the JSON data looks like this:</p><pre><code>public class JsonCourseParser implements CourseParser{ public Course parseCourse(String courseData) {  Course result;  try  {   JSONObject jsonObject = new JSONObject(courseData);   // parse stuff here and construct a proper Course object   result = new Course(""foo"", ""bar"");  }  catch (JSONException e)  {   result = null;  }  return result; }}</code></pre><p>This builds just fine, and it works when I call the <code>parseCourse()</code> method from within my Activity.</p><p>When trying to test this very same function in a unit test however, the unit test won't even launch. A <code>NoClassDefFoundError</code> is shown in the Failure Trace of the JUnit view in Eclipse:</p><pre><code>java.lang.NoClassDefFoundError: org/json/JSONException at JsonCourseParserTest.initClass(JsonCourseParserTest.java:15) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)Caused by: java.lang.ClassNotFoundException: org.json.JSONException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 16 more</code></pre><p>My unit test looks like this:</p><pre><code>public class JsonCourseParserTest{ private static CourseParser courseParser; @BeforeClass public static void initClass() {  courseParser = new JsonCourseParser(); } @Test public void testParseCourse() {  Object course = courseParser.parseCourse(DummyJsonConstants.TEP4165_JSON);  assertNotNull(course); }}</code></pre><p>If I simply comment out the line with the <code>JSONObject</code> (and the belonging <code>JSONException</code>) in my <code>JsonCourseParser</code> class, the test runs just fine.</p><p>In case it might be relevant, I have the following structure on my workspace:<br>I have three different projects. One is the Android application project. The second is an Android Test project where I have unit tests that needs to interact with application context, database, views etc. The third is a normal project where I keep the ""clean"" unit tests, i.e. those that only test utility classes, POJO classes etc. The unit test above resides in the third project.</p><p><em>Edit:</em><br>I sadly don't have much more detail to add to the problem description. Is there really nobody that has any idea what might cause this issue? Any suggestions would be welcome!</p>","310001","","310001","","2010-10-19 07:38:34","2013-05-04 09:46:42","NoClassDefFoundError when trying to unit test JSON parsing in Android","<android><eclipse><unit-testing><json><junit>","3","0","4","",""
"3951299","1","3994228","","2010-10-16 23:38:25","1","436","<p>I want to know how to specify something like in my database adapter:</p><pre><code>Select * from _myTable WHERE _columnValue IN ('2','3','4');</code></pre><p>Is there a way to use any of the existing query methods specified in <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html"" rel=""nofollow"">SQLiteDatabase</a>? I can write the query in pure sql, but wondering whether there is a better (and easier) way to accomplish what I am after.</p><p>Thanks!</p>","478230","","","","","2010-10-22 05:44:31","How to specify multiple OR conditions in android (sqlite3)?","<android><database><sqlite><sqlite3>","1","0","","",""
"3951300","1","3954715","","2010-10-16 23:38:54","3","301","<p>The examples that I have seen of how to make a <a href=""http://developer.android.com/reference/android/content/ContentProvider.html"" rel=""nofollow""><code>ContentProvider</code></a> have all used the <a href=""http://developer.android.com/reference/android/content/UriMatcher.html#match%28android.net.Uri%29"" rel=""nofollow""><code>UriMatcher#match(Uri)</code></a> method within the <code>insert</code>, <code>query</code>, <code>update</code>, and <code>delete</code> methods to easily handle all of the URI patterns that the content provider responds to (e.g.: <a href=""http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NotePadProvider.html"" rel=""nofollow"">http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NotePadProvider.html</a>). This seemed okay to me until today, when I noticed on the <code>ContentProvider</code> API documentation that <code>insert</code>, <code>query</code>, <code>update</code>, and <code>delete</code> ""can [all] be called from multiple threads"". Additionally, the <code>UriMatcher</code> documentation says nothing about thread-safety or whether <code>match</code> is reentrant.</p><p>Do I need to worry about synchronizing calls to <code>match</code> on a shared, <code>static</code> instance of <code>UriMatcher</code> that is used within my implementations of <code>insert</code>, <code>query</code>, <code>update</code>, and <code>delete</code>?</p>","196844","","","","","2010-11-22 02:49:08","Is match(Uri) of class UriMatcher reentrant?","<android><thread-safety><reentrancy><android-contentprovider>","1","0","","",""
"3951373","1","","","2010-10-17 00:04:20","0","687","<p>Hi In Android is it possible to switch focus back and forth between an open dialog box and the main view without closing the dialog box. The preferred method of switching would be to click on the unfocused view so that it obtains focus.</p>","478244","","","","","2010-10-17 00:06:47","Switch Focus without closing dialog in Android","<android>","1","0","","",""
"3951402","1","3951438","","2010-10-17 00:14:42","6","599","<p>I'm attempting to create a 3d game using OpenGL.  I have a very basic world and am now working on a character.  I want to map a texture to the head which will be oval shaped.  How do I do the mapping?  I know how to map to flat surface.  I'm wondering if the normals can be used to help but I've never done this before and when I search Google I don't have any luck.</p><p>I'm planning on doing this all programmatically and not using Blender or Maya if that makes any difference.</p>","256062","","44729","","2010-10-18 15:37:10","2010-10-18 15:37:10","How do I texture map onto a curved surface?","<iphone><android><language-agnostic><opengl-es>","1","0","0","",""
"3951586","1","","","2010-10-17 01:30:26","-3","381","<p>Today C# and a modern copy of Delphi is getting very expressive for a student /hobbyist to start out on with a $2,000 price tag to get started. I remember when you could get started at a 10th of the price with Delphi. And a very large array of small programs came about in all sorts of fields. The ones that come through that hobby level are ether working for people or people that have marketed their own product.    Now we have P/Invoke as our future and MS plays the big daddy and markets it self.And thinks every one will tag along as little puppies. The truth is they are trying to set a standard that with out us tagging along MS will be in problems.At the same time MS has to address the future and as programmers Android devices will be 60% of the future world market and students will take them up fast.   Why 1/ portable 2/ they communicate for the student in many more ways. 3/ price.As MS sales have dropped in resent years they will drop further and apple shears man are they about to fall real bad. To me windows XP will hang on because future sales will drop and I find average person thinks XP is complex enough to maintain !!!!!!!!!!!!!!!!  And yes there is the power gamer out their and computers have just gone over the 4 gig barrier to 8 gig. But the least leap in size is wasted because of .net P/invoke with ANSSI and 64 bit pointers effectively using twice the space. 90% of users do not use 0.5 of a gig of memory and 70% of all users use English. There is clearly a limit to IBM programming power as proce4ssors only go so fast!!!!!!!. Android devices are using UTF-8 that is not supported by MS properly. UTF-8 is an extension of ACSSI that is so compatible with Delphi and those other languages, So I want to suggest this.</p><p>Create and market a freeware Delphi *.Dll called D/Invoke!!!!!!!!!     1/  UTF-8 to ACSSI interfacing.   2/  32 and 64 bit platform for old XP computers and users that will never use more than 4 gig memory space. 3/ Write the Dll in Delphi that its not C++ compatible that .net cannot interfere with the standard. And a future consideration is communication with the Java JNI for Java communication.   4/ Create freeware code that links with Delphi 3 to Delphi 6 as some projects out already have done some work. Except in the area of threads. In may ways many projects will just need recompiling once everything in this project is sorted. Then all projects made with D/Invoke will run faster than .Net, use the best text system UTF-8, Be Future proofed better than .net, communicate to important languages like Java. And students can learn to develop at cheaper prices producing a big development base again.  </p><p>What do people think!!!!!!!!!!!!!!!</p>","665392","","","","","2010-10-17 01:34:04","MS future .net P/InVoke Android Delphi c++ price compertition","<android><windows><delphi>","1","7","1","2010-10-17 01:37:34",""
"3951594","1","","","2010-10-17 01:33:44","0","799","<p>It appears that the <code>java.util.TimeZone</code> implementation in Android is broken (at least in 2.2). For instance</p><pre><code>TimeZone denver = TimeZone.getTimeZone (""America/Denver"") ;TimeZone phoenix = TimeZone.getTimeZone (""America/Phoenix"") ; </code></pre><p>Running under the emulate in Eclipse, denver.hasSameRules (phoenix) returns true, and it should return false: both are <strong>GMT-7:00</strong> but Phoenix doesn't use dst. I don't have access to any Android devices to test whether this is just a problem with the emulator or not.</p><p>Is there an official way to post android bug reports?</p>","478275","","1232277","","2013-01-05 03:12:51","2013-01-05 03:12:51","android java.util.TimeZone problems with daylight savings time implementation?","<android><timezone>","0","2","1","",""
"3951670","1","","","2010-10-17 02:00:02","1","2462","<p>OK, so i <em>have</em> seen all the stuff about how acting as a USB host is impossible on vanilla android, but is there anything in the Android API that would allow an app to override the default USB behavior in order to manually control the USB i/o responses, in order to support some other protocol?  I have not seen anything that would facilitate this, but is it possible without hacking the kernel?</p><p>This seems like the sort of thing which <em>should</em> be relatively easy, but i haven't found anything.  Forgive me if i've been googling incorrectly.</p>","251860","","","","","2010-10-17 22:04:34","Android USB I/O","<android><usb>","2","2","2","",""
"3951694","1","3951728","","2010-10-17 02:07:38","0","3458","<p>I have a textbox and search button, now all I need is the code to implement searching an array. The array I have is called Facts_Array (consists of strings). Comment if you need any more information.</p>","478297","","","","","2011-01-27 15:11:15","Search an Array Android","<android><arrays><search>","2","6","0","",""
"3951698","1","3954254","","2010-10-17 02:08:33","3","1370","<p>I trying to create a ""publish"" button for an image in my android app, that works with the Facebook App and Email.</p><p>This is my code (imagePath is something like ""/sdcard/myapp/image.jpg""</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.setType(""image/jpeg"");sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file://""+imagePath));sendIntent.putExtra(Intent.EXTRA_TEXT, ""Enjoy the photo"");startActivity(Intent.createChooser(sendIntent, ""Email:""));</code></pre><p>This works perfectly for sending the email with the attachment, but it doesn't work with the Facebook App. If I'm using </p><pre><code>    sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imagePath));</code></pre><p>the publishing for Facebook works - but the email-attachment isn't send anymore. </p><p>Any ideas what could do it for both?</p>","458361","","","","","2012-01-26 16:42:46","Using ActionChooser with Attachment for email and Facebook-App in Android","<android><facebook><email>","5","0","1","",""
"3951822","1","3955173","","2010-10-17 02:55:48","0","1704","<p>I am actually looking for some opinion on how to get this done. I have a php server with a mysql backend to authenticate users using android os. I came across the debate of having JSON vs XML to minimize the overhead and using REST vs SOAP. Can I get some tips on what is the best path to go about getting this done ? I know its a trade-off if I use JSON/REST because its a bit complicated than XML/SOAP</p>","429199","","126039","","2010-10-17 02:58:20","2011-09-16 13:04:40","android webservice to a php server (XML vs JSON and SOAP vs REST)","<php><android><xml><json><soap>","1","0","1","",""
"3951865","1","3951905","","2010-10-17 03:15:43","0","2349","<p>I have an error stating something like:</p><blockquote>  <p>The method foo() is undefined for the type bar(){}</p></blockquote><p>Eclipse tells me that after entering this code:</p><pre><code>((application_variables) this.getApplication()).setSomeVariable(""foo"");</code></pre><p>I'm not sure if this is the problem, but I have it located under....</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {</code></pre><p>I'm guessing it has a problem with ""this."" I'm still learning about Android so I'm going pretty basic. What do I need to fix?</p>","478297","","","Roger Pate","2010-10-17 13:22:15","2010-10-17 14:16:20","Method Undefined for the Type in Android","<java><android>","1","0","","",""
"3951878","1","3954625","","2010-10-17 03:21:04","0","93","<p>I have a listview that is the main part of my activity. When there are no objects in the listview, I want to replace it with a helpful message (a TextView). I simply call setContentView again if the list is unpopulated in onResume.</p><p>However, this only works for the TextView. If I call <code>setContentView(R.layout.mylayout)</code>, then I get a blank. This is especially bothersome after the user has created an item that would properly go into the listview in another activity and returns.</p><p>Do I have the right approach? How do I fix this?</p><p>Thanks!</p>","210920","","","","","2010-10-17 18:27:45","Switching View Midactivity","<android><listview>","4","0","","",""
"3952173","1","","","2010-10-17 05:36:36","0","379","<p>Can I modify android.R.layout.simple_list_item_1? For eg., I want to change the text color of the textview inside the listview dynamically. For this, I need to get to the textview and change its color.. How can I do that?</p>","478363","","","","","2010-10-17 06:38:12","Question on Android Layout","<android><android-layout>","1","0","","",""
"3952210","1","3952274","","2010-10-17 06:03:51","4","2640","<pre><code>package com.commonsware.android.threads;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.view.View;import android.view.View.OnClickListener;import android.widget.ProgressBar;import android.widget.TextView;import android.widget.Toast;public class HandlerDemo extends Activity {   Thread mBackground;   ProgressBar bar;    Handler handler = new Handler() {            @Override            public void handleMessage(Message msg) {                    bar.incrementProgressBy(5);            }    };    boolean isRunning = false;    @Override    public void onCreate(Bundle icicle) {            super.onCreate(icicle);            setContentView(R.layout.main);            bar = (ProgressBar) findViewById(R.id.progress);    }    public void onStart() {            super.onStart();            bar.setProgress(0);            mBackground = new Thread(new Runnable() {                    public void run() {                            try {                                    int a = 0;                                    for (int i = 0; i &lt; 20 &amp;&amp; isRunning; i++) {                                            for (int j = 0; j &lt; 2000; j++) {                                                    for (int k = 0; k &lt; 1000; k++) {                                                            a++;                                                    }                                            }                                            handler.sendMessage(handler.obtainMessage());                                    }                            } catch (Throwable t) {                                    // just end the background thread                            }                    }            });            findViewById(R.id.LoginButton).setOnClickListener(                            new OnClickListener() {                                    public void onClick(View v) {                                            mBackground.run();                                    }                            });            isRunning = true;    }    public void onStop() {            super.onStop();            isRunning = false;    }</code></pre><p>}</p><p>I'm really <strong>confused</strong> about that...</p>","478375","","","","","2013-10-01 11:41:16","Android thread problem, why ui still blocks when i have used a worker thread?","<android><multithreading><user-interface><handler>","2","0","","",""
"3952271","1","","","2010-10-17 06:34:03","1","1456","<p>How can I get currently playing track info at app startup?</p><p><a href=""http://blog.dexetra.com/2010/09/get-current-playing-track-info-from.html"" rel=""nofollow"">http://blog.dexetra.com/2010/09/get-current-playing-track-info-from.html</a> has nice and working example on how to get info when android media player does some action (track is changed, finished, started etc). But when I launch my app I need to get currently (in the background) playing track info immediately and this example doesn't work for it (tried it with HTC Desire and Android 2.2).</p><p>Thanks</p>","478385","","","","","2010-10-26 21:37:29","Android - Get current track info at app startup","<android><media-player>","1","0","1","",""
"3952375","1","8498183","","2010-10-17 07:19:12","4","11013","<p>I am a newbie to android development. I am trying to create a List which has a spinner, a edit text and a check box. The data for spinner and check box come from data base. I have the following files.</p><p>NewTransac class which extends ListActivity</p><pre><code>private PayDbAdapter mDbHelper;private  Spinner paySpinner;private CheckBox mCheckBox;@Overrideprotected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.new_transac_listview);     mDbHelper = new PayDbAdapter(this);     mDbHelper.open();     populatedata();}private void populatedata() {    paySpinner = (Spinner)findViewById(R.id.payerspinner);    mCheckBox = (CheckBox)findViewById(R.id.paidforcheckboxname);    Cursor mCursor = mDbHelper.fetchAllTransactionValue();    startManagingCursor(mCursor);    // Create an array to specify the fields we want to display in the list.    String[] from = new String[]{PayDbAdapter.KEY_NAME};    int[] to = new int[]{android.R.id.text1};    int[] cbto = new int[]{R.id.paidforcheckboxname};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter adapter =        new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, mCursor, from, to );    adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );    paySpinner.setAdapter(adapter);    SimpleCursorAdapter cbAdapter =        new SimpleCursorAdapter(this, R.layout.show_new_transac_data, mCursor, from, cbto );    setListAdapter(cbAdapter);}</code></pre><p>The list view xml</p><pre><code>&lt;ListView android:id=""@android:id/list""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:drawSelectorOnTop=""false""    android:textSize=""14sp""/&gt;&lt;TextView android:id=""@android:id/empty""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/no_friends""    android:textSize=""14sp""/&gt;&lt;Button android:id=""@+id/confirmpay""     android:text=""@string/confirm""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:gravity=""center_vertical|center_horizontal""     android:layout_gravity=""center_vertical|center_horizontal|center""&gt;&lt;/Button&gt;</code></pre><p></p><p>list view filled xml</p><p></p><pre><code>&lt;TextView    style=""?android:attr/listSeparatorTextViewStyle""    android:text=""@string/listSeparatorPay""    android:layout_marginTop=""5dip""    android:layout_marginBottom=""5dip""/&gt;&lt;Spinner android:id=""@+id/payerspinner""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:drawSelectorOnTop=""true""    android:prompt=""@string/selectpayer""/&gt;&lt;TextView android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:text=""@string/paytext""/&gt;&lt;EditText android:id=""@+id/payamount""     android:layout_width=""match_parent""    android:layout_height=""wrap_content""     android:layout_weight=""1""     android:inputType=""text""/&gt;&lt;TextView    style=""?android:attr/listSeparatorTextViewStyle""    android:text=""@string/listSeparatorPayedFor""    android:layout_marginTop=""5dip""    android:layout_marginBottom=""5dip""/&gt;&lt;CheckBox android:id=""@+id/paidforcheckboxname""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""/&gt;&lt;EditText android:id=""@+id/paidforamount""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:inputType=""number""/&gt;</code></pre><p></p><p><code>Problem</code><br>I get multiple spinners, checkboxes and edittext based on the number of fields in the database. I see that we cannot set the adapter for the checkbox as i set for the spinner.I need to get only one spinner with one edit text and multiple checkboxes(total number of database rows).  please help!</p>","434790","","40015","","2011-01-03 03:06:20","2013-06-12 11:41:04","Android Listview with spinner and a checkbox","<android><listview><checkbox><edittext>","2","1","1","",""
"3952428","1","3952467","","2010-10-17 07:38:34","0","183","<p>I'm developing an Android application.</p><p>I have the following interface:</p><pre><code>public interface IDBAdapter {    public enum Table {        ...    }    public int insertItem(Table table, Object item);    public boolean removeItem(Table table, long rowIndex);    public Cursor getAllItemsCursor(Table table);    public Cursor setCursorToItem(Table table, long rowIndex);    public void getItem(Table table, long rowIndex);    public boolean updateItem(Table table, long rowIndex, Object item);}</code></pre><p>For each table defined on <code>enum Table</code>, it will be an object that represents that table.</p><p>My problem is about parameter <code>Object item</code>. I will have to unbox each item every time I call one of this methods and I don't know if this will be very slow for Android.</p><p>Do you know a better solution? I don't want to create a DBAdapter for each table because I should share SQLiteDatabase object between each other.</p><p><strong>UPDATE:</strong><br/></p><p>Here is an example of object that I need to pass to those methods:</p><pre><code>public class GameDescriptionData {    public int gameId;    public char[] language = new char[5];    public String name;    public String description;    public GameDescriptionData() {    }}</code></pre><p>Thanks.</p>","68571","","68571","","2010-10-17 08:14:31","2010-10-17 08:14:31","Boxing and UnBoxing on Android","<java><android><unboxing>","2","0","","",""
"3952452","1","","","2010-10-17 07:47:23","3","8996","<p>For my site I need to be able to tell the difference between when an Android tablet visits  and when an Android phone visits. It needs to be detected before the page is sent to the user so using JavaScript to check the screen res isn't an option.</p><p>At the moment I use this to detect an android device: stripos($ua, 'android')</p><p>Is there anything unique thar a tablet has in it's user agent?</p>","478408","","","","","2013-08-26 02:40:52","How can I detect Android phones and Android tablets differently using the user agent header?","<php><android><header><user-agent>","3","1","","",""
"3952459","1","3952775","","2010-10-17 07:51:51","1","1251","<p>Following the Android SDK tutorials I have implemented my first basic date picker dialog. It works fine but is there any way to change the format of the date shown?</p><p>Example:The date picker dialog displays the date as ""17 Oct 2010"". I would it like to be displayed as ""17 10 2010"".</p><p>Greetings,Robert</p>","478406","","","","","2011-03-08 10:22:21","Change format of date in DatePickerDialog?","<android><datepicker>","1","0","","",""
"3952485","1","","","2010-10-17 08:01:05","1","167","<p>I have setup a tabwidget, and in one panel there is a button to trigger a new activity, I want to display the sub-activities just in the tab widget, but not to open a new window. How can I do that </p>","238061","","218196","","2010-10-17 08:06:43","2010-10-17 08:06:43","How to make startActivity method render new activity view in the tabwidget?","<android><tabs>","0","0","","",""
"3952548","1","3952729","","2010-10-17 08:30:28","0","1458","<p>How can I show a set of images as a slide show in android?</p>","436765","","899344","","2012-08-20 05:16:14","2012-08-20 05:16:14","How can I show a set of images as a slide show in android? ","<android>","2","0","","2012-08-23 03:03:14",""
"3952863","1","3952998","","2010-10-17 10:40:05","6","1636","<p>I am implementing the new <code>BackupAgentHelper</code> from Android OS 2.2.</p><p>For it to work you need to supply the name of the <code>SharedPreferences</code> that you want to backup:</p><pre><code>public class MyPrefsBackupAgent extends BackupAgentHelper {// The name of the SharedPreferences filestatic final String PREFS = ""user_preferences"";// A key to uniquely identify the set of backup datastatic final String PREFS_BACKUP_KEY = ""prefs"";// Allocate a helper and add it to the backup agentvoid onCreate() {    SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS);    addHelper(PREFS_BACKUP_KEY, helper);}}</code></pre><p>Problem is I use the <code>PreferenceManager.getDefaultSharedPreferences()</code> method in my application to get the default shared preferences instance. Now I need to supply the name of that file. How can I find out what name that is?</p><p>(And why do they not supply a helper that just does a <code>DefaultSharedPreferences</code> backup?)</p>","107029","","810368","","2012-10-29 11:52:12","2012-10-29 11:52:12","Android 2.2 Data Backup: How to backup DefaultSharedPreferences?","<android><backup><sharedpreferences><android-backup-service>","1","0","1","",""
"3952899","1","","","2010-10-17 10:55:03","6","1514","<p>how do I remove focus from options menu item? I.e. when I open the menu for the first time, none of the items has focus. however, if I focus on one of them using track ball, and then close and re-open the menu the focus is still there. How do I get rid of it?</p><p>I am clearing and recreating the menu in <code>onPrepareOptionsMenu</code> (as I have to adjust it to the current activity state).</p><p><strong>EDIT:</strong></p><pre><code>public boolean onPrepareOptionsMenu(Menu menu){    menu.clear();    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.my_menu, menu);    return true;}</code></pre>","367677","","367677","","2011-08-04 19:58:10","2011-08-07 14:42:06","options menu - removing focus from item","<android><menu><options-menu>","1","2","2","",""
"3952963","1","","","2010-10-17 11:17:12","1","63","<p>(Android) Some days ago I saw a way to register a broadcast receiver to understand when the screen goes black or the inverse.</p><p>Now i'd like to find a way to understand when the users is speaking at the phone but i don't find a broadcast for this case, so how can i understand if the user is at the phone? (Possibly without always running a service that would discharge the battery).</p><p>Tnk's</p><p>Valerio</p>","314554","","","","","2011-02-27 02:11:37","Understand when user is speaking at the phone","<android><action><broadcast>","1","0","","",""
"3952991","1","","","2010-10-17 11:24:20","32","12474","<p>What is a good Android analog of iOS's <code>UISegmentedControl</code>?</p>","461975","","580677","","2013-12-11 01:30:38","2013-12-11 01:30:38","iOS SegmentedControl equivalent in Android","<android><uisegmentedcontrol>","2","0","10","2013-02-23 20:42:17",""
"3953012","1","3953080","","2010-10-17 11:31:35","19","4351","<p>Im running eclipse on my windows 7 machine, 64bit with 6gb ram and core 2 duo.Im currently running Eclipse 3.6 and android 2.2 SDKIm running jdk 1.6</p><p>Im noticing that when coding and the context popups to list methods of a class, it hangs Eclipse for up to 15 seconds. This is very frustrating.</p><p>One thing to note, when Eclipse hangs, my processor is maxed out, and is being worked by a java process. So its doing something whatever it is. But frequently everytime I finish an object with a period and the context box pops up, its becoming too painful to work with.</p><p>I changed some settings in the Eclipse.ini file such as:-Xms1024m-Xmx1024m--launcher.XXMaxPermSize 512m</p><p>Is there anything else I should look at:</p>","478482","","12860","","2011-08-07 08:11:42","2011-08-17 08:56:10","Eclipse Android SDK slow Content Assist performance","<android><windows><eclipse><content-assist>","4","3","10","",""
"3953052","1","3953450","","2010-10-17 11:43:42","0","1244","<p>I have recently experimented with creating an easy way to open a ProgressDialog up in  a second thread, so if the main thread freezes the dialog will keep working.</p><p>Here is the class:public class ProgressDialogThread extends Thread{ public Looper ThreadLooper; public Handler mHandler;</p><p>public ProgressDialog ThreadDialog; public Context DialogContext; public String DialogTitle; public String DialogMessage;</p><pre><code>public ProgressDialogThread(Context mContext, String mTitle, String mMessage) {  DialogContext = mContext;  DialogTitle = mTitle;  DialogMessage = mMessage; } public void run() {  Looper.prepare();  ThreadLooper = Looper.myLooper();  ThreadDialog = new ProgressDialog(DialogContext);  ThreadDialog.setTitle(DialogTitle);  ThreadDialog.setMessage(DialogMessage);  ThreadDialog.show();  mHandler = new Handler();  Looper.loop(); } public void Update(final String mTitle, final String mMessage) {  while(mHandler == null)   synchronized(this) {    try { wait(10); }     catch (InterruptedException e) {     Log.d(""Exception(ProgressDialogThread.Update)"", e.getMessage() == null ? ""MISSING MESSAGE"" : e.getMessage());    }   }  mHandler.post(new Runnable(){   @Override   public void run() {    ThreadDialog.setTitle(mTitle);    ThreadDialog.setMessage(mMessage);   }}); } public void Dismiss()  {  while(ThreadDialog == null || mHandler == null)   synchronized(this) {    try { wait(10); }     catch (InterruptedException e) {     Log.d(""Exception(ProgressDialogThread.Dismiss)"", e.getMessage() == null ? ""MISSING MESSAGE"" : e.getMessage());    }   }  mHandler.post(new Runnable(){   @Override   public void run() {    ThreadDialog.dismiss();   }}); } public void Continue()  {  while(ThreadLooper == null || mHandler == null)   synchronized(this) {    try { wait(10); }     catch (InterruptedException e) {     Log.d(""Exception(ProgressDialogThread.Continue)"", e.getMessage() == null ? ""MISSING MESSAGE"" : e.getMessage());    }   }  mHandler.post(new Runnable(){   @Override   public void run() {    ThreadLooper.quit();   }}); }</code></pre><p>However it sometimes work perfectly but other times the application simply freezes and crashes eventually.</p><p>Here is an example of use:</p><pre><code>ProgressDialogThread thread = new ProgressDialogThread(this, ""Loading"", ""Please wait..."");thread.start();// Do Stuffthread.Dismiss();thread.Continue();</code></pre><p>It generates a lot of warning and even some crashes sometimes:</p><p>eg. Handler: Sending message to dead thread....</p><p>and exceptions like ANR in ...... Reason: keyDispatchingTimedOut</p><p>Thanks for any help,Alex.</p>","478478","","","","","2010-10-17 13:44:06","Android 2.2: ProgressDialog Freezing In Second Thread","<android><multithreading><progressdialog>","1","0","1","",""
"3953057","1","","","2010-10-17 11:45:07","0","491","<p>I have a webview in my activity and loaded contents for webview by following:</p><pre><code>webview.loadUrl(""file:///android_asset/description.html"");</code></pre><p>In description.html i have a reference for another html file located in the same place by following:</p><pre><code>&lt;a href='file:///android_asset/uml.html'&gt;see UML diagram&lt;/a&gt;</code></pre><p>This was working absolutely fine in emulator but when i run it on my Galaxy S mobile, hyperlink does not work fine. Kindly help me. Is there any permission i am missing or something else?</p>","478490","","","","","2010-10-18 03:08:37","referencing local resources from assets in a static html","<android>","1","0","","",""
"3953060","1","3954126","","2010-10-17 11:45:51","2","1295","<p>I am trying to load BROWSER VIEW intent in android within <code>onTouchEvent</code>. Basically I have created a live wallpaper and if I click on it then I want to open BROWSER VIEW intent with a specified uri.</p><p>I have tried following code inside <code>onTouchEvent</code></p><pre><code>Uri uri = Uri.parse(""http://www.google.com"");Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);</code></pre><p>but I am getting the following error:</p><pre><code>android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activitycontext requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</code></pre><p>Another approach is that I have create one activity and inside its <code>onCreate</code> method I tried following code:</p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    browser=new WebView(this);    setContentView(browser);    browser.loadUrl(""http://commonsware.com"");}</code></pre><p>and tried to load this activity via custom intent message as follows, but still I am getting the same error </p><pre><code>Intent intent = new Intent(ACTION);startActivity(intent);// over here I have not used context, as while creating live wallpaper I// don't know here to get the context</code></pre>","405383","","377270","","2012-03-22 03:06:07","2012-03-22 03:32:51","launch browser intent in live wallpaper","<android><live-wallpaper><wallpaper>","1","0","1","",""
"3953090","1","3953105","","2010-10-17 11:55:36","0","6323","<p>when user click on url link i want to install apk file from server.</p><p>please guide me how to do i searched on net i am not getting corresponding info</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2012-11-11 12:42:06","install apk from remote server","<android>","3","1","3","",""
"3953109","1","3953209","","2010-10-17 12:01:20","4","1100","<p>I have problem with a Gallery. I can't scroll via touch. Scrolling via DPAD or trackball works fine.</p><p>Here is some code:The 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"" android:gravity=""center_vertical""&gt; &lt;Gallery android:id=""@+id/Gallery_Main"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:spacing=""10dip""  android:unselectedAlpha=""0.7"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The adapter:</p><pre><code>package de.goddchen.android.advent.template;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;public class AdventAdapter extends BaseAdapter { @Override public int getCount() {  return 24; } @Override public Object getItem(int arg0) {  return arg0; } @Override public long getItemId(int arg0) {  return arg0; } @Override public View getView(int arg0, View arg1, ViewGroup arg2) {  MyImageView aiv = (MyImageView) LayoutInflater.from(    arg2.getContext()).inflate(R.layout.galleryimage, arg2, false);  aiv.number = arg0 + 1;  return aiv; }}</code></pre><p>I test the app on my Android 2.2 phone.Any ideas?</p>","373138","","1288","","2012-08-04 17:29:15","2012-08-04 17:29:15","Gallery - Scroll via touch doesn't work","<android>","1","0","","",""
"3953409","1","","","2010-10-17 13:35:33","2","413","<p>I have made a pedometer application... i wanted to know how to test this application on  an emulator as i am not having an android device </p>","478535","","21399","","2010-10-17 13:40:31","2010-10-17 13:44:07","Is there any way to test PEDOMETER on Android Emulator?","<android><android-emulator>","1","1","","",""
"3953432","1","4011638","","2010-10-17 13:39:59","17","22332","<p>Hey! Im looking for an OpenGL library/framework to handle basic drawing code etc for me. Otherwise im also looking for some NDK and OpenGL ES tutorials, I cant seem to find anything out there!</p><p>Any information would be helpful cheers.</p><p>Adam</p>","478537","","1228","","2013-08-14 12:46:10","2013-08-14 12:46:10","Android NDK - OpenGL ES Tutorial/Libraries","<android><opengl-es><android-ndk><libraries>","3","0","9","2013-08-14 14:36:14",""
"3953454","1","3953484","","2010-10-17 13:44:53","1","96","<p>I've released an app about a month ago now, and it works as it should on my Desire and presumably on a lot of other phones. However it is also receiving it's fair share of 1 star ratings with comments that say that the sound simply doesn't work. Given that this is an app to play sounds and alarms that's a pretty major problem.</p><p>Thankfully one user emailed me to say it didn't work for her, so I at least know one model of phone it's not working on. However I have ZERO idea how you would even begin to work out why code isn't working on a particular phone. If the code is written as per the android docs, and it works in the emulator and on my own phone, I can't begin to work out where to start fixing this.</p><p>Any ideas?</p>","414266","","414266","","2010-10-17 14:24:30","2010-10-17 14:24:30","Android app bugs/errors only on certain phones","<android><debugging>","1","4","","",""
"3953498","1","3954000","","2010-10-17 13:54:43","2","1736","<p>I am new to Android and I want to develop 2D/3D games in Android. Can you suggest me good books and/or tutorials on the subject?</p>","1746300","","777408","","2012-07-13 18:11:42","2012-07-13 18:11:42","Resources on 3D game programming in Android","<android>","2","1","2","2013-10-25 18:53:42",""
"3953604","1","3954980","","2010-10-17 14:23:56","0","1104","<p>I know that the default is 30 minutes, however I am looking at making a game in a widget</p><p>This would require millisecond responses.... has anyone messed with the AlarmClock Timing that is described to use instead to achieve this? does it work well? </p><p>I haven't finished the Software Arc for the project yet because I see a lot of complaints about this on the net, so need to know if this is feasable before I go for the adventure... but the game would consist of a large widget size of one screen... many areas to click on and interact with and multiple textured animations</p><p>Looks like I can draw to a canvas and then pop it up to the bitmap to do this... but that still confuses me a bit, so if anyone knows of some good tutorials I would greatly appreciate it</p><p>this is what I was told works:</p><p>Code:Paint p = new Paint();             p.setAntiAlias(true);            p.setStyle(Style.STROKE);            p.setStrokeWidth(8);            p.setColor(0xFFFF0000);</p><pre><code>        Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888);        Canvas canvas = new Canvas(bitmap);        canvas.drawArc(new RectF(10, 10, 90, 90), 0, 270, false, p);       // RemoteViews views = new RemoteViews(updateService.getPackageName(), R.layout.main);        RemoteViews updateViews = null;        updateViews.setImageViewBitmap(R.id.canvas, bitmap);        ComponentName componentName = new ComponentName(updateService, DashboardAppWidgetProvider.class);        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(updateService);        appWidgetManager.updateAppWidget(componentName, views);</code></pre><p>but I am struggling with the concepts of this code having an ID for the canvas and how to use that so I have not been able to test this code</p><p>(I am a experienced c/c++/c#/dx/opengl coder first time with android and java)</p><p>Thank you!</p>","478183","","","","","2010-10-18 11:33:04","Maximum Refresh Rate of A Widget","<android><android-widget><widget>","2","0","","",""
"3953605","1","3956367","","2010-10-17 14:25:07","2","3690","<p>I want to create a simple layout like the following:</p><pre><code>(o) Radio button A(o) Radio button B [textedit]    [x] checkbox</code></pre><p>For that I've created the following layout.xml:</p><pre><code>&lt;RadioGroup     android:layout_above=""@+id/RadioButton_Count""     android:id=""@+id/RadioGroup01""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""&gt;    &lt;RadioButton         android:layout_height=""wrap_content""         android:id=""@+id/RadioButton_A""         android:text=""Play forever""         android:checked=""true""         android:layout_width=""fill_parent""         android:textSize=""20sp""&gt;    &lt;/RadioButton&gt;    &lt;RelativeLayout         android:id=""@+id/RelativeLayout01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;        &lt;RadioButton             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/RadioButton_B""             android:text=""Count:""             android:textSize=""20sp""&gt;        &lt;/RadioButton&gt;        &lt;EditText             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/EditText_NumCount""             android:inputType=""number""             android:layout_toRightOf=""@+id/RadioButton_B""             android:width=""70sp"" &gt;        &lt;/EditText&gt;        &lt;CheckBox             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/CheckBox_StopCount""             android:text=""Stop""             android:layout_below=""@+id/RadioButton_B""             android:textSize=""18sp""&gt;        &lt;/CheckBox&gt;    &lt;/RelativeLayout&gt;&lt;/RadioGroup&gt;</code></pre><p>It looks right, but the problem is that the radiobuttons doesn't connect between each other, i mean that they can be both on in the same moment.I think it's because even if they're hanging from the same  the second one is inside another layout :\Does anyone have some idea how could I make this kind of layout (Mainly the [textedit] just right the RadioButton B), getting working also the radiobuttons?Thank you very much</p>","474684","","","","","2013-04-10 23:15:16","RadioGroup with radiobuttons inside a relative android layout","<android><gui><layout><radio-button>","2","0","","",""
"3953606","1","3955387","","2010-10-17 14:25:47","8","9082","<p>To give the user of my app an indication which field currently has the focus I am trying to change the background color of some of my fields depending on the current state, however, I am having troubles understanding Androids Color State List Resources:</p><p>I found example (sorry, URL no longer works) and if I try <strong>exactly</strong> the same, i.e. if I want to adapt the <strong>textColor</strong> , things <strong>do</strong> work. However, if I try an only <strong>slightly different</strong> thing, namely to adapt the <strong>background</strong> color, things <strong>do not</strong> work and I don't understand why? Why is this so inconsistent???</p><p>To make it simpler to understand what I am trying to do, I append my misc. .xml files:</p><p>The <code>AndroidManifest.xml</code> 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=""mmo.android.test""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Test""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>The <code>Test-Activity</code>:</p><pre><code>package mmo.android.test;import android.app.Activity;import android.os.Bundle;public class Test extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><p>The <code>res/values/strings.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World, Test!&lt;/string&gt;    &lt;string name=""app_name""&gt;Test&lt;/string&gt;&lt;/resources&gt;</code></pre><p><code>res/color/button_test_color.xml</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""   android:color=""#f0f""/&gt; &lt;!-- pressed --&gt;    &lt;item android:state_focused=""true""   android:color=""#ff0""/&gt; &lt;!-- focused --&gt;    &lt;item android:color=""#000""/&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>and finally my <code>res/layout/main.xml</code> 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;Button        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""foobar""        android:textColor=""@color/button_test_color""        android:background=""#f00""     /&gt;    &lt;!--     &lt;Button        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""foobar""        android:textColor=""#f00""        android:background=""@color/button_test_color""     /&gt;     --&gt;&lt;/LinearLayout&gt;</code></pre><p>If I run this as shown here, it works, i.e. I get a button whose text color changes depending on whether the button is focuses, pressed, etc.</p><p>If I uncomment the lower button, where I just flipped the attribute values for textColor and background I get an exception, stating </p><pre><code>... &lt;item&gt; tag requires a 'drawable' attribute or child tag defining a drawable</code></pre><p>What the heck am I missing here? Why is that color state list acceptable as a text color but not as a background color? How does one specify a view's background color depending on the view's state?</p>","423411","","950799","","2013-08-09 10:05:18","2013-08-09 10:05:18","How to specify background color in Color State List Resources?","<android><colors><android-linearlayout>","2","0","3","",""
"3953647","1","3955303","","2010-10-17 14:39:42","2","1520","<p>Good Morning,</p><p>I have a ListView that with alphabetical headers for each letter.  I also have an index function that brings the letter headers to the top of the screen.  </p><p>My problem is when I reach the end of the list setSelection is unable to bring the last few headers to the top because it will not scroll past the end of the list.</p><p>My question is this:  Is there a way to add a blank space to the end of the screen dependent on screen size?  I would like to scroll until the  last item in the list is at the top of the listView.</p><p>Any help would be appreciated.</p><p>Thanks,Josh</p>","453305","","","","","2013-09-18 00:47:47","ANDROID : Adding Empty Space to End of ListView","<android><listview>","2","0","","",""
"3953689","1","","","2010-10-17 14:48:43","5","7935","<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 have made a simple Android app with a pin-code/screen lock. The user have to write a password to lock the phone and then repeat it to unlock the phone. The problem is that the user still can press back, home (etc) to exit the app without writeing the code. How can I prevent this? </p>","450019","","","","","2011-05-10 17:18:35","How to lock android buttons/phone from code (screen lock)?","<java><android><locking>","3","0","1","2011-09-29 10:51:21",""
"3953732","1","3953841","","2010-10-17 14:57:07","1","539","<p>I have an android app and I want to set an icon. I have set the icon using androidmanifest.xml and that shows the icon inside the app list. However, I want the icon to be displayed while the application is running, also. Any help/hints ?</p><p>Thanks.</p><p>-ahsan</p>","342925","","","","","2011-12-31 11:40:13","How to set icon inside the main app page in android?","<android><icons>","2","0","1","",""
"3953791","1","3984652","","2010-10-17 15:09:57","2","3018","<p>I update the html in a webView using loadData() followed by a reload().  I get the new data to display but the scroll of the page has not updated.  I want to keep the view of the page at the bottom.  I can wait a long time and it still doesn't update.  Once I click the webView the scroll bars adjust and I can drag to the bottom of the page and see the new text.</p><p>Things I have tried:- multiple settings and calls in onPageFinished().  None worked because the getContentHeight() hasn't changed yet.  I have  also tried to scrollTo(100 + getContentHeight) and that doesn't work.- pageDown(true)</p><ul><li><p>calling requestLayout() after reload()</p></li><li><p>browser.requestFocusFromTouch() - still no good, thinking i could simulate my click.</p></li><li><p>adding a few br tags. This worked a bit, but the number of br's has to equal the number of lines of new text. Since the number of new lines is not something that can be exactly determined based on orientation and screen variables it's not a good fix.Any ideas? TIA</p></li></ul>","465199","","465199","","2010-10-17 15:36:21","2010-10-21 05:53:32","webview loaddata scroll setting not updating till clicked","<android><uiwebview>","1","0","1","",""
"3953804","1","3954936","","2010-10-17 15:13:39","0","961","<p>I have a widget with a configuration activity.</p><p>Currently the configuration launches when you click on the widget.</p><p>I want to add the configuration as an app icon to the launcher.</p><p>The problem is that when the configuration launches on click, I get a specific widget id , so each widget instance can have a different configuration.</p><p>What will happen if I start the activity from the launcher?</p><p>I wont be able to show multiple configurations on the same activity.</p><p>Thanks.</p>","445114","","","","","2010-10-17 19:40:49","How to add widget configuration activity to launcher?","<android><configuration><widget><launcher>","1","0","","",""
"3953940","1","","","2010-10-17 15:43:23","1","794","<p>Is it possible to set android:gradientRadius of a drawable via Java or is it only possible to set this attribute via Xml?</p>","25282","","","","","2010-10-17 15:48:23","Setting android:gradientRadius via Java","<android><android-ui>","1","0","","",""
"3953957","1","3954107","","2010-10-17 15:46:57","0","981","<p>I want that when i will pass the <strong>utube url</strong> to media player it will automatically load the video and play in it.Example: <a href=""http://www.youtube.com/watch?v=WAG8e_53le4"" rel=""nofollow"">http://www.youtube.com/watch?v=WAG8e_53le4</a>  This type of url i want to play in android media player</p>","477301","","","","","2012-02-04 08:47:27","How to assign utube video url to android media player","<android>","2","1","","",""
"3954003","1","3954486","","2010-10-17 15:57:29","4","1195","<p>Again and again I have the case that during development, the Android SDK suddenly doesn't regenerate the ""R"" file. Usually this is due to some error in one of the many .xml files, but that darn thing doesn't give the slighted indication, as to <strong>WHY</strong> it suddenly refuses to regenerate that file.</p><p>There is no error or warning listed for any of my .xml files and manually checking all those (meanwhile almost hundred!) XML files for errors is no real fun, either! </p><p>Is there some option or log or something that would allow to locate the problem quicker and more direct? Last time I had to do a lengthy binary search (i.e. copying and removing files to/from a second test project) trying to locate the offending file. That's really a nightmare and not how it should be in any decent SDK that deserves that name!</p>","423411","","984393","","2012-08-18 21:40:19","2013-08-03 23:44:20","How to find out, why the ""R"" (resource) file is not generated?","<android>","6","1","","",""
"3954069","1","3979611","","2010-10-17 16:17:20","1","4283","<p>I am trying to Reverse GeoCode current Lat/Long data to just Admin Area and Sub Admin Area using the Geocoder class.I am using the NETWORK_PROVIDER as the Location provider. Here is the code that I use and it works. The problem is sometimes it does not give me any location sometimes it does. </p><p>Android Manifest permissions I am using.</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;</code></pre><p>Here is the rest of the code that does give me correct location from time to time but nothing at other times.</p><pre><code>            double latPoint = 0;            double lngPoint = 0;            List&lt;Address&gt; myList = null;            getApplicationContext();            LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);            Location recentLoc = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);            if (recentLoc != null){            latPoint = recentLoc.getLatitude();            lngPoint = recentLoc.getLongitude();            Geocoder myLocation = new Geocoder(getApplicationContext(), Locale.getDefault());            if (myLocation != null){            try {                 myList = myLocation.getFromLocation(latPoint, lngPoint, 1);            } catch (IOException e1) {                // TODO Auto-generated catch block                e1.printStackTrace();            }            if (myList.size()&gt; 0){                        String AdminArea = myList.get(0).getAdminArea();                        String SubAdminArea = myList.get(0).getSubAdminArea();                        String Zipcode = myList.get(0).getPostalCode();                        String urlocation = SubAdminArea + "", "" + AdminArea + "" "" + Zipcode;                        Context context1 = getApplicationContext();                         int duration1 = Toast.LENGTH_LONG;                        CharSequence text1 = urlocation;                        Toast toast1 = Toast.makeText(context1, text1, duration1);                        toast1.show();            }            }</code></pre><p>Are there restrictions with the network providers how frequently you can request location data?</p><p>How can I make sure that everytime its run this can give me valid location data.</p><p>Thanks in advance for any insight into this.</p><p>PS: I have run this code on my real device running Froyo 2.2 (Verizon Wireless). Target API Level 8.</p><p>This is what I got from my debugging.</p><p>Latitude Longitude is always fetched but the getFromLocation often returns null for the latitude longitude data passed to it. So what should be the workaround? May be pass the Lat/Long info to Google Maps API for reverse geocoding. Will be glad to receive any input.</p>","447886","","447886","","2010-10-18 19:15:26","2012-05-09 12:11:02","Reverse Geocoding in Android App","<android><geolocation><reverse-geocoding><geo>","2","0","1","",""
"3954103","1","","","2010-10-17 16:25:38","3","932","<p><br>My app is retrieving data from a RESTful http source.<br>Sometimes, there will be Hewbrew text.<br>title ??? ?????, ???? ????<br>content ????'??? - ???? 6 ??? 12 ????? ?????? ?????! ?????: ??? ?? ???</p><p>Everything is fine until it has to be used in a textview.I'm using my own list adapter and the following happens when this text tries to get loaded:</p><pre><code>I/dalvikvm( 2524): Stack overflow, expanding (0x41048200 to 0x41048000)I/dalvikvm( 2524): Shrank stack (to 0x41048200, curFrame is 0x41049cd8)D/AndroidRuntime( 2524): Shutting down VMW/dalvikvm( 2524): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)E/AndroidRuntime( 2524): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 2524): java.lang.StackOverflowErrorE/AndroidRuntime( 2524):        at android.text.Styled.drawText(Styled.java:290)</code></pre><p>So, I tried to use a try/catch around the code, but I no help.  The catch doesn't catch this exception.</p><p>My code:</p><pre><code>try{       holder.content.setText(currPage.GetContent())         holder.title.setText(currPage.GetTitle());      } catch (StackOverflowError e){         e.printStackTrace();  }</code></pre><p>That doesn't work because that's not where the exception is actually happening.  It's when the text is being drawn onto the screen.  I don't know how to stop this from happening.I really would rather just have a blank field if that is the easiest fix, but I don't know how to detect for Hebrew text is decent way.Any help and suggestions would be greatly appreciated.  </p><p>ThanksCheers,Terry.</p><p>logcat output:</p><pre><code>I/dalvikvm( 2411): Stack overflow, expanding (0x41048200 to 0x41048000)I/dalvikvm( 2411): Shrank stack (to 0x41048200, curFrame is 0x41049cd8)D/AndroidRuntime( 2411): Shutting down VMW/dalvikvm( 2411): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)E/AndroidRuntime( 2411): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 2411): java.lang.StackOverflowErrorE/AndroidRuntime( 2411):        at android.text.Styled.drawText(Styled.java:290)E/AndroidRuntime( 2411):        at android.text.Layout.drawText(Layout.java:1366)E/AndroidRuntime( 2411):        at android.text.Layout.draw(Layout.java:339)E/AndroidRuntime( 2411):        at android.widget.TextView.onDraw(TextView.java:3921)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5838)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1486)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5841)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1486)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5841)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1486)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319)E/AndroidRuntime( 2411):        at android.widget.ListView.dispatchDraw(ListView.java:2820)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5944)E/AndroidRuntime( 2411):        at android.widget.AbsListView.draw(AbsListView.java:2121)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1486)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5841)E/AndroidRuntime( 2411):        at android.widget.FrameLayout.draw(FrameLayout.java:352)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1486)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5841)E/AndroidRuntime( 2411):        at android.widget.FrameLayout.draw(FrameLayout.java:352)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1486)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.ViewGroup.drawChild(ViewGroup.java:1484)E/AndroidRuntime( 2411):        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)E/AndroidRuntime( 2411):        at android.view.View.draw(View.java:5841)E/AndroidRuntime( 2411):        at android.widget.FrameLayout.draw(FrameLayout.java:352)E/AndroidRuntime( 2411):        at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847)E/AndroidRuntime( 2411):        at android.view.ViewRoot.draw(ViewRoot.java:1217)E/AndroidRuntime( 2411):        at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)E/AndroidRuntime( 2411):        at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)E/AndroidRuntime( 2411):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 2411):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 2411):        at android.app.ActivityThread.main(ActivityThread.java:3948)E/AndroidRuntime( 2411):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 2411):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 2411):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime( 2411):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime( 2411):        at dalvik.system.NativeStart.main(Native Method)</code></pre><p>NOTE:  The original post and title said Arabic. It's been correct to say Hebrew.  Maybe it matters.</p>","478629","","478629","","2010-10-17 17:29:16","2011-12-18 12:24:42","Android textview stackoverflow when using Hebrew","<android>","1","2","","",""
"3954177","1","3955140","","2010-10-17 16:43:39","3","1081","<p>I got a application for android which downloads and parses some data from a internet-source. Nothing special here. But, I need the application for two difference source, with slightliy different source-code. Currently there are simply two applications in the <code>AndroidManifest</code> and two slightly different Activites, which override a big abstract class containing all the similar things. This works without any problems, I get two applications, just as I expected.</p><p>Now, I want to build two APK's to upload them to the Market, each should contain one of the Applications, and each of the applications must be seperate installable (and even both at the same time). The only solution which came to my mind was to create two new projects (with two new AndroidManifest) and symlink the original source-folder to the two new projects. <em>However, this also leads into problems, as it is forbidden to install two applications which got the same package (in terms of java-package 'de.dbruhn.app'). <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg53199.html"" rel=""nofollow"">See this thread on the Mailinglist</a></em></p><p>Is there a working solution?</p><p>Thanks!</p>","61855","","411500","","2010-10-18 02:01:02","2010-10-18 02:01:02","Building two APK's from one Android-Source-Tree","<java><android><ant>","1","0","2","",""
"3954244","1","4011199","","2010-10-17 16:57:43","6","4045","<p>How do you get the current top suggestion in an <code>AutoCompleteTextView</code>?  I have it suggesting items, and I have a text change listener registered.  I also have a list on the same screen.  As they type, I want to scroll the list to the current ""best"" suggestion.  But I can't figure out how to access the current suggestions, or at least the top suggestion.  I guess I'm looking for something like <code>AutoCompleteTextView.getCurrentSuggestions()</code>:</p><pre><code>autoCompleteTextView.addTextChangedListener(new TextWatcher() {    public void onTextChanged(CharSequence s, int start, int before, int count) {            String currentText = autoCompleteTextView.getText();            String bestGuess = autoCompleteTextView.getCurrentSuggestions()[0];            //                                      ^^^ mewthod doesn't exist            doSomethingWithGuess(bestGuess);        }        public void beforeTextChanged(CharSequence s, int start, int count,                int after) {            // do nothing        }        public void afterTextChanged(Editable s) {            // do nothing        }    });</code></pre>","85348","","","","","2010-10-25 00:34:04","Getting current suggestion from `AutoCompleteTextView`","<android><autocomplete>","2","0","3","",""
"3954445","1","","","2010-10-17 17:44:19","0","822","<p>LogCat filtered by errors is in the following:    </p><p>10-17 19:08:18.650: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)<br>   10-17 19:08:18.650: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)<br>   10-17 19:08:18.650: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)<br>   10-17 19:08:18.650: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)<br>   10-17 19:08:31.911: ERROR/BatteryService(51): usbOnlinePath not found<br>   10-17 19:08:31.911: ERROR/BatteryService(51): batteryVoltagePath not found<br>   10-17 19:08:31.911: ERROR/BatteryService(51): batteryTemperaturePath not found<br>   10-17 19:08:31.931: ERROR/SurfaceFlinger(51): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake<br>   10-17 19:08:36.251: ERROR/EventHub(51): could not get driver version for /dev/input/mouse0, Not a typewriter<br>   10-17 19:08:36.251: ERROR/EventHub(51): could not get driver version for /dev/input/mice, Not a typewriter<br>   10-17 19:08:36.381: ERROR/System(51): Failure starting core service<br>   10-17 19:08:36.381: ERROR/System(51): java.lang.SecurityException<br>   10-17 19:08:36.381: ERROR/System(51):     at android.os.BinderProxy.transact(Native Method)<br>   10-17 19:08:36.381: ERROR/System(51):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)<br>   10-17 19:08:36.381: ERROR/System(51):     at android.os.ServiceManager.addService(ServiceManager.java:72)<br>   10-17 19:08:36.381: ERROR/System(51):     at com.android.server.ServerThread.run(SystemServer.java:176)<br>   10-17 19:08:36.391: ERROR/AndroidRuntime(51): Crash logging skipped, no checkin service<br>   10-17 19:08:45.626: ERROR/ActivityThread(94): Failed to find provider info for android.server.checkin<br>   10-17 19:08:47.255: ERROR/ActivityThread(94): Failed to find provider info for android.server.checkin<br>   10-17 19:08:47.375: ERROR/ActivityThread(94): Failed to find provider info for android.server.checkin<br>   10-17 19:08:49.196: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)<br>   10-17 19:08:49.435: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound<br>   10-17 19:08:49.466: ERROR/MediaPlayer(51): Unable to to create media player<br>   10-17 19:08:52.866: ERROR/AndroidRuntime(130): ERROR: thread attach failed<br>   10-17 19:09:02.006: ERROR/AndroidRuntime(185): ERROR: thread attach failed    </p><p>My OS is MAC 10.6.4, I'm using Eclipse Helios Service Release 1 with . I tried to install SDK (android-sdk_r07-mac_x86.zip) and run Hello Android: the first time I've seen hello android on the emulator screen, but from the second time (I destroyed the avd recreated it for the platform 2.1), I received that errors. </p>","478676","","","","","2010-11-19 15:17:00","Android emulator crashes when I try to run HelloAndroid","<android><android-emulator>","1","0","","",""
"3954488","1","3954698","","2010-10-17 17:54:30","1","154","<p>The only available reproducible example I can find to share with the board is the Android sample code NotePad, which is loaded into the IDE's Package Explorer as 'NotesList'.</p><p>I want to know why, in the package's NoteEditor.java, LinedEditText (extended from EditText) can't be renamed?  In other words why can't I rewrite this extended class as, say, ""Lined_EditText"" in the two lines where the word exists, in its class name and its constructor?  They are the only two locations, as far as I can determine, where the words exist in the entire package.  </p><p>(There is an org.hermit.android.widgets.LinedEditText at <a href=""http://moonblink.googlecode.com/svn/trunk/HermitAndroid/doc/org/hermit/android/widgets/LinedEditText.html"" rel=""nofollow"">http://moonblink.googlecode.com/svn/trunk/HermitAndroid/doc/org/hermit/android/widgets/LinedEditText.html</a>, but this NotePad sample in the Android SDK doesn't import that class.  The sample only imports android.widget.EditText .)</p><p>Thanks for any help.</p>","225626","","","","","2010-10-17 18:45:06","A Java question, but an Android question, here's why:","<android>","2","0","","",""
"3954526","1","","","2010-10-17 18:05:42","2","1164","<p>I need to invoke skype application and make a call from skype when a 'skype me' link (eg: skype://1866012345) is clicked from a webview. Can someone help how to do this?</p><p>I tried the following:</p><p>Downloaded skype application from market (in my driod 2.2).When launching skype, the package invoked is 'skype.android.raider' - as per ADB logs.So I tried invoking a ACTION_VIEW intent with cmp=com.skype.raider/.ui.call.SplashScreenActivity or cmp=com.skype.raider/.ui.call.SkypeOutCallActivityand data=Uri.parse(""skype://1866012345""). These did not work.</p><p>(I also did find a few posts suggesting to use skypelite component, but I guess I should ve skype lite installed for that, which could not find in the market. I assume skype lite is not in market anymore.)</p><p>(Also, i have to be able to make a phone call or email when corresponding links are clicked from WebView. As of now, I have added custom handling for each of these, but wondering if webview by default would not support it. Is there any webview setting to be enabled t do this? Any idea??)</p><p>thanks!</p>","478689","","21234","","2010-11-20 14:19:22","2011-08-05 17:25:19","Android: How to Invoke skype from WebView?","<android><android-intent><skype><android-webview>","1","3","1","",""
"3954561","1","3954908","","2010-10-17 18:16:17","1","964","<p>I've created a ListPreference in PreferenceActivity and it works good:</p><ul><li>user clicks on the Preference item</li><li>a list dialog opens (retrieves listItems and their values from array.xml)</li><li>if the user selects one of the list items it saves his selection (which I can later retrieve).</li></ul><p>My question is: how can I preform a method the second he presses one of the list items (according to the user selection)?</p><p>Appreciate any help!</p>","444324","","444324","","2010-10-17 18:30:09","2010-10-17 19:34:18","Android ListPreference - Preform a method on listItem select?","<android><listpreference>","1","0","","",""
"3954604","1","3954622","","2010-10-17 18:25:01","1","3010","<p>how can i get a variable on the imageview that i have defined in a layout.xml in the code?</p><p>thanks!</p>","97688","","","","","2013-04-16 13:02:49","android: get imageview in code","<android>","1","5","","",""
"3954675","1","","","2010-10-17 18:38:57","0","650","<p>Trying to implement simple dictionary. I want to make it so while the user is typing in the EditText box the list to scroll automatically to the best match. I don't want it to filter the list. For example if the user types ""s"" in the EditText I want the first word that s/he sees under the EditText box to be the first word in the dictionary that starts with ""s."" But the user should still be able to slide up and down and to be able to see the entire list of words. It is basically like a go to functionality. I used ArrayList to store my list of words. The data is in res/raw/data.xml file. Here is my onCreate method    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    wordListView = (ListView)findViewById(R.id.wordList);    myEditText = (EditText)findViewById(R.id.myEditText);    words = new ArrayList&lt;Word&gt;();    arrAdap = new ArrayAdapter&lt;Word&gt;(this, android.R.layout.simple_list_item_1, words);    wordListView.setAdapter(arrAdap);    try {     InputStream inSource = getResources().openRawResource(R.raw.data);     DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();     Document doc = builder.parse(inSource, null);     NodeList wordsList = doc.getElementsByTagName(""eng-bg"");     int length = wordsList.getLength();     for(int i = 0; i&lt;length; i++) {      Element entry = (Element)wordsList.item(i);      Element eng = (Element)entry.getElementsByTagName(""english"").item(0);      Element bul = (Element)entry.getElementsByTagName(""bulgarian"").item(0);      Element id = (Element)entry.getElementsByTagName(""ID"").item(0);      String english = eng.getFirstChild().getNodeValue();      String bulgarian = bul.getFirstChild().getNodeValue();      int wordId = Integer.parseInt(id.getFirstChild().getNodeValue());      Word word = new Word(bulgarian, english, wordId);      addNewWord(word);     }} catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace();} catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace();} catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace();}  wordListView.setOnItemClickListener(new OnItemClickListener(){ public void onItemClick(AdapterView&lt;?&gt; parent, View view, int pos, long id) {  selectedWord = words.get(pos);  showDialog(TRANS_DIALOG);  myEditText.setText(selectedWord.getEnglish()); }});myEditText.addTextChangedListener(new TextWatcher(){     public void onTextChanged(CharSequence s, int start, int before, int count) {      }@Overridepublic void afterTextChanged(Editable s) {// TODO Auto-generated method stub}@Overridepublic void beforeTextChanged(CharSequence s, int start, int count,  int after) { // TODO Auto-generated method stub}    });}</code></pre>","478706","","59058","","2010-10-17 19:24:49","2010-10-17 19:35:44","Android: trying to find an item in a list without filtering the list but just scrolling to that item","<android>","1","0","","",""
"3954678","1","3954820","","2010-10-17 18:39:39","0","789","<p>I want to use a control similar to Swing JSpinner in an Android application. I know that Android has a widget called Spinner, but it's more like a combo box than a JSpinner. I've noticed that DatePicker and TimePicker widgets are using components that are just like JSpinner. The only problem is that I don't really want Date or Time. I just want to get some integer, say from 1 to 50, that user chooses. Is this possible? I've searched Android API reference in and out, but I couldn't find any clue on how to do this. Any help or hint would be much appreciated.</p><p>Thanks,Tomislav</p>","342435","","","","","2010-10-18 00:57:55","Android equivalent to Java's Swing JSpinner","<android>","2","0","0","",""
"3954846","1","","","2010-10-17 19:21:09","2","3253","<p>I'm new in Java/Android programming, so please have patience with me.</p><p>I try to play a mp3 which is locate und the assets folder. I know there is another way with the /res/raw/ folder, but use the assets-folder because later I'll try to access the file by String.</p><p>This code works to play a mp3-file:</p><pre><code>        try    {        MediaPlayer mp = new MediaPlayer();         FileDescriptor sfd = getAssets().openFd(""song.mp3"").getFileDescriptor();         mp.setDataSource(sfd);         mp.prepare();         mp.start();    }    catch(Exception e) {}</code></pre><p>Now the problem: In the same assets-folder is another mp3 file stored. Though I specify the name of the mp3 to use it take the one which comes first in alphabet. E.g. the other file is named ""music.mp3"" it plays this one. Renaming it to ""worldmusic.mp3"" it will play ""song.mp3"". Rerename ""worldmusic.mp3"" back to ""music.mp3"" it will take this mp3 again. Another test: Renaming ""song.mp3"" to something other so the application can find whats specify by the code above will result that no song is played. So this means the songname have to exist, although it take arbitrary the song first in alphabet.</p><p>I'm testing with the AVD emulator of eclipse. But I think the behaviour would be the same on a real device.</p><p>Have someone an idea about this problem?</p>","478730","","478730","","2010-10-17 19:33:07","2011-10-16 06:29:14","Android Assets-Folder: it takes always the first file by alphabetical order","<android><assets>","2","0","1","",""
"3954948","1","3955098","","2010-10-17 19:44:36","1","1720","<p>I am going to create a gallery view where the user shall switch between different pictures of products. On some of them is going to be a label like ""sale"" and a short discription. On startup I want to display a loading animation at that place until the product photo is downloaded. </p><ol><li>Use layer list or state list for one product photo?</li><li>Could you please show me, how to set that up? </li><li>How to make <a href=""http://dl.dropbox.com/u/299320/android-drawables/1.6/spinner_black_76.png"" rel=""nofollow"">that spinner</a> spin? </li><li>How to turn it on or off (how to access the layer list through code)?</li></ol><p><em>By the way, is ""spinner"" the best word for <a href=""http://dl.dropbox.com/u/299320/android-drawables/1.6/spinner_black_76.png"" rel=""nofollow"">this?</a> It seems to stand for several things. Feel free to edit this question, if I didn't hit the right words.</em></p>","433718","","21234","","2010-12-08 11:02:26","2011-07-21 20:02:10","Show spinner wheel instead of image while downloading the source","<android><animation><android-widget><spinner><layer>","2","0","3","",""
"3955129","1","3955624","","2010-10-17 20:30:28","0","1423","<p>I am trying to run a service that polls the server every ten seconds and broadcasts the intent. I tried using Thread.sleep(10000) but that dint work. I found out about this START_NOT_STICKY constant used in the service. But I am unable to figure how do I use it. Can someone please help.</p><pre><code>@Override    public int onStartCommand(Intent intent, int flags, int startId) {        handleStart(intent, startId);        return START_NOT_STICKY;    }</code></pre>","377337","","","","","2010-10-17 22:41:38","how to use START_NOT_STICKY","<android>","1","0","","",""
"3955171","1","6812999","","2010-10-17 20:38:44","0","877","<p>I want to record a sample from the microphone, then I want to play the recorded file maximizing the volume and apply some audio effect, like modifing sample rate or addind an echo.</p><p>Waht is the best way? is there an example?</p>","50455","","","","","2011-07-25 07:37:50","How can I apply an audio effect to a recorded audio?","<android><audio>","2","0","","",""
"3955326","1","3955340","","2010-10-17 21:14:40","1","251","<p>I want to know when Android's contact launch activity is opened because my application opens after a call is finished and then the contact launch activity is opened after it meaning it will cover my app's activity leading to that I have to press ""back"" button to see my app.</p><p>That is, I want to open my app after contact launch activity has been opened.All help is greatly appreciated!</p>","222773","","","","","2010-10-17 21:17:59","How do I listen to Android's contacts launch activity?","<java><android><activity><phone>","1","0","","",""
"3955410","1","3955826","","2010-10-17 21:34:04","16","4570","<p>I'm trying to have my IntentService show a Toast message,but when sending it from the onHandleIntent message, the toast shows but gets stuck and the screen and never leaved.I'm guessing its because the onHandleIntent method does not happen on the main service thread, but how can I move it?</p><p>Has anyone has this issue and solved it?</p>","406682","","109941","","2013-12-19 19:39:59","2014-01-02 15:54:06","create toast from IntentService","<android><multithreading><intentservice><android-toast>","1","0","6","",""
"3955411","1","3955470","","2010-10-17 21:34:22","0","172","<p>I am trying to write the logic for an animation sequence and can't seem to get the thing right.  What I want to happen is: if the user clicks on the screen, the method takes in the touchEvent coordinates, and then changes the movement variables of a sprite so that the sprite travels to where the user touched the screen.  I have my ""launch"" event setup like this.</p><pre><code> public void launch(float eventX, float eventY) {    //get the touch event coords and then move the banana to them.    fire = true;               //the x and y variables for the sprite    getX();    getY();               //the target x and y variables    targetX = eventX;    targetY = eventY;               //the total distance the two variable have to ""travel""    distanceX = x - targetX;    distanceY = y - targetY;               //variables to update the movement    moveX = distanceX;    moveY = distanceY;}</code></pre><p>Then, I thought I was supposed to put the movement variables in the update method like this:</p><pre><code> public void update(long gameTime) {    if(gameTime &gt; frameTicker + framePeriod) {        frameTicker = gameTime;        currentFrame++;        if(currentFrame &gt;= frameNbr){            currentFrame = 0;        }    }    this.sourceRect.left = currentFrame * spriteWidth;    this.sourceRect.right = this.sourceRect.left + spriteWidth;    if(fire == true){        x = (int) moveX;        y = (int) moveY;    }</code></pre><p>If the user clicks as it is, the animation shows up like it's supposed to, but then instantaneously goes to the top left corner of the screen or what I have come to understand is (0,0) on a coordinate system.  I can't figure out how to slow it down so that it moves at a reasonable space and goes where it is supposed to.</p>","436204","","","","","2010-10-17 21:53:32","Android Animation Question","<android>","1","0","","",""
"3955531","1","3955542","","2010-10-17 22:18:08","1","1110","<p>Obviously the answer is no... right? The reason I ask is because I have this string defined in XML for an Android app:</p><pre><code>&lt;string name=""foo""&gt;&lt;![CDATA[&lt;html&gt;&lt;body&gt;&lt;p&gt;This%20is%20a%20test&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;]]&gt;&lt;/string&gt;</code></pre><p>All I do to the string is read it, and display in an HTML view. I would <em>not</em> have expected the <code>%20</code>s to be interpreted, yet they are. Is this the correct behaviour, or is Android being typically buggy?</p>","265521","","","","","2010-10-17 22:21:45","Is CDATA supposed to be URL-encoded?","<html><android><xml><urlencode><cdata>","1","2","","",""
"3955706","1","3956019","","2010-10-17 23:06:33","2","1873","<p>One part of my layout is supposed to have two components: A ScrollView on top, and a MapView on the bottom. Both views should be exactly half the size of the parent.</p><p>I have the size of the parent (I'm switching to this layout at a point when I already have the size), but I don't know how to define the maximum size. Besides, I figure there is a solution that doesn't require defining the size; for example by having something like a Swing-style GridLayout, or defining a weight somewhere, but I haven't found anything that sounds like it would work.</p><p>My current approach is this here, which defines the minimum size, which obviously falls apart as soon as the ScrollView grows beyond half the height of the parent:</p><p>The layout (the parent is a LinearLayout):</p><pre><code>&lt;LinearLayout    android:id=""@+id/result_layout""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:visibility=""gone""    &gt;&lt;ScrollView    android:id=""@+id/result_scroll""    android:layout_height=""fill_parent""    android:layout_width=""fill_parent""    android:orientation=""vertical""    &gt;&lt;LinearLayout    android:id=""@+id/result""    android:layout_height=""fill_parent""    android:layout_width=""wrap_content""    android:paddingRight=""?android:attr/scrollbarSize""    android:orientation=""vertical""/&gt;&lt;/ScrollView&gt;&lt;view class=""com.google.android.maps.MapView""    android:id=""@+id/mapview""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""  /&gt;&lt;/LinearLayout&gt;</code></pre><p>And the code, after I switch to it (totalWidth being the width of the parent, viewHeight half the height of the parent):</p><pre><code>LinearLayout.LayoutParams lp =            new LinearLayout.LayoutParams(totalWidth, viewHeight);scrollView.setLayoutParams(lp);</code></pre>","345717","","345717","","2010-10-18 01:08:16","2010-10-18 01:20:42","How to define a maximum or relative dimension in a view?","<android><android-layout>","1","0","","",""
"3955786","1","3955838","","2010-10-17 23:29:56","8","1015","<p>My app works with pictures. It can take multiple pictures as an input, process them, and send them again to another app.</p><p>As a consequence, my main <code>Activity</code> has declared an intent filter on <code>ACTION_SEND_MULTIPLE</code> for <code>image/*</code> mimetypes and can result in issuing a new <code>Intent</code> with the same action and data type using <code>Activity.startActivity(Intent)</code>.</p><p>Is there a way to exclude my own activity from the list of apps that is displayed to the user after the <code>startActivity()</code> call ?</p>","343816","","","","","2010-10-17 23:49:36","How to exclude my own Activity from Activity.startActivity(Intent) chooser?","<android><activity><android-intent><intentfilter>","1","2","1","",""
"3955840","1","","","2010-10-17 23:50:17","1","2714","<p>I want to build MusicPlayer, using source code of standart android music player(projects / platform/packages/apps/Music). I also renamed the package (for no conflict with emulator app)</p><p>When I build the project and run it, I have following error:Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED</p><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!-- Copyright (C) 2007 The Android Open Source Project     Licensed under the Apache License, Version 2.0 (the ""License"");     you may not use this file except in compliance with the License.     You may obtain a copy of the License at          http://www.apache.org/licenses/LICENSE-2.0     Unless required by applicable law or agreed to in writing, software     distributed under the License is distributed on an ""AS IS"" BASIS,     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     See the License for the specific language governing permissions and     limitations under the License.--&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""        package=""com.com.zune_player""        android:versionCode=""1""        android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;    &lt;uses-permission android:name=""android.permission.SYSTEM_ALERT_WINDOW"" /&gt;    &lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;    &lt;application android:icon=""@drawable/app_music""        android:label=""@string/musicbrowserlabel""        android:taskAffinity=""android.task.music""        android:allowTaskReparenting=""true""&gt;        &lt;activity android:name=""com.com.zune_player.MusicBrowserActivity""            android:theme=""@android:style/Theme.NoTitleBar""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;action android:name=""android.intent.action.MUSIC_PLAYER"" /&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;        &lt;receiver android:name=""com.com.zune_player.MediaButtonIntentReceiver""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MEDIA_BUTTON"" /&gt;                &lt;action android:name=""android.media.AUDIO_BECOMING_NOISY"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;        &lt;!-- This is the ""current music playing"" panel, which has special             launch behavior.  We clear its task affinity, so it will not             be associated with the main media task and if launched             from a notification will not bring the rest of the media app             to the foreground.  We make it singleTask so that when others             launch it (such as media) we will launch in to our own task.             We set clearTaskOnLaunch because the user             can go to a playlist from this activity, so if they later return             to it we want it back in its initial state.  We exclude from             recents since this is accessible through a notification when             appropriate. --&gt;        &lt;activity android:name=""com.com.zune_player.MediaPlaybackActivity""                android:theme=""@android:style/Theme.NoTitleBar""                android:label=""@string/mediaplaybacklabel""                android:taskAffinity=""""                android:launchMode=""singleTask""                android:clearTaskOnLaunch=""true""                android:excludeFromRecents=""true"" &gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:scheme=""content""/&gt;                &lt;data android:scheme=""file""/&gt;                &lt;data android:mimeType=""audio/*""/&gt;                &lt;data android:mimeType=""application/ogg""/&gt;                &lt;data android:mimeType=""application/x-ogg""/&gt;                &lt;data android:mimeType=""application/itunes""/&gt;            &lt;/intent-filter&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.android.music.PLAYBACK_VIEWER"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.StreamStarter""                android:theme=""@android:style/Theme.Dialog"" &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"" /&gt;                &lt;data android:mimeType=""audio/mp3""/&gt;                &lt;data android:mimeType=""audio/x-mp3""/&gt;                &lt;data android:mimeType=""audio/mpeg""/&gt;                &lt;data android:mimeType=""audio/mp4""/&gt;                &lt;data android:mimeType=""audio/mp4a-latm""/&gt;                &lt;data android:mimeType=""application/ogg""/&gt;                &lt;data android:mimeType=""application/x-ogg""/&gt;                &lt;data android:mimeType=""audio/ogg""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.ArtistAlbumBrowserActivity""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:mimeType=""vnd.android.cursor.dir/artistalbum""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.AlbumBrowserActivity""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:mimeType=""vnd.android.cursor.dir/album""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.TrackBrowserActivity""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.EDIT"" /&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:mimeType=""vnd.android.cursor.dir/track""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.QueryBrowserActivity""                android:theme=""@android:style/Theme.NoTitleBar""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.SEARCH"" /&gt;                &lt;action android:name=""android.intent.action.MEDIA_SEARCH"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data                android:name=""android.app.searchable""                android:resource=""@xml/searchable""            /&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.PlaylistBrowserActivity""                android:label=""@string/musicbrowserlabel""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:mimeType=""vnd.android.cursor.dir/playlist""/&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;data android:mimeType=""vnd.android.cursor.dir/playlist""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity-alias android:name=""com.android.music.PlaylistShortcutActivity""            android:targetActivity=""com.android.music.PlaylistBrowserActivity""            android:label=""@string/musicshortcutlabel""            android:icon=""@drawable/ic_launcher_shortcut_music_playlist""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.CREATE_SHORTCUT"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity-alias&gt;        &lt;activity android:name=""com.com.zune_player.VideoBrowserActivity""            android:taskAffinity=""android.task.video""            android:label=""@string/videobrowserlabel""            android:icon=""@drawable/app_video""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:mimeType=""vnd.android.cursor.dir/video""/&gt;            &lt;/intent-filter&gt;&lt;!--            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;--&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.MediaPickerActivity""                android:label=""@string/mediapickerlabel""&gt;&lt;!--            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;data android:mimeType=""media/*""/&gt;                &lt;data android:mimeType=""audio/*""/&gt;                &lt;data android:mimeType=""application/ogg""/&gt;                &lt;data android:mimeType=""application/x-ogg""/&gt;                &lt;data android:mimeType=""video/*""/&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;category android:name=""android.intent.category.OPENABLE"" /&gt;                &lt;data android:mimeType=""media/*""/&gt;                &lt;data android:mimeType=""audio/*""/&gt;                &lt;data android:mimeType=""application/ogg""/&gt;                &lt;data android:mimeType=""application/x-ogg""/&gt;                &lt;data android:mimeType=""video/*""/&gt;            &lt;/intent-filter&gt;--&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.MusicPicker""                android:label=""@string/music_picker_title""&gt;            &lt;!-- First way to invoke us: someone asks to get content of                 any of the audio types we support. --&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;category android:name=""android.intent.category.OPENABLE"" /&gt;                &lt;data android:mimeType=""audio/*""/&gt;                &lt;data android:mimeType=""application/ogg""/&gt;                &lt;data android:mimeType=""application/x-ogg""/&gt;            &lt;/intent-filter&gt;            &lt;!-- Second way to invoke us: someone asks to pick an item from                 some media Uri. --&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.PICK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.OPENABLE"" /&gt;                &lt;data android:mimeType=""vnd.android.cursor.dir/audio""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name=""com.com.zune_player.CreatePlaylist""            android:theme=""@android:style/Theme.Dialog"" /&gt;        &lt;activity android:name=""com.com.zune_player.RenamePlaylist""            android:theme=""@android:style/Theme.Dialog"" /&gt;        &lt;activity android:name=""com.com.zune_player.WeekSelector""            android:theme=""@android:style/Theme.Dialog"" /&gt;        &lt;activity android:name=""com.com.zune_player.DeleteItems""            android:theme=""@android:style/Theme.Dialog"" /&gt;        &lt;activity android:name=""com.com.zune_player.ScanningProgress""            android:theme=""@android:style/Theme.Dialog"" /&gt;        &lt;service android:name=""com.com.zune_player.MediaPlaybackService""            android:exported=""true"" /&gt;        &lt;receiver android:name=""com.com.zune_player.MediaAppWidgetProvider""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.appwidget.provider"" android:resource=""@xml/appwidget_info"" /&gt;        &lt;/receiver&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre>","457683","","1288","","2011-09-21 11:08:40","2011-09-21 11:08:40","Android, build music app?","<android><android-music-player>","0","1","","",""
"3956218","1","","","2010-10-18 02:14:21","0","1146","<p>I have a dynamic table layout created in OnCreate(). Everytime the activity resumes, the data in the table rows can change, so I would like to destroy the table rows and create new ones.How can I do that? Thanks!!!</p><p>Here is what the OnCreate table creation portion looks like:</p><pre><code>    tableLayout tl = new TableLayout(this);    for (i = 0; i &lt; numberOfVariables; i++) {        TableRow tr = new TableRow(this);        CheckBox cb = new CheckBox(this);        tr.addView(cb);        TextView dv = new TextView(this);        tr.addView(dv);        EditText et = new EditText(this);        tr.addView(et);        tl.addView(tr);    }    ll.addView(tl);</code></pre>","478872","","244296","","2010-10-18 02:27:17","2010-10-18 02:27:17","Dynamically re-creating a table layout","<android><dynamic><tablelayout>","1","0","","",""
"3956240","1","4012756","","2010-10-18 02:21:06","0","1953","<p>I have a video stream that I used in an iPhone application. I'm now working to port the application to Android so I want to use the same stream.</p><p>As Apple requiered, I created a HTTP Live Streaming (media segmenter, m3u8 file, etc.). You can find the stream here: <a href=""http://envue.insa-lyon.fr/smartphone/aloun_stream/prog_index.m3u8"" rel=""nofollow"">http://envue.insa-lyon.fr/smartphone/aloun_stream/prog_index.m3u8</a> . </p><p>I want to use this same stream on Android. Did someone have the same a resembling experience?  </p>","473887","","73488","","2010-10-18 02:29:38","2011-10-24 09:27:41","Stream video on Android","<iphone><android><http><video><streaming>","4","3","3","",""
"3956300","1","","","2010-10-18 02:42:48","6","7764","<p>I am designing a simple Android game using a surfaceview similar to the Lunar Lander sample provided by Google. I want to have various things such as highscores, messages, menus etc pop up on screen with the surface view still in the background.</p><p>The problem is that I want the ""pop ups"" to contain many design elements such as images, textboxes etc. Is there a way that I can create a layout in XML to design the pop up I want and then display that over the surfaceview as one object rather than having to construct each individual element one by one in code and paint them all to the canvas?</p><p>I want to animate the pop ups in from the side of the screen, so it would be good if I design the layout in XML so that all the object know their relation to each other and then animate that layout as one object.</p><p>It strikes me as something quite simple but I just cant seem to find how to achieve it.</p>","478928","","","","","2010-10-18 06:09:47","Overlay an Android layout on a surfaceview","<android><layout><overlay><surfaceview>","2","0","2","",""
"3956304","1","","","2010-10-18 02:44:04","-1","492","<p>Hi I am making a app that fetches a xml file and displays the results with a button labeled get it. I need help with when the button is clicked it will take the .pkg file url in the xml file and download it with some sort of progress reporting. Any help would be awesome thanks in advance. Here is what I have so far it has a error in the download code I tried maybe someone can fix this for me. I am stumped also the links are to .pkg files </p><p>package com.mypackagename;</p><p>import java.io.IOException;import java.io.InputStream;import java.io.UnsupportedEncodingException;import java.net.HttpURLConnection;import java.net.MalformedURLException;import java.net.URL;import java.net.URLConnection;import java.util.ArrayList;import java.util.List;import javax.net.ssl.HttpsURLConnection;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpPost;import org.apache.http.client.params.ClientPNames;import org.apache.http.client.params.CookiePolicy;import org.apache.http.entity.StringEntity;import org.apache.http.protocol.HttpContext;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.Node;import org.w3c.dom.NodeList;import android.app.Activity;import android.app.ListActivity;import android.content.Context;import android.content.Intent;import android.content.DialogInterface.OnClickListener;import android.graphics.drawable.Drawable;import android.os.AsyncTask;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.Button;import android.widget.ImageView;import android.widget.TextView;</p><p>import java.io.BufferedInputStream;</p><p>import java.io.File;</p><p>import java.io.FileOutputStream;</p><p>import java.io.IOException;</p><p>import java.io.InputStream;</p><p>import java.net.URL;</p><p>import java.net.URLConnection;</p><p>import org.apache.http.util.ByteArrayBuffer;</p><p>import android.util.Log;</p><p>public class MainActivity extends ListActivity {    String XML_URL = ""http://www.mysite.com/book.xml"";    private DocumentBuilder docBuilder;    private Document doc;    private DocumentBuilderFactory docBuilderFactory;    private String bookImageUrl;    private int nodeListbooksLength;    private String bookId;    private String bookUrl;    private String bookDescription;    private String bookTitle;</p><pre><code>ButtonListMenuAdapter notes;ArrayList&lt;Book&gt; list;TextView tv_title;ImageView iv_logo;private String Title;  Drawable booksImagesList[];/** Called when the activity is first created. 1 */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv_title = (TextView) findViewById(R.id.TextView01);    iv_logo = (ImageView) findViewById(R.id.ImageView01);    list = new ArrayList&lt;Book&gt;();    parseXML();    notes = new ButtonListMenuAdapter(             this,             R.layout.book_row,            list );    setListAdapter( notes );}private void parseXML(){    try{        Log.d(""MainActivity"", ""Connecting Server"");        InputStream inStream =openHttpConnection(XML_URL);        Log.d(""MainActivity"", ""Fetching Data Completed"");        if(inStream!=null){            docBuilderFactory = DocumentBuilderFactory.newInstance();            docBuilderFactory.setCoalescing(true);            docBuilder = docBuilderFactory.newDocumentBuilder();            docBuilder.isValidating();            doc = docBuilder.parse(inStream);            NodeList nodeListbookTitle = doc.getDocumentElement().getElementsByTagName(""Title1"");            if(nodeListbookTitle.getLength()&gt;0){                Element elementbooktitile = (Element) nodeListbookTitle.item(0);                NodeList nodeListElementbooktitle = elementbooktitile.getChildNodes();                if(nodeListElementbooktitle.getLength()&gt;0)                {                    Title = ((Node) nodeListElementbooktitle.item(0)).getNodeValue();                    Log.d(""MainActivity"", ""Title:""+Title);                    tv_title.setText(Title);                }            }            NodeList nodeListbookBanner = doc.getDocumentElement().getElementsByTagName(""logo"");            if(nodeListbookBanner.getLength()&gt;0){                Element elementTeamBanner = (Element) nodeListbookBanner.item(0);                NodeList nodeListElementTeamBanner = elementTeamBanner.getChildNodes();                if(nodeListElementTeamBanner.getLength()&gt;0)                {                    bookImageUrl = ((Node) nodeListElementTeamBanner.item(0)).getNodeValue();                    try {                        DownloadFilesTask d = new DownloadFilesTask();                        d.execute(new URL(bookImageUrl));                        d.sendObjectImageView(iv_logo);                    } catch (Exception e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                        Log.d(""ERROR getView"", ""EX::""+e);                    }                    Log.d(""MainActivity"", ""bookImageUrl:""+bookImageUrl);                    Log.d(""MainActivity"", """");                }            }            NodeList nodeListbook = doc.getDocumentElement().getElementsByTagName(""Book"");            Log.d(""MainActivity"",""nodeListbook Length--""+nodeListbook.getLength());            nodeListbooksLength=nodeListbook.getLength();            booksImagesList = new Drawable[nodeListbooksLength+1];            if(nodeListbooksLength&gt;0){                for(int v=0;v&lt;nodeListbooksLength;v++){                    Node nodebook = nodeListbook.item(v);                    if (nodebook.getNodeType() == Node.ELEMENT_NODE){                        Element elementbookResult = (Element) nodebook;                        bookId=elementbookResult.getAttribute(""bid"");                        Log.d(""MainActivity"",""----in bookId- -&gt;""+v+""   ""+bookId);                        bookImageUrl=elementbookResult.getAttribute(""bimg"");                        Log.d(""MainActivity"",""--bookImageUrl---&gt;""+bookImageUrl);                        bookTitle=elementbookResult.getAttribute(""bte"");                        Log.d(""MainActivity"",""--bookTitle---&gt;""+bookTitle);                        bookDescription=elementbookResult.getAttribute(""bsd"");                        Log.d(""MainActivity"",""--bookDescription---&gt;""+bookDescription);                        bookUrl=elementbookResult.getAttribute(""bph"");                        Log.d(""MainActivity"",""--bookUrl:---&gt;""+bookUrl);                        list.add( new Book( bookId, bookImageUrl,bookTitle,bookDescription,bookUrl) );                    }                }            }        }    }catch(Exception e){        Log.d(""MainActivity"", ""parseXML:""+e);    }}private InputStream openHttpConnection(String urlStr) {    InputStream in = null;    int resCode = -1;    try {        Log.d(""openHttpConnection"", ""URL:""+urlStr);        URL url = new URL(urlStr);        URLConnection urlConn = url.openConnection();        if (!(urlConn instanceof HttpURLConnection)) {            throw new IOException (""URL is not an Http URL"");        }        Log.d(""openHttpConnection"", ""httpConn:1"");        HttpURLConnection httpConn = (HttpURLConnection)urlConn;        httpConn.setAllowUserInteraction(false);        httpConn.setInstanceFollowRedirects(true);        httpConn.setRequestMethod(""GET"");        httpConn.setRequestProperty(""User-Agent"", ""Mozilla/5.0 (X11; U; Linux ""+""i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)"");        httpConn.setRequestProperty(""Content-Type"", ""application/x-www-form-urlencoded"");        Log.d(""openHttpConnection"", ""setting requests and properties"");        httpConn.connect();         Log.d(""openHttpConnection"", ""Connected successfully"");        resCode = httpConn.getResponseCode();            Log.d(""openHttpConnection"", ""resCode""+resCode);        if (resCode == HttpURLConnection.HTTP_OK) {            in = httpConn.getInputStream();             Log.d(""openHttpConnection"", ""Fetchinf data done"");        }             } catch (MalformedURLException e) {        e.printStackTrace();        Log.d(""openHttpConnection"", ""1""+e);    } catch (IOException e) {        e.printStackTrace();        Log.d(""openHttpConnection"", """"+e);    }    return in;}private HttpClient httpClient;private HttpPost httpPost;private HttpResponse response;private HttpContext localContext;private String ret;private InputStream postPage(String url, String data) {    InputStream is = null;    ret = null;    httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109);    httpPost = new HttpPost(url);    response = null;    StringEntity tmp = null;            httpPost.setHeader(""User-Agent"", ""Mozilla/5.0 (X11; U; Linux "" +        ""i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)"");    httpPost.setHeader(""Accept"", ""text/html,application/xml,"" +        ""application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"");    httpPost.setHeader(""Content-Type"", ""application/x-www-form-urlencoded"");    try {        tmp = new StringEntity(data,""UTF-8"");    } catch (UnsupportedEncodingException e) {        System.out.println(""HTTPHelp : UnsupportedEncodingException : ""+e);    }    httpPost.setEntity(tmp);    try {        response = httpClient.execute(httpPost,localContext);    } catch (ClientProtocolException e) {        System.out.println(""HTTPHelp : ClientProtocolException : ""+e);    } catch (IOException e) {        System.out.println(""HTTPHelp : IOException : ""+e);    }             ret = response.getStatusLine().toString();            HttpEntity he = response.getEntity();            try {                InputStream inStream = he.getContent();                is = inStream;            } catch (IllegalStateException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            return is;    }class Book{    public String getBookId() {        return bookId;    }    public String getBookImageUrl() {        return bookImageUrl;    }    public String getBookTitle() {        return bookTitle;    }    public String getBookDescription() {        return bookDescription;    }    public String getBookUrl() {        return bookUrl;    }    private String bookId;    private String bookImageUrl;    private String bookTitle;    private String bookDescription;    private String bookUrl;    public Book(String bookId, String bookImageUrl, String bookTitle,String bookDescription, String bookUrl) {        this.bookId = bookId;        this.bookImageUrl = bookImageUrl;        this.bookTitle = bookTitle;        this.bookDescription = bookDescription;        this.bookUrl = bookUrl;    }}public class ButtonListMenuAdapter extends BaseAdapter {    public static final String LOG_TAG = ""ButtonListAdapter"";    private Context context;    private List&lt;Book&gt; menuList;    private int rowResID;    public ButtonListMenuAdapter(MainActivity context, int rowResID,            ArrayList&lt;Book&gt; menuList) {        // TODO Auto-generated constructor stub        this.context = context;        this.rowResID = rowResID;        this.menuList = menuList;    }    public int getCount() {                                return menuList.size();    }    public Object getItem(int position) {             return menuList.get(position);    }    public long getItemId(int position) {          return position;    }    public View getView(final int position, View convertView, ViewGroup parent) {         final Book row = menuList.get(position);        LayoutInflater inflater = LayoutInflater.from( context );        View v = inflater.inflate(  rowResID, parent, false );        TextView tv_title = (TextView)v.findViewById(R.id.Text_book_title);        tv_title.setText(row.getBookTitle());        TextView tv_desc = (TextView)v.findViewById(R.id.Text_Book_Desc);        tv_desc.setText(row.getBookDescription());        ImageView iv_book_img = (ImageView)v.findViewById(R.id.Image_book);        if(booksImagesList[position]==null)        {            try {                DownloadFilesTask d = new DownloadFilesTask();                d.execute(new URL(row.getBookImageUrl()));                d.sendObjectImageView(iv_book_img,position);            } catch (Exception e) {                // TODO Auto-generated catch block                e.printStackTrace();                Log.d(""ERROR getView"", ""EX::""+e);            }        }        else        {            iv_book_img.setImageDrawable(booksImagesList[position]);            Log.d(""Not"",""Reloaded"");        }        Button b_get_book = (Button)v.findViewById(R.id.Button01);        b_get_book.setOnClickListener(                new View.OnClickListener()                {                                  public void onClick(View v) {                                private final String PATH = ""/mnt/sdcard/"";  //put the downloaded file here                                public void DownloadFromUrl(String bookUrl, String fileName) {  //this is the downloader method                                        try {                                                URL url = new URL(""http://mysite.com/"" + bookUrl); //you can write here any link                                                File file = new File(fileName);                                                long startTime = System.currentTimeMillis();                                                Log.d(""ImageManager"", ""download begining"");                                                Log.d(""ImageManager"", ""download url:"" + url);                                                Log.d(""ImageManager"", ""downloaded file name:"" + fileName);                                                /* Open a connection to that URL. */                                                URLConnection ucon = url.openConnection();                                                /*                                                 * Define InputStreams to read from the URLConnection.                                                 */                                                InputStream is = ucon.getInputStream();                                                BufferedInputStream bis = new BufferedInputStream(is);                                                /*                                                 * Read bytes to the Buffer until there is nothing more to read(-1).                                                 */                                                ByteArrayBuffer baf = new ByteArrayBuffer(50);                                                int current = 0;                                                while ((current = bis.read()) != -1) {                                                        baf.append((byte) current);                                                }                                                /* Convert the Bytes read to a String. */                                                FileOutputStream fos = new FileOutputStream(PATH+file);                                                fos.write(baf.toByteArray());                                                fos.close();                                                Log.d(""ImageManager"", ""download ready in""                                                                + ((System.currentTimeMillis() - startTime) / 1000)                                                                + "" sec"");                                        } catch (IOException e) {                                                Log.d(""ImageManager"", ""Error: "" + e);                                        }                                }                    }           });        return v;    }}private class DownloadFilesTask extends AsyncTask&lt;URL, Integer, Long&gt; {    ImageView iv;    int id;    protected Long doInBackground(URL... urls) {        int count = urls.length;        long totalSize = 0;        downloadDrawable(urls[0].toString());        return totalSize;    }    public void sendObjectImageView(ImageView ivLogo) {        // TODO Auto-generated method stub        this.iv = ivLogo;        id = -1;    }    public void sendObjectImageView(ImageView iv,int id) {        // TODO Auto-generated method stub        this.iv = iv;        this.id = id;    }    protected void onProgressUpdate(Integer... progress) {        Log.d(""DownloadFilesTask"", ""onProgressUpdate""+progress[0]);    }    protected void onPostExecute(Long result) {        Log.d(""DownloadFilesTask"", ""onPostExecute""+result);        if(d!=null &amp;&amp; iv!=null)        {            iv.setImageDrawable(d);            if(id!=-1)            booksImagesList[id] = d;        }    }    private Drawable d;    public Drawable downloadDrawable(String imageUrl) {        try {            Log.d(""downloadDrawable"", ""Starting Connection"");            URL url = new URL(imageUrl);            URLConnection conn = url.openConnection();            conn.connect();            Log.d(""downloadDrawable"", ""Connection Created Successfully"");            InputStream is = conn.getInputStream();            Log.d(""downloadDrawable"", ""InputStream created Successfully"");            d = Drawable.createFromStream(is, url.toString());            Log.d(""downloadDrawable"", ""Drawable created Successfully"");            is.close();        } catch (IOException e) {           Log.d(""ERROR3"", ""Ex::""+e);        }         return d;    }}</code></pre><p>}</p>","475994","","","","","2010-10-18 03:13:57","Can someone help me with some file download code","<android>","1","5","","",""
"3956318","1","","","2010-10-18 02:49:10","0","2322","<p>Has anyone had any success getting an android device to participate in a two-way SSL hanshake? ie with a client cert involved on the device?  After installing the client cert from the sd card - i cannot connect to the URL that requires a two way ssl handshake in either the browser or the mail app.  (we secure our mail server behind a hardware appliance that establishes the SSL connection).</p><p>The Device just throws an SSL handshake error.  Our setup works on all desktop browsers, iphones and WinMo devices with the client cert installed.</p><p>This is the error log from the device (HTC Desire with 2.1):</p><pre><code>D/EAS_AppSvc(  422): 06021143 &gt; testServer()D/EAS_AppSvc(  422): 06021143 &gt; initEASService()V/EAS DeviceInfo(  422):  GetDeviceID: 4020b869D/EAS_AppSvc(  422): 06021143   (1)connect to &gt; https://serverxxx.com.au/Microsoft-Server-ActiveSync?User=u415434&amp;DeviceId=HTCAnd4020b869&amp;DeviceType=htcbravoI/AlertDialog(  422): [onCreate] auto launch SIP.D/EASProgressDialog(  422): 06021143 onStart()D/EAS_AppSvc(  422): 06021143 onServiceStateChanged :serviceState = 0 home Telstra Mobile (N/A) 50501  HSDPA CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EriInd: -1EriMode: -1RadioPowerSv: falseI/LockUtil(  422): 06021143 - acquire PowerLock - PARTIAL_WAKE_LOCK: EAS_NETWORK_CHANGED/EAS_AppSvc(  422): 06021143 isWifiNetwork: falseD/EAS_AppSvc(  422): 06021143 isWifiNetwork: falseD/EAS_AppSvc(  422): 06021143 isMobileNetwork: trueD/EAS_AppSvc(  422): 06021143 NETWORK_STATE_CHANGED: isWifi:false, isMobile:trueD/EAS_AppSvc(  422): 06021143 SvcHandler - Account not configuredI/LockUtil(  422): 06021143 - release PowerLock: EAS_NETWORK_CHANGED/TelephonyRegistry(   81): notifyDataConnection() state=2isDataConnectivityPossible()true, reason=nullD/TelephonyRegistry(   81): broadcastDataConnectionStateChanged()  state=CONNECTEDtypes=default,supl, interfaceName=rmnet0D/NetworkLocationProvider(   81): onDataConnectionStateChanged 8D/MobileDataStateTracker(   81): replacing old mInterfaceName (rmnet0) with rmnet0 for suplD/PhoneApp(  145): mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGEDD/PhoneApp(  145): - state: CONNECTEDD/PhoneApp(  145): - reason: nullD/PendingMsgSendReceiverRegister(  372): onReceive, start to send QueuedMessageD/PendingMsgSendReceiverRegister(  372): SmsReceiverService_handleServiceStateChanged() sendFirstQueuedMessage &gt;&gt;D/PendingMsgSendReceiverRegister(  372): SmsReceiverService_handleServiceStateChanged() sendFirstQueuedMessage &lt;&lt;V/MmsSystemEventReceiver(  372): Intent received: Intent { act=android.intent.action.ANY_DATA_STATE cmp=com.android.mms/.transaction.MmsSystemEventReceiver (has extras) }E/OpenSSLSocketImpl(  422): Unknown error 1 during connectW/System.err(  422): java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol errorW/System.err(  422): error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure (external/openssl/ssl/s3_pkt.c:1053 0x4b1778:0x00000003)W/System.err(  422):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)W/System.err(  422):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:305)W/System.err(  422):  at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)W/System.err(  422):  at com.htc.android.mail.eassvc.common.EASHostnameVerifier.verify(EASHostnameVerifier.java:34)W/System.err(  422):  at com.htc.android.mail.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:242)W/System.err(  422):  at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)W/System.err(  422):  at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)W/System.err(  422):  at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)W/System.err(  422):  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)W/System.err(  422):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)W/System.err(  422):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)W/System.err(  422):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)W/System.err(  422):  at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:283)W/System.err(  422):  at com.htc.android.mail.eassvc.EASAppSvc.testServer(EASAppSvc.java:3999)W/System.err(  422):  at com.htc.android.mail.eassvc.EASAppSvc$2.testServer(EASAppSvc.java:600)W/System.err(  422):  at com.htc.android.mail.easclient.ExchangeSvrSetting$TestServerThread.run(ExchangeSvrSetting.java:1188)I/EAS_AppSvc(  422): 06021143 testServer(), IOException(1): SSL handshake failure: Failure in SSL library, usually a protocol errorI/EAS_AppSvc(  422): error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure (external/openssl/ssl/s3_pkt.c:1053 0x4b1778:0x00000003)V/EAS DeviceInfo(  422):  GetDeviceID: 4020b869D/EAS_AppSvc(  422): 06021143   (2)connect to &gt; https://serverxxx.com.au/Microsoft-Server-ActiveSync?User=u415434&amp;DeviceId=HTCAnd4020b869&amp;DeviceType=htcbravoE/OpenSSLSocketImpl(  422): Unknown error 1 during connectW/System.err(  422): java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol errorW/System.err(  422): error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure (external/openssl/ssl/s3_pkt.c:1053 0x3f9e10:0x00000003)W/System.err(  422):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)W/System.err(  422):  at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:305)W/System.err(  422):  at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)W/System.err(  422):  at com.htc.android.mail.eassvc.common.EASHostnameVerifier.verify(EASHostnameVerifier.java:34)W/System.err(  422):  at com.htc.android.mail.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:242)W/System.err(  422):  at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)W/System.err(  422):  at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)W/System.err(  422):  at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)W/System.err(  422):  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)W/System.err(  422):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)W/System.err(  422):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)W/System.err(  422):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)W/System.err(  422):  at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:283)W/System.err(  422):  at com.htc.android.mail.eassvc.EASAppSvc.testServer(EASAppSvc.java:3999)W/System.err(  422):  at com.htc.android.mail.eassvc.EASAppSvc$2.testServer(EASAppSvc.java:600)W/System.err(  422):  at com.htc.android.mail.easclient.ExchangeSvrSetting$TestServerThread.run(ExchangeSvrSetting.java:1188)I/EAS_AppSvc(  422): 06021143 testServer(), IOException(2): SSL handshake failure: Failure in SSL library, usually a protocol errorI/EAS_AppSvc(  422): error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure (external/openssl/ssl/s3_pkt.c:1053 0x3f9e10:0x00000003)D/EASProgressDialog(  422): 06021143 onStop()V/HtcAlertDialog(  422): onStopI/HtcAlertDialog(  422): deinitSensor</code></pre>","478927","","","","","2010-11-16 21:46:20","Are two way SSL handshakes supported on Android?","<android>","1","0","","",""
"3956390","1","3956415","","2010-10-18 03:10:40","1","774","<p>I'm interested in developing an android application that will display a globe of some sort like Google Earth.</p><p>I've never used opengl or have any experience with graphic programming so I'm here to learn some basics. Now, I know there are things like the Unity or Ogre that help facilitate graphics but what exactly do I gain from using these engines as opposed to just using opengl api to render graphics? Why do you use engines like Ogre as opposed to straight up opengl?</p>","478934","","44729","","2010-10-18 15:34:32","2010-10-18 15:34:32","What does a 3D Engine do for me?","<android><graphics><opengl-es><3d>","2","2","","",""
"3956577","1","","","2010-10-18 04:15:24","1","592","<p>I am trying to run Apidemos sample on my PC.for that fst i hav launched AVD nd then run tht Apidemos app..but it is giving me following errors...</p><pre><code>[2010-10-16 10:33:43 - ApiDemos] Performing com.example.android.apis.ApiDemos activity launch[2010-10-16 10:33:44 - ApiDemos] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'apidemoavd'[2010-10-16 10:33:44 - ApiDemos] **WARNING: Application does not specify an API level requirement!**[2010-10-16 10:33:44 - ApiDemos] **Device API version is 7 (Android 2.1-update1)**[2010-10-16 10:33:44 - ApiDemos] Uploading ApiDemos.apk onto device 'emulator-5554'[2010-10-16 10:33:52 - ApiDemos] **Failed to upload ApiDemos.apk on device 'emulator-5554'**[2010-10-16 10:33:52 - ApiDemos] **java.io.IOException: Unable to open sync connection![2010-10-16 10:33:52 - ApiDemos] Launch canceled!**</code></pre>","478951","","66353","","2010-10-18 04:17:38","2010-10-18 08:05:03","android question","<java><android><sdk>","2","0","","",""
"3956669","1","3956755","","2010-10-18 04:49:17","0","389","<p>Actually earlier i was working as a Web Developer so i am not able to imagine mobile database. It has become complicated for me</p><p>I mean to say steps like given as below,CheckDBExistCreate it if does not exist,Insert when told to,Update when required and,anything u would like to suggest me as a beginner</p><p>Example with multiple fields addition in a table and multiple values entering into it.</p><p>Thanks in advance.</p>","457146","","","","","2010-10-18 06:43:21","can anybody give me realtime sqlite example","<java><android>","1","0","","",""
"3956726","1","6028964","","2010-10-18 05:08:47","0","479","<p>Is it possible to create partitions on SD card from the emulator.</p>","465834","","465834","","2010-10-18 05:33:57","2011-05-17 09:38:23","Emulator SD card Partition","<android><android-emulator>","1","4","","",""
"3956746","1","","","2010-10-18 05:17:25","3","1633","<p>I want to record a video using the camera with Android. Can anyone please give me some useful links or examples?</p>","478981","","221061","","2011-12-01 20:38:42","2012-04-19 19:01:16","How can I record video using the camera with Android?","<android><android-hardware>","2","0","","",""
"3956747","1","3956883","","2010-10-18 05:18:31","1","1604","<p><br>Can Somebody give me some pointers on how to create a sideshow application in android.<br>I need to have the Android transition animation when I switch between the images.  </p><p>Please guide me.  </p><p>Thanks,<br>Sen</p>","449378","","","","","2010-10-18 05:58:56","Slideshow in android","<android>","1","0","3","",""
"3956770","1","3956859","","2010-10-18 05:27:10","6","5345","<p>I have file ""Image_RGB565.raw"" which contains image buffer in RGB565 format. I want this image to be displayed in ImageView. is it possible without extra code of converting to RGB888?</p><p>I have tried to</p><pre>BitmapFactory.Options opt = new BitmapFactory.Options();opt.inPreferredConfig = Bitmap.Config.RGB_565;Bitmap bitmap = BitmapFactory.decodeFile(""Image_001_RGB565.raw"");</pre><p>but bitmap is null.</p><p>then i also tried to load using bytearray</p><pre>BitmapFactory.Options opt = new BitmapFactory.Options();opt.inPreferredConfig = Bitmap.Config.RGB_565;Bitmap bitmap = BitmapFactory.decodeFile(decodeByteArray(data, 0, data.length, opt);</pre><p>Please guide me to correct direction. My image dimension is 160x160.</p>","465751","","73488","","2010-10-18 05:30:36","2011-05-13 09:48:46","How to load RGB565 buffer to ImageView","<android><imageview>","2","0","3","",""
"3956774","1","4409168","","2010-10-18 05:29:15","1","745","<p>Does Android provide a callback when the clear button on the notification list is clicked ? My app needs to clear some data whenever the notification is clicked or cleared. On clicking I know what to do, but how do I handle the second case ?</p>","266272","","65977","","2010-10-18 05:33:12","2010-12-10 13:45:05","Does Android provide a callback when the clear button on notifications list is clicked","<android><android-notifications>","1","0","","",""
"3956784","1","","","2010-10-18 05:32:29","3","324","<p>I hope my query is quite clear from the title itself. I need to implement the auto-completion for youtube(video suggestions in a list as the user begins typing).</p><p>I need this feature for one of my Android activities.</p><p>Experts, please advise as to how to get these auto-completion list as i start typing.</p><p>Any help in this regard is well appreciated.</p><p>Looking forward. </p>","264953","","","","","2012-03-15 19:48:32","Autocompletion in android - for youtube search","<java><android><google-api-java-client><gdata-java-client>","0","5","","2012-03-15 22:16:35",""
"3956814","1","3956872","","2010-10-18 05:41:34","0","1223","<p>I 'd like to know how can I render a text over a 48x48 bitmap in my android application, considering sometimes the text exceeds the bitmap width .In such cases I need to render only a part of the text followed by dots such that all fits the available width !</p><p>Thanks !</p><p><strong>Update</strong>, Here's the code I used:</p><pre><code>    Bitmap renderSurface = icon.createBitmap();    Canvas canvas = new Canvas(renderSurface);    Paint paint  = new Paint();    paint.setTextSize(10);    if(paint.measureText(nativeName)&gt;canvas.getWidth())        nativeName = getClippedString(paint,nativeName,canvas.getWidth() );    canvas.drawText(nativeName,33,0, paint);    return renderSurface;  </code></pre>","304866","","827418","","2011-10-07 06:09:46","2011-10-07 06:09:46","Text Rendered over bitmap","<android>","1","0","","",""
"3956848","1","","","2010-10-18 05:50:46","0","807","<p>I can't seem to have any luck with normal views and SurfaceViews.  I have a FrameLayout with two children, a glSurfaceView and a ViewAnimator.  The purpose is to have a background rendering with buttons on top for menus, options and such.  When I animate from the ViewAnimator they move as they should but it appears they scroll under something, as if they were being partially masked out (the masked area seems to be related to the size of the views).  If I remove the glSurfaceView it behaves correctly (even though the onDraw in the SurfaceView does nothing but a  glClear).  I was about to give up and do another approach completely but I thought I was ask if anybody has encountered this as well.</p><p>the main xml</p><pre><code>&lt;FrameLayout    android:id=""@+id/FrameLayout01""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;include android:id=""@+id/glrender""  layout=""@layout/glview"" /&gt;&lt;include android:id=""@+id/guiscreens""  layout=""@layout/viewflipper"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>the gl view</p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;    &lt;android.opengl.GLSurfaceView                     android:id=""@+id/glsurfaceview""                     android:layout_width=""fill_parent""                     android:layout_height=""fill_parent""/&gt; &lt;/FrameLayout&gt;</code></pre><p>the view animator</p><pre><code>&lt;ViewAnimator xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/flipper""android:layout_width=""fill_parent""android:layout_height=""fill_parent"" &gt;    &lt;include android:id=""@+id/first""  layout=""@layout/mainmenu"" /&gt;    &lt;include android:id=""@+id/second""  layout=""@layout/otherscreen"" /&gt;&lt;/ViewAnimator&gt;</code></pre><p>one of the views</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;Button android:id=""@+id/Button01""        android:text=""CLICK ME""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>I read through the docs and I thought I had everything fixed up, but I guess I am missing something.  I could not find any samples in the demos that did exactly what I was trying.  I appreciate any input, thanks!</p>","476164","","","","","2010-10-18 05:58:36","Using a ViewAnimator over a SurfaceView causes Problems","<android>","1","0","2","",""
"3956880","1","3956896","","2010-10-18 05:57:51","2","4732","<p>The problem with my application is that i could'nt see my application name under display icon. I used the following code in my manifest file to set application name and the icon for my project.</p><pre><code>&lt;application android:icon=""@drawable/icon""              android:label=""@string/app_name""&gt; </code></pre><p>After putting this piece of code in my application, i can see the icon but the application name(app name) does'nt appear at all. I even checked the string.xml file for the string app_name and i found it was also there. </p><p>I even tried to hard core the app name directly like the below,</p><pre><code>&lt;application android:icon=""@drawable/icon""               android:label=""app_name""&gt;</code></pre><p>but of no use i cannot see my app name. I was making a mess with this problem. can anyone suggest, what is happening here and what has to be done to display app name or is there anyother way to display my app name? Any suggestion on this is appreciable.</p>","431655","","","","","2012-09-06 11:21:49","problem to set application name in android?","<android><label>","1","0","","",""
"3956965","1","","","2010-10-18 06:21:11","0","1462","<p>I am developing an android 2.2 application. I want to open MS word,ppt and excel files to be open in emulator. How can I achieve it? is there any free version of Documents To Go?</p><p>Please help</p><p>ThanksParvendra</p>","479007","","","","","2011-01-30 19:46:31","how to open MS word,ppt and excel document in android2.2 emulator","<android>","1","0","","",""
"3956995","1","5190988","","2010-10-18 06:30:07","0","1861","<p>I'm now stuck in html loading from my assets folder. I've several html pages under assets folder and have to load those at listview item onclick. Each listview item own their html pages.Does anybody know how i can get onclick event and how to show specific html pages ?</p><p>Thanks</p>","405219","","","","","2013-02-12 17:07:03","load html at listview item onclick","<html><android><listview><webview>","4","0","1","",""
"3957013","1","","","2010-10-18 06:36:05","0","1448","<p>I want to take the value from a EditText from one page and to display that value to a TextView in another page. How can I do that? How can I store values in EditText?Plesae Help me....Thanking you..</p>","453607","","","","","2012-06-01 12:36:27","Passing value from a EditText to TextView","<android>","1","0","","",""
"3957085","1","","","2010-10-18 06:57:18","0","136","<p>I have developed an application on android2.2. when I install this application on actual device having android1.6 then it gives me error ""java.lang.string"" when click on a button.does somebody has any idea what may be the cause and how to eradic</p><p>ThanksParvendra</p>","479007","","","","","2010-10-18 07:01:33","when porting android 2.2 application on android1.6 platform","<android>","1","1","","",""
"3957253","1","3957269","","2010-10-18 07:30:38","1","3918","<pre><code>10-18 10:26:39.382: ERROR/global(13919): Deprecated Thread methods are not supported.10-18 10:26:39.382: ERROR/global(13919): java.lang.UnsupportedOperationException10-18 10:26:39.382: ERROR/global(13919):     at java.lang.VMThread.stop(VMThread.java:85)10-18 10:26:39.382: ERROR/global(13919):     at java.lang.Thread.stop(Thread.java:1379)10-18 10:26:39.382: ERROR/global(13919):     at java.lang.Thread.stop(Thread.java:1344)10-18 10:26:39.382: ERROR/global(13919):     at spexco.hus.camera.Camera.cancel(Camera.java:273)10-18 10:26:39.382: ERROR/global(13919):     at spexco.hus.cepvizyon.ViewCam.onStop(ViewCam.java:83)10-18 10:26:39.382: ERROR/global(13919):     at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1169)10-18 10:26:39.382: ERROR/global(13919):     at android.app.Activity.performStop(Activity.java:3797)10-18 10:26:39.382: ERROR/global(13919):     at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3416)10-18 10:26:39.382: ERROR/global(13919):     at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3487)10-18 10:26:39.382: ERROR/global(13919):     at android.app.ActivityThread.access$2800(ActivityThread.java:119)10-18 10:26:39.382: ERROR/global(13919):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1896)10-18 10:26:39.382: ERROR/global(13919):     at android.os.Handler.dispatchMessage(Handler.java:99)10-18 10:26:39.382: ERROR/global(13919):     at android.os.Looper.loop(Looper.java:123)10-18 10:26:39.382: ERROR/global(13919):     at android.app.ActivityThread.main(ActivityThread.java:4363)10-18 10:26:39.382: ERROR/global(13919):     at java.lang.reflect.Method.invokeNative(Native Method)10-18 10:26:39.382: ERROR/global(13919):     at java.lang.reflect.Method.invoke(Method.java:521)10-18 10:26:39.382: ERROR/global(13919):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)10-18 10:26:39.382: ERROR/global(13919):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)10-18 10:26:39.382: ERROR/global(13919):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","463888","","815724","","2013-02-26 01:02:15","2013-02-26 01:02:15","What is this log, when I coded thread.stop()?","<android><multithreading>","2","1","","",""
"3957256","1","","","2010-10-18 07:31:10","0","391","<p>same code  anyDensity=false works fine for device with display resolution 320*480, but images are displayed pixelerate in device with display resolution 480*800.</p>","479059","","21234","","2010-10-18 07:41:42","2011-04-30 13:09:25","Why images are displayed pixelerate when attribute anyDensity=false in android menifest file for samsung galaxy device?","<android><android-sdk-2.1>","2","1","","",""
"3957259","1","3959343","","2010-10-18 07:31:33","0","639","<p>Can I set an <code>onclickListner</code> for <code>AlertDialog</code>?</p>","436765","","268273","","2012-03-24 21:59:36","2012-03-24 21:59:36","onclickListner for AlertDialog","<android>","2","0","","",""
"3957363","1","","","2010-10-18 07:53:47","0","773","<p>i met a problem now , the android system can not decode gif files , but we need to do that job , how can i do that , if you know that , pls tell me , thanks.</p>","410390","","","","","2011-04-15 00:10:21","the gif cannot be decoded","<android>","2","0","","2012-11-19 16:04:55",""
"3957406","1","3957957","","2010-10-18 08:01:38","0","408","<p>I use a sqlite database in my project. The stored data in it must not be available for the user to edit. As I've read here I saw that if you have root access you can alter sqlite database. The only solution would be to encrypt database content, but this would be time consuming for device. Any solution to prevent access to database ?</p>","379865","","","","","2010-10-18 09:38:08","Android Prevent access to SQLite database","<android><sqlite>","1","0","","",""
"3957419","1","","","2010-10-18 08:04:38","2","2017","<p>I am new to android. I want to now how to create a status notification bar in the home page. Can anyone help me with some codes. Thanks in advance.</p>","366916","","223386","","2011-11-22 08:26:16","2012-05-19 14:14:07","Android-Status bar Notification","<android>","2","0","2","",""
"3957438","1","3958767","","2010-10-18 08:07:05","1","1555","<p>Android ListView</p><p>if my list has 10 items.. the onclick listener is fired only for the 10th item.How to get the state of checkbox in a onListItemClick in Listactivity?</p><p>I have a class OnItemClickListener like this:</p><pre><code>private class OnItemClickListener implements OnClickListener {    private int mPosition;    public OnItemClickListener(int position) {        mPosition = position;    }    @Override    public void onClick(View arg0) {        if (arg0 == repeat_chbt) {//check box is checked                 A        } else {//item is checked                B        }    }}</code></pre><p>and I use this class like this in my getview()</p><pre><code>repeat_chbt.setOnClickListener(new OnItemClickListener(position));</code></pre><p>but only when I check the last item's checkbox, it go A correctly. Other items' checkbox are checked they just go B. Who could tell me where I am wrong. Thanks very much. I've searched many site, but I didn't find out the answer.</p>","473944","","473944","","2010-10-21 05:38:45","2010-10-21 05:38:45","How to get the state of checkbox in a onListItemClick in Listactivity?","<android><listview>","1","0","","",""
"3957467","1","","","2010-10-18 08:12:54","0","188","<p>I want to write an application that will log down whatever I type using the Android keyboard.</p><p>The purpose is to have a backup of all the keyboard entries.</p><p>Is it possible?</p><p>Regards.</p>","426201","","","","","2011-06-22 19:50:47","keyboard log for reference","<android>","1","0","","",""
"3957521","1","","","2010-10-18 08:26:48","3","2723","<p>I am working on a prototype port of one of our iPhone apps to Android.</p><p>The iPhone app uses the RouteMe API to load our own custom maps into the application. (also tiled, just like Google Maps itself, so only loading what you see at that moment - this is very important in this case)</p><p>I have been searching for a similar product for Android. I found Nutiteq, but as RouteMe is free, I am trying to find something free for Android as well.</p><p>If anybody has suggestions, I would love to hear them. The more information the better, of course :). </p><p>EDIT:Still haven't found anything that acts the same as RouteMe, so suggestions are still very welcome.</p>","479103","","479103","","2010-10-28 06:49:25","2011-07-29 09:42:31","Custom maps in Android, loading via tiles (alternative for RouteMe for iPhone SDK)","<iphone><android><api><maps>","1","0","","",""
"3957663","1","4078645","","2010-10-18 08:53:27","2","3180","<p>After I have set up all the unit test cases for my android application I now also want to do functional testing. But I encouter one problem. As I am developping for the HTC Legend I can, by now, only use android platforms up to 2.1. But in some way it seems that the <strong>ActivityInstrumentationTestCase2</strong> won't work. </p><pre><code>public SupplierSelectoinTest() {    super(""com.sap.catalogue.activities"", SupplierSelection.class);}</code></pre><p>This simple piece of code gives me the following error, when I try to run the test:</p><pre><code>java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.sap.catalogue.activities/com.sap.catalogue.activities.SupplierSelection }at android.app.Instrumentation.startActivitySync(Instrumentation.java:371)at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:120)at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:98)at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:87)at com.sap.catalogue.test.acceptance.SupplierSelectoinTest.setUp(SupplierSelectoinTest.java:27)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre><p>I read through all tutorials and all I get out of it is, that it should work but it doesn't. Anyway, when I switch to android 2.2 (which is no solution for now) and I use the new constructor, where I only need to hand in the activity class and not the pkg string the emulator will run the tests without complaining.</p><p>But there has to be a way to get this running in android 2.1!</p><p><strong>In addition</strong>These are my two Manifest.xml files. The first one, is the one of the application itself. The other one is the one of the test project.</p><p><strong>Application Manifest.xml</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.sap.catalogue""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Catalogue""                  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="".activities.CategoryBrowser""&gt;&lt;/activity&gt;&lt;activity android:name="".activities.ProductDetails""&gt;&lt;/activity&gt;&lt;activity android:name="".activities.ProductSearch""&gt;&lt;/activity&gt;&lt;activity android:name="".activities.ProductView""&gt;&lt;/activity&gt;&lt;activity android:name="".activities.SupplierSelection""&gt;&lt;/activity&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre><p><strong>Test Manifest.xml</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.sap.catalogue.test""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;uses-library android:name=""android.test.runner"" /&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;    &lt;instrumentation android:targetPackage=""com.sap.catalogue"" android:name=""android.test.InstrumentationTestRunner"" /&gt;&lt;/manifest&gt; </code></pre>","463910","","463910","","2010-10-18 09:22:35","2010-11-02 14:27:53","Are there problems with ActivityInstrumentationTestCase2 in Android 2.1?","<android><testing><functional-testing>","2","0","","",""
"3957683","1","3959375","","2010-10-18 08:58:08","5","1141","<p>I'm using the phone's camera in an Android app to take a photo. I'm using Intents to use the built-in camera application and I'm using the following code:</p><pre><code>Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(FILEPATH)));startActivityForResult(intent, ACTIVITY_NATIVE_CAMERA_AQUIRE);</code></pre><p>It works fine and the camera is brought up. I can take a photo and the phone presents me with three options: Cancel, Retake, OK. The first two work, pressing cancel returns the user to the app, but pressing OK and <em>nothing</em> happens. Apparently onActivityResult isn't being called, and the camera just stays on the screen. Nothing in the debugger either.</p><p>Running the app on a Nexus One with Android 2.2.1. Same problem on the emulator running Android 2.0.</p><p><em>Edit</em>: Tested on a HTC Desire running Android 2.2 with HTC's Sense UI: works perfectly. Nothing on the emalator nor Google N1.</p><p><em>Edit2</em>: It seems that the HTC Desire image aquiring activity works better in the sense that it does return, but it disregards the EXTRA_OUTPUT -setting and returns only a small image in the onActivityResult -call. Checking on the ddms console while the phone is hooked to the computer I see that the phone is storing the image on the SD card, but the path is not passed back to my application. It is starting to look like there is no reliable way to use the camera intent, and get back a reasonably-sized image. Bad, bad, bad.</p>","251455","","251455","","2010-10-18 12:16:22","2010-10-18 13:00:44","Using phone camera via Intent - activity never returns?","<java><android><camera>","1","0","1","",""
"3957686","1","7280382","","2010-10-18 08:58:54","0","544","<p>i have a Problem using FTP connection on Android 2.2 devices. </p><p>My app uses AndFTP via intent and loads data from a FTP Server connected via Wifi to the handset. </p><p>The FTP downloadspeed is only 7kByte/s.</p><p>I had the same speed on my Windows XP Notebook, then i changed the delayed acknowledge setting. So now my Notebook reaches 300kbyte/s but i dont know how to adjust the Settings in Android / Linux based OS Systems. </p><p>Does anyone know about this latency problems? </p><p>Best regards, Rotesmofa</p><p>Edit: now i finaly found the SocketOptions for my problem but how to set no_delay? Can i set this in my App or do i have to set it on every device with a terminal tool?Link to the SocketDescription: <a href=""http://developer.android.com/reference/java/net/SocketOptions.html"" rel=""nofollow"">link text</a></p>","479115","","479115","","2010-10-19 05:44:29","2011-09-02 07:29:17","Poor FTP Performance due to delayed Ack : Solutions exist for Android?","<android><performance><ftp><latency><delay>","1","0","","",""
"3957697","1","8050574","","2010-10-18 09:00:23","1","1009","<p>Let's say i have a layout with style:</p><pre><code>&lt;LinearLAyout ... &gt;    &lt;TextView ... style=someStyle /&gt;    &lt;ImageView ... style=someImageStyle ... /&gt;&lt;/LinearLayout&gt;</code></pre><p>the style will be defined in an xml in my project.How can i override that style with an external xml ? (i'm asking because i've noticed the View does not have applyStyle\setStyle or anything of that sort (best bet, because style need to be parsed, compared against android:attr for validation and then applied on each item of the view).I do wonder how am i suppose to make downlaodable themes for my app.</p>","312288","","","","","2011-11-08 12:46:35","overriding a style in android","<android><coding-style><themes><android-widget>","1","3","","",""
"3957707","1","","","2010-10-18 09:02:24","3","668","<p>I'm utilizing the Open Session in View pattern for my jsf/icesfaces application.As usual a servlet filter is opening and closing all the hibernate sessions at the beginning and the end of a ""web server thread"".</p><p>My problem now is that I'm using asynchronous tasks for eg. loading big lists of objects from the database. Therefore I'm creating a new thread ""by hand"" which executes the task.</p><p>Now my question: what's the best way to handle hibernate sessions for such async tasks? Should I manually create a session in the thread itself or is there something like a servlet filter also for threads (something which opens the session when the thread starts and closes it when it ends)?</p><p>I would be grateful for any best practives or the like. Thank you.</p><p>Here's the code which creates the thread:</p><pre><code>protected static ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5,            15, 50, TimeUnit.SECONDS, new LinkedBlockingQueue(20));// called by action method of a buttonprivate void asyncLoading() {        SessionRenderer.addCurrentSession(this.renderGroup);                    threadPool.execute(new Thread() {                   // do the thing to do (...)                }}</code></pre>","266478","","426671","","2012-06-12 16:59:28","2012-06-12 16:59:28","hibernate 'open session in view' and asynchronous tasks","<java><android><asynchronous><android-asynctask><open-session-in-view>","1","0","","",""
"3957749","1","","","2010-10-18 09:09:24","1","3272","<p>I want to control the system settings ""auto brightness"", setting it ON or OFF. I'm able to control the brightness level but only if AUTO is OFF. From what I read until now there is a SCREEN_BRIGHTNESS_MODE in Settings.System but only for API level 8 or higher and also not recommended to mess wit it. But currently my phone has Android 2.1 (API 7) and there are widgets that can control this setting (enable/disable auto brightness and set the level). How is this done?</p>","467780","","741249","","2012-05-02 13:31:51","2014-01-06 08:20:56","How to enable/disable auto brightness mode from API","<android><brightness>","2","0","","",""
"3957785","1","3957795","","2010-10-18 09:14:26","2","721","<p>I am no good with hardware concepts. So I have this probably very silly doubt.</p><p>I want to add Log to my application. When running on an emulator, I know where to see the Log output - it's visible in the Logcat window of Eclipse.</p><p>I want to know where I can see these logs when I run it on a hardware device. I am using following command to load my app on to the device : <code>./adb install helloWorld.apk</code></p><p>So where will the log be created and under what name?</p><p>Apologies if the question is vague or silly. I really do not know more details.</p><p>-Kiki</p>","454660","","","","","2010-10-18 09:21:56","Android: Logging on an android device","<android><hardware><logcat>","2","0","","",""
"3957830","1","3958710","","2010-10-18 09:20:38","0","127","<p>is it possible to programmatically access the website that is currently displayed within the Android browser?<br>As far as I know the native Browser doesn't handle plugins (please correct me if I'm wrong), so I thought that reading the browser cache would be an option.</p><p>Is there a more sophisticated way to get the currently displayed HTML?</p><p>Thanks in advance!<br>S.</p>","419501","","","","","2013-03-06 12:31:24","Accessing the currently displayed website of the Android browser","<android><browser><caching>","1","2","","",""
"3957848","1","3958605","","2010-10-18 09:22:44","0","265","<p>I have an pojo like this:</p><pre><code>public class LocationPoint {    protected double la;    protected double lo;    public double getLat() {        return la;    }    public void setLat(double value) {        this.la = value;    }    public double getLong() {        return lo;    }    public void setLong(double value) {        this.lo = value;    }}</code></pre><p>The scenario:After doing something on a MapView activity I get back to the activity that called id</p><pre><code>if (resultCode == RESULT_OK) {                    int latitude = data.getIntExtra(""Latitude"", 0);                     int longitude = data.getIntExtra(""Longitude"", 0);                    if (latitude!=0 &amp;&amp; longitude!=0)                    {                                                                                                                                                   LocationPoint p = new LocationPoint();                        p.setLat((double) latitude);                        p.setLong((double) longitude);                    }</code></pre><p>The int latitude = 43802334 and int longitude = 24825592The converted values in p are: 4.3802334E7 and 2.4825592E7</p><p>I want the double value to be without E7, because the web service throws an error because of it. I am doing something wrong and can't understan why. Can you give an advice ? Thanks</p>","379865","","","","","2010-10-18 11:23:38","Android GSon serialize double to .net compatible","<android><double><gson>","1","0","","",""
"3957881","1","","","2010-10-18 09:28:53","0","755","<p>Can I call nested activities in Android?I have 3 activities.In first activity there are a list of options like ice cream, chocolate etc.When I am selecting one option (through button), I will go to second activity. Here I will enter the quanity for each option. I want to save these option value and quantity, and display the result either in first activity or third activity. How can I do that?startActivity(intent) is working fine when I call the second acitivity. but when I am calling the third activity through startActivity(intent), the process is suddently killed.Please help me..Thank you.</p>","453607","","","","","2010-10-18 09:35:17","Nested Activities","<android>","1","0","","",""
"3958031","1","","","2010-10-18 09:50:23","0","143","<p>After creating SQLite database connection, while running when I view DDMS, file explorer shows the size of database as 3072.</p><p>I think that why I am unable to open the database and retrive the values. Can help me out to sort out this error?</p>","479352","","92837","","2011-05-27 11:48:48","2011-05-27 11:48:48","Why I am getting database size as 3072 in file explorer of android application","<android>","1","0","","",""
"3958036","1","3959051","","2010-10-18 09:51:42","0","1067","<p>Hai Friends,            I have developed an application which en-composes list views and posted that .apk file in my htc device, the design and alignment everything works fine,but the problem When  i am testing  in various devices such as Morotolo Droid,Nexus Devices the alignment of Listviews goes wrong, so i planned to use the Layout folder as layout-hdpi,layout-ldpi, and layout-mdpi, for that i changed my manifest file as </p><pre><code>&lt;supports-screens android:largeScreens=""true""         android:normalScreens=""true"" android:smallScreens=""true""        android:anyDensity=""true"" /&gt; </code></pre><p>Is it right putting android:anyDensity=""true"",also i used dp instead of dip. I went through this url, but still am not able to get a clear idea in this <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a>. so friends pls tell me(help me) to get clear idea in this and tell what mistakes i have doing. This is my main page xml code frnds.</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=""wrap_content""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""@drawable/background_retinav2""&gt;        &lt;LinearLayout android:layout_gravity=""center"" android:foregroundGravity=""bottom"" android:background=""@color/white"" android:id=""@+id/rl_1"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:orientation=""horizontal""&gt;        &lt;ImageView  android:paddingTop=""3dp"" android:id=""@+id/starthideimage"" android:layout_width=""30dp"" android:layout_height=""35dp"" android:src=""@drawable/newback"" /&gt;        &lt;HorizontalScrollView  android:paddingTop=""8dp"" android:id=""@+id/gv""        android:layout_width=""wrap_content"" android:layout_marginTop=""0dp""        android:layout_height=""wrap_content"" android:background=""#ffffff""        android:scrollbars=""none"" android:layout_weight=""1"" android:foregroundGravity=""bottom""&gt;        &lt;LinearLayout android:id=""@+id/san_tag"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;/LinearLayout&gt;    &lt;/HorizontalScrollView&gt;    &lt;ImageView  android:paddingTop=""3dp"" android:id=""@+id/Endhideimage"" android:layout_width=""30dp"" android:layout_height=""35dp"" android:src=""@drawable/newforward"" /&gt;    &lt;/LinearLayout&gt;    &lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical"" android:id=""@android:id/tabcontent""          android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;         &lt;ListView android:id=""@+id/content_movies"" android:cacheColorHint=""@color/cachecolor""            android:layout_weight=""1"" android:scrollbars=""vertical""           android:layout_width=""fill_parent"" android:layout_height=""420dp""/&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;TabWidget    android:id=""@android:id/tabs""    android:gravity=""bottom""    android:layout_gravity=""bottom""    android:listSelector=""@color/gray""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" /&gt; &lt;/TabHost&gt;</code></pre>","424413","","424413","","2010-10-18 12:34:51","2013-10-18 01:28:46","Problem in Supporting Multiple Screens in Android?","<android>","2","3","2","",""
"3958129","1","3958285","","2010-10-18 10:08:24","2","1791","<p>In my manifest file, I have given the application name as MyApp and the name of the starting activity as Main Menu.</p><pre><code>&lt;application android:theme=""@style/theme"" android:icon=""@drawable/myicon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".MainMenu""              android:label=""@string/mainmenu_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p>When I see the app icon in the default menu screen of android, the name shown is Main Menu. Why is MyApp not the name shown for the app?</p><p>-Kiki</p>","454660","","","","","2012-07-26 06:31:55","Android: Why is the name of the android app taken as the name of the starting activity?","<android><icons>","3","0","1","",""
"3958138","1","3959610","","2010-10-18 10:10:57","7","2592","<p>I have a one line EditText, when I set a long hint, the hint wraps to two lines. Can I force the EditText to be always one line tall? <code>android:lines=""1""</code> didn't work.</p>","243225","","","","","2012-02-13 23:26:50","How to make EditText hint not to wrap?","<android><edittext>","2","2","1","",""
"3958141","1","3958177","","2010-10-18 10:11:18","2","265","<p>I am working on an application to sync contacts which are large in number.The syncing takes place in a background thread with user being able to browse through the rest of the application. I am displaying the sync status in the notification bar suing the progress bar. </p><p>The problem I am facing is that there are instances when the activity is killed and hence the background thread used for syncing the contacts is purged.</p><p>Can this situation be avoided in any case? </p>","366053","","","","","2010-10-18 10:16:09","Android: Issue working on background thread","<android>","1","0","1","",""
"3958205","1","3958671","","2010-10-18 10:21:59","0","508","<p>I want to do some calculating after touch-Event on my widget.Is there a possibility to do this without starting an activity? My problem is that i have to register an onClickPendingIntent to the touch-action....</p><p>There is an annoying visual response with my solution: screen flashes to black and reappears to homescreen.</p><p>this is in the widget-provider:</p><pre><code>Intent doit_intent = new Intent(context, DoItActivity.class);PendingIntent pendingIntent =            PendingIntent.getActivity(context,0, doit_intent, 0);remoteView.setOnClickPendingIntent(R.id.main_widget, pendingIntent);</code></pre><p>DoItActivity.class</p><pre><code>public class DoItActivity extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //do some static function calls    finish();  }}</code></pre>","44276","","","","","2010-10-18 11:31:28","TouchEvent on Widget without creating an activity","<android><widget>","1","0","1","",""
"3958218","1","3960163","","2010-10-18 10:23:53","1","512","<p>Total noob here. Just installed eclipse and SDK. I was instructed to</p><p>""To update your PATH variable to include the Android tools directory, right-clickComputer and choose Properties. In Vista, you also need to click Advanced SystemSettings. You continue by clicking the Advanced tab of the System Properties dialogand clicking the Environment Variables button.In the System Variables section, edit the PATH variable and add the path to the toolsdirectory.""</p><p>Can someone please explain how I edit the PATH variable? Do I click ""New"" and point to the SDK tools folder?</p>","479180","","418183","","2010-10-18 10:26:49","2010-10-18 14:27:52","Updating path to include Android tools directory?","<windows><android>","1","2","","",""
"3958282","1","","","2010-10-18 10:34:38","0","349","<p>I have an app which contains 4 activities. The splash activity/screen is the first. It either connects to a service and starts activity 2 or times out after 8 seconds and starts activity 3.</p><p>When launching the app in debug from the emulator, it does start the splash activity OK but it's not forced to the front - the Home screen is still shown. I need to press the 'Menu' button, by which time the app has jumped to either activity 2 or 3. </p><p>How can I make the spash activity immediately visible on launch? ( I have used setConentView in the onCreate() and I have set its action as MAIN and its category as LAUNCHER in the manifest)</p>","440010","","","","","2010-10-18 10:34:38","How to force the emulator to jump to the opening(Splash) activity's view","<android><android-emulator>","0","3","","",""
"3958425","1","","","2010-10-18 10:56:02","-5","245","<p>i am new to android. i want sample program how to use intent</p>","475349","","","","","2010-10-18 12:20:59","regarding intents","<android>","3","2","1","2010-10-18 12:30:25",""
"3958458","1","3963925","","2010-10-18 10:59:42","2","8476","<p>EDIT 2:</p><p>I did solve my problem, but i don't know how:S I was moving my code snippets a bit around, a suddenly it worked. Must have done something in the wrong order, but its weird, checked it many times. Thanks for you help, and sorry I can't post an answer ;)</p><p>Hi.</p><p>I have a list view which I'm trying to refresh to update it self when i add an element tothe underlying array list.</p><p>Here is the code snippet:</p><pre><code>private void addEvent() {    arrlEvents.add( event );    adptEvents.notifyDataSetChanged();    updateSaveFile();    filterList();}</code></pre><p>The arrlEvents is the underlying arraylist with the events, and im adding one event, trying to update the list view with notifyDataSetChanged(), but it doesnt work. Can anyone help?</p><p>Thanks for your time:)</p><p>EDIT:Here is the source code for the adapter:</p><pre><code>private ArrayAdapter&lt;Event&gt; adptEvents;adptEvents = new ArrayAdapter&lt;Event&gt;( EventCalendar.this, R.layout.list_items, arrlEvents );</code></pre>","466303","","466303","","2010-10-20 22:27:00","2011-12-13 21:07:29","adapters notifyDataSetChanged does not work","<android><listview><arraylist><adapter>","2","2","","",""
"3958607","1","3985089","","2010-10-18 11:24:04","1","966","<p>I have an application that runs only once. But after finishing (<em>finish()</em>), it remains in the history of applications (last opened) and can be opened again. (Long press on the Home button). How do I remove my application from this history?</p><p>I ask because everything I found, it's a flag in the manifest - 'noHistory'. But it works with Activiti history, not last opened Application history.</p><p>Thanks</p>","479211","","479211","","2010-10-18 11:34:02","2011-12-25 10:07:32","How to remove the application icon from the application history (appears after long click on Home button)?","<android>","5","1","1","",""
"3958702","1","4265932","","2010-10-18 11:35:34","1","594","<p>i am working on making bluetooth application which makes use of bluetooth api.</p><p>i am able to do it for version 2.0 or above but many newer Api of 2.0 are not supported in 1.6</p><p>So any help on what could be the solution.</p><p><strong>BluetoothAdapter</strong> is available in 2.0 bt not 1.6 , so any alternate way of implementing it?same with <strong>Bluetoothdevice</strong></p><p>thanks in advance</p><p>Rakesh</p>","1386533","","","","","2010-11-24 10:49:32","Android : Using Bluetooth APi","<android>","1","0","","",""
"3958716","1","3959675","","2010-10-18 11:37:07","4","5394","<p>I keep getting this when trying to start a new project</p><pre><code>ERROR: Unable to open class file C:\Users\Levi\Desktop\Android\workspace\Droid1\gen\com\androidbook\droid1\R.java: No such file or directory</code></pre><p>I tried changing preferences to alter build path to project, but it still wouldnt work,,,</p><p>Is subfolder on desktop a bad place to install Eclipse?</p>","479180","","179850","","2010-11-12 18:19:57","2011-06-23 12:32:14","Error: Unable to fnd class R.java No such file or dir","<java><android><eclipse>","5","2","","",""
"3958866","1","3959154","","2010-10-18 11:59:33","0","1069","<pre><code>can anybody help me about how to change the contents of spinner on run time in android.</code></pre><p>any help will be appreciative. </p><p>thanks a lot</p>","397901","","","","","2010-10-18 12:33:17","how to change the contents of spinner on run time in android","<android><spinner>","1","0","","",""
"3958897","1","3958920","","2010-10-18 12:02:24","4","5567","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3477422/what-does-layout-inflater-in-android-do"">What does Layout Inflater in Android do?</a>  </p></blockquote><p>What is the layout inflater used for in an Android application?</p>","475349","","419","","2010-10-18 12:19:13","2012-06-23 03:20:23","What is the layout inflater in an Android application?","<android>","3","6","6","2012-10-10 18:34:04",""
"3958923","1","","","2010-10-18 12:05:21","0","962","<p>I have latitude and longitude of two places. Can i calculate the distance between them in android?</p>","436765","","1069068","","2013-03-19 14:35:42","2013-03-19 14:35:42","The distance Calculation from two places","<android>","3","1","1","",""
"3959128","1","","","2010-10-18 12:30:20","5","3746","<p>i would get outgoing call duration a call, I thought to get when the persone to the other side answer my call, but with PhoneStateListener we can get the state of a call, but PhoneStateListener changes state to CALL_STATE_OFFHOOK immediately when the outgoing call starts and not when the person to other side answers, so i can't get the effective time of call during a conversation.Any ideas to do this</p><p>Thanks in advance!</p>","479285","","","","","2011-01-27 09:59:22","It's possible to get outgoing call duration during call?","<android>","1","3","1","",""
"3959135","1","","","2010-10-18 12:31:04","-1","880","<p>There is no error in Web serviceBut there is an error </p><pre><code>Error:org.ksoap2.Soapfault=null </code></pre><p>pls help</p>","479352","","704008","","2014-03-10 03:29:59","2014-03-10 03:29:59","Error:org.ksoap2.Soapfault=null","<android><ksoap2>","2","0","","",""
"3959266","1","3959518","","2010-10-18 12:47:28","5","4552","<p>If I draw a round rect shape by code I can use <a href=""http://developer.android.com/reference/android/graphics/Paint.html#setShadowLayer%28float,%20float,%20float,%20int%29"">setShadowLayer</a> to get a shadow drawn for the shape. Is there an equivalent when defining shapes in XML?</p><p>The following example draws a round rect background to a shape. What would I need to add to get a shadow added to the shape? Is it even possible using XML?</p><p>shape_test.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;solid android:color=""#8067BF6A""/&gt;        &lt;stroke android:width=""3dp"" android:color=""#80000000"" /&gt;    &lt;padding android:left=""1dp""      android:top=""1dp""      android:right=""1dp""      android:bottom=""1dp"" /&gt;     &lt;corners android:bottomRightRadius=""7dp""      android:bottomLeftRadius=""7dp""      android:topLeftRadius=""7dp""      android:topRightRadius=""7dp""/&gt; &lt;/shape&gt;</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:padding=""10dp"" android:background=""#ffdddddd""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt; &lt;Button android:background=""@drawable/shape_test"" android:padding=""5dp"" android:textStyle=""bold"" android:textSize=""28sp"" android:text=""Hello"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre>","128800","","","","","2010-10-18 13:15:45","Is there an equivalent to setShadowLayer when defining shapes in XML in Android?","<android><xml><layout><shape>","1","0","3","",""
"3959362","1","","","2010-10-18 12:59:29","2","82","<p>I am working on an Android application that is supposed to run on Android 1.5 and later devices. I am using <code>RawContacts.CONTENT_URI</code> enumeration for registering a <code>ContentObserver</code> in my application subclass. Now, RawContacts was introduced in Eclair and running this code on Android devices having runtime less than 2.0, gives java.lang.VerifyError. For older devices, I have to use <code>Contacts.CONTENT_URI</code>.</p><p>So to fix this, I've put something like the following in my code:</p><pre><code>if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ECLAIR){  uri = android.provider.ContactsContract.RawContacts.CONTENT_URI;}else{  uri = android.provider.Contacts.CONTENT_URI;}</code></pre><p>I am still getting java.lang.VerifiyErrors.</p><p>How do I setup my code for different runtimes?</p>","423639","","","","","2010-10-18 13:10:05","Setting up Android code for different runtimes","<java><android>","1","0","","",""
"3959420","1","3959459","","2010-10-18 13:05:03","0","1548","<p>I'm learning about the android. Now, I want to display a button that can turn off the screen. That is when the user click the button the screen off as the user click the power button. How can I do this? Thank you.</p>","464012","","","","","2010-10-18 13:08:58","display a button that can turn off the screen like the power button","<android>","1","0","","",""
"3959840","1","3961228","","2010-10-18 13:51:07","1","3454","<p>I have a ListView with custom items - 3 ImageViews and a TextView. I have a call to <code>setItemsCanFocus(true)</code>, so I can make the ImageViews clickable. I'm currently using SimpleAdapter to populate the View.</p><p>I'd like to trigger the AdapterView's <code>onItemClick</code> event when one of those subviews is clicked. The <code>onItemClickListener</code> receives a view as the second argument and that can be used to identify which subview was clicked. Frankly, I was expecting this to be the default behaviour but it isn't, unfortunately.</p><p>Is there any way to implement this behaviour without bluntly breaking encapsulation (i.e. creating an Adapter that holds a reference to its View)?</p><p>What is the accepted way of dealing with events from views in list items? How do you keep the Adapter from knowing too much about the ListView?</p>","282398","","","","","2012-11-23 19:05:23","ListView and propagating click events from children views in the items","<android><listview>","2","0","","",""
"3959842","1","4262238","","2010-10-18 13:51:12","1","1222","<p>I'm developing an Android application with database storage.</p><p>I want to test some classes that I use to access database.</p><p>I've found <code>ActivityInstrumentationTestCase2</code> to test Activities but I haven't found anything to test classes.</p><p>How can I do that? I haven't used jUnit before.</p><p>Thanks.</p>","68571","","68571","","2010-10-18 17:03:21","2010-11-23 23:50:42","jUnit testing Database operations","<android><sqlite3><junit3>","1","0","","",""
"3959859","1","","","2010-10-18 13:52:18","0","240","<p>I come from a .Net background and recently x-training to java.</p><p>I wanted to develop an Android application that required simple functionality to communicate with a server. For example, functionality such as post a username/score to a website (or service), or request information such as top 10 scores.</p><p>What type of communications should I focus on? What is the common technology to use? Does Java have the equivalent of WCF? Or does it have some sort of simple web service? Can web services be secured with authentication?</p><p>Ive heard other references to xml-rpc. Should this be something I should look into?</p>","470000","","","","","2010-10-18 14:57:13","Android communicating with servers","<java><android>","3","0","","",""
"3959866","1","3959888","","2010-10-18 13:53:06","0","290","<p>I used the layout resource editor to modify the main.xml layout file to add a secondTextView control to my app. by default, its set to something like @+id/TextView01. How do I Set the text attribute of the TextView control to my newly created String resource? I tried going into main.xml and just editing the android:text to point to the name of my new string, but it didn't seem to work. </p>","479180","","","","","2010-10-18 13:55:14","Setting TextView to new string?","<java><android>","1","0","1","",""
"3959875","1","3959913","","2010-10-18 13:53:32","1","257","<p>Hello I would like to know if and how it is possible to detect if my application have run in the past on a given android device. I would like every time the phone reboots to be able to check if my application has run on the past and retrieve some private data. If not just create those data.</p><p>regards maxsap</p>","234898","","","","","2010-10-18 14:08:06","android How to detect if the application have run in the past","<android>","4","0","","",""
"3960005","1","3960207","","2010-10-18 14:07:22","5","1120","<p>I will try to be as brief as possible... I have published a very simple android application it's name is ""Vib-e-rator PRO"". It's purpose is obvious, it can be used as a masssage vibrator or as an erotic stimulator...</p><p>My Problem is don't have an Android Phone to test my app in real time.</p><p>I have been recieving mixed comments from people. A few users say its working fine. But majority of them complained that the Phone would n quit vibrating even after the closing application. </p><p>Later i speculated that when ever the user switched off the vibrator and quit the app it would work as expected. If any user (most of em) directly closed the application ( either through the close option provided in the app itself or by pressing the END button in the phone ) without switching off the vibrator then it would not stop vibrating.</p><p>So i added myvib.Cancel() (myvib is the context for Phone Vibrator) in the exit block the close option provided in my app. For the other scenario, when it is closed by pressing the END button in phone, i have no idea how to solve it... So friends please advice me what is necessary to do... The comments i have been receiving from many users of my app is really embarassing.... </p>","347783","","","","","2010-10-18 15:26:04","My Android ""massage viberator"" application does not stop vibrating even after the process is killed?","<android>","2","1","0","",""
"3960050","1","4007934","","2010-10-18 14:12:38","11","6695","<p>I searched the web but no luck: how can plugins for the native Android browser be developed?! Neither Google nor the Android SDK give information about this topic.</p>","419501","","894284","","2012-02-10 14:09:04","2012-11-02 06:57:38","How to develop plugins for the native Android browser","<android><plugins><browser>","2","3","8","",""
"3960055","1","3960155","","2010-10-18 14:13:45","1","644","<p>I was wondering if there is a way for placing a view to the right side of another view and centering it vertically on the second views height. In know this can be done using a LinearLayout, but for other reasons the 2 views must be part of the same RelativeLayout. </p><p>Thanks a lot</p>","460611","","","","","2010-10-18 14:26:48","Place view to right of other view and vertically centered relatively to this view using RelativeLayout","<android>","1","0","","",""
"3960187","1","3960407","","2010-10-18 14:30:22","2","1006","<p>There are 2 parts to my question but both are related. I have searched all over the place but cannot find a way to put in an array, all file names from R.raw, such as MP3s in string format.</p><p>I also want to create new buttons on the fly in Java, as opposed to using the XML files to lay out buttons.</p><p>psuedocode:</p><p>array[] = put all file names from R.raw into this array with file name;</p><p>count = count num of rows in array[];</p><p>//I want to be able to do this with that arrayfor (int i = 0; i &lt; count; i++) {   create new button and assign it a sound(onclick);   this.button should be placeable anywhere i want without using XML for layout}</p><p>Thanks in advance to any help anyone can provide!</p>","479390","","","","","2012-10-06 12:10:11","Android Java - Putting all file names from R.raw into array without manually specifying each","<java><android><media>","2","0","1","",""
"3960222","1","","","2010-10-18 14:36:16","1","1174","<p>G'day. I'm develop android application that uses GPS module. API version that i use is Google API8. </p><p>I'm implements LocationListener interface and setup listener</p><pre><code>LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);MyLocationListener myLocationListener = new MyLocationListener();lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 61000, 0, myLocationListener);</code></pre><p>But i can't step into void onLocationChanged(Location location) method of my listener. In logcat i see this:</p><pre><code>D/GpsLocationProvider(   96): ALARM_WAKEUPD/GpsLocationProvider(   96): startNavigatingD/libgps  (   96): qct_gps_set_qos_time_out(standalone = 2, agps = 89)D/libgps  (   96): qct_gps_set_qos_accuracy(accuracy = 50)D/libgps  (   96): qct_gps_set_position_mode = 1, fix_frequency = 61D/libgps  (   96): qct_gps_startV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread calling send_get_positionV/AlarmManager(   96): Adding Alarm{46731390 type 2 android} -?-+-¦ 01 04:48:29 AMV/libgps  (   96): PD command:V/libgps  (   96): RPC_PDSM_PD_CMD_GET_POSV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): PD event:V/libgps  (   96): PDSM_PD_EVENT_BEGIND/libgps  (   96): report status : 1D/GpsLocationProvider(   96): Acquiring wakelockV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): PD event:V/libgps  (   96): PDSM_PD_EVENT_COMM_BEGINV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedD/libgps  (   96): calling sAGpsStatusCallback GPS_REQUEST_AGPS_DATA_CONND/GpsLocationProvider(   96): mConnMgr.startUsingNetworkFeature result: 2D/libgps  (   96): qct_agps_data_conn_failedD/libgps  (   96): DeferredActionThread calling send_pdsm_atl_post_event PDSM_ATL_EVENT_OPEN_FAILD/ConnectivityService(   96): startUsingNetworkFeature for net 0: enableSUPL by 96/1000D/ConnectivityService(   96): special network not availableV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): PD event:V/libgps  (   96): PDSM_PD_EVENT_GPS_BEGIND/libgps  (   96): report status : 3V/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returnedV/libgps  (   96): DeferredActionThread pthread_cond_wait returned...</code></pre><p>Please, help</p>","410919","","203600","","2010-11-29 16:04:39","2010-11-29 16:04:39","Can't get GPS coordinates","<java><android><gps>","0","4","","",""
"3960367","1","3973765","","2010-10-18 14:53:03","1","1817","<p>I'm trying to figure out the whole Android licensing thing, and getting frustrated.In the emulator, I run the app with no account, or one that isn't in the testing environment, and it seems to work correctly, returning the not licensed response and pops up the buy the app now message.</p><p>When I try to run it on an actual Android device, it returns licensed every time, even though the device account isn't one that is in the testing environment.Also, even though it returns licensed, the ""checking license"" box never goes away, unless you click cancel. Then it just lets you use the app as if it was licensed.It's mostly C&amp;P from the example, with a few changes. I removed the check license button and the status text box.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mHandler = new Handler();    // Try to use more data here. ANDROID_ID is a single point of attack.    String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);    // Library calls this when it's done.    mLicenseCheckerCallback = new MyLicenseCheckerCallback();    // Construct the LicenseChecker with a policy.    mChecker = new LicenseChecker(        this, new ServerManagedPolicy(this,            new AESObfuscator(SALT, getPackageName(), deviceId)),        BASE64_PUBLIC_KEY);    doCheck();    ArrayAdapter&lt;String&gt; booksAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, mBooks);    this.setListAdapter(booksAdapter);}protected Dialog onCreateDialog(int id) {    // We have only one dialog.    return new AlertDialog.Builder(this)        .setTitle(R.string.unlicensed_dialog_title)        .setMessage(R.string.unlicensed_dialog_body)        .setPositiveButton(R.string.buy_button, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(                    ""http://market.android.com/details?id="" + getPackageName()));                startActivity(marketIntent);                finish();            }        })        .setNegativeButton(R.string.quit_button, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                finish();            }        })        .create();}private void doCheck() {    setProgressBarIndeterminateVisibility(true);    alertbox(""status"", getString(R.string.checking_license));    mChecker.checkAccess(mLicenseCheckerCallback);}protected void alertbox(String title, String mymessage)  {      new AlertDialog.Builder(this)         .setMessage(mymessage)         .setTitle(title)         .setCancelable(true)         .setNeutralButton(android.R.string.cancel,            new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton){}           })        .show();  }private void displayResult(final String result) {    mHandler.post(new Runnable() {        public void run() {            alertbox(""status"", result);            setProgressBarIndeterminateVisibility(false);        }    });}private class MyLicenseCheckerCallback implements LicenseCheckerCallback {    public void allow() {        if (isFinishing()) {            // Don't update UI if Activity is finishing.            return;        }        // Should allow user access.        //displayResult(getString(R.string.allow));    }    public void dontAllow() {        if (isFinishing()) {            // Don't update UI if Activity is finishing.            return;        }        //displayResult(getString(R.string.dont_allow));        // Should not allow access. In most cases, the app should assume        // the user has access unless it encounters this. If it does,        // the app should inform the user of their unlicensed ways        // and then either shut down the app or limit the user to a        // restricted set of features.        // In this example, we show a dialog that takes the user to Market.        showDialog(0);    }    public void applicationError(ApplicationErrorCode errorCode) {        if (isFinishing()) {            // Don't update UI if Activity is finishing.            return;        }        // This is a polite way of saying the developer made a mistake        // while setting up or calling the license checker library.        // Please examine the error code and fix the error.        String result = String.format(getString(R.string.application_error), errorCode);        displayResult(result);    }}@Overrideprotected void onDestroy() {    super.onDestroy();    mChecker.onDestroy();}</code></pre><p>I just don't know what I need to change to make it work... or if the license is somehow cached (even though this is the first time I've run it on this device) and if I can uncache it without wiping the device, as that'll be nice for when I do testing on other apps.Also, how do I remove the ""checking license"" message without having to click the cancel button... should I just make it so that it doesn't show up?</p>","356438","","","","","2010-10-23 03:53:34","Android Licensing Server on a device","<android><licensing>","1","1","2","",""
"3960444","1","3960555","","2010-10-18 15:01:00","2","3059","<p>Hai Friends,            I have implemented tab Listener, when i am clicking on the tabs it loads the data in the list view with no problem, if i click other tab options it also load fine, again if i click the first one i am getting the following the exception in my log, i do not know why i am getting this?, so please help me on this.</p><pre><code>error android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</code></pre><p>The code is  </p><pre><code>    tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {       @Override       public void onTabChanged(String arg0) {        if (arg0.equals(""tab1"")) {         Log.v(""Hi"",""Tilsan"");         BS_Main.submit.setVisibility(View.INVISIBLE);         alt_header_text.setVisibility(View.INVISIBLE);         header_text.setText(""Articles"");         tabHost.setCurrentTab(1);         if (temp_stat.equals(""lv"")) {          Log.v(""Hi+++"",""Tilsan"");          alt_header_text.setVisibility(View.INVISIBLE);          back.setVisibility(View.INVISIBLE);          //share.setVisibility(View.INVISIBLE);          gal_lay.setVisibility(View.VISIBLE);          //lv_movies.setVisibility(View.GONE);          lv_movies.setVisibility(View.VISIBLE);          url = ""http://www.theblacksheeponline.com/mobile/article.php?start=1&amp;showcount=-1&amp;tag=all"";          flyurl = url;          san_flag=true;          new San_FirstTask().execute();         }        } else if (arg0.equals(""tab2"")) {         BS_Main.submit.setVisibility(View.INVISIBLE);         // visiblity();         header_text.setText(""Schools"");         alt_header_text.setVisibility(View.INVISIBLE);         if (BS_Bars.temp_bars == 0) {          BS_Main.submit.setVisibility(View.INVISIBLE);          BS_Bars.lv_bardate.setVisibility(View.GONE);          BS_Bars.lv_barlist.setVisibility(View.GONE);          // BS_Bars.lv_barlist_details.setVisibility(View.GONE);          BS_Bars.lv.setVisibility(View.VISIBLE);          back.setVisibility(View.INVISIBLE);          gal_lay.setVisibility(View.GONE);         } else if (BS_Bars.temp_bars == 1) {          BS_Main.submit.setVisibility(View.INVISIBLE);          BS_Bars.lv.setVisibility(View.GONE);          BS_Bars.lv_barlist.setVisibility(View.GONE);          // BS_Bars.lv_barlist_details.setVisibility(View.GONE);          BS_Bars.lv_bardate.setVisibility(View.VISIBLE);          back.setVisibility(View.VISIBLE);          gal_lay.setVisibility(View.GONE);         } else if (BS_Bars.temp_bars == 2) {          BS_Main.submit.setVisibility(View.INVISIBLE);          BS_Bars.lv_bardate.setVisibility(View.GONE);          BS_Bars.lv.setVisibility(View.GONE);          BS_Bars.lv_barlist.setVisibility(View.VISIBLE);          back.setVisibility(View.VISIBLE);          gal_lay.setVisibility(View.GONE);         } else if (BS_Bars.temp_bars == 3) {          BS_Main.submit.setVisibility(View.INVISIBLE);          BS_Bars.lv_bardate.setVisibility(View.GONE);          BS_Bars.lv.setVisibility(View.GONE);          BS_Bars.lv_barlist.setVisibility(View.GONE);          back.setVisibility(View.VISIBLE);          gal_lay.setVisibility(View.GONE);         } else if (BS_Bars.temp_bars == 4) {          BS_Main.submit.setVisibility(View.INVISIBLE);          BS_Bars.lv_bardate.setVisibility(View.GONE);          BS_Bars.lv.setVisibility(View.GONE);          BS_Bars.lv_barlist.setVisibility(View.GONE);          BS_Bars.bars_wv.setVisibility(View.VISIBLE);          back.setVisibility(View.VISIBLE);          gal_lay.setVisibility(View.GONE);         } else {          BS_Main.submit.setVisibility(View.INVISIBLE);          BS_Bars.lv.setVisibility(View.VISIBLE);          BS_Bars.lv_barlist.setVisibility(View.GONE);          BS_Bars.lv_bardate.setVisibility(View.GONE);          back.setVisibility(View.GONE);          gal_lay.setVisibility(View.GONE);         }        } else if (arg0.equals(""tab3"")) {         back.setVisibility(View.GONE);         gal_lay.setVisibility(View.GONE);         alt_header_text.setVisibility(View.INVISIBLE);         header_text.setText(""ShoutOuts"");         BS_Main.submit.setVisibility(View.INVISIBLE);         tabHost.setCurrentTab(3);         BS_Shoutout.shout_realtive.setVisibility(View.VISIBLE);        } else if (arg0.equals(""tab4"")) {         Log.v(""Tag"", ""TAB4"");         back.setVisibility(View.GONE);         //share.setVisibility(View.GONE);         gal_lay.setVisibility(View.GONE);         temp_stat1 = ""imgv"";         header_text.setText(""Pictures"");         alt_header_text.setVisibility(View.INVISIBLE);         Log.v(""TAG"", ""Pictures"");         tabHost.setCurrentTab(4);        } else if (arg0.equals(""tab5"")) {         Intent obj_intent = new Intent(BS_Main.this,           Rss_Feed_Grid.class);         startActivity(obj_intent);        }       }      });// Asynchronous Task class codeprivate class San_FirstTask extends AsyncTask&lt;Void, Void, Void&gt; {  private final ProgressDialog dialog = new ProgressDialog(BS_Main.this);  String san_url;  // can use UI thread here  protected void onPreExecute() {   this.dialog.setMessage(""Loading..."");   this.dialog.setCancelable(false);   this.dialog.show();  }  @Override  protected Void doInBackground(Void... params) {   try {    if(san_flag == true)    {     Log.v(""Hai Sankar"",""san_flag==true"");     san_url=""http://www.theblacksheeponline.com/mobile/article.php?start=1&amp;showcount=-1&amp;tag=""+san_id[0];     Log.v(""SanUrl_here"", san_url);     slist = new MultiLine_Sex(BS_Main.this, san_url);     lv_movies.addFooterView(footerView, null, true);     footerView.setVisibility(View.VISIBLE);     san_flag=false;     }    else    {     Log.v(""Url_here"", url);     slist = new MultiLine_Sex(BS_Main.this, url);    }    Log.v(TAG, ""progress"");   } catch (Exception e) {    Log.v(TAG, ""error "" + e);   }   return null;  }  protected void onPostExecute(Void result) {   Log.v(""Hai"",""Inside Else in Atask"");//   footerView.setVisibility(View.VISIBLE);//   ListView.FixedViewInfo footerInfo1 = lv_movies.new FixedViewInfo();//   footerInfo1.isSelectable=true;//   ArrayList&lt;ListView.FixedViewInfo&gt; footerInfos1=new ArrayList&lt;ListView.FixedViewInfo&gt;(); //   footerInfo1.view = footerView;//   footerInfos1.add(footerInfo1);//   HeaderViewListAdapter headerViewListAdapter1 = new HeaderViewListAdapter(null,footerInfos1,slist);//   lv_movies.setAdapter(headerViewListAdapter1);   //lv_movies.addFooterView(footerView);   //footerView.setVisibility(View.VISIBLE);   lv_movies.setAdapter(slist);   slist.notifyDataSetChanged();//   code blocked by sandher.......//   if (san_url != null) {//    Log.v(""Hai"",""Inside If in Atask"");//    footerView.setVisibility(View.VISIBLE);//    ListView.FixedViewInfo footerInfo = lv_movies.new FixedViewInfo();//    footerInfo.isSelectable=false;//    ArrayList&lt;ListView.FixedViewInfo&gt; footerInfos=new ArrayList&lt;ListView.FixedViewInfo&gt;(); //    footerInfo.view = footerView;//    footerInfos.add(footerInfo);//    HeaderViewListAdapter headerViewListAdapter = new HeaderViewListAdapter(null,footerInfos,slist);//    lv_movies.setAdapter(headerViewListAdapter);//    //lv_movies.addFooterView(footerView);////    ////    lv_movies.addFooterView(footerView);////    lv_movies.setAdapter(slist);//    slist.notifyDataSetChanged();//   }//   else if (url != null) {//    Log.v(""Hai"",""Inside Else in Atask"");//    footerView.setVisibility(View.VISIBLE);//    ListView.FixedViewInfo footerInfo1 = lv_movies.new FixedViewInfo();//    footerInfo1.isSelectable=true;//    ArrayList&lt;ListView.FixedViewInfo&gt; footerInfos1=new ArrayList&lt;ListView.FixedViewInfo&gt;(); //    footerInfo1.view = footerView;//    footerInfos1.add(footerInfo1);//    HeaderViewListAdapter headerViewListAdapter1 = new HeaderViewListAdapter(null,footerInfos1,slist);//    lv_movies.setAdapter(headerViewListAdapter1);////    //lv_movies.addFooterView(footerView);//    //lv_movies.setAdapter(slist);//    slist.notifyDataSetChanged();//   }   if (this.dialog.isShowing()) {    this.dialog.dismiss();   }  } }</code></pre>","424413","","1466188","","2012-08-27 09:16:56","2012-08-27 09:16:56","Need Help in Tab changed Listener?","<android>","1","0","","",""
"3960472","1","4184154","","2010-10-18 15:04:19","1","8093","<p>Kindly provide me the <strong>Android code to get the User-Agent from the Android mobile device</strong> like in J2me where we can get System information about the mobile device using the J2me API.</p><p>Also , is there any list of Rdf or useragent string/ xml for the different Android devices available in the market.</p>","443141","","114066","","2012-10-04 07:08:17","2012-10-04 07:08:17","Get User-Agent using Android API","<android>","3","2","3","",""
"3960634","1","3961003","","2010-10-18 15:22:46","0","704","<p>I have two different project A &amp; B. Inside the project A I link the source from project B so activity from project A can start the activity from project B. I'm using Eclipse Galileo.</p><p>The problem is, when I want to edit the value of a view in activity B, the resource id from both projects have some conflicts in it. So when I call findViewById() in activity B I got a view from the activity A instead.</p><p>I've declared the activity B inside the AndroidManifest in project A. I've even tried to start the activity B as the entry point of the application but it didn't show anything at all. It's like the findViewById tried to search the view of project A only although I've specified the package name correctly.</p><pre><code>findViewById(com.my.company.projectB.R.id.someView);</code></pre><p>Does anyone have any idea about what's going on? I'll really appreciate any help. Thanks!</p>","305864","","305864","","2010-10-18 15:48:17","2010-10-18 16:08:28","Conflicting resource id of two different project's R.java","<java><android><resources>","1","4","","",""
"3960661","1","3960801","","2010-10-18 15:26:26","12","12940","<p>I've tried different methods around the web but couldn't make it work. </p><pre><code>    Cursor cursor = sqlite.myDataBase.rawQuery(""SELECT StartDate, EndDate FROM Tracks Where Id=""+'""'+trackId+'""',null); SimpleDateFormat outputFormat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss""); Date startDate = outputFormat.parse(cursor.getString(cursor.getColumnIndex(""StartDate""))); Date endDate = outputFormat.parse(cursor.getString(cursor.getColumnIndex(""EndDate"")));</code></pre><p>In this way I get both dates in good format. Now I want to find the difference between EndDate and Startdate in seconds.</p><p>Any advice ? Thank you.</p>","379865","","812149","","2012-07-23 07:18:14","2014-04-11 10:45:23","Android difference between two dates in seconds","<android><date><seconds>","2","0","4","",""
"3960695","1","3960803","","2010-10-18 15:30:55","3","4883","<p>I want to make my Android app look a little bit sexier but as I don't have knack for design I was wondering if there are other themes that are available for importing into your Android app (like the Dark and Light themes that come with SDK)?</p><p>I do not expect a Theme that would make Android app look like an iPhone app, but anything that would help me  move in that direction is a welcome suggestion (and please don't go with ""you can create theme on your own"").</p>","237858","","","","","2013-01-14 22:26:45","Android - Custom App Themes that are freely available","<android>","2","2","","",""
"3960797","1","","","2010-10-18 15:43:47","9","3193","<p>How should I go about identifying an android user to a server.Should I get the IMSI number and some salting algorithm?Considering androids space and performance limitations is there a library that isn't too heavy that I can use to do the calculation?</p>","25282","","","","","2013-08-24 10:53:51","What's the best way to uniquely identify Android users to a server?","<android>","5","4","0","",""
"3960835","1","3960856","","2010-10-18 15:49:04","0","570","<p>I have a layout I want to reuse, it looks like:</p><pre><code>&lt;LinearLayout .. &gt;  &lt;Button /&gt;&lt;/LinearLayout&gt;</code></pre><p>It is in a file called ""reuseme.xml"". Now I have an activity layout, which like the following, how can I incorporate the layout above into it?:</p><pre><code>&lt;LinearLayout&gt;  &lt;TextView /&gt;  &lt;TextView /&gt;  &lt;ReuseMeLayout /&gt; // How do we add this here?&lt;/LinearLayout&gt;</code></pre><p>It seems that's possible, but I'm not sure how to use the merge tag to accomplish it?</p>","291701","","244296","","2010-10-18 15:52:51","2010-10-18 15:52:51","Using the merge tag in layouts to add external layout resource?","<android>","1","1","","",""
"3960884","1","3960952","","2010-10-18 15:54:26","2","3015","<p>How can i set the opacity of a <code>Drawable</code> object? </p>","416412","","","","","2012-06-30 14:42:41","Set drawable opacity","<android><opacity>","2","0","1","",""
"3960886","1","3960926","","2010-10-18 15:54:39","2","1568","<p>I am trying to call the invalidate() from asyntask thread. I am getting this error :</p><blockquote>  <p>10-18 15:14:30.469: ERROR/AndroidRuntime(889): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p></blockquote><p>The line I have used is :</p><blockquote>  <p>mainClass.myMapView.invalidate();//where mainClass=main UI class</p></blockquote><p>Can anyone kindly suggest where my fault is ? </p><p>Thanks.</p><p>-ahsan</p>","342925","","","","","2010-10-18 16:00:21","problem with calling invalidate in async task thread in Android !","<android><android-asynctask><invalidate>","1","0","1","",""
"3961022","1","","","2010-10-18 16:10:17","2","2519","<p>I am having trouble dynamically adding a text box to my view. More specifically, the text-box-adder works, but the button I am trying to move below it does not. The original view is the first picture in the below hyperlink.</p><p>After the +/- button is pressed, it should add a text box between the second text box and the decide button, and then move the +/- button down so it is next to the new box. Instead, the second picture happens:</p><p><a href=""http://i.stack.imgur.com/mzBL3.png"" rel=""nofollow"">http://i.stack.imgur.com/mzBL3.png</a></p><p>My code looks like this: </p><pre><code>EditText textBox2 = (EditText) findViewById(R.id.box2);            RelativeLayout rel = (RelativeLayout) findViewById(R.id.mainlayout);            Context context = getApplicationContext();            EditText newText = new EditText(context);            newText.setId(numBoxes);            numBoxes++;            LayoutParams p = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);            p.addRule(RelativeLayout.BELOW, bottomView.getId());            p.addRule(RelativeLayout.ALIGN_RIGHT, bottomView.getId());            newText.setWidth(220);            newText.setHeight(LayoutParams.WRAP_CONTENT);            newText.setLayoutParams(p);            rel.addView(newText);            bottomView = newText;            ((TextView) bottomView).setText((CharSequence)bottomView.getTag());            LayoutParams b = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);            Button goButton = (Button)findViewById(R.id.decide);            b = (LayoutParams) goButton.getLayoutParams();            b.addRule(RelativeLayout.BELOW, bottomView.getId());            goButton.setLayoutParams(b);            Button addButton = (Button)findViewById(R.id.addsub);            b = (LayoutParams) addButton.getLayoutParams();            b.addRule(RelativeLayout.RIGHT_OF, textBox2.getId());            b.addRule(RelativeLayout.ALIGN_TOP, bottomView.getId());            addButton.setLayoutParams(b);</code></pre><p>Numboxes is just a counter so I can keep track of the boxes and name them accordingly, and bottomView is just the bottom-most text box.</p><p>I have searched all over the android development pages, and tried creating the new layout params. I also tried replacing the decide button with a text box, bu the same problem occurred. Please help.</p>","479503","","479503","","2010-10-18 18:50:33","2010-11-09 20:52:11","Problem adding textboxes dynamiclly in a relative layout","<android><relativelayout>","1","0","0","",""
"3961031","1","4132805","","2010-10-18 16:11:29","3","7897","<p>I have list activity with custom array adapter and I can't to get context menu when make long press on list item.</p><pre><code>&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;ListView                android:id=""@+id/list""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                /&gt;    &lt;/FrameLayout&gt;</code></pre><p>list item layout</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;     &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""        &gt;    &lt;ImageView            android:id=""@+id/icon""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            /&gt;    &lt;TextView            android:id=""@+id/info""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:padding=""10dp""            android:textSize=""15sp""            android:singleLine=""true""            android:ellipsize=""marquee""            android:scrollHorizontally = ""true""            android:maxWidth=""200dp""            /&gt;    &lt;LinearLayout             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             android:gravity=""right""            &gt;        &lt;ImageButton                android:id=""@+id/button""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:background=""@null""                android:paddingRight=""10dp""                                android:paddingLeft=""10dp""                /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>In activity</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {   registerForContextMenu(getListView());}    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.context_menu, menu);  }</code></pre><p>Why I do not see context menu? What I do wrong? How to get context menu with array adapter and ListActivity.Thanks! </p>","423868","","","","","2012-04-28 23:47:35","Context menu in list activity","<android><listview><contextmenu><listactivity><android-arrayadapter>","2","0","","",""
"3961032","1","","","2010-10-18 16:11:29","0","749","<p>I have a ListView which is defined in a layout XML.   I have another XML whcih defines TextViews that are elements in each of the items in the ListView and in code use the 'inflator' mechanism .   There are 3 TextViews named top, middle and bottom.  During the runtime life of the ListView I change some text in the bottom row of one the ListView items and it results in two lines of text in place of the one which it was.   The bottom row in the TextViews XML has 'single line' defined as ""false"".</p><p>When the app is running and code amends the bottom row in one of the ListView items two lines of text appears but because the depth of the ListView item doesnt change the second line of text is half hidden.</p><p>I've pored over the XML and code to try to puzzle out how to amend the depth of the ListView item but without success.   Can it be done and any help as to how?Thanks</p>","479505","","","","","2010-10-18 16:35:10","Altering ListView items at runtime","<android>","1","0","","",""
"3961071","1","4942812","","2010-10-18 16:15:16","12","11860","<p>I need to display a pretty image of a map of Europe, and I want my app to, e.g. bring up a different activity, when the user clicks each country - each country on the map needs to have a different onClickListener (or equivalent).</p><p>Essentially, I need to be able to call a different function when the user taps on France rather than Spain in an image such as this:<a href=""http://commons.wikimedia.org/wiki/File:Blank_map_of_Europe_cropped.svg"">http://commons.wikimedia.org/wiki/File:Blank_map_of_Europe_cropped.svg</a></p><p>How would I best go about this on Android?</p><p>I've got ideas, but there may be some simple way that I'm overlooking.</p><p>Many thanks in advance!</p><p>Cheers,r3mo</p>","421636","","","","","2013-09-14 07:02:20","Android: how to make a clickable map image with each country producing a different action?","<android><image>","4","2","18","",""
"3961096","1","","","2010-10-18 16:17:52","1","1215","<p>I’m looking for recommendations for what people are using to get access to development hardware for developing and testing Android Apps. I see three choices that make sense:</p><ol><li>Buy Nexus One devices off contract from Google’s developer program (http://www.google.com/phone/detail/nexus-one)</li><li>Buy used or new off contract devices from Ebay or other sellers</li><li>Buy devices from carriers with contract and carrier discount</li></ol><p>We have a small number of Nexus One’s we’ve purchased and some developers have their own Android phones from carriers, but I was hoping to hear ideas from others. What are you doing to get real hardware for development and testing? we have some application features that don't test well under the emulator, so we need real hardware.</p><p>I am also concerned about QA coverage. I see posts like <a href=""http://blog.tweetdeck.com/android-ecosystem"" rel=""nofollow"">http://blog.tweetdeck.com/android-ecosystem</a> or the variety of devices listed at <a href=""http://en.wikipedia.org/wiki/List_of_Android_devices"" rel=""nofollow"">http://en.wikipedia.org/wiki/List_of_Android_devices</a> and I wonder do you do QA on various devices? Is there a small set of devices could give you better test coverage? </p>","90236","","90236","","2010-10-21 14:21:22","2010-10-21 14:21:22","Recommendations for Android app development and test hardware","<android>","0","4","","",""
"3961111","1","","","2010-10-18 16:19:29","1","486","<p>I'm trying to get my widget button (or the Widget itself) position to pass it to another activity triggered by this button. I've tried like this at the other activity on onCreate() method, and NPE is happening:</p><pre><code>Button b1 = (Button) findViewById(R.id.ButtonLogin);        int[] outLocs;if (b1.getWindowToken() == null)      outLocs = null;else {      outLocs = new int[2];      b1.getLocationOnScreen(outLocs);}</code></pre><p>I've also tried unsuccessfully (NPE) doing at my Widget update class (extends service)  also at onUpdate() method, using the intent that triggers the other activity:</p><pre><code>Intent configIntent = new Intent(context, ClickOneActivity.class);Rect outLocs = configIntent.getSourceBounds();Log.d(VexWidget.LOG_TAG, ""x="" + outLocs.flattenToString() + ""\n"");Log.d(VexWidget.LOG_TAG, ""y="" + outLocs.centerY());</code></pre><p>I've heard it's not possible call such positions method at any construct/update methods at App lifecycle.</p><p>But what should I have to do for achieve what I want? (the position on the screen of my widget being seen by other activities).</p><p>Thanks a lot.</p>","479515","","","","","2010-10-18 16:19:29","Android - getting AppWidget Position","<android><android-widget>","0","0","2","",""
"3961117","1","","","2010-10-18 16:20:05","0","345","<p>My question is exactly the same as this one. <a href=""http://stackoverflow.com/questions/3599508/how-to-set-different-locales-in-android"">http://stackoverflow.com/questions/3599508/how-to-set-different-locales-in-android</a></p><p>I checked, my phone supports en_PK and en_BE.</p><p>My resource folders are values-en-rPK and values-en-rBE. When i change locale, android seems to ignore the 2nd part of locale (country code), and always picks the strings from values-en.</p><p>I've tried setting various variations of these locale codes (en-PK, en_pk, etc), with dashes, underscored, uppercase, lowercase, nothing seems to work!! Android always pulls the resources out of values-en.</p><p>Any ideas??</p>","450741","","","","","2010-10-18 16:20:05","android locale 2nd part code ignored","<android><locale>","0","2","","",""
"3961122","1","3961586","","2010-10-18 16:20:56","0","86","<p>I've just created some preferences using the PreferenceScreen XML following the Earthquake example from Wrox's ""Professional Android Development"" book.</p><p>Using the emulator, how do I accept the preferences?If I use the back button I return a Activity.RESULT_CANCELED. So which key returns the Activity.RESULT_OK code?</p><p>Thanks.</p>","472428","","","","","2010-10-18 17:26:20","How to accept preferences in the emulator?","<android><android-emulator>","1","0","","",""
"3961125","1","3961184","","2010-10-18 16:21:10","1","1092","<p>Could anyone point me in the right direction on this. I have 20+ weeks to design and code a Texas Hold'em Poker Game in Java for an Android phone for a University Project. It should include AI opponents that play with you or just against themselves. They should be able to learn what strategies work best over a period of time, conservative, bluffing etc. I am in my final year and I don't want to make this too complex, I just need a simple, easy but effective AI system that can be played on a small device and be reasonably challenging. I have looked at a lot of theories and articles written about the possibilities that are available (including the University of Alberta), but I don't intend to have a world beating AI, just a simple one. And once that's out the way I can concentrate on the game gui quicker :). Any ideas?</p><p>Thanks in advance for any feedback!</p>","258415","","1465910","","2012-09-29 09:17:21","2012-09-29 09:17:21","Java Android App - Simple AI for Texas Hold'em","<java><android><artificial-intelligence>","1","0","0","",""
"3961260","1","3961525","","2010-10-18 16:40:28","0","1258","<p>My android application is consists of 20+ activities. I want to perform some task when application is in background (not an specific activity) and want to perform some other task when application is resumed. How to do this? I couldn't find onPause() and onResume() methods in Application class. </p>","278194","","","","","2010-10-18 19:24:18","How to capture an android application's onPause event?","<android>","1","0","","",""
"3961439","1","4010302","","2010-10-18 17:00:04","0","1985","<p>I want to rebuild (maybe I don't even have to) the <a href=""http://dl.dropbox.com/u/299320/android-drawables/1.6/spinner_black_76.png"" rel=""nofollow"">nativ android progress indicator</a> and show it as icon for a list item. I followed <a href=""http://stackoverflow.com/questions/2032304/android-imageview-animation"">this example</a> and endet up with a heavy performance eating animation, which also doesn't match the native spinner. The code has as ""LinearInterpolator"" which seems to cause those problems.</p><p>Now I made my own Interpolar and fulfilled one of my needs: It's quantizing the steps into 12. </p><p>However, I still have huge performance problems. <strong>The UiThread now doesnt let my background threads run</strong>, which are intended to download and parse data. Note the fact, that I am displaying several spinners in a list. I also tried to set the interpolator as class variable in my listAdapter. So, all listViews can take use of this Interpolator.</p><pre><code>if(imageViewIcon != null) {  RotateAnimation anim = new RotateAnimation(0f, 360f, 51f, 51f);  anim.setInterpolator(new Interpolator() {    @Override    public float getInterpolation( float input ) {      return (float) Math.floor((double)input*10)/12;    }  }); // anim  anim.setRepeatCount(Animation.INFINITE);  anim.setDuration(1000);  // Start animating the image  imageViewSpinner.startAnimation(anim);}</code></pre><p><strong>Update</strong></p><p>Finally I found the ProgressBarWidget which does exactly the same as I do. However, it's still not very performant. (It's better though)</p>","433718","","433718","","2010-10-24 20:27:52","2010-10-24 20:31:34","Take use of the native spinner in Android","<android><android-widget><rotation><spinner><android-animation>","1","0","","",""
"3961444","1","3962116","","2010-10-18 17:00:46","1","254","<p>I am just getting started developing my first Android app, and one function that I need the app to do is to be able to place a voice call and play a recording into the call.</p><p>I have been looking all over the place and I cannot find the ability to do this in the Android SDK. I do see there is com.android.internal.telephony which does seem to offer the ability but I also read that apps are not supposed to use this because it is not part of the SDK. </p><p>Am I understanding things correctly that there is no way for an Android app to be able to do this (make an actual voice call)? Any help would be appreciated.</p>","479542","","","","","2013-02-20 04:25:45","Using telephony functionality from Android app","<android>","3","2","","",""
"3961589","1","","","2010-10-18 17:19:53","32","42175","<p>It's possible to use following method for content's setting of a web-viewloadData(String data, String mimeType, String encoding)</p><p>How to handle the problem with unknown encoding of html data?!</p><p>Is there a list of encodings?!</p><p>I know from my college that in my case html comes from DB and is encoded with latin-1.I try to set encoding parameter to latin-1, to ISO-8859-1 / iso-8859-1, but still have problem with displaying of special signs like ä, ö, ü.</p><p>I'll be very thankful for any advice.</p>","408780","","421372","","2013-09-23 14:37:34","2014-01-10 08:59:14","Android. WebView and loadData","<android><encoding><webview>","10","0","20","",""
"3961637","1","3963648","","2010-10-18 17:25:22","0","1841","<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=""@+string/urlText""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:hint=""Enter Url Here""/&gt;&lt;Button android:id=""@+string/go""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""Go""/&gt;&lt;WebView android:id=""@+string/webView""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     /&gt;&lt;/LinearLayout&gt;</code></pre><p>So with the above android layout, I am not able to make the editbox and button to be to the full width of the container. About 50 px from the left and the right are not filled.</p><p>Any sugestions</p>","191803","","","","","2010-10-18 21:42:39","Set maximum width of Linear Layout","<android><layout>","2","7","1","",""
"3961652","1","3961716","","2010-10-18 17:26:31","4","12666","<p>i have content i need to display above my listview and below, so much that a scrollview would be great to use if you could use scrollviews and listviews together.  Since thats not the best solution, i've been trying to do a couple of things to add footer content to my listview,</p><p>here the pic below shows what happens when i add a different type of row as the last row.  I  can't get my content to fill the width of the row </p><p><img src=""http://i.stack.imgur.com/exjgV.jpg"" alt=""alt text""></p><p>I have a couple of buttons that need to go in the footer.  I'm using a custom adapter that extends BaseAdapter.  </p><p>I have also tried using the addFooterView but i'm confused on how to use the addFooterView method if you are implementing your own adapter.  Anyone have any simple examples of how to implement addFooterView on a custom adapter </p><p>or</p><p>is there a way i can get the row at this position (as seen in the picture ) to display better, here is the code i'm using to create this footer row</p><pre><code>        View v = getLayoutInflater().inflate(R.layout.item_listview_footer, null);        LinearLayout ll = (LinearLayout) v.findViewById(R.id.ll);        return ll;  // return ll as convertView in getView function</code></pre><p>edit:</p><p>here is the xml for my footer layout</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:background=""@drawable/red"" android:orientation=""vertical"" android:id=""@+id/ll""&gt;    &lt;Button android:id=""@+id/specialInsButton"" style=""@style/button"" android:text=""Add Special Instructions"" android:layout_width=""fill_parent""/&gt;    &lt;Button android:id=""@+id/addToBagButton"" style=""@style/button"" android:text=""Add To Bag""/&gt;    &lt;EditText android:id=""@+id/quantity"" style=""@style/standard"" android:text=""1""/&gt;&lt;/LinearLayout&gt;</code></pre><p>here is the xml for style/button</p><pre><code>&lt;style name=""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;item name=""android:textSize""&gt;17px&lt;/item&gt;        &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;        &lt;item name=""android:typeface""&gt;sans&lt;/item&gt;        &lt;item name=""android:gravity""&gt;center&lt;/item&gt;        &lt;item name=""android:layout_gravity""&gt;center&lt;/item&gt;    &lt;/style&gt;</code></pre><p>standard style </p><pre><code> &lt;style name=""standard""&gt;        &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;        &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;    &lt;/style&gt;</code></pre>","202064","","202064","","2010-10-18 20:28:32","2010-10-18 20:28:32","listview addFooterView problems","<android><listview><android-linearlayout><android-listview>","1","0","2","",""
"3961683","1","","","2010-10-18 17:29:39","0","92","<p>I am working on developing an application that requires me toestablish multiple client-server based connections. Connection can beof two types where the Android device can be a server or a client. Ican have up to 6 - 8 connections. Once the connections are set-up theyneed to be running in the background and are not typically affected byUI actions.</p><p>Since each connection can be blocking, I am wondering what is a goodaway to design this app. Should I have two services for handling theserver and client connections? Each service could have a ""connectionmanager"" that can spawn new threads when necessary. Or does creatingtwo services even help? I presume spawning new processed would not begood as they will be expensive. Is this correct?</p><p>I would appreciate any suggestions. Also, if this use case is nottypical please let me know if you need more information to make anyrecommendation.</p><p>Thanks,-Ray</p>","479568","","","","","2011-03-11 11:36:28","App design question for multiple ""data"" connections","<android>","1","0","","",""
"3961772","1","3963469","","2010-10-18 17:40:21","0","142","<p>I am writing a commercial Android app to take survey, which should also give option to edit survey.What is the best approach to link UI fields to database without writing explicit logic to do that.</p>","284606","","","","","2010-10-18 21:16:09","Android populate and set values from UI to object and Viceversa","<android><gui><2-way-object-databinding>","1","0","1","",""
"3961785","1","3961886","","2010-10-18 17:41:35","1","1499","<p>I am trying to compare dates and I have found where my code goes wrong, but I don't know why. </p><p>I am trying to compare a date with todays date (using Gregorian Calendars only). I have printed out todays date where ever it is mentioned in the code and in one place it magically changes from year 2010 to year 3910 (todays year + 1900).</p><p>Does anyone know any reason for this? I will post my code if needed but I honestly haven't changed the date object at all.</p><p>As requested here's the code:</p><pre><code>    //Prints out 2010       System.out.println(""TodaysDate.getYear():\t"" + todaysDate.getYear());    //Prints out 2010    System.out.println(todaysDate);     //Getting a year from a string (it is 2010)    todaysDate.setYear(Integer.parseInt(yea));    //Prints out 2010       System.out.println(""TodaysDate.getYear():\t"" + todaysDate.getYear());    //Prints out 3910       System.out.println(todaysDate);</code></pre>","348261","","345717","","2012-08-05 09:59:51","2012-08-05 09:59:51","Years are incorrect in Android's date classes","<android><date><compare><magic><gregorian-calendar>","1","3","","",""
"3961853","1","","","2010-10-18 17:49:15","0","1582","<p>I am trying to make use of Runtime.getRuntime.exec() command to copy afolder from one location to another on sdcard.But it seems like it doesn't work</p><p>Below is the code snippet where I am trying to copy the contents from /sdcard/etc/data to /sdcard/etc/temp/</p><p><strong>try   {   Process process = Runtime.getRuntime().exec(""cp -r /sdcard/etc/data /sdcard/etc/temp"");   }catch (IOException e)   {    e.printStackTrace();   }</strong></p><p>I also tried  creating a soft link as an alternative.. Event that didnot work.</p><p><strong>try   {   Process process = Runtime.getRuntime().exec(""ln -s /sdcard/etc/data /sdcard/etc/temp/data"");   }catch (IOException e)   {    e.printStackTrace();   }</strong></p><p>Could someone please help me on this. Am I using the Runtime in theproper way if not could you please suggest me an alternative..Appreciate your help!</p><p>Thanks,Nik..</p>","424296","","","","","2010-10-19 23:10:33","Help regarding Runtime.getRuntime().exec() command usage in Android app","<android><runtime.exec>","1","0","1","",""
"3961892","1","3962460","","2010-10-18 17:54:01","2","1734","<p>Hi allI want to start Android development but I just don't like Eclipse. (Yes, I am picky. lol)Is there any other good IDE rather than Eclipse that really WORKS with Android SDK? (QT maybe?)</p><p>Thanks in advance</p><p>Ignacio</p><p>UPDATE:I am on Mac OS X. Is there any plugin for Xcode that makes the trick of linking Android SDK with it?</p>","149008","","149008","","2010-10-19 02:45:24","2013-08-01 09:52:22","Developing Android with other IDE rather than Eclipse","<android><eclipse><qt><ide>","4","4","","",""
"3961918","1","3962407","","2010-10-18 17:56:55","2","4590","<p><strong>Thank you all for your answers and time!</strong></p><p>Hello,</p><p>I've been trying to call a non-static method, located in my main application Class, from the Preferences Class.Because the method I call is not static, I instantiate the main class and then try to call the specific method I want but it's force closing.</p><p><strong>Preferences.class (from where I call the method):</strong></p><pre><code>Preference sorted = (Preference) findPreference(""sortPref"");        sorted.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {            public boolean onPreferenceChange(Preference preference, Object newValue) {                Object d = new mainActivity();                ((mainActivity) d).queryBookmarks();                return true;            }        });</code></pre><p><strong>the mainActivity.class method I call:</strong></p><pre><code>    public void queryBookmarks() {        Toast.makeText(context, ""blah blah"", Toast.LENGTH_LONG).show(); //context is not null and the Toast is working if I  call it from mainActivity.class        }</code></pre><p><strong>The Logcat:</strong></p><pre><code>E/AndroidRuntime(11718): FATAL EXCEPTION: mainE/AndroidRuntime(11718): java.lang.NullPointerExceptionE/AndroidRuntime(11718):        at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:90)E/AndroidRuntime(11718):        at android.app.Activity.managedQuery(Activity.java:1520)E/AndroidRuntime(11718):        at com.queryBookmarks(.java:101)E/AndroidRuntime(11718):        at com.Preferences$2.onPreferenceChange(Preferences.java:47)E/AndroidRuntime(11718):        at android.preference.Preference.callChangeListener(Preference.java:756)E/AndroidRuntime(11718):        at android.preference.ListPreference.onDialogClosed(ListPreference.java:219)E/AndroidRuntime(11718):        at android.preference.DialogPreference.onDismiss(DialogPreference.java:384)E/AndroidRuntime(11718):        at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1047)E/AndroidRuntime(11718):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(11718):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(11718):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(11718):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(11718):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(11718):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(11718):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(11718):        at dalvik.system.NativeStart.main(Native Method)D/dalvikvm(11718): GC_FOR_MALLOC freed 4248 objects / 282248 bytes in 40msW/ActivityManager(  244):   Force finishing activity com.package/.Preferences</code></pre><p>Appreciate any help! :)</p><p>EDIT: I can't make queryBookmarks() a static function because it uses Android function managedQuery which is not a static function.</p>","444324","","444324","","2011-02-20 14:29:03","2011-02-20 14:29:03","Call non-static method (located in main class) from different class","<java><android>","5","5","","",""
"3961960","1","3962145","","2010-10-18 18:00:35","3","1481","<p>I'd like to allow possible inputs of 0-9, "","" or ""-"" for EditText and couldn't find an answer.</p><p>I know using the ""|"" as an separator is possible:</p><pre><code>android:inputType=""number|text""</code></pre><p>But how can I archive something like this (too bad it doesn't work):</p><pre><code>android:inputType=""number|,|-""</code></pre><p>Does anyone know?</p><p>Regards,</p><p>cody</p><hr><p>Addition to the comment below:</p><blockquote>  <p>private class MyKeylistener extends  NumberKeyListener {</p><pre><code>    public int getInputType() {      return InputType.TYPE_CLASS_NUMBER;    }    @Override    protected char[] getAcceptedChars() {      return new char[] {'0','1','2','3','4','5','6','7','8','9',',','-'};    }</code></pre>    <p>}</p></blockquote>","474326","","474326","","2010-10-18 22:19:34","2010-10-18 22:19:34","Android: Expand the inputType of EditText?","<android><edittext>","1","0","","",""
"3962030","1","4732365","","2010-10-18 18:08:46","0","2592","<p>The code below is executed as the jpeg picture callback after TakePicture is called. If I save data to disk, it is a 1280x960 jpeg. I've tried to change the picture size but that's not possible as no smaller size is supported. JPEG is the only available picture format. </p><pre><code> PictureCallback jpegCallback = new PictureCallback() {  public void onPictureTaken(byte[] data, Camera camera) {   FileOutputStream out = null;   Bitmap bm = BitmapFactory.decodeByteArray(data, 0, data.length);    Bitmap sbm = Bitmap.createScaledBitmap(bm, 640, 480, false);</code></pre><p>data.Length is something like 500k as expected. After executing BitmapFactory.decodeByteArray(), bm has a height and width of -1 so it appears the operation is failing. </p><ul><li>It's unclear to me if Bitmap can handle jpeg data. I would think not but I have seem some code examples that seem to indicate it is.</li><li>Does data need to be in bitmap format before decoding and scaling?</li><li>If so, how to do this?</li></ul><p>Thanks!</p>","479608","","234039","","2010-10-18 18:14:40","2011-01-19 06:29:00","Best way to scale size of camera picture before saving to SD","<android><bitmap><jpeg>","1","0","","",""
"3962385","1","3962843","","2010-10-18 18:58:06","4","2915","<p>I am writing a small app that at the moment generates a random map of textures.</p><p>I am drawing this map as a 10 x 15 group of ""quads"" which are infact all triangle strips. I use the ""map"" to grab an int which I then take as the location of the texture for this square in the textureAtlas. so for example 0 is the bottom left ""tile"". The atlas is 128 x 128 and split into 32 pixel tiles.</p><p>However I seem to be getting some odd artifacts where the texture from the one tile is creeping in to the next tile. I wondered if it was the image itself but as far as I can tell the pixels are exactly where they should be. I then looked at the texture coords I was specifying but they all look exact (0.0, 0.25, 0.5, 0.75, 1.0 - splitting it into the 4 rows and columns I would expect).</p><p>The odd thing is if I run it on the emulator I do not get any artifacts.</p><p>Is there a setting I am missing which would cause bleeding of 1 pixel? It seemed to only be vertical too - this could be related to on the phone I am ""stretching"" the image in that direction as the phone's screen is larger than normal in that direction.</p><p>I load the texture like so:</p><pre><code>//Get a new ID    int id = newTextureID(gl);    //We will need to flip the texture vertically    Matrix flip = new Matrix();    flip.postScale(1f, -1f);    //Load up and flip the texture    Bitmap temp = BitmapFactory.decodeResource(context.getResources(), resource);    //Store the widths for the texturemap    int width = temp.getWidth();    int height = temp.getHeight();    Bitmap bmp = Bitmap.createBitmap(temp, 0, 0, width, height, flip, true);    temp.recycle();    //Bind    gl.glBindTexture(GL10.GL_TEXTURE_2D, id);    //Set params    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR);    //Push onto the GPU    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);    TextureAtlas atlas = new TextureAtlas(id, width, height, tileSize);    return atlas;</code></pre><p>I then render it like so:</p><pre><code>gl.glBindTexture(GL10.GL_TEXTURE_2D, currentAtlas.textureID);    //Enable the vertices buffer for writing and to be used during our rendering    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    //Specify the location and data format of an array of vertex coordinates to use    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);    //Enable the texture buffer    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer);</code></pre><p>I would take a picture, but I am unsure how to get a screen cap from the phone...</p><p>If anyone knows of how I can capture the current frame and perhaps put it out into a file I will do that if it helps explain what is going on!</p><p>Look forward to your response.</p><p>Edit: Here is a screencap - note I run the app in landscape but cap is in portrait. Also excuse the horrible textures :D they were merely a place holder / messing around.</p><p><a href=""http://images.redial.net/device.png"" rel=""nofollow"">ScreenCap</a></p>","432272","","432272","","2010-10-18 19:18:10","2010-10-18 19:55:05","Android OpenGL - ES Texture bleeding","<android><opengl-es><render><textures>","1","2","2","",""
"3962519","1","3962884","","2010-10-18 19:16:55","1","1455","<p>I am downloading a JSONObject from a web site. The entries are however HTML-encoded, using </p><pre><code>&amp;quot; </code></pre><p>and </p><pre><code>&amp;#038;</code></pre><p>tags. Is there an easy way to get these to Java strings? Short of writing the converter myself, of course.</p><p>Thanks RG</p><p>PS: I am using the stuff in a ListView. Probably I can use Html.fromHTML as I can for TextView. Don't know.</p>","447111","","447111","","2010-10-18 19:45:28","2010-10-19 08:15:58","Is there a htmlDecode?","<android>","2","0","","",""
"3962656","1","3963429","","2010-10-18 19:33:54","3","4552","<p>I have Activity for displaying search results. It extends ListActivity. I need to show search results in listview grouping several items. So, how do I add grouping to my listview?</p>","468311","","","","","2010-10-18 21:11:33","Android listview groups","<android><listview>","1","0","","",""
"3962706","1","","","2010-10-18 19:38:51","1","9673","<p>I have some strange socket behavior going on.  I've set an timeout of 5 seconds using setSoTimeout.  This should be plenty of time in my situation.  According to online java documentation a <code>SocketTimeoutException</code> should be thrown if it times out.  It also says that the socket is still valid.  So I want to catch it and then continue.  However instead of the inner catch, the outer catch <code>IOException</code> is catching the expception and when I output to the log the details it says it was a <code>SocketTimeoutException</code>.  Another perplexing thing is I change the timeout from 5 seconds to say, 15 seconds and log the amount of time it take for every read, the times are always in the milli-second range, never even close to a second.  Any ideas are GREATLY appreciated.</p><p><code>ReadThread</code> code snippet</p><pre><code>@Overridepublic void run(){    try    {        while (true)        {            byte[] sizeBuffer = new byte[BYTES_FOR_MESSAGE_SIZE];            int bytesRead = this.inputStream.read(sizeBuffer);            int length = 0;            for (int i = 0; i &lt; BYTES_FOR_MESSAGE_SIZE; i++)            {                int bitsToShift = 8 * i;                int current = ((sizeBuffer[i] &amp; 0xff) &lt;&lt; bitsToShift);                length = length | current;            }            byte[] messageBuffer = new byte[length];            this.socket.setSoTimeout(5000); //5 second timeout            try            {               this.inputStream.read(messageBuffer);            }            catch(java.net.SocketTimeoutException ste)            {               Log.e(this.toString(), ""---- SocketTimeoutException caught ----"");               Log.e(this.toString(), ste.toString());            }        }    }    catch (IOException ioe)    {       Log.e(this.toString(), ""IOException caught in ReadThread"");       Log.e(this.toString(), ioe.toString());       ioe.printStackTrace();    }    catch (Exception e)    {       Log.e(this.toString(), ""Exception caught in ReadThread"");       Log.e(this.toString(), e.toString());       e.printStackTrace();    }    this.interfaceSocket.socketClosed();}// end run</code></pre>","418714","","894682","","2012-03-24 01:15:10","2012-03-24 01:15:10","Android - Socket time out","<java><android><sockets>","2","0","","",""
"3962722","1","3962759","","2010-10-18 19:40:19","0","752","<p>I'm looking to create a listview screen similar to the Sound Setting screen (in the built in Settings app, see image below), i.e I want some rows to have text + checkboxes, other rows to have text + ""pop up"" buttons, some rows should have text only etc.</p><p>What is the best way to accomplish this? </p><p><img src=""http://i.stack.imgur.com/BMvRI.png"" alt=""alt text""></p>","277711","","","","","2010-10-18 20:35:55","Android: how do I create a listview screen with different content for each row","<android><listview><content><varying>","2","0","","",""
"3962841","1","3964304","","2010-10-18 19:54:52","0","195","<p>I have an Activity I would like to automate testing on. The start up of the Activity is like this:</p><ul><li>Get data from Intent</li><li>Bind to service and obtain some objects specific to that Activity's intent data</li><li>Query these objects and print information to screen</li></ul><p>I have a basic grasp of testing Activities but given how this Activity depends quite heavily on a Service and other objects, I'm unsure how to start testing it. Ideally, the service would also be set up during testing to return only data pre-defined by me.</p>","240251","","","","","2010-10-18 23:34:22","Testing this Activity","<android><testing><junit><instrumentation>","1","3","","",""
"3963135","1","3963376","","2010-10-18 20:31:51","5","4956","<p>I have been reading the Android documentation and I am wondering if anyone can shed some light on what happens to a service instance when a service started with START_STICKY has it's process killed.  I am assuming that the local state data (instance variables) are also lost.  Does Android do anything to help re-populate the local state when it recreates the service?</p><p>I had some data that was sent to the service in an intent.  In onStateCommand(), I would populate the service's instance data based on what was in the intent.  From what I have read in the Android docs, the intent passed to onStartCommand() will be null when the service has been killed and restarted (with START_STICKY).  Does this mean that I lose both the intent and the service's member data when the service is recreated?</p>","419961","","255905","","2011-03-15 22:00:22","2013-05-31 11:23:25","onStartCommand after service process is killed when started with START_STICKY","<android>","4","0","1","",""
"3963142","1","","","2010-10-18 20:32:45","0","1384","<p>i am a newbie android developer. I am using scrollView in my application. The application will take some profile information from user and will save it in database. There are 2 EditText fields which are broken in scrollView. I have tried my best to solve it but failed. Please help me if anyone knows what is the problem. here is my layout Code.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt; &lt;ScrollView   android:id=""@+id/ScrollView""   android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_marginBottom=""50dip"" &gt;   &lt;RelativeLayout    android:id=""@+id/layoutR""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" &gt;    &lt;ImageView    android:id=""@+id/galleryPic""    android:layout_width=""140px""    android:layout_height=""175px""    android:background=""#ff666666"" /&gt;   &lt;TextView android:id=""@+id/lblmail"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:layout_alignParentTop=""true"" android:layout_marginLeft=""5dip"" android:text=""E_mail:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/galleryPic""/&gt;   &lt;EditText android:id=""@+id/txt_email"" android:layout_width=""170px"" android:layout_height=""32px"" android:layout_marginLeft=""5dip"" android:hint=""e-mail"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/galleryPic"" android:layout_below=""@+id/lblmail""/&gt;   &lt;TextView android:id=""@+id/lblpass"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:layout_marginLeft=""5dip"" android:text=""Password:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/galleryPic"" android:layout_below=""@+id/txt_email""/&gt;&lt;EditText android:id=""@+id/txt_pass"" android:layout_width=""170px"" android:layout_height=""32px"" android:password=""true"" android:maxLines=""1"" android:layout_marginLeft=""5dip"" android:hint=""password"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/galleryPic"" android:layout_below=""@+id/lblpass""/&gt;&lt;TextView android:id=""@+id/lblrepass"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:layout_marginLeft=""5dip"" android:text=""Re-Password:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/galleryPic"" android:layout_below=""@+id/txt_pass""/&gt;     &lt;EditText android:id=""@+id/txt_repass"" android:layout_width=""170px"" android:layout_height=""32px"" android:password=""true"" android:maxLines=""1"" android:layout_marginLeft=""5dip"" android:hint=""re-password"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/galleryPic"" android:layout_below=""@+id/lblrepass""/&gt;&lt;Button    android:id=""@+id/btn_Gallery""    android:layout_width=""wrap_content""    android:layout_height=""35px""     android:gravity=""center""    android:typeface=""serif""    android:textStyle=""bold""    android:text=""Browse""    android:layout_below=""@+id/galleryPic""/&gt;    &lt;TextView android:id=""@+id/lblname"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Name:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""6dip"" android:layout_below=""@+id/btn_Gallery""/&gt;&lt;EditText android:id=""@+id/txt_name"" android:layout_width=""224px"" android:layout_height=""32px"" android:hint=""name"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""3dip"" android:layout_toRightOf=""@+id/lblname"" android:layout_below=""@+id/btn_Gallery"" android:layout_marginLeft=""5dip""/&gt;&lt;TextView android:id=""@+id/lblage"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Age:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""9dip"" android:layout_below=""@+id/lblname""/&gt;&lt;EditText android:id=""@+id/txt_age"" android:layout_width=""225px"" android:layout_height=""32px"" android:hint=""age"" android:numeric=""integer"" android:maxLines=""1"" android:maxLength=""3"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/lblage"" android:layout_below=""@+id/txt_name"" android:layout_marginLeft=""19dip""/&gt;&lt;TextView android:id=""@+id/lblsex"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Sex:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""12dip"" android:layout_below=""@+id/lblage""/&gt;&lt;EditText android:id=""@+id/txt_sex"" android:layout_width=""226px"" android:layout_height=""32px"" android:hint=""sex"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/lblsex"" android:layout_below=""@+id/txt_age"" android:layout_marginLeft=""20dip""/&gt;&lt;TextView android:id=""@+id/lbllocation"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Location:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""12dip"" android:layout_below=""@+id/lblsex""/&gt;&lt;EditText android:id=""@+id/txt_location"" android:layout_width=""206px"" android:layout_height=""32px"" android:hint=""location"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/lbllocation"" android:layout_below=""@+id/txt_sex"" android:layout_marginLeft=""5dip""/&gt;&lt;TextView android:id=""@+id/lblstatus"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Status:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""12dip"" android:layout_below=""@+id/lbllocation""/&gt;&lt;EditText android:id=""@+id/txt_status"" android:layout_width=""220px"" android:layout_height=""32px"" android:hint=""status"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/lblstatus"" android:layout_below=""@+id/txt_location"" android:layout_marginLeft=""5dip""/&gt;&lt;TextView android:id=""@+id/lblinterest"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Interest:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""12dip"" android:layout_below=""@+id/lblstatus""/&gt;&lt;EditText android:id=""@+id/txt_interest"" android:layout_width=""206px"" android:layout_height=""21px"" android:hint=""interest"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/lblinterest"" android:layout_below=""@+id/txt_status"" android:layout_marginLeft=""5dip""/&gt;&lt;TextView android:id=""@+id/lblorientation"" android:layout_width=""wrap_content"" android:layout_height=""21px"" android:text=""Orientation:"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_marginTop=""12dip"" android:layout_below=""@+id/lblinterest""/&gt;&lt;EditText android:id=""@+id/txt_orientation"" android:layout_width=""125px"" android:layout_height=""21px"" android:hint=""status"" android:maxLines=""1"" android:textSize=""10sp"" android:typeface=""serif"" android:textStyle=""bold"" android:layout_toRightOf=""@+id/lblorientation"" android:layout_below=""@+id/txt_interest"" android:layout_marginLeft=""5dip""/&gt;   &lt;/RelativeLayout&gt; &lt;/ScrollView&gt; &lt;RelativeLayout android:layout_marginTop=""-50dip""   android:gravity=""bottom""  android:layout_height=""50px""   android:layout_width=""fill_parent""    android:background=""#ff999999"" &gt;    &lt;Button      android:id=""@+id/btnNext""      android:layout_width=""100px""      android:layout_height=""45px""      android:text=""Next""     android:layout_marginTop=""2dip""     android:layout_alignParentRight=""true""/&gt; &lt;/RelativeLayout&gt;</code></pre><p></p><p>//Zeeshan</p>","476433","","21234","","2010-10-18 20:59:07","2010-10-19 00:31:52","scrollView Problem in android","<android><scrollview>","1","5","","",""
"3963185","1","","","2010-10-18 20:40:04","0","1953","<p>I recently rebuilt my Android project to target 2.2 from 2.1.</p><p>In the old project, I did not specify a target SDK (the manifest did not contain something like: android:minSdkVersion=""8""). This gave me an error in the console when running, but everything worked fine so I didn't fool with it.</p><p>The new project now uses android:minSdkVersion=""8""  in the manifest.</p><p>But now my drawables from the /drawable-nodpi/ folder are loading with scaling, making them much smaller and significantly changing the desired visuals.</p><p>If I cut out the  tag from my manifest, they load properly without scaling.</p><p>Even when loading my images like so:</p><pre><code>            BitmapFactory.Options opts = new BitmapFactory.Options();            opts.inScaled = false;               Bitmap bm = BitmapFactory.decodeResource(_resources, resId, opts);</code></pre><p>They are still scaled when I declare the minimum SDK in the manifest, but not scaled if I remove that tag.</p><p>Why is this happening? How can I load them without scaling while still declaring the minimum SDK?</p>","479777","","","","","2012-02-23 20:15:18","Android app loading images from /drawables-nodpi/ with scaling","<android><image><scale>","1","1","","",""
"3963252","1","","","2010-10-18 20:46:52","4","1621","<p>How can I make the LED or trackball pulse or flash while my application is running and the screen is on ? Like when a phonecall is received for instance ?</p><p>Thanks</p>","234868","","","","","2012-10-05 09:13:54","Android pulse LED notification while the screen is on","<android>","3","0","2","",""
"3963490","1","3963615","","2010-10-18 21:19:30","15","31040","<p>I was successfully using google maps in my application but then needed to change the Android SDK version from 1.5 to 2.0.  Now the import for Google maps can't be resolved.  </p>","445884","","234009","","2010-10-18 21:24:11","2013-04-17 05:31:28","import cannot be resolved: import com.google.android.maps.*;","<java><android><google-maps>","3","2","3","",""
"3963631","1","","","2010-10-18 21:39:04","1","4294","<p>I think the answer to this question is probably so simple, but I'm struggling....</p><p>I have a TableLayout with multiple columns. I want the last column to be of a fixed width, but I want to define that width to just be able to hold the widest possible string from my program. i.e. it is always wide enough to contain ""THIS STRING"" without wrapping, or wasting any space.</p><p>I would like to do this as I have these TableLayouts within a ListView, so it looks very poor when the last column is of variable widths.</p><p>I have tried obtaining the string width, even going so far as to put it into a TextView, call getTextSize() then setWidth() on all appropriate TextViews. The problem I hit there is that gettextSize() returns pixels, but setWidth uses ScaledPixels.</p><p>I'm sure there is a really simple solution. Can anyone help?</p>","479811","","","","","2010-10-20 20:24:49","Android - fix TextView width by string","<android><string><width><textview><pixels>","1","0","","",""
"3963711","1","","","2010-10-18 21:53:33","1","501","<p>After moving from Verizon to Sprint and buying several Android phones (EVO 4G), I became interested in developing Android applications.  I have some programming experience (35+ years with various software firms (e.g. Cray Research, IBM, Oracle)) and would like to finally do some programming for myself.</p><p>I'm looking for recommendations on Android tablets.  After looking at the marketplace, I realized it really is ""buyer beware"" and would appreciate hearing from other programmers.  After all why reinvent the wheel or take graduate courses at the University of Hard Knocks.  I thought about getting one of the Google dev phones, but I'd like to support tablets (and phones).</p><p>I suspect I'll end up with two tablets and then use one of my phones during the beta testing.  As for features, I'm open other than it needs WIFI (but not 3G or 4G) and show be a good solid development platform.</p><p>Bert Moshier</p>","479826","","21234","","2010-10-18 22:15:44","2011-11-11 04:59:59","Development Tablet Recommendations","<android><tablet-pc>","1","2","","",""
"3963724","1","","","2010-10-18 21:55:34","0","643","<p>I am trying to implement a drop down list when a button is clicked. </p><p>So,  I have a text view and a button in a navigation bar(nav.xml) and a corresponding list view. This navigation bar is included in another page( products.xml) </p><p>when the button is clicked i get the list view right below the button(which is what i want to acheive) but its my moving all the contents on the current page downwards, even the text view which is placed in nav bar  moved downwards.</p><p>I am totally new to Android, any sample examples or a way how to achieve it???</p>","479828","","479828","","2010-10-18 22:02:39","2013-04-26 10:06:18","Showing a List View when a button is clicked: Android","<android><list><view>","2","0","","",""
"3963783","1","","","2010-10-18 22:06:35","15","5723","<p>If so, does anybody know which version it's scheduled to be supported in (in built-in Chrome Lite browser)?  Also, is it currently supported on any of the alternative browsers for Android like FireFox or Opera Mini?</p>","376705","","471795","","2010-11-02 18:28:13","2012-07-11 21:28:21","Will Android support WebSockets in an upcoming version?","<android><html5><websocket>","7","1","2","",""
"3963907","1","3964078","","2010-10-18 22:25:57","4","557","<p>I created an app for the bus system at my university and they want to buy it off me. Problem is, I have absolutely no idea what to offer. Its nearly completed, and once they buy it i would be brought on as a student employee making $25 an hour. They would want me to hire someone else to start on an iPhone version, and implement other features. Its an app everyone with a droid would use, since its sorely needed. 20,000 people go here, and most of them have smart phones. If anyone has any advice, or a reference they could give me it would be greatly appreciated.</p>","385051","","","","","2011-02-05 19:35:44","Selling an android app to a very large university","<android><rights><selling-software>","6","4","3","",""
"3963915","1","3965213","","2010-10-18 22:27:54","0","1455","<p>I built a very simple custom Comparator, that I use with a TreeSet in order to sort Strings by length in that TreeSet.</p><p>I'm having trouble finding the reason why <code>(s1.equals(s2))</code> returns false even when the two strings s1 and s2 contain the same value...</p><p>Eclipse ""variables view"" shows the letters are the same in both strings, but the ""id"" is different, I guess that's why equals returns False.By the way what is that id="" "" representing ? some kind of pointer to the String object data ?</p><p>Here is the screenshot: <a href=""http://yfrog.com/2rvariablesproblemj"" rel=""nofollow"">http://yfrog.com/2rvariablesproblemj</a></p><pre><code>public class MyComparator implements Comparator&lt;String&gt; {    public int compare(String s1, String s2) {        if(s1.length()&lt;s2.length()) return -1;              else if (s1.length()&gt;s2.length()) return 1;          return 0;         else if (s1.equals(s2)) return 0; //?? ALWAYS RETURNS FALSE        else if (s1.toString().equals(s2.toString()))//SAME PROBLEM HERE (test)        else return -1;    }    public boolean equals(String s) {        if (this.equals(s)) return true;        else return false;    }}</code></pre><p>Now here is where I use this custom Comparator:</p><pre><code>combinations = new TreeSet&lt;String&gt;(new MyComparator());</code></pre><p>I fill combinations with several Strings, built with the substring() method.Because of the previously mentioned problem, combinations contains duplicates.</p><p>When I set NO custom Comparator for this TreeSet, there is no duplicate anymore (that's what I want) but it is sorted alphabetically which is normal but not my purpose.</p><p>Thanks in advance for your help on understanding the WHY of this...</p><p>Sébastien</p>","479851","","479851","","2010-10-20 11:52:04","2010-10-20 11:52:04","Problem with String equals() returning false (custom Comparator involved)","<java><android><string><comparator>","1","4","","",""
"3963978","1","3965978","","2010-10-18 22:36:38","11","15511","<p>When I look at misc. Android tutorials and examples when it comes to specifying colors I very often see constants like <code>@color/red</code> or <code>@color/black</code> etc. being used. For some strange reason that NEVER works for me! I always need to specify colors using the ""#RGB"", #ARGB, ..., #AARRGGBB notation.</p><p>As soon, as I try to use any of those mnemonic constants like e.g. ""@color/red"" I am getting error messages like these:</p><pre><code>[...] C:\Users\mmo\Test\res\drawable\edit_text.xml:5: error: Error: No resource found that matches the given name (at 'drawable' with value '@color/orange').[...] C:\Users\mmo\Test\res\drawable\myDrawable.xml:3: error: Error: No resource found that matches the given name (at 'drawable' with value '@color/black').[...] C:\Users\mmo\Test\res\drawable\myDrawable.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@color/black').[...] C:\Users\mmo\Test\res\drawable\myDrawable.xml:5: error: Error: No resource found that matches the given name (at 'drawable' with value '@color/green').[...] C:\Users\mmo\Test\res\drawable\myDrawable.xml:6: error: Error: No resource found that matches the given name (at 'drawable' with value '@color/black').</code></pre><p>Why is that so? Why can't I use these predefined constants? Do I need to prefix them with some package name (I tried <code>@android:color/red</code> but that only caused a different error)?Do I need to specify these colors myself? If so: how and where? Any ideas or suggestions?</p><p>Michael</p>","423411","","","","","2013-11-01 11:37:45","Android .xml files: Why do predefined colors not work for me?","<android>","6","0","","",""
"3964016","1","4850212","","2010-10-18 22:43:35","3","884","<p>I'm adding Android C2DM to a Android library project.  I started with the <a href=""http://code.google.com/p/chrometophone/source/browse/trunk/android/c2dm/?r=18#c2dm/com/google/android/c2dm"" rel=""nofollow"">com.google.android.c2dm package</a> that is included with <a href=""http://code.google.com/p/jumpnote/"" rel=""nofollow"">JumpNote</a> and <a href=""http://code.google.com/p/chrometophone/"" rel=""nofollow"">Chrome To Phone</a>.  In order to use this package, you have to subclass the <a href=""http://code.google.com/p/chrometophone/source/browse/trunk/android/c2dm/com/google/android/c2dm/C2DMBaseReceiver.java?r=18"" rel=""nofollow"">C2DMBaseReceiver</a> service which takes the Sender Id as an argument to it's constructor.  In JumpNote, this argument is initialized using a hard-coded static variable in a config class.  However, in an Android library project, which may be used by multiple concurrently running apps I don't think I can use a hard-coded static variable (that is, I believe it could lead to problems when/if multiple apps are trying to access/modify the static variable).</p><p>I tried to think of a way to initialize the Sender Id without using a static variable and am stumped so far.</p><p>The obvious solution would be to use the Manifest or a Resource string or a combination of the 2.  For example, in strings.xml I might have a ""ac2dmSender"" string, which is accessed in a meta-data child of the C2DMReceiver service declaration in the manifest.  However, it seems that you cannot get a reference to the PackageManager or ResourceManager from a static context, so there is no way for me to then retrieve the meta data in such a way as to pass it in to the constructor of C2DMBaseReceiver.  </p><p>Please let me know that I'm missing something! Thanks in advance.</p>","273628","","","","","2011-01-31 11:13:33","How can I initialize the Sender ID for Android C2DM without using a hard-coded value in a static variable?","<android><push><android-c2dm>","2","0","1","",""
"3964206","1","3964242","","2010-10-18 23:14:55","0","1249","<p>can i do it? I just wanna make SELECT/INSERT into a remote database, i think it have to be easy but i can't find the way. I only find people that tell i have to make a webservice or something like that, but that is another world for me, and i can't put a webservice in the database host...</p><p>¿there is not a normal way to do it without a webservice?</p><p>thanks</p>","479886","","","","","2010-10-18 23:21:10","How to connect to a remote MySQL DB without webservices... ? (ANDROID)","<android><database>","1","0","","",""
"3964375","1","3964728","","2010-10-18 23:49:46","9","1602","<p>Due to overwhelming user complaints I have decided try allowing users of my Android application to move it to the SD card as per <a href=""http://developer.android.com/guide/appendix/install-location.html"">the official documentation</a>.  However, a core feature of my application requires a background service to be continuously running.  When someone who has moved my app to their SD card mounts their SD card for whatever reason, my background service will be killed.</p><p>That's all okay by me, as long as I can restart the service at the first available opportunity.  Unfortunately, despite the <a href=""http://developer.android.com/guide/appendix/install-location.html"">install-location</a> guide claiming I can use the Broadcast Intent <a href=""http://developer.android.com/reference/android/content/Intent.html#ACTION_EXTERNAL_APPLICATIONS_AVAILABLE""><code>ACTION_EXTERNAL_APPLICATIONS_AVAILABLE</code></a> to detect when the SD card is remounted locally, the documentation for that flag itself, <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/9ed73e072e0ea22a?hl=en"">this newsgroup discussion</a>, and my own testing show that this broadcast is not delivered to the applications which become available. Only applications which have not been moved to the SD card get the Broadcast Intent.</p><p>Is there any way to restart my background service without waiting for the user to open my app after the SD card is remounted?</p>","195691","","","","","2010-10-19 01:22:01","Restart Service for App on SD Card When SD Card Is Remounted","<android><sd-card><android-sdcard>","1","0","3","",""
"3964430","1","","","2010-10-19 00:02:20","0","299","<p>am not too experienced in android and i am just using the TabActivity, so please bear with me. i keep seeing post about not using activites in Tabhost but views. and am not sure which is which and if thats the reason of my latest headache? i have a code with 4 tabs like this:</p><pre><code> // Category TabActivity class    tab.setContent(new Intent(this, Mylist.class));    tab1.setContent(new Intent(this, Mylist.class));    tab2.setContent(new Intent(this, Mylist.class));</code></pre><p>and each tab is showing the result of a method in the Mylist Activity.</p><ol><li><p>is that using an activity in a tab or displaying a view? whats the difference?.</p></li><li><p>i have a context menu on an item selected in the Mylist Activity which updates the list. how can i reflect the changes in the list back to the tab in other to display that particular method in the Mylist class, that was set as the tabs content. obviously this will change if i updated or deleted an item from the list when the tab is shown. i think its possible with onResume(), but don't know what to call there or is there any better way?</p><p>in the Mylist class, i have tried this little piece of code to restart the TabActivity:</p><p>myAdapter.deleteItem(id);</p><pre><code>       fillData(); //     Intent refereshCategory = new Intent(this, Category.class);      startActivity(refereshCategory);</code></pre></li></ol><p>its restarting the activity after the item have been deleted, but how can i only show the  tab whose view was in focus when it restarts and i don't want fillData() method to be shown as it does not have to do with the tabs. i hope i made myself clear enough. Thanks </p><p>Any help will be greatly appreciated. Thanks for your time. </p>","479908","","479908","","2010-10-19 15:00:12","2010-10-19 15:00:12","slight misunderstanding with tabActivity, views and activity","<android>","1","2","","",""
"3964499","1","","","2010-10-19 00:17:59","1","630","<p>how do i load a local image from android assets from a generated (php) server-side html file?</p><p>eg.></p><p>img src=""file:///android_asset/calendar-date-icon.png""></p><p>-or-</p><p>background:#ffffff url(file:///android_asset/calendar-date-icon.png)no-repeat;</p><p>cannot get either to work</p>","1567109","","","","","2011-02-09 16:58:37","css and android web application, loading local images","<html><android><css><server-side>","2","0","","",""
"3964503","1","","","2010-10-19 00:19:08","0","1528","<p>I am new to Android development and am interested in working out a design of an application. I am however, unfamiliar with the best way to handle what I want to do. I am interested in obtaining information from my band's Joomla website and placing it into an Android application. At the moment I'd like to get News articles posted and potentially other information that I create on the site. I was thinking of doing this by setting up RSS feeds for the website. Would it be better to somehow access the data directly by connecting to the database? I don't know PHP so I can't develop a webservice to access the content. Any ideas?</p>","479306","","","","","2010-10-19 03:23:01","Android Application Design - Accessing website data","<android>","1","1","","",""
"3964534","1","3969362","","2010-10-19 00:26:33","1","2266","<p>I am trying to run Hierarchy Viewer. developer.android.com says to</p><p>""Connect your device or launch an emulator.</p><p>From a terminal, launch hierarchyviewer from your SDK /tools directory.""</p><p>I tried finding the hierarchy viewer in sdk/tools, but couldn't find it. I realize my difficulty may just be the result of me being a total noob so I could just be missing something basic.</p><p>How do I run hierarchyviewer?</p><p>Thanks!</p>","479180","","479180","","2011-12-30 20:30:12","2011-12-30 20:30:12","Running Hierarchy Viewer","<java><android>","5","0","","",""
"3964587","1","","","2010-10-19 00:40:45","0","510","<p>Is there any way to access a Facebook non-user page (ex: Musician, Product, etc) through an API through Android? I saw that there is a Facebook Android SDK but I haven't been able to figure out if this can be done.</p>","479306","","","","","2010-10-19 01:26:57","Access Facebook page data using Android","<android>","1","0","","",""
"3964606","1","","","2010-10-19 00:44:55","1","2888","<p>I have a Symbian based phone with a ARM Cortex-A8 processor (SonyEricsson Vivaz) and was thinking on how hard would it be to try and port the Android OS for it. Obviously Android runs on a myriad of devices with different hardware so I imagine it shouldn't be too hard to adapt it to SE hardware. Could some one give me a clue where to start or if this is even undertakable...</p>","479936","","","","","2010-10-19 01:26:09","Is it posible to port Android for a Symbian phone","<android><symbian><port>","1","0","","",""
"3964666","1","3966684","","2010-10-19 01:04:44","1","1618","<p>I have read the other window leak posts and have tried what what suggested there to no avail.</p><p>I have 3 activities: A, B, and C. Activity A gathers information from the user. Activity B displays a spinning ProgressDialog while it communicates with a server on another thread. When the thread finishes, it dismisses the ProgressDialog and starts the next activity. Activity C displays the information from the server to the user. Activity B is set up so that when the user hits back from C, they fall back to A.</p><p>It is important that these tasks be in separate Activities.</p><p>As of now the app successfully does what it is supposed to in most cases, except in the following scenario: If the user changes the orientation while in activity C before returning to Activity A, the app crashes due to a window leak.</p><ul><li>I am dismissing the ProgressDialog inthe onPause() of Activity B before istart C.</li><li>I have tried dismissing theProgressDialog on the main threadusing a handler as well as in theseparate thread.</li><li>When the user does not change theorientation in C, no window leakoccurs.</li></ul><p>Any ideas? TIA</p>","339428","","","","","2011-09-28 18:38:35","Android: Window leaks on finish","<android><memory-leaks><orientation-changes>","3","2","2","",""
"3964709","1","3964925","","2010-10-19 01:15:39","6","4576","<p>Hey guys. I am developing a client/server program where the client is an android device. The server has a listener class that reads an object from the input stream. I created a client software for another COMPUTER that sends a small object over a local network. <strong>Computer to Computer works perfectly fine</strong>, i read the object and printed the contents. However, the <em>SAME</em> code ported over to android (I rewrote it just in case) does not work. I construct an object (ANY object), which is serializable, and send it via the ObjectOutputStream. My server running on the computer does connect to the device, but it gives me a ClassNotFound exception, even if im printing the object (Which has a toString). As i said, the same code running on another COMPUTER (as a .jar file) works perfectly fine.</p><p><strong>Here is the really strange part, if i send a boolean or String (from the device) it works....its just my ""custom"" objects that dont. I presume this would work for any ""standard"" java object.</strong>  </p><p>If you do find mistake please keep in mind that the code does work, but only from another computer to my computer...not the Android device to the Computer. If you still find another glaring mistake, then awesome :)</p><p><strong>ANDROID PROGRAM:</strong></p><pre><code>package WaitDroid.Main;import java.io.ObjectOutputStream;import java.net.InetAddress;import java.net.Socket;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;public class main extends Activity {/** Called when the activity is first created. */private Button a;private TextView x;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    this.a = (Button) this.findViewById(R.id.Send_Order);    this.x = (TextView) this.findViewById(R.id.TextView1);    this.a.setOnClickListener(new OnClickListener()    {        @Override        public void onClick(View arg0)        {            sendMenu();        }    });}private void sendMenu(){     try     {         InetAddress serverAddress = InetAddress.getByName(""128.153.180.109"");         Socket socket = new Socket(serverAddress, 4322);         ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());         TestObject send = new TestObject(""Hi"", 32);         out.writeObject(send);         out.close();         socket.close();         }         catch(Exception e)         {         x.setText(e.getMessage());         }    }}</code></pre><p><strong>TEST OBJECT:</strong></p><pre><code>package WaitDroid.Main;import java.io.Serializable;public class TestObject implements Serializable{    private String name;    private int number;    public TestObject(String a, int b)    {        name = a;        number = b;    }    public String toString()    {        return name +"" - ""+ number;    }}</code></pre><p><strong>SERVER LISTENER:</strong></p><pre><code>package Main;import java.io.IOException;import java.io.ObjectInputStream;import java.io.ObjectInputStream.GetField;import java.net.ServerSocket;import java.net.Socket;import Order.Order;public class ServerListener extends Thread {    public void run() {        try {            ServerSocket listen = new ServerSocket(4322);            while (true) {                Socket socket = listen.accept();                String clientInetAddr = socket.getInetAddress().toString();                ObjectInputStream in = new ObjectInputStream(socket.getInputStream());                System.out.println(""Connected to: "" + clientInetAddr);                try                {                    Object a = in.readObject();                    System.out.println(a);                    //RestaurantServerRun.n.server.addOrder(a);                }                catch(IOException e)                {                    System.err.println(e.getMessage());                }                in.close();                socket.close();            }        }        catch (Exception e) {            System.err.println(""Error in run()"");            e.printStackTrace();        }    }}</code></pre><p>Thanks!!</p>","1520919","","1520919","","2010-10-19 01:26:57","2010-11-22 11:03:15","Android Socket + ObjectOutputStream not working correctly","<java><android><sockets><objectoutputstream><classnotfoundexception>","1","0","1","",""
"3964742","1","3964838","","2010-10-19 01:24:21","1","1491","<p>I am experiencing the same bug reported here (<a href=""http://code.google.com/p/android/issues/detail?id=9597"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=9597</a>)</p><p>Anyone know of a work around?  I want to have a progress bar in a WebView like the Android Browser does while the page is loading.</p>","445348","","","","","2010-10-19 01:58:47","WebView.getProgress() always returning 100","<android><progress-bar><webview>","1","0","","",""
"3964847","1","3964893","","2010-10-19 02:01:29","4","5196","<p>When you establish a shared preference such as below...</p><pre><code>public static final String PREFS_HI = ""MyPrefsFile"";</code></pre><p>Can you access it from other activities just like you would normally do?</p><pre><code>SharedPreferences settings = getSharedPreferences(PREFS_HI, 0);</code></pre><p>Or is there something unique that you must do to access the preferences?</p>","478297","","478297","","2010-10-19 02:07:23","2011-12-17 20:20:43","Access Shared Preferences from Different Activity (Android)","<android><string><variables><preferences>","3","0","3","",""
"3964884","1","","","2010-10-19 02:15:04","0","227","<p>I am developing a Java Android application that displays web content from the assets folder in a web view. I had no problem getting this content to display in the application but I am confused as to why my images are not displaying properly. I'm working with a Motorola Droid that is supposed to be 480x854 resolution. When I create banner images using these dimensions and attempt to display them in the web view they're enormous and they flow off of the screen. It doesn't appear that the web view is actually 480x854. Can somebody let me know what I am missing here? I do not know what size to set the images to so they are just right.  </p>","479979","","118391","","2010-10-19 03:14:52","2011-03-22 02:18:14","Images in a web view on a Motorola Droid. What size?","<android><android-webview>","1","0","","",""
"3964939","1","3965144","","2010-10-19 02:35:13","1","2413","<p>Now I'm using the follow code to scale down the image downloaded from internet at runtime. But the result is not good enough.</p><pre><code>Bitmap.createScaledBitmap(srcBitmap, dstWidth, dstHeight, true);</code></pre><p>Any help? Thanks.</p>","428022","","","","","2010-10-19 03:28:38","How to scale down the image for better quality on Android?","<android><bitmap><image-scaling>","1","4","","",""
"3965099","1","3973393","","2010-10-19 03:19:11","2","245","<p>Java specification allows the compiler and the VM to reorder memory writes in the interest of efficiency. Does the Dalvik VM take concrete advantage of this ?</p><p>Disclaimer : I have no intention of relying on order even if Dalvik does not do it (besides the compiler may do it too), but it would be nice to know.</p>","440355","","","","","2010-10-19 22:47:52","Dalvik and out-of-order writes","<java><android><concurrency><dalvik>","1","0","2","",""
"3965122","1","","","2010-10-19 03:23:33","7","7788","<p>i have to align text by middle in android alertdialog.but i cannot find way...anyone knows how to this?</p>","480010","","","","","2014-04-02 05:58:40","android : how to align message in alertDialog?","<android>","6","0","","",""
"3965126","1","3965149","","2010-10-19 03:24:05","1","1034","<p>I am using <a href=""http://code.google.com/p/google-api-java-client/"" rel=""nofollow"">google-api-client</a> to access Google calendar.</p><p>Following are the permissions in my manifest file.</p><pre><code> &lt;uses-permission  android:name=""android.permission.INTERNET"" /&gt; &lt;uses-permission  android:name=""android.permission.GET_ACCOUNTS"" /&gt; &lt;uses-permission  android:name=""android.permission.USE_CREDENTIALS"" /&gt; &lt;uses-permission  android:name=""android.permission.MANAGE_ACCOUNTS"" /&gt;</code></pre><p>but I am getting such a warning message on the first run:</p><hr><p>The following one or more applications request permission to access your account, now and in the future.</p><ul><li>Google.....@gmail.com</li><li>Google Calendar</li></ul><p>Do you want to allow this request?</p><hr><p>screenshot:</p><p><img src=""http://i.stack.imgur.com/8dKbt.jpg"" alt=""enter image description here""></p><p>is there a way to avoid this message?</p>","480007","","881229","","2013-12-29 02:20:05","2013-12-29 02:20:05","Android google calendar permission issue","<android><permissions><google-calendar><account>","1","0","1","",""
"3965151","1","3965171","","2010-10-19 03:30:50","2","4265","<p>I'm trying to create a title bar that is the same throughout my application and have been creating layouts like this for each of my activities:</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;include layout=""@layout/title_bar_layout"" android:id=""@+id/title_bar_layout"" /&gt; &lt;include layout=""@layout/main_body"" android:id=""@+id/main_body"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>main_body.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:id=""@+id/main_table"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:stretchColumns=""1"" android:orientation=""vertical""&gt;&lt;/TableLayout&gt;</code></pre><p>my onCreate contains:</p><pre><code>setContentView(R.layout.main);TableLayout t = (TableLayout) findViewById(R.id.main_table);</code></pre><p>but t always ends up null.</p>","104527","","104527","","2010-10-19 03:36:59","2011-11-22 18:52:03","Using multiple layouts with include tag in Android","<java><android><xml>","1","2","","",""
"3965170","1","","","2010-10-19 03:36:22","3","992","<p>I am managing a bunch of PDF files in an android application maintaining a list of records in a SQLite database as well as storing the pdf files on the external storage. </p><p>Now I would like to present a thumbnail of the first page of the pdf in my list view as part of each cell representing a pdf.</p><p>I am aware of libraries like iText, fop..  on the JavaSE side that can render a PDF but I would rather not delve into embedding a large library like that. On a similar approach I would also rather not embed a native PDF viewer like droidreader, apv or vudroid.</p><p>Otherwise I could of course also get it rendered on a server via some webservice but that is a lot of headache as well.</p><p>I am already using intents to get the pdf's displayed for the user so I was thinking it would be great if I could get a thumbnail via a intent call as a result somehow. However I found nothing on the web (e.g. on openintents) that indicates something like that exists ..</p><p>So I am a bit at a loss on what to do? What do you think is the best approach to get these thumbnails into my app? Are there any public intents available? Or did I just totally miss something and the SDK provides features for that already (it should imho but currently does not)?</p>","136445","","","","","2010-10-19 08:22:38","Produce thumbnail from pdf on Android","<android><pdf><thumbnails>","1","0","1","",""
"3965275","1","3965355","","2010-10-19 04:12:32","4","225","<p>I'm started to get my feet wet with the android framework, and wanted to work on a game but was looking for a partner to work with. I was wondering if there are sites online where people can talk about a project and possibly collaborate and start a new project.</p><p>I realize this might be a stupid question, and not appropriate for this board. If so, I apologize.</p><p>Thanks!</p>","388025","","","","","2010-10-19 04:34:06","Find people to work on an android project","<android><open-source>","1","0","2","",""
"3965484","1","3965796","","2010-10-19 05:07:31","58","54094","<p>Is there an easy way to use a custom image for a checkbox? I'm looking to duplicate the ""starred"" behavior of gmail. So I want to have a checkbox that, when checked, is a filled in star. And when unchecked is an empty star. Do I have to use an imageview and do my own logic myself? </p>","375874","","","","","2014-03-04 05:51:09","Custom checkbox image android","<android><checkbox>","4","0","15","",""
"3965500","1","","","2010-10-19 05:12:51","0","522","<p>I am a Android Developer and working on project where client need camera zoom functionality, first i have created custom activity and preview classes to deal with camera and used zoom functionality which support only in version 2.2, and this also not working correctly, then i decided to use device inbuilt camera functionality using intent, but this also working on some of the device, some of the device like Motorola Droid X it is not opening camera and throwing error and camera crashes.</p><p>Please can i have some idea or sample code to achieve this goal.</p><p>Thanks in Advance.</p>","443118","","","","","2010-10-19 05:12:51","Need Help regarding Camera Zoom functionality","<android><camera><zoom>","0","2","","",""
"3965583","1","4264814","","2010-10-19 05:30:33","1","334","<p>I'm doing a app which allow user to search on the server. how can i get the text from the Quick Search Box and send to server?</p><pre><code>if (Intent.ACTION_SEARCH.equals(intent.getAction())) {     String search= intent.getStringExtra(SearchManager.QUERY);}</code></pre><p>the string ""search"" is it the text which typing by user? </p><p>P/S: sorry about my bad english. Hope you guys understand what's I'm talking about.Thanks.</p><p>Regard</p><p>Wynix</p>","409419","","","","","2010-11-24 08:38:33","Android : collect Quick Search Box result form internet","<android><search-box>","1","0","","",""
"3965644","1","3965673","","2010-10-19 05:45:33","2","1526","<p>Im reading a book ""Pragmatics: Hello Android""and copy the code word for word and syntax is all correct because i get no errors but it does not do what i tell it to do on the onAnimationEnd.. it suppose to take me to my next activity but since that was not working i changed it to something simple like txtView.setText(""ggag"")just to see if it was even executing... and i noticed the way the book goes about it is slightly different.. </p><pre><code>    Animation fadein = AnimationUtils.loadAnimation(this, R.anim.fade_in);    fadein.setAnimationListener(new AnimationListener() { /*im thinking the problem is     that it does all the work from within the setAnimationLIstener instead of like i     have seen around where the methods onAnimationEnd , onAnimationRepeat are all     done seprately outside of the        setAnimationListener(new AnimationListener() {..all work is done here??... } */     @Override     public void onAnimationEnd(Animation animation) {      //startActivity(new Intent(splahActivity.this,menuActivity.class));      //the above line of code was not working so i added the line below       //neither executes                    TextView topLogo = (TextView)findViewById(R.id.lblTop);      topLogo.setText(""dfsgsdfg"");     }    @Override    public void onAnimationRepeat(Animation animation) {      // TODO Auto-generated method stub    }    @Override    public void onAnimationStart(Animation animation) {     // TODO Auto-generated method stub    }    });</code></pre><p>so yeah my onAnimationEnd code is never executed :(</p>","471278","","","","","2012-08-25 13:42:39","OnAnimationEnd does not work , and yes ive researched","<android>","2","0","","",""
"3965654","1","3965808","","2010-10-19 05:47:59","1","5975","<p>I have created a custom Base Adapter class, to populate a list view with image and text.The code of class is as below :</p><pre><code>public class ViewAdapter extends BaseAdapter {private Activity activity;private String[] data;private static LayoutInflater inflater=null;public ImageLoader imageLoader; private ArrayList&lt;String&gt; items;public ViewAdapter(Activity a, ArrayList&lt;String&gt; items,String[] d) {    this.items = items;         activity = a;    data=d;    inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    imageLoader=new ImageLoader(activity.getApplicationContext());}public int getCount() {    return data.length;}public Object getItem(int position) {    return position;}public long getItemId(int position) {    return position;}public static class ViewHolder{    public TextView text;    public ImageView image;}public View getView(int position, View convertView, ViewGroup parent) {    View vi=convertView;    ViewHolder holder;    if(convertView==null){        vi = inflater.inflate(R.layout.sectionview, null);        holder=new ViewHolder();        holder.text=(TextView)vi.findViewById(R.id.txtLogoName);;        holder.image=(ImageView)vi.findViewById(R.id.imgBrandLogo);        vi.setTag(holder);    }    else        holder=(ViewHolder)vi.getTag();    holder.text.setText(items.get(position));    holder.image.setTag(data[position]);    imageLoader.DisplayImage(data[position], activity, holder.image);    return vi;    }</code></pre><p>}</p><p>so far the list is working smoothly, but when I use the below code to get the value of the item at particular poisition, but instead of value, it is returning the item position of the list view.</p><p>i.e. the code I am using is</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View V, int position, long arg3) {                System.out.println(""****SELECTED VALUES "" Parent.getItemAtPosition(position));    });</code></pre><p>Even using getItemIdAtPosition(position) is also returning the value.</p><p>Need urgent help on this, is there any thing needed to be changed in the adapter class??</p>","328518","","411807","","2012-06-05 03:42:09","2012-06-05 03:42:09","getItemAtPosition() not returning value in listview","<android><listview><adapter>","2","0","","",""
"3965677","1","","","2010-10-19 05:54:28","1","686","<p>I am running Android 2.2 on a netbook (Android x86).</p><p>The keyboard shortcut, <kbd>Alt</kbd> + <kbd>F7</kbd> doesn't lead me back to graphics screen (GUI) from the console.</p><p>Does anyone know any alternative to this shortcut?</p>","373049","","321366","","2011-09-15 09:01:27","2011-09-15 09:01:27","Alt + F7 keyboard shortcut does not work on a netbook","<android><keyboard-shortcuts><x86>","1","0","","",""
"3965778","1","","","2010-10-19 06:19:24","0","1225","<p>My Map activity crashes on launch. I have included all the permission and also tested on a new standalone map project where it worked perfectly well with the underlying code.</p><p>Rather when I incorporate the same code in my application, it crashes as soon as this activity is invoked. I have a project submission tomorrow morning, so please reply asap</p><p>My map activity is as follows</p><pre><code>            package com.healthcare.iFind;            import com.google.android.maps.MapActivity;            import com.google.android.maps.MapView;            import com.google.android.maps.MapView.LayoutParams;            import android.os.Bundle;            import android.view.View;            import android.widget.LinearLayout;            public class MapsActivity extends MapActivity            {            MapView mapView;            /** Called when the activity is first created. */            @Override            public void onCreate(Bundle savedInstanceState)            {            super.onCreate(savedInstanceState);            setContentView(R.layout.maps);            mapView = (MapView) findViewById(R.id.mapView);            LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);            View zoomView = mapView.getZoomControls();            zoomLayout.addView(zoomView,            new LinearLayout.LayoutParams(            LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT));            mapView.displayZoomControls(true);            }            @Override            protected boolean isRouteDisplayed() {            // TODO Auto-generated method stub            return false;            }            }</code></pre><p>My 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=""com.healthcare.iFind""            android:versionCode=""1""            android:versionName=""1.0.0""&gt;            &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;            &lt;uses-library android:name=""com.google.android.maps"" /&gt;            &lt;activity android:name="".HomeScreen""            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=""MessageList""&gt;&lt;/activity&gt;            &lt;activity android:name=""RateDoctor""&gt;&lt;/activity&gt;            &lt;activity android:name=""RateQuiz""&gt;&lt;/activity&gt;            &lt;activity android:name=""DetailedDoctor""&gt;&lt;/activity&gt;            &lt;activity android:name=""DoctorProfile""&gt;&lt;/activity&gt;            &lt;activity android:name="".MapsActivity""/&gt;            &lt;/application&gt;</code></pre><p>My maplayout.xml file.                                </p><pre><code>            &lt;/manifest&gt;            &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;            &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;com.google.android.maps.MapView            android:id=""@+id/mapView""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:enabled=""true""            android:clickable=""true""            android:apiKey=""mykey""            /&gt;            &lt;LinearLayout android:id=""@+id/zoom""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentBottom=""true""            android:layout_centerHorizontal=""true""            /&gt;            &lt;/RelativeLayout&gt;</code></pre>","480113","","480113","","2010-10-19 13:28:53","2010-10-19 16:03:22","Map activity crashes on invoking it!","<android><web-applications><google-maps><crash>","1","3","0","",""
"3965810","1","3965858","","2010-10-19 06:25:55","2","920","<p>How can I know what Activity has started the current Activity? Is there any specific method like, i.e. <code>getIntent().getCallerActivity()</code> or the only way is saving some information within the Intent using <code>putExtra()</code>?</p><p>Thanks.</p>","458093","","","","","2010-10-19 06:34:57","How to know what Activity has started the current Activity","<android>","1","0","1","",""
"3965943","1","3971692","","2010-10-19 06:50:42","0","287","<p>Does the commitText() method of the android.view.inputmethod.InputConnection allowed to be called from different thread than UI thread?</p>","286041","","932225","","2012-02-20 18:41:35","2012-02-20 18:41:35","android: InputConnection from different thread.","<java><android><multithreading><input>","1","0","","",""
"3965969","1","3966082","","2010-10-19 06:54:59","2","948","<p>does all resource (all in res folder if on eclipse IDE), specially drawable image, is loaded to memory during runtime? or it is just like a file which is available when the application need it?</p>","286041","","","","","2010-10-19 07:17:06","android, drawable resource loaded to memory?","<android><resources><drawable>","1","0","","",""
"3966021","1","3967012","","2010-10-19 07:05:49","0","592","<p>on softkeyboard, which one is better to give user a visual feedback during keypress:</p><p>1.redraw portion of button that was pressed to background canvas of main <code>View</code> to give pressed effect2.each button has its own ""pressed"" <code>View</code>, and that <code>View</code> is set to visible (flashing) during keypress event (so no redraw needed but need more memory)</p><p>I know its trade-off between speed and memory usage, but I just want to know what you will do under this situation.</p>","286041","","","","","2010-10-19 09:33:01","Android: soft keyboard efficient key press effect?","<android><input><performance><android-softkeyboard>","1","0","","",""
"3966065","1","3966275","","2010-10-19 07:14:08","6","27634","<p>Ok guys I'm little stacked here. According to official documentation Google says that ""Once you've defined your Drawable in XML, save the file in the res/drawable/ directory of your project."" is the way to add a XML drawable to the project.</p><p>But when I created the project ADT created 3 different drawable folders for mdpi, hdpi, and ldpi. So when I wanted to create my XML drawable, I right click on my drawable-hdpi folder and select ""Add new Android XML file"", and there I have to select what kind of XML file I want to create, but there isn't ""drawable"" to select.</p><p>If I create new text file and save it as button_drawable.xml Eclipse says that there is an Error in the file and that It can't build my project.</p><p>So, please tell me how do you add xml drawables in Eclipse ADT?</p>","475564","","","","","2013-05-30 21:16:52","How to add XML drawable in Eclipse","<android><drawable>","8","3","3","",""
"3966210","1","","","2010-10-19 07:44:03","0","819","<p>A few weeks ago, I followed a tutorial to get Eclipse and the Android Development Kit up and running. I successfully built the test application and ran it on a virtual device.</p><p>Tonight I finally went back to do the next step in the tutorial, but when I went to start a new project there wasn't an option to start a new Android project. Even searching for it didn't produce anything. Window -> Preferences doesn't have an Android preferences dialog, either. The developer tools are still installed, though, according to Help -> Install New Software.</p><p>I'm using Eclipse Galileo 3.5.2 on Ubuntu 10.10 Maverick Meerkat. I just recently upgraded. I remember I had to install some additional packages to get Eclipse to run the Android stuff last time. I haven't uninstalled those, so I don't know what's causing the problem.</p><p>What's causing this problem, and what can I do to fix it?</p>","480156","","","","","2010-10-19 07:48:45","Eclipse won't start a new Android project anymore","<android><eclipse><adk>","1","2","","",""
"3966222","1","4163511","","2010-10-19 07:47:04","0","440","<p>friends,</p><p>i am using following global variables in my activity</p><pre><code>private  String Session_ID;  private  String uid;  // menu item starts  private final int Trash = 0x003;  private final int More = 0x005;  private final int SignOut = 0x006;  private final int SignIn = 0x007;  //menu item ends   private  EfficientAdapter adap;  private  String[] Msg_id;   private  String[] Msg_body;  private  String[] Sent_by;  private  String[] Sent_on;  private  String[] Is_my_message;  private  String[] Photo_thumbnail;  private  String[] Photo_full_path;  private  String Conversation_id;   ProgressBar progressBar;   Button getMoreButton;   boolean callComplete = false;   private Handler mHandler = new Handler();   private int PageSize = Constants.pageSizeForMessages;   Object serviceData = null;    private String ConversationName;   private Uri selectedImage; public  class EfficientAdapter extends BaseAdapter implements Filterable {                    private LayoutInflater mInflater;                    private Context context;                    public EfficientAdapter(Context context) {                      mInflater = LayoutInflater.from(context);                      this.context = context;                    }                    public View getView(final int position, View convertView, ViewGroup parent) {                      ViewHolder holder;                        convertView = mInflater.inflate(R.layout.adaptor_contentmessagedetail, null);                        holder = new ViewHolder();                        holder.ImgPhoto = (ImageView)convertView.findViewById(R.id.ImgPhoto);                        holder.lblMsgSentBy = (TextView) convertView.findViewById(R.id.lblSentBy);                        holder.lblMsgBody = (TextView) convertView.findViewById(R.id.lblMessageBody);                        holder.lblMsgSentOn = (TextView) convertView.findViewById(R.id.lblSentOn);                        convertView.setOnClickListener(new OnClickListener() {                              @Override                              public void onClick(View v) {                                  if (!((MessageDetail)v.getContext()).isConnected()) {                                        Constants.DisplayMessage(v.getContext(),                                                Constants.CONNECTION_ERROR_MESSAGE);                                        return;                                    }                                  if(!Photo_full_path[position].equals(""""))                                  {                                      String str= Photo_full_path[position].substring(Photo_full_path[position].length() - 3);                                      if(str.equals(""pdf""))                                      {                                      }else                                      {                                  Intent myIntent = new Intent(v.getContext(), ViewSingleImage.class);                                    Bundle b = new Bundle();                                    b.putString(""single_image_path"", Photo_full_path[position] );                                    myIntent.putExtras(b);                                    v.getContext().startActivity(myIntent);                                      }                                  }                              }                            });                        convertView.setTag(holder);                      // Bind the data efficiently with the holder.                      if(Is_my_message[position].equals(""1""))                          holder.lblMsgSentBy.setTextColor(Color.BLACK);                          else                          holder.lblMsgSentBy.setTextColor(Color.rgb(255, 107, 1));                    SimpleDateFormat fromUser = new SimpleDateFormat(Constants.SERVICE_DATE_FORMAT);                     java.text.DateFormat df=new SimpleDateFormat(Constants.DATE_FORMAT);                                              Date dt=new Date();                    try                    {                        dt = fromUser.parse(Sent_on[position]);                    } catch (java.text.ParseException e) {                        e.printStackTrace();                    }                    // display photo                    if(!Photo_thumbnail[position].equals(""""))                    {                    // resize it                        holder.ImgPhoto.setImageBitmap(DisplayLiveImage(Photo_thumbnail[position]));                    }else                    {                        holder.ImgPhoto.setVisibility(View.GONE);                    }                    // display photo                      holder.lblMsgSentBy.setText(Constants.GetSpecialCharacters(Sent_by[position]));                      holder.lblMsgBody.setText(Constants.GetSpecialCharacters(Msg_body[position]));                      holder.lblMsgSentOn.setText(df.format(dt));                      return convertView;                    }                     class ViewHolder {                      ImageView ImgPhoto;                      TextView lblMsgSentBy;                      TextView lblMsgBody;                      TextView lblMsgSentOn;                    }                    @Override                    public Filter getFilter() {                      // TODO Auto-generated method stub                      return null;                    }                    @Override                    public long getItemId(int position) {                      // TODO Auto-generated method stub                      return 0;                    }                    @Override                    public int getCount() {                      // TODO Auto-generated method stub                      return Msg_id.length;                    }                    @Override                    public Object getItem(int position) {                      // TODO Auto-generated method stub                      return Msg_id[position];                    }                  }  public Bitmap DisplayLiveImage(String ImageSrc)        {            Bitmap bm;                         try {                                   URL aURL = new URL(ImageSrc);                                   URLConnection conn = aURL.openConnection();                                  conn.connect();                                   InputStream is = null;                                 try                                 {                                     is= conn.getInputStream();                                   }catch(IOException e)                                 {                                     return null;                                 }                                 BufferedInputStream bis = new BufferedInputStream(is);                                   bm = BitmapFactory.decodeStream(bis);                                   bis.close();                                   is.close();                              } catch (IOException e) {                                  return null;                            }                              return  bm;        }</code></pre><p>i have made them global in activity because i need them all in more than 1 functionsnow my question is how to improve performance of my activity it is too slowshould i make them static or what?</p><p>any help would be appreciated.</p>","249991","","249991","","2010-10-20 10:42:25","2010-11-12 10:06:02","Suggestions to improve Activity Performance?","<android><activity>","2","0","","",""
"3966403","1","3968368","","2010-10-19 08:14:59","4","500","<p>I need to detect the 4G capability of the device.</p><p>How can I do that?</p><p>Thanks for any hints.</p>","289463","","","","","2012-12-30 22:58:43","Detecting a 4G capable device","<android><detect><capability>","2","2","0","",""
"3966468","1","","","2010-10-19 08:23:30","2","6823","<p>Not yet a developer, just trying to find out if an android app can do what I need..</p><p><strong>What I need:</strong></p><p>Simple app that displays a full frame of a single color onscreen at a certain intensity at a fixed frequency! I need it for a synchronization purpose with as high a resolution as possible (achieved by changing an intensity in a known pattern with as high a fixed frequency as possible).</p><p><strong>What questions I have:</strong></p><ol><li><p>Does an android device run with afixed display frequency or is thereany way to set it to a fixedfrequency of say 60fps?</p></li><li><p>If the fixed frequency can beachieved, is there a vsync interruptor something similar that lets mechange the intensity on the screenat the right time.</p></li><li><p>If the above two things can beachieved, which approach do I needto take. I'm thinking I need to lookat OpenGL ES and perhaps NDK....Could anyone please point me in theright direction....</p></li></ol><p>TIA,</p><p>Mathias</p>","480217","","480217","","2010-10-19 08:46:08","2011-12-04 02:21:36","Controlling Display Refresh Rate on Android Device","<android>","2","0","5","",""
"3966549","1","","","2010-10-19 08:35:05","1","168","<p>In the Android app which is getting developed, i have multiple alarms.</p><p>I want to initiate, different actions on different alarms.</p><p>How can i differentiate or determine , exactly which alarm has been fired??</p><p>RgdsYaaga</p>","419685","","","","","2010-10-19 10:38:31","How to differentiate between Mulitple alarms in android","<android>","1","0","","",""
"3966722","1","3967323","","2010-10-19 08:57:35","0","714","<p>What is the correct way of showing a new View with more detailed information from a ListView in Android? It's a topic that I can't find a solid answer for in <a href=""http://rads.stackoverflow.com/amzn/click/1430226293"" rel=""nofollow"">either</a> of <a href=""http://rads.stackoverflow.com/amzn/click/0596521472"" rel=""nofollow"">these</a> Android books.</p><p>For example a list of contact names, one is selected and a view shows their full details.</p><p>Do I launch a new activity for this or use a ViewFlipper?</p>","21574","","21574","","2010-10-19 10:42:59","2010-10-19 10:42:59","Showing detail from a ListView","<android><listview>","1","2","","",""
"3966827","1","3966899","","2010-10-19 09:10:59","0","3237","<p>i followed the ApiDemo to create a gallery.</p><p>but i don't need the background of each item , so i marked these code:</p><pre><code> public ImageAdapter(Context c) {            mContext = c;            // See res/values/attrs.xml for the &lt;declare-styleable&gt; that defines            // Gallery1.**//            TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);//            mGalleryItemBackground = a.getResourceId(//                    R.styleable.Gallery1_android_galleryItemBackground, 0);//            a.recycle();**        }public View getView(int position, View convertView, ViewGroup parent) {            ImageView i = new ImageView(mContext);            i.setImageResource(mImageIds[position]);            i.setScaleType(ImageView.ScaleType.FIT_XY);            i.setLayoutParams(new Gallery.LayoutParams(48, 48));            // The preferred Gallery item background           **// i.setBackgroundResource(mGalleryItemBackground);**            return i;        }</code></pre><p>then , i met a  problem :</p><p>the default first selected item( also the first item) is bright ,</p><p>but after a start to drag , and the selected item be changed , all items looked dark.....</p><p>i don't know how to set the alpha back , let the item looks bright.......could someone help me?</p>","422405","","","","","2010-10-19 09:36:20","android gallery without background","<android>","1","0","1","",""
"3966854","1","3966934","","2010-10-19 09:13:58","0","432","<p>HelloI am using Android 1.5.I am using database to save the user details.My requirement is like if two users want something to share between then the data in the database should be converted to XML file and sent to the server.Is there any way that i can achieve this in android.Is there anything like plist in iphone for android as well.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-10-20 08:15:02","convert file to Xml in android","<android>","1","0","","",""
"3966905","1","3966917","","2010-10-19 09:20:00","2","430","<p>after finishing my android application development i used the command showing below to get private key, but it shows some errors such as ""The Keystore was tampered with or password was in correct""</p><p>$ keytool -genkey -v -keystore DEBUG.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000</p><p>Is my problem with DEBUG.keystore?? Should i need to generate another keystore for public release??</p>","462695","","","","","2010-10-20 10:19:01","android application public release issue","<android>","1","1","1","",""
"3966981","1","","","2010-10-19 09:29:49","1","862","<p>I am just starting out with Android and I am attempting my first test app, but I am a bit stuck.</p><p>I have an SQLite database and a user is selecting a picture and a reference to this a long with a short description is getting stored in the database.This is all working fine, now I want to bind the images from to database to a gallery, but I am a bit confused how I do this.</p><p>My layout xml is as follows:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;Gallery      xmlns:android=""http://schemas.android.com/apk/res/android""      android:id=""@+id/Weeksgallery""          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""/&gt; &lt;Button android:id=""@+id/ok""            android:layout_width=""wrap_content""          android:layout_height=""wrap_content""       android:layout_below=""@+id/text1""           android:layout_marginLeft=""10dip""           android:text=""Take a Picture""          android:onClick=""TakePicture"" /&gt; &lt;/LinearLayout&gt;</code></pre><p>I want the gallery with a button below</p><p>My on create function I have the following:</p><pre><code>    public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  mDbHelper = new DbAdapter(this);  mDbHelper.open();  Cursor cur = mDbHelper.fetchDaysImages();  //array of fields to display  String[] from = new String[] { mDbHelper.KEY_ROWID,mDbHelper.KEY_PICREF};  int[] to = new int[] { R.id.Weeksgallery };  // Now create a simple cursor adapter and set it to display  SimpleCursorAdapter images = new SimpleCursorAdapter(this,    R.layout.main, cur, from, to);  setListAdapter(images);  mDbHelper.close(); }</code></pre><p>I am using the notepad tutorial as an example and my class extends ListActivity.</p><p>When I run it I get the error</p><blockquote>  <p>Your content must have a ListView whose id attribute is 'android.R.id.list'</p></blockquote><p>I'm assuming I am using the wrong type of binding, but I can't seem to find anywhere that tells me how to bind from an sqlite DB to a gallery. I also want to add a reference to the rowId in the gallery so when the image is clicked it will open the relevant page (so it can show the message)</p><p>Can anyone help?</p><p>Thanks</p><p>Bex</p>","390501","","390501","","2010-10-19 09:38:28","2010-12-07 11:28:19","Android Binding from SQLite to Gallery","<android>","1","2","","",""
"3967017","1","","","2010-10-19 09:33:57","13","2152","<p>I have an Android app which has a few different activities for browsing articles and images downloaded from RSS. </p><p>I'd like to be able to offer to hook up the <a href=""http://developer.android.com/intl/zh-TW/guide/topics/search/search-dialog.html"" rel=""nofollow"">search button to the Search dialog</a>, using the a <code>searchable.xml</code> file. I've managed to do this with one search, using:</p><pre><code>&lt;activity android:name="".search.SearchResultsActivity""    android:label=""@string/search_results_activity_title"" &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_articles""/&gt;&lt;/activity&gt;</code></pre><p>and in the <code>&lt;application /&gt;</code></p><pre><code>&lt;meta-data android:name=""android.app.default_searchable""    android:value="".search.SearchResultsActivity"" /&gt;</code></pre><p>I can now launch the Search dialog from any activity, and it launches the <code>SearchResultsActivity</code>.</p><p>I would now like to be able to search for images when the user is an <code>ImageListActivity</code>, using a <code>searchable_images.xml</code>, and use the default everywhere else. </p><p>I have a <code>SearchResultsImageActivity</code> which includes the following meta-data element, and used the same element in the <code>ImageListActivity</code>.</p><pre><code>&lt;meta-data android:name=""android.app.searchable""    android:resource=""@xml/searchable_images""/&gt;</code></pre><p>On pressing the search button in the <code>ImageListActivity</code>, I get the default search from <code>searchable_articles.xml</code>. </p><p>If I change the <code>default_searchable</code> to <code>SearchResultsImageActivity</code>, the image search is always launched, and the article search is never launched.</p><p>If I remove the <code>default_searchable</code> meta-data element altogether, and add <code>searchable</code> meta-data only selected activities, no search is launched.</p><p>I'm fairly sure this should be possible, but I don't know what I'm doing wrong.</p>","4737","","1466188","","2012-09-08 10:42:50","2012-09-08 10:43:45","Two searchable.xml activities in one AndroidManifest.xml","<android><search><android-manifest><searchable>","3","2","1","",""
"3967032","1","","","2010-10-19 09:35:16","0","3813","<p>Is it possible to add <code>TextView</code> and <code>ImageView</code> on canvas?</p>","446010","","180538","","2010-10-19 09:49:41","2012-12-24 16:00:54","TextView on Canvas","<android><canvas><views>","4","1","2","",""
"3967089","1","5937829","","2010-10-19 09:46:20","0","209","<p>I'm developing an Android application.</p><p>I have a package to access SQLite3. It isn't a ContentProvider. How can I test the package's classes using JUnit?</p><p>Thanks.</p>","68571","","","","","2011-05-09 13:52:04","Testing package's classes with JUnit","<android><junit><sqlite3>","2","0","2","",""
"3967170","1","","","2010-10-19 09:57:22","3","1006","<p>I am trying to create a custom look for the seekbar, and I created images for normal/filled and the thumb states. But the problem is that the images are not being scaled by android, instead are just tiled/clipped. How can I ask Android to scale the given images instead of tiling/clipping?</p>","177890","","","","","2011-08-16 11:45:11","Use scalable bitmaps for seekbar/progressbar Android","<android><xml><layout><seekbar>","2","1","1","",""
"3967192","1","3967208","","2010-10-19 10:00:18","0","1282","<p>Is double buffering makes any sense on android? Can it be implemented?</p>","480307","","","","","2010-10-19 10:02:44","Android double buffering","<android>","1","0","","",""
"3967237","1","","","2010-10-19 10:06:23","1","254","<p>I have the android resource.</p><ol><li>. build/envsetup.sh</li><li>make</li></ol><p>above two steps I have finish the source build, and the out directory has some useful file.but I can't understand how to make a zip file like update.zip.I want to flash my phone.</p>","438633","","","","","2010-10-19 10:13:12","how to build a android system","<android><build><makefile>","1","0","","",""
"3967487","1","","","2010-10-19 10:40:54","3","1587","<p>How can I send data from a server to an Android device without the device polling for data?</p>","480361","","403455","","2012-09-10 21:23:33","2012-09-11 00:07:02","Android:How to send data from server to android with no request from the android?","<android><networking><upload><push-notification><google-cloud-messaging>","3","0","","",""
"3967522","1","3967779","","2010-10-19 10:44:52","0","108","<p>Is there a way to use an image size when setting the sizes of a view? I want to create a TextView item with the exact height of a resource image, but I don't want to use the image as a background for the text view.</p><p>Thanks a lot</p>","460611","","","","","2010-10-19 11:21:00","Use image sizes","<android>","1","0","0","",""
"3967529","1","3967582","","2010-10-19 10:45:51","2","7355","<p>I have a rooted device, I type ""su"" in adb shell, then I try to traceroute.It says ""traceroute: not found"".I can't find traceroute in any bin folders.</p><p>Thanks for any hints.</p>","289463","","","","","2013-03-19 08:26:11","How to traceroute in adb shell?","<android><shell><adb><traceroute>","2","0","","",""
"3967694","1","3967827","","2010-10-19 11:07:50","1","2407","<p>Is there a nice way to retriev the time format e.g. 24h or 12h from within an android app?</p>","314597","","","","","2010-10-19 11:28:37","Android get time format","<android><datetime><format>","1","0","","",""
"3967816","1","3969401","","2010-10-19 11:27:25","0","1000","<p>I am writing an android application that check the username and the password of the user once a login button is clicked</p><p>i run the app in the emulator and when i click on login button the application is crashed</p><pre><code>package com.google.android.InitialScreen;import android.app.TabActivity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TabHost;public class InitialScreen extends TabActivity implements View.OnClickListener {    EditText username;     EditText password;    Button login;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        username = (EditText) findViewById(R.id.usernamefield);        password = (EditText) findViewById(R.id.passwordfield);        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TabHost mTabHost = getTabHost();        mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"")                .setIndicator(""TAB 1"")                .setContent(R.id.tabview1));        this.login = (Button)findViewById(R.id.login);        this.login.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                if ((username.getText().length()==0)&amp;&amp;(password.getText().length()==0))                    username.setText(""u&amp;p"");//                    Toast.makeText(getApplicationContext(), ""Please Enter Username and Password"", Toast.LENGTH_SHORT).show();                else if ((username.getText().length()==0)){                    username.setText(""u"");//                    Toast.makeText(getApplicationContext(), ""Please Enter Username"", Toast.LENGTH_SHORT).show();                }                else if (password.getText().length()==0)                    username.setText(""p"");                else                     username.setText(""ok"");            }        });              mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"")                .setIndicator(""TAB 2"")                .setContent(R.id.tabview2));              mTabHost.setCurrentTab(0);    }}</code></pre><p>please i am looking for your assistance </p><p>thanks in advanced </p>","480401","","180784","","2010-10-19 14:56:49","2010-10-19 14:56:49","android application crashes when button is clicked","<android>","1","2","","",""
"3967990","1","3968105","","2010-10-19 11:51:20","1","240","<p>Curious to know the reason behind not allowing updating UI elements from background thread in Android.   </p><p>Will main thread does something more (probably interacting with framework) after updating the UI elements so that changes can be seen on the screen.?</p><p>Is it the same case with other GUI tool kits?</p>","110024","","","","","2010-10-19 12:06:15","Why is it required to update the view only from application main thread?","<android>","1","1","","",""
"3968028","1","5237336","","2010-10-19 11:55:27","0","305","<p>Does anybody have any idea on how to prevent a spinners <code>OnItemSelectedListener</code> being fired at start up? It should be fired when someone clicks on it and chooses a specific item from the list. Please help if anybody knows this.</p><p>Thanks a lot. </p>","397901","","344347","","2012-11-18 21:47:18","2012-11-18 21:47:18","prevent spinner,s OnItemSelectedListner being fired on startup","<android><spinner>","1","1","","",""
"3968032","1","","","2010-10-19 11:55:38","0","2280","<p>I have been trying to put a back button progress bar in a webview and keep the url loading within my app instead of using the android default web browser.</p><p>If I manage to keep to browsing within the app and keep the back button the progress bar never shows up if I manage to get the progress bar to show up the code at the bottom for shouldoverideurl come up never read and the default browser launches, I tried all the google tutorials and solution but none of them work.  I am currently using google..  Can anyone help??</p><pre><code>public class livebrad extends Activity {WebView mWebView;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Adds Progrss bar Support    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.brows);    // Makes Progress bar Visible    getWindow().setFeatureInt(    Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);     // Get Web view    mWebView = (WebView) findViewById( R.id.webView ); //This is the id you gave                                                          //to the WebView in the main.xml    mWebView.getSettings().setJavaScriptEnabled(true);       mWebView.getSettings().setSupportZoom(true);         //Zoom Control on web (You don't need this                                                          //if ROM supports Multi-Touch            mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM    // Load URL    mWebView.loadUrl(""http://www.bbc.co.uk"");    // Sets the Chrome Client, and defines the onProgressChanged    // This makes the Progress bar be updated.    final Activity MyActivity = this;    mWebView.setWebChromeClient(new WebChromeClient() {    public void onProgressChanged(WebView view, int progress)       {        //Make the bar disappear after URL is loaded, and changes string to Loading...        MyActivity.setTitle(""Loading..."");        MyActivity.setProgress(progress * 100); //Make the bar disappear after URL is loaded        // Return the app name after finish loading        if(progress == 100)            MyActivity.setTitle(R.string.app_name);    }class HelloWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }    }    });}//End of Method onCreate</code></pre><p>}</p>","445174","","","","","2013-12-31 10:18:17","Adding a progress bar to webview","<java><android><eclipse><android-webview>","3","0","0","",""
"3968064","1","4042322","","2010-10-19 12:00:53","7","4237","<p>I currently use the <a href=""http://developer.android.com/guide/developing/tools/monkey.html"">Android Monkey tool</a> for stress testing Android system/packages. I find it to be useful. But so far everything has been <strong>manual testing</strong> (i.e. open emulator, execute adb shell monkey &lt;...>, etc.). I'd like to <strong>""automate""</strong> this and have it triggered externally by a build server. </p><p>My <em>initial</em> instinct is to just write a shell script to execute monkey (using random seeds) and then store the results in an build server accessible file. But is this really useful?</p><p>Just curious if anyone has done this before and/or has a ""smarter"" idea for automating Android Monkey runs. A Google search using terms ""automating android monkey"" turned up little relevant information. </p><p>All thoughts welcome.</p>","464504","","","","","2010-10-28 11:17:11","Ideas for automating Android Monkey runs","<android><testing><automated-testing>","2","0","4","",""
"3968066","1","3968208","","2010-10-19 12:01:05","0","140","<p>In my actual project I need to draw a MapView with a given running/walking/cycling path on top of it.</p><p>I don't need the current position so I added an overlay just for the path (no MyLocationOverlay). The path is painted but I don't see the Map in the emulator - only the grey tiles. The apiKey is set in the layout (MapView) and INTERNET permission is set in the Manifest.</p><p>So I'm wondering if I need more. Is it the emulator simply not working well (I do have 3G and 2 bars in the emulator) or do I need something else? Do I need to build an additional overlay or add additional permissions (xxxLOCATION) to the Manifest.</p>","471681","","213269","","2010-12-08 10:17:21","2010-12-08 10:17:21","Want to display Map but no current position. What's needed?","<android><android-mapview>","1","0","","",""
"3968170","1","3968305","","2010-10-19 12:14:44","8","12084","<p>Hello I would like to prompt the user to give me input in my android application using a dialog. this is what I have found:</p><pre><code>AlertDialog.Builder alert = new AlertDialog.Builder(this);alert.setTitle(""Title"");alert.setMessage(""Message"");// Set an EditText view to get user input final EditText input = new EditText(this);alert.setView(input);alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int whichButton) {String value = input.getText(); // Do something with value! }});alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) {     // Canceled.}}); alert.show();</code></pre><p>but this gives me :</p><p>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</p><p>is there any problem on my code it seems like a null argument is passed on the dialog but I can't find out what is the problem.</p><p>regards maxsap.</p>","234898","","","","","2011-06-28 13:38:56","android prompt user's input using a dialog","<android>","2","0","4","",""
"3968171","1","","","2010-10-19 12:14:44","12","13271","<p>I'm trying to put 2 listviews into my layout. The problem is that I don't know the size of each listview in advance. The first listview could have a few items (0, 1, 2 up to roughly 10) and the second listview could have many items (up to 100).</p><p>I tried to set the weight of both listviews at 1 but it did not work:</p><p>=> If the first listview has only 1 item and the second one 99, you don't see the first item of listview #1 => it's shrinks so much (relative to listview #2) that you don't see it.</p><p>So I'm thinking now to split the screen in 2 equals parts (no matter what/no matter the size of each listview) and put the two listviews in each part. Of course it needs to work on any device ... so how do I capture the device screen size, divide it in two and force the listview size to fit in each half of the screen ?</p><p>Has anyone done that already ? Is there another option to show two listviews of different sizes on the same layout (should I use a scrollview in some way ? => when the user is reaching the end of the first listview, the second listview appears => is that possible ??)</p><p>Thank you for your help and any suggestion ...</p><p>Hubert</p>","116573","","","","","2013-11-05 07:07:07","ANDROID : split the screen in 2 equals parts with 2 listviews ","<android><listview><android-layout>","3","3","5","",""
"3968204","1","","","2010-10-19 12:18:48","1","1164","<p>Is it possible to set up a localhost server on Android so that a browser window can access the device's GPS coordinates?</p><p>I'd like to be able to access the GPS coordinates in Javascript inside a browser window.</p><p>Now I could simply send the GPS coords to the server and read from within the browser window by reading off the server, but I was wondering if there was any way to send the GPS coordinates from the device straight into the browser window without having to go through a remote server?</p><p>It would be really great to be able to access the GPS coordinates directly from <a href=""http://10.0.2.2:9999"" rel=""nofollow"">http://10.0.2.2:9999</a></p><p>Many thanks in advance,</p>","395974","","","","","2010-10-19 12:24:40","Serving GPS coordinates from Android localhost 10.0.2.2","<android><gps><localhost>","1","0","1","",""
"3968207","1","","","2010-10-19 12:18:58","0","1401","<p>my code is like this</p><p>ContentValues values = new ContentValues();</p><pre><code>    values.put(MediaStore.Audio.Media._ID, _ID);        values.put(MediaStore.Audio.Media.DATA, DATA);        values.put(MediaStore.Audio.Media.DISPLAY_NAME, DISPLAY_NAME);        values.put(MediaStore.Audio.Media.SIZE, SIZE);        values.put(MediaStore.Audio.Media.MIME_TYPE, MIME_TYPE);        values.put(MediaStore.Audio.Media.DATE_ADDED, DATE_ADDED);        values.put(MediaStore.Audio.Media.DATE_MODIFIED, DATE_MODIFIED);        values.put(MediaStore.Audio.Media.TITLE, TITLE);        values.put(MediaStore.Audio.Media.TITLE_KEY, TITLE_KEY);        values.put(MediaStore.Audio.Media.DURATION, DURATION);        values.put(MediaStore.Audio.Media.ARTIST_ID, ARTIST_ID);        values.put(MediaStore.Audio.Media.COMPOSER, COMPOSER);        values.put(MediaStore.Audio.Media.ALBUM_ID, ALBUM_ID);        values.put(MediaStore.Audio.Media.TRACK, TRACK);        values.put(MediaStore.Audio.Media.YEAR, YEAR);        values.put(MediaStore.Audio.Media.IS_RINGTONE, IS_RINGTONE);        values.put(MediaStore.Audio.Media.IS_ALARM, IS_ALARM);        values.put(MediaStore.Audio.Media.IS_NOTIFICATION, IS_NOTIFICATION);        values.put(MediaStore.Audio.Media.IS_PODCAST, IS_PODCAST);        values.put(MediaStore.Audio.Media.BOOKMARK, BOOKMARK);        values.put(MediaStore.Audio.Media.ARTIST_KEY, ARTIST_KEY);        values.put(MediaStore.Audio.Media.ARTIST, ARTIST);        values.put(MediaStore.Audio.Media.ALBUM_KEY, ALBUM_KEY);        values.put(MediaStore.Audio.Media.ALBUM, ALBUM);        Uri uri = getContentResolver().insert(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, values);        try {            OutputStream outStream = getContentResolver().openOutputStream(uri);            outStream.write(buffer);            outStream.close();        } catch (Exception e) {            Log.e(""insetAudio"", ""exception inserting audio"", e);        }</code></pre><p>it gives me exception that there is no column in audio_meta named artist_key</p><p>10-19 17:14:22.491: INFO/Database(214): sqlite returned: error code = 1, msg = table audio_meta has no column named artist_key10-19 17:14:22.543: ERROR/Database(214): Error inserting artist_key=%D%&lt;%8%&lt;%R%,%B% is_alarm=0 is_ringtone=0 is_podcast=0 composer=null title=Vivuzela mime_type=audio/mpeg _id=5 date_added=1287488662 _display_name=vuvuzela.mp3 album_key=%,%&lt;%D%P%%D%&lt;%8%&lt;%R%,%B%%R%4%0%:%F%H%V%&lt;%,%R%&lt;%H%F%P%%J%V%R%%B%R%2%-1882603603 year=2010 _size=498344 _data=/mnt/sdcard/Android/data/vuvuzela.mp3 bookmark=null date_modified=1287374780 track=0 artist_id=1 album_id=4 duration=31112 is_notification=0 title_key=%V%&lt;%V%T%^%4%B%,%10-19 17:14:22.543: ERROR/Database(214): android.database.sqlite.SQLiteException: table audio_meta has no column named artist_key: , while compiling: INSERT INTO audio_meta(artist_key, is_alarm, is_ringtone, is_podcast, composer, title, mime_type, _id, date_added, _display_name, album_key, year, _size, _data, bookmark, date_modified, track, artist_id, album_id, duration, is_notification, title_key) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:36)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1536)10-19 17:14:22.543: ERROR/Database(214):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)10-19 17:14:22.543: ERROR/Database(214):     at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1813)10-19 17:14:22.543: ERROR/Database(214):     at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1638)10-19 17:14:22.543: ERROR/Database(214):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)10-19 17:14:22.543: ERROR/Database(214):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:146)10-19 17:14:22.543: ERROR/Database(214):     at android.os.Binder.execTransact(Binder.java:288)10-19 17:14:22.543: ERROR/Database(214):     at dalvik.system.NativeStart.run(Native Method)</p><p>can anybody help me whts wrong with my codealthough i can see coulmn artist_key while getting values from cursor from this uri and also value for that but when i want to insert value it throws exception </p><p>thanks in advance</p>","480420","","","","","2010-10-19 12:25:36","problem while inserting audio file in MediaStore.Audio.Media.EXTERNAL_CONTENT_URI in android","<android>","1","0","","",""
"3968279","1","3968480","","2010-10-19 12:26:44","1","3762","<p>Can someone tell me the procedure to host an app in Android Market? I know that there is no review process. But is there any other steps I need to follow to publish my App?</p>","189006","","21234","","2010-10-19 12:32:49","2012-06-12 11:00:45","What is procedure to Host an App in Android Market?","<android><google-play>","2","0","1","",""
"3968340","1","","","2010-10-19 12:34:43","3","254","<p>I want a clarification on intent.this is my scenario,there are 3 activities in my project namely <strong>""A"",""B"",""C""</strong>.....On clicking the button in Activity <strong>""A""</strong> ,i pass the values to ""B"" through bundle and based on the received value i retrieved set of values from database...Similarly <strong>""B""</strong>-><strong>""C""</strong> also...</p><p>The problem when i clicked the back button in <strong>""C""</strong> it does not proceed to <strong>""B""</strong> rather throws a error.similarly <strong>""B</strong>"" to <strong>""A""</strong> also....</p><p>i found the reason that ""B"" can not get value from bundle when clicking Back button from ""C""</p><p>Hope you understand.what's the solution....</p><p>Thanks in advance</p>","461972","","","","","2012-09-24 22:14:02","Intent on Android","<android>","2","3","","",""
"3968350","1","","","2010-10-19 12:36:05","2","282","<p>I have an <code>AnimationDrawable</code> that is running. How to stop &amp; reset it so that it does not start again until <code>start()</code> is called? Calling <code>setVisible(true, true)</code> resets it, but also immediately starts animation, and I'd like to avoid it.</p>","6533","","","","","2011-08-02 15:05:45","Resetting animation in Android without starting it","<android>","1","0","","",""
"3968451","1","","","2010-10-19 12:47:53","1","1428","<p>I want to display MJPEG (generated by live camera) in the Android device. is this possible to display MJPEG over the android device. if yes then how I will implement it.</p>","309990","","","","","2010-10-19 18:56:50","how to display MJPEG over the android","<android>","1","1","","",""
"3968618","1","","","2010-10-19 13:05:08","4","5951","<p>i have a sqlite database on my android, whith a datetime column, that contains a date with the Format dd.MM.yyyy.It's not my Database, I'm niot able to change the Dateformat.I want to compare the date in the database with a String, which is representing a secon date, but everything I tryed failed.How can I convert this column to a valid, compareable date?date(), dattime() sdfttime() everything returns NULL.</p>","432657","","","","","2012-11-09 10:02:51","sqlite convert 'dd.MM.yyyy' formated String to date","<android><sqlite>","3","0","4","",""
"3968704","1","3969017","","2010-10-19 13:14:41","2","571","<p>Hello I would like to know if it is possible to for some application other my own to change a preference value of my application.Also are the preferences been kept by android when the phone is turned off?</p><p>is it safe to store some data(flags) on sharedpreferences in order to notify an activity for something?</p><p>when user clears the application data what exactly  is erased,shared preferences data?</p><p>is it prefered to use an internal private file to store secure data? such ass passwords?</p><p>also I would like to be able to show a dialog when I detect a certain behavior, for this I have a monitoring service that has to notify the main activity about that. currently this is done through a  callback method but I would like to maintain that state even if the application is killed or the phone reboots.</p><p>so I thought of setting a sharedpreference value (flag) and then on the oncreate method check if that flag exists. Also should I also check on the resume method?</p><p>Thanks a lot and sorry for the amount of questions but I am a little confused.regards maxsap </p>","234898","","","","","2010-10-19 13:47:52","android data storage question","<android>","1","0","1","",""
"3968871","1","3968980","","2010-10-19 13:30:45","1","673","<p>If I am going to be reading files from the SD Card, where do I put them during development? Also, when I install the app, will it include these files and put them to the SD Card?</p>","348261","","","","","2010-10-19 13:43:04","Where to put a file when reading from SD Card (Android Development)","<android><file><android-sdcard>","1","0","","",""
"3968926","1","3976854","","2010-10-19 13:37:44","2","543","<p>When testing Android layouts, I'm constantly building for three different emulators from Eclipse (with ADT), so I have to run three times and then select each one. Is there any configuration or plugin that allows me to press Run once and the application is started in all three?</p>","169786","","","","","2010-10-20 11:24:55","In Eclipse, any way to start application in more than one emulator at the same time?","<android><eclipse><emulator><adt>","2","0","1","",""
"3969041","1","3969138","","2010-10-19 13:51:18","2","3555","<p>I heard something recently about it being included in Froyo and I was wondering if there was any truth to it. If there is, it would help me with an app idea greatly.</p>","348261","","309086","","2013-09-13 14:27:37","2013-09-13 14:27:37","Does android have a built-in PDF viewer?","<android><pdf><android-2.2-froyo><built-in>","1","0","1","",""
"3969080","1","","","2010-10-19 13:56:12","0","201","<p>I am working developing a tab layout based RSS Feed reader app for my android. I have four different sites to get the feeds from and each feed should go into the separate tab. Now I have the app working fine but I was just wondering if there is a way to pass in the feed url while invoking the feed activity? </p><p>I guess what I am after is to make my code more generic. When I invoke a new tab view using an intent I want to pass in the url for feed to the class being invoked in addition to the Class name and the intent. For example currently I have the following code for each RSS feed:</p><pre><code>Intent i = new Intent(this, RSSReader.class);spec = tabHost.newTabSpec(""Tab1"").setIndicator(""Tab1"").setContent(i);tabHost.addTab(spec);</code></pre><p>where RSSReader holds my url that would be displayed in ""Tab1"". Is there a way to tell RSSReader which url it is supposed to display based on the tab selected? I tried looking up the API but I couldn't find anything useful or may be I might have missed it. Any help in the matter would be appreciated!</p>","480524","","212275","","2010-10-19 14:04:50","2010-10-19 14:06:32","Android Intent usage","<java><android>","2","0","","",""
"3969137","1","3969261","","2010-10-19 14:00:50","0","399","<p>HelloIn my android application i am using a image as background initially.Then on top of that i need to place small images and on top of the small images i would like to place a textview with some text on it.</p><p>I am using below code for that.With this am able to place the small images but the textview if i am trying to place it place in the next row and not over the image.I also tried with adding the image as the background and then placing textview but at that case the padding and size of the image is not getting decreased.</p><pre><code>      TableLayout table = (TableLayout)findViewById(R.id.FirstTable);       TableRow tr = new TableRow(this);      tr.setId(i);      tr.setPadding(0, 25, 0, 10);       ImageView imageView = new ImageView(this);       imageView.setLayoutParams(new TableRow.LayoutParams(60, 60));        imageView.setImageResource(R.drawable.bookicon);        tr.addView(imageView);          table.addView(tr);</code></pre><p>Is there any way that i can have the images of size 60 by 60 and place a textview on top of these images.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-10-19 14:11:58","padding issue while setting a image as background in android","<android>","1","0","","",""
"3969143","1","3969318","","2010-10-19 14:01:16","0","1131","<p>I'm working on an Android application that tracks time durations of tasks.  Internally, it saves these durations as a float representing how many hours were spent on the task.  So 30 minutes would be 0.5, 1 hour would be 1, etc.  I've got all that code working great, along with code to convert these into hh:mm format for easier reading.</p><p>However, there's also an aspect where the user can manually change this value using a string input box.  The following inputs should all be considered valid:</p><p>""1:30"" => 1.5""1.83"" => 1.83""0.5"" => 0.5</p><p>I don't care if users enter something like ""0:90"", which would be 1.5 hours.</p><p>This is my current (untested) solution.  Just wondering if there's a better way to go about this:</p><pre><code>public static float HoursToFloat(String tmpHours) {    float result = 0;    tmpHours = tmpHours.trim();    // Try converting to float first    try    {        result = Float.parseFloat(tmpHours);    }    catch(NumberFormatException nfe)    {        // OK so that didn't work.  Did they use a colon?        if(tmpHours.contains("":""))        {            int hours = 0;            int minutes = 0;            int locationOfColon = tmpHours.indexOf("":"");            hours = Integer.parseInt(tmpHours.substring(0, locationOfColon-1));            minutes = Integer.parseInt(tmpHours.substring(locationOfColon+1));            result = hours + minutes*60;        }    }    return result;}</code></pre>","158766","","","","","2010-10-19 19:26:35","Converting time durations from string to float","<java><android><parsing>","2","2","","",""
"3969558","1","3970138","","2010-10-19 14:43:33","0","508","<p>I am writing a game app for Android, where a question word with four different alternatives will show that the user can choose between.</p><p>I have a database and i can insert from the app, but what would be the easiest way to use a select statement, and then parse the response and populate the five different positions in the radio group?</p><p>I have done the Notepad tutorial on the dev. site, and it seems a bit too complicated for what i need. At least I cannot decipher it well enough to apply on my project. </p><p>Thanks for any help! /AK</p>","455479","","","","","2010-10-19 15:44:20","Populate radiobutton group with data from squlite database","<android><database><sqlite><select><radiobuttonlist>","1","0","","",""
"3969578","1","","","2010-10-19 14:45:29","0","328","<p>i want to use a function for image recognition i dont want to make an algorithm.please suggest me a function where i could compare two images and tell whether these images belong to the same object. please help me!.</p>","480606","","","","","2010-10-21 18:05:16","is there any inbuilt function for image recognition","<java><iphone><android><image-processing>","2","1","","",""
"3969637","1","","","2010-10-19 14:50:14","0","1234","<p>I need to make a service that capture all touch events, not in a specific view or when an specific activity is open. This service is started when the boot is completed (and I have an app to stop/play this service when I want it). So it write something (in a Toast) when the user touch any place in the screen.</p><p>Can I do this? Or only in specifics things (with OnTouchListener and adding specifics views, for example)?</p><p>Sorry for my bad english.thanks </p>","480617","","","","","2010-10-19 15:10:37","Getting touch event in any view (Android)","<android><events><touch>","1","0","","",""
"3969807","1","4137963","","2010-10-19 15:06:42","10","5764","<p>I have a <code>ListPreference</code> which look something like this:</p><pre><code>&lt;ListPreferenceandroid:title=""Choose item""android:summary=""...""android:key=""itemList""android:defaultValue=""item1""android:entries=""@array/items""android:entryValues=""@array/itemValues"" /&gt;</code></pre><p>Then, I have another preference which should only be enabled if ""item3"" is selected in the <code>ListPreference</code>.</p><p>Can I somehow accomplish this with <code>android:dependency</code>? Something like <code>android:dependency=""itemList:item3""</code></p><p>Thanks!</p>","366330","","","","","2013-12-19 08:13:09","ListPreference dependency","<android><dependencies><preferences>","2","0","4","",""
"3969840","1","","","2010-10-19 15:10:56","2","785","<p>Does it exists a way to apply a rotation (of 90 degrees) to an AlertDialog that has been created by the system? </p><p>This could seem tricky at first sight. My application uses the camera in preview and must work in landscape <strong>AND</strong> in portrait, starting from Android 1.5.</p><p>However, when the OS automatically manages the phone orientation, the previewed image is not displayed in the same way on all phones! (I have tested with an Android Dev Phone 1 = G1, a HTC Desire and a Samsung Galaxy). When I fixed the issue on the G1, the issue occurs on the Desire....</p><p>The only way to fix it on all phones consists in forcing the application to stay in landscape (<em>android:screenOrientation=""landscape""</em> in the <em>AndroidManifest.xml</em>) and to manage to apply a rotation of 90° to each displayed element so that the UI will be in portrait from the user point of view.</p><p>However, system dialogs must also undergo a rotation.</p><p>So my question is : <strong><em>is it possible to change the orientation of an AlertDialog created by the system, maybe using a tricky way ?</em></strong></p><p>If not, I know how to do it using a custom layout, but I will lose the system style.</p>","480640","","469983","","2012-10-26 08:03:01","2012-10-26 08:03:01","Rotate of 90 degrees a Dialog / AlertDialog created by the system?","<android><dialog><camera><rotation><portrait>","0","0","0","",""
"3969842","1","3969896","","2010-10-19 15:11:00","0","561","<p>HelloIn my android application on click of image i would like to display a page which could provide a notepad facility to user.I placed a edit text with fill parent but the cursor starts from the middle of the screen.Is there any way that i can start the cursor from the beginning.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-10-19 15:18:22","fill edit text to the complete screen android","<android>","1","1","","",""
"3970002","1","","","2010-10-19 15:30:06","1","1185","<p>I am planning an app with a ""coin flipping simulation"" function(Activity) in an Android phone. I am new to 3D (OpenGL) here , and I know there will be a lot of efforts to build from scratch. So , I am looking for an existing 3D engine , which is able to simulate :</p><ol><li><p>Coin flip and drop , with G-Sensor , so that users can shake/wave his phone to see the coins flipping. </p></li><li><p>Able to get which coin is up or down after the coins drop.</p></li><li><p>Able to assign how many coins are in the 'hands(or virtual table)'</p></li><li><p>Able to render different textures to the coins</p></li><li><p>The simulation must be the more realistic the better. So there should be a built-in gravity algorithm.</p></li></ol><p>OpenSource is welcome , and Commercial is acceptable too.</p><p>Can someone give me some suggestions , or existing libraries , or algorithms (gravity ...)</p><p>Thanks a lot!</p>","298430","","44729","","2010-10-19 16:31:37","2011-11-27 20:35:43","Looking for an Android 3d engine that able to simulate coin flipping?","<android><animation><opengl-es><3d>","2","0","1","",""
"3970046","1","5732679","","2010-10-19 15:35:14","3","6799","<p>I have an android application using LocationManager get the cell network location and not the Wifi location?  If I have turned off the Wifi antenna and do the following:</p><pre><code>LocationManager lm = (LocationManager) paramContext.getSystemService(Context.LOCATION_SERVICE);Location location = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);</code></pre><p>I am always returned the Wifi location and not the cell network location.  I want it to return the cell location since I have moved fromthe Wifi location.  I tried using a LocationListener but that doesn't seem to help.</p><p>This is running on an HTC Evo running Froyo.</p><p>Thanks!</p>","480658","","","","","2011-12-28 20:14:15","How do you make Android LocationManager use Cell network and not Wifi network?","<android><wifi><cell><locationmanager>","2","1","","",""
"3970063","1","6111509","","2010-10-19 15:36:24","8","4619","<p>I wrote a remote service that the clients can log on with the usual mechanisms of IPC provided by Android and the binding seems to work. The problem arises when I go to call a method in which I have to pass an object as a parameter because I get this ""curious"" exception:</p><pre><code>10-19 15:09:04.601: ERROR/AndroidRuntime(2985): FATAL EXCEPTION: main  10-19 15:09:04.601: ERROR/AndroidRuntime(2985): java.lang.NullPointerException  10-19 15:09:04.601: ERROR/AndroidRuntime(2985): at android.os.Parcel.readException(Parcel.java:1253)   10-19 15:09:04.601: ERROR/AndroidRuntime(2985):at android.os.Parcel.readException(Parcel.java:1235)  10-19 15:09:04.601: ERROR/AndroidRuntime(2985): at it.domod.commons.interfaces.DeviceManager$Stub$Proxy.sendCommand(DeviceManager.java:121)</code></pre><p>It seems to be thrown from the proxy class generated from the .aidl file.</p><p>The more strange thing is that the object seems to be passed correctly but probably there is something wrong around. Any idea?</p>","321354","","321354","","2013-04-27 17:05:48","2013-04-27 17:05:48","Parcel.readException passing an object to remote service","<android><service><parcelable>","1","4","","",""
"3970158","1","3970831","","2010-10-19 15:45:47","0","1666","<p>I am having a problem in ScrollView. When i run my application on X10i it works fine but when i change the view to landscape half of the layout at the bottom (RelativeLayout) go down to the screen. Here is my Layout code. please suggest a general solution that will be applicable to all phones not only X10i.</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_height=""wrap_content""  android:layout_width=""fill_parent""&gt; android:layout_marginBottom=""50dip""&gt; &lt;ScrollView  android:id=""@+id/ScrollView""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_marginTop=""2dip"" &gt; &lt;RelativeLayout android:id=""@+id/layoutR"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt; &lt;ImageView android:id=""@+id/galleryPic""         android:layout_width=""140dip""         android:layout_height=""175dip""         android:background=""#ff666666"" /&gt;      &lt;TextView      android:id=""@+id/lblmail""      android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:layout_alignParentTop=""true""         android:layout_marginLeft=""5dip""          android:text=""E_mail:""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/galleryPic"" /&gt;      &lt;EditText       android:id=""@+id/txt_email""       android:layout_width=""170dip""         android:layout_height=""32dip""          android:layout_marginLeft=""5dip""         android:hint=""e-mail""          android:maxLines=""1""          android:textSize=""10sp""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/galleryPic""          android:layout_below=""@+id/lblmail"" /&gt;      &lt;TextView       android:id=""@+id/lblpass""       android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:layout_marginLeft=""5dip""         android:text=""Password:""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/galleryPic""          android:layout_below=""@+id/txt_email"" /&gt;      &lt;EditText       android:id=""@+id/txt_pass""       android:layout_width=""170dip""         android:layout_height=""32dip""          android:password=""true""         android:maxLines=""1""          android:layout_marginLeft=""5dip""          android:hint=""password""         android:textSize=""10sp""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/galleryPic""          android:layout_below=""@+id/lblpass"" /&gt;      &lt;TextView       android:id=""@+id/lblrepass""       android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:layout_marginLeft=""5dip""         android:text=""Re-Password:""          android:typeface=""serif""         android:textStyle=""bold""          android:layout_toRightOf=""@+id/galleryPic""         android:layout_below=""@+id/txt_pass"" /&gt;      &lt;EditText       android:id=""@+id/txt_repass""       android:layout_width=""170dip""         android:layout_height=""32dip""          android:password=""true""         android:maxLines=""1""          android:layout_marginLeft=""5dip""          android:hint=""re-password""         android:textSize=""10sp""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/galleryPic""          android:layout_below=""@+id/lblrepass"" /&gt;      &lt;Button       android:id=""@+id/btn_Gallery""       android:layout_width=""wrap_content""         android:layout_height=""wrap_content""          android:gravity=""center""         android:typeface=""serif""          android:textStyle=""bold""          android:text=""Browse""         android:layout_below=""@+id/galleryPic"" /&gt;      &lt;TextView       android:id=""@+id/lblname""       android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:text=""Name:""          android:typeface=""serif""         android:textStyle=""bold""          android:layout_marginTop=""6dip""         android:layout_below=""@+id/btn_Gallery"" /&gt;      &lt;EditText       android:id=""@+id/txt_name""       android:layout_width=""224dip""         android:layout_height=""32dip""          android:hint=""name""          android:maxLines=""1""         android:textSize=""10sp""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_marginTop=""3dip""          android:layout_toRightOf=""@+id/lblname""         android:layout_below=""@+id/btn_Gallery""          android:layout_marginLeft=""5dip"" /&gt;      &lt;TextView       android:id=""@+id/lblage""       android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:text=""Age:""          android:typeface=""serif""         android:textStyle=""bold""          android:layout_marginTop=""9dip""         android:layout_below=""@+id/lblname"" /&gt;      &lt;EditText       android:id=""@+id/txt_age""       android:layout_width=""225dip""         android:layout_height=""32dip""          android:hint=""age""          android:numeric=""integer""         android:maxLines=""1""          android:maxLength=""3""          android:textSize=""10sp""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/lblage""          android:layout_below=""@+id/txt_name""         android:layout_marginLeft=""19dip"" /&gt;      &lt;TextView       android:id=""@+id/lblsex""       android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:text=""Sex:""          android:typeface=""serif""         android:textStyle=""bold""          android:layout_marginTop=""12dip""         android:layout_below=""@+id/lblage"" /&gt;      &lt;EditText       android:id=""@+id/txt_sex""       android:layout_width=""226dip""         android:layout_height=""32dip""          android:hint=""sex""          android:maxLines=""1""         android:textSize=""10sp""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/lblsex""          android:layout_below=""@+id/txt_age""         android:layout_marginLeft=""20dip"" /&gt;      &lt;TextView       android:id=""@+id/lbllocation""         android:layout_width=""wrap_content""          android:layout_height=""21dip""         android:text=""Location:""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_marginTop=""12dip""          android:layout_below=""@+id/lblsex"" /&gt;      &lt;EditText       android:id=""@+id/txt_location""         android:layout_width=""206dip""          android:layout_height=""32dip""         android:hint=""location""          android:maxLines=""1""          android:textSize=""10sp""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/lbllocation""          android:layout_below=""@+id/txt_sex""         android:layout_marginLeft=""5dip"" /&gt;      &lt;TextView       android:id=""@+id/lblstatus""       android:layout_width=""wrap_content""         android:layout_height=""21dip""          android:text=""Status:""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_marginTop=""12dip""          android:layout_below=""@+id/lbllocation"" /&gt;      &lt;EditText       android:id=""@+id/txt_status""       android:layout_width=""225dip""         android:layout_height=""32dip""          android:hint=""status""          android:maxLines=""1""         android:textSize=""10sp""          android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/lblstatus""          android:layout_below=""@+id/txt_location""         android:layout_marginLeft=""5dip"" /&gt;         &lt;TextView          android:id=""@+id/lblinterest""         android:layout_width=""wrap_content""          android:layout_height=""21dip""         android:text=""Interest:""          android:typeface=""serif"" android:textStyle=""bold""         android:layout_marginTop=""12dip""          android:layout_below=""@+id/lblstatus"" /&gt;         &lt;EditText          android:id=""@+id/txt_interest""         android:layout_width=""212dip""          android:layout_height=""32dip""         android:hint=""interest""          android:maxLines=""1""          android:textSize=""10sp""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/lblinterest""          android:layout_below=""@+id/txt_status""         android:layout_marginLeft=""5dip"" /&gt;      &lt;TextView       android:id=""@+id/lblorientation""         android:layout_width=""wrap_content""          android:layout_height=""21dip""         android:text=""Orientation:""          android:typeface=""serif""         android:textStyle=""bold""          android:layout_marginTop=""12dip""         android:layout_below=""@+id/lblinterest"" /&gt;         &lt;EditText          android:id=""@+id/txt_orientation""         android:layout_width=""187dip""         android:layout_height=""32dip""         android:hint=""status""         android:maxLines=""1""         android:textSize=""10sp""         android:typeface=""serif""          android:textStyle=""bold""         android:layout_toRightOf=""@+id/lblorientation""         android:layout_below=""@+id/txt_interest""         android:layout_marginLeft=""5dip""/&gt;&lt;/RelativeLayout&gt;&lt;/ScrollView&gt; &lt;RelativeLayout   android:layout_marginTop=""-32dip""   android:gravity=""bottom""   android:layout_height=""50dip""    android:layout_width=""fill_parent""  android:background=""#ff999999""&gt; &lt;Button   android:id=""@+id/btnNext""   android:layout_width=""100dip""   android:layout_height=""45dip""   android:text=""Next""  android:layout_marginTop=""2dip""  android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","367121","","","","","2010-10-19 20:55:40","android scrollView not aligning in screen Landscape View","<android><android-widget>","2","0","","",""
"3970198","1","3970276","","2010-10-19 15:51:25","0","1488","<p>Hello I would like to show an alert dialog that shows a counter(timer of time) and after 10 seconds will automatically disappear.</p><p>I have:</p><pre><code>builder = new AlertDialog.Builder(this);    builder.setTitle(title);    builder.setMessage(msg);    final EditText input = new EditText(this);    builder.setView(input);    runOnUiThread(new Runnable() {        @Override        public void run() {            builder.setMessage(""ELEOS"");        }    });    builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            dismissDialog(id);        }    });    return builder.create();</code></pre><p>which simply creates the dialog. </p><p>regards maxsap</p>","234898","","","","","2010-10-19 17:17:29","android how to show a dialog for a specific time","<android>","1","0","","",""
"3970546","1","","","2010-10-19 16:32:16","2","4651","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3963185/android-app-loading-images-from-drawables-nodpi-with-scaling"">Android app loading images from /drawables-nodpi/ with scaling</a>  </p></blockquote><p>I recently rebuilt my Android project to target 2.2 from 2.1.</p><p>In the old project, I did not specify a target SDK (the manifest did not contain something like: android:minSdkVersion=""8""). This gave me an error in the console when running, but everything worked fine so I didn't fool with it.</p><p>The new project now uses android:minSdkVersion=""8"" in the manifest.</p><p>But now my drawables from the /drawable-nodpi/ folder are loading with scaling, making them much smaller and significantly changing the desired visuals.</p><p>If I cut out the tag from my manifest, they load properly without scaling.</p><p>Even when loading my images like so:</p><pre><code>        BitmapFactory.Options opts = new BitmapFactory.Options();        opts.inScaled = false;           Bitmap bm = BitmapFactory.decodeResource(_resources, resId, opts);</code></pre><p>They are still scaled when I declare the minimum SDK in the manifest, but not scaled if I remove that tag.</p><p>Why is this happening? How can I load them without scaling while still declaring the minimum SDK?</p>","480738","","","","","2012-02-23 20:11:45","Android /drawable-nodpi/ loading scaled","<android><bitmap><scale>","3","0","1","2012-07-10 20:46:09",""
"3970598","1","3970639","","2010-10-19 16:37:41","4","1177","<p>I've been using firefox for Android and really like the use of the sidebar to hold shortcut icons and the like.  How would I go about creating a similar bar myself with the following attributes:</p><ol><li>progressively revealed as I swipe in one direction </li><li>progressively hides as I swipe in the other direction</li><li>can be a custom width</li><li>I can dynamically inject layout in to it or it can hold static content</li></ol><p>Is there any open source code available?  If not, what approach would I use to create this?</p>","264276","","","","","2011-01-30 08:45:53","Android sidebar","<android><sidebar><firefox-sidebar>","2","0","2","",""
"3970697","1","","","2010-10-19 16:51:18","3","1377","<p>I'm tearing my hair out over this. I would like a ListView where each item in the list is an ImageView. I want each item to have a radio button next to it and only one item can be selected at a time (i.e. single choice mode). This code works fine for creating a list of text box with radio buttons:</p><pre><code>    ListView listView = ...    String [] value = {""test1"",""test2""};    listView.setAdapter(        new ArrayAdapter&lt;String&gt;(            this, android.R.layout.simple_list_item_single_choice,value    ));    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);</code></pre><p>For my ImageView items, I implemented by own ArrayAdapter. In the getView method of my ArrayAdapter object, I load the follow xml file for each list row:</p><p>e.g.</p><p></p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:focusable=""false""  android:gravity=""center""&gt;&lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@android:id/text1""  android:layout_width=""fill_parent""  android:layout_height=""?android:attr/listPreferredItemHeight""  android:textAppearance=""?android:attr/textAppearanceLarge""  android:gravity=""center_vertical""  android:checkMark=""?android:attr/listChoiceIndicatorSingle""  android:paddingLeft=""6dip""  android:paddingRight=""6dip""  /&gt;   &lt;ImageView android:id=""@+id/preview""  android:layout_width=""75dip"" android:layout_height=""100dip""  android:scaleType=""fitCenter""  android:enabled=""true""  android:focusable=""false""  /&gt;   &lt;/RelativeLayout&gt;</code></pre><p>I copied the CheckedTextView item from the simple_list_item_single_choice.xml file used in the previous example. I assume that ListView must look for an item with id ""text1"" to use for displaying the selection status (I'm just guessing here as I cannot work out where the radio buttons are meant to come from). If I don't include the CheckedTextView item, I don't see any radio buttons at all.</p><p>When I use my custom adapter with the above xml file, I can see the radio buttons but selecting them does nothing. In addition, I've implemented the selection listener for the list view and this do not fire when I click items. What am I doing wrong?</p>","477028","","","","","2010-10-19 20:54:34","ListView where each item is an ImageView with a radiobox and one item can be selected at a time?","<java><android><gui><mobile>","0","4","","",""
"3970968","1","3971635","","2010-10-19 17:23:40","1","251","<p>I wanna check if the draw_texture function is avaiable on the actual device, so:</p><p><strong>How can I check if this extension is supported?</strong></p>","386562","","44729","","2012-11-28 22:13:18","2012-11-28 22:13:18","Check for draw_texture","<java><android><opengl-es>","1","0","","",""
"3971047","1","","","2010-10-19 17:33:35","1","246","<p>The sql statement is:</p><pre><code>SELECT 'customer_address'._id, 'address'.Descriptor AS Name FROM 'customer_address' INNER JOIN 'address' ON 'customer_address'.AddressID='address'._idWHERE 'customer_address'.CustomerID=4 ORDER BY Name</code></pre><p>When I examine the db using the adb sqlite shell, it reports that the schema for the address table is:</p><pre><code>CREATE TABLE address (  _id INTEGER PRIMARY KEY AUTOINCREMENT,  EntityID INTEGER NOT NULL,  TypeID INTEGER NOT NULL,  Address VARCHAR(256) DEFAULT NULL,  City VARCHAR(32) NOT NULL,  Region VARCHAR(24) DEFAULT NULL,  PostalCode VARCHAR(12) DEFAULT NULL,  Country VARCHAR(30) NOT NULL,  Descriptor VARCHAR(512) NOT NULL,  Memo VARCHAR(1024) DEFAULT NULL,  `Profile` VARCHAR(64) DEFAULT NULL,  TofP DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP)</code></pre><p>and for the customer_address view is:</p><pre><code>CREATE VIEW customer_address AS select address._id AS _id,corporation.CustomerID AS CustomerID,address._id AS AddressID from (corporation join address on((corporation.EntityID = address.EntityID))) where (corporation.CustomerID is not null)</code></pre><p>Can anyone see the error?</p><p>thnx</p>","353616","","714965","","2011-08-29 10:41:05","2011-08-29 10:41:05","The ADB shell says the column exists but the LogCat says otherwise ","<android><sqlite3>","0","2","","",""
"3971087","1","3971319","","2010-10-19 17:38:50","8","1825","<p>Im displaying contact details on a screen. I need to display phone call window to appear when user clicks on phone number in the contact details.</p><p>Please let me know How i can do this</p><p>Thanks in advance</p>","341443","","","","","2013-07-21 13:28:33","How to display phone call window when click on phone number text","<android>","2","0","1","",""
"3971248","1","3971394","","2010-10-19 18:02:28","3","1185","<p>I have two appWidgets, now if user open ""Add widget"" dialog, both widgets will be visible in main list. But bundled HTC widgets are grouped by subject. For example clicking on ""Calnedar"" will bring another list, where user can pick desired design.</p><p>Is it possible to reproduce such feature or it is some feature hardcoded to Sense ?</p><p>Thanks!Andrew</p>","433242","","","","","2010-10-19 18:20:59","How to group widgets in ""Add widget"" dialog","<android><list><appwidget>","1","0","1","",""
"3971314","1","3971888","","2010-10-19 18:10:47","0","621","<p>is there a way to reprompt the user to choose a default activity for an intent? For example, user selects his default home apk and I want him to reconsider his choice once again.</p><p>I know how to do that on 2.1 and before, but is there a way to do that now on 2.2? </p><p>Famous Home Switcher, which did similar thing, does not work on 2.2 anymore thanks to google team</p>","473725","","473725","","2010-10-19 19:25:09","2011-07-13 19:51:23","re-prompt to choose default activity","<android><user-preferences>","2","3","","",""
"3971360","1","3972550","","2010-10-19 18:16:23","1","1751","<p>How to get image coordinates at mouse hover position.</p><p>Please let me know </p><p>Thank you</p>","341443","","341443","","2012-07-12 13:02:17","2012-07-14 17:05:01","how to know the coordinates of image when touch ","<android>","4","3","","",""
"3971384","1","3971894","","2010-10-19 18:19:49","0","1145","<p>You can manage wifi connectivity, and you can kind of manage 3G, but what about 4G, more specifically WiMAX? I saw an API on ClearWire's website, but I am not sure if Google is planning to include WiMAX as part of the SDK. Does anyone have an insight? I am  looking for connect/disconnect functionality, failover connection settings, etc. Thanks!</p>","2341","","","","","2010-10-19 19:20:15","managing wimax in android","<android>","1","0","","",""
"3971467","1","3971953","","2010-10-19 18:30:16","0","1193","<p>Beginning with a basic approach -- Options Menu.</p><p>Question: What is the best way to capture a <em>cancel</em> (return) event? I.e. the user changes their mind and hits the back arrow. The issue is that I would like to <em>unpause</em> my an application thread.</p><pre><code> @Override public boolean onCreateOptionsMenu(Menu menu) {  onPause();  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.game_menu, menu);  return true; } @Override public boolean onOptionsItemSelected(MenuItem item) {  // Handle item selection  switch (item.getItemId()) {  case R.id.preferences:   Intent settingsActivity = new Intent(this, PreferencesActivity.class);   startActivity(settingsActivity);   return true;  case R.id.quit:   finish();   return true;  default:   return super.onOptionsItemSelected(item);  } }</code></pre><p>Is there something like @Override onCancelOptionsMenu ??</p>","478044","","234039","","2010-10-19 19:25:26","2013-08-21 10:50:55","Options Menu Cancel Event [Android]","<android><event-handling><menu>","2","0","","",""
"3971471","1","3971792","","2010-10-19 18:30:36","0","908","<p>So I'm writing an android app, and I have an xml parser class that parses my xml files and builds me a tree</p><p>I want to reuse my xml parser code for different xml files</p><p>However, having problems with getXml(resourceID) not working:</p><pre><code>public class myactivity extends Activity {  public void someMethod()  {    Xmlparser myparser = new Xmlparser();    myparser.parseXML(this.context, R.xml.somedata);  }  public void someOtherMethod(){    Xmlparser adifferentparser = new Xmlparser();    adifferentparser.parseXML(this.context, R.xml.differentdata);  }}public class Xmlparser{import java.io.IOException;import java.util.Vector;import org.xmlpull.v1.XmlPullParserException;import android.content.Context;import android.content.res.Resources;import android.content.res.XmlResourceParser;private XmlResourceParser xrp;  public String parseXML(Context cont, int resourceID){    xrp = cont.getResources().getXml(resourceID);  //xrp = cont.getResources().getXml(R.xml.differentdata); // this works, but isn't any good for code reuse!  }}</code></pre><p>When I hard code it with a resource ID, it works (e.g.  getXml(R.xml.differentdata)), but not when I pass a resource ID as an int to the method in the class where I know what xml file I want to use (as in the code snippet above)</p><p>I could create the XmlResourceParser object in the activity class, get the xml file and then pass that XmlResourceParser object into my Xmlparser but  that'd be solving the wrong problem, which is how to pass a resource ID</p>","480829","","","","","2010-10-19 19:09:29","Android: Passing Resource ID as an int","<android><xml><resources>","1","0","","",""
"3971561","1","","","2010-10-19 18:43:02","0","1527","<p>Is it possible to record video in a service, that is without setting the setPreviewDisplay?I tried it on a HTC Desire, however it is throwing this info in the log,</p><p>MediaRecorder Prepare Failed: -1</p><p>CameraInput No surface is available for display</p><p>Is there some additional properties to be set?</p>","13046","","13046","","2010-10-19 18:56:51","2014-03-14 14:18:09","Record Video in a Service","<android>","3","2","","",""
"3971832","1","3972048","","2010-10-19 19:12:46","1","4197","<p>I have a JS file that has functions to search a document for substrings.</p><p>I want to access functions inside this file by passing parameters to it (the search keyword).</p><p>I know we can use .loadUrl(""javascript:~~~~~) but I'm not clear on how to do it using multiple functions.</p><p>Anyone who can point me in the right direction?</p><p>Thanks!</p>","392178","","","","","2011-01-23 22:50:29","Android - Loading an external .js file into a webview then accessing it's functions?","<javascript><html><android><search><webview>","1","0","6","",""
"3972113","1","3972251","","2010-10-19 19:46:01","2","3366","<p>I want to display about one or two full screens worth of text in an Android application (like a welcome screen or help screen), and I'm trying to figure out the best way of storing that text in the app. The text does not need formatting, but line breaks and empty lines must be preserved.</p><p>So far I have come up with the following alternatives:</p><ol><li>Store the text in a long string in an XML file in <code>res/values</code>, access it like any other string and display it in a <code>TextView</code>. But then what is the proper way of handling line breaks, etc?<li>Store it in a text file in <code>res/raw</code>, read that from the application and display it in a <code>TextView</code>. Again, do I need to consider line breaks, etc, in this case?<li>Store it in an HTML file and display it in a <code>WebView</code>. Then how and where should I store the HTML file?</ol><p>And there are likely more ways that I haven't thought of yet.</p><p>Is there a common way of achieving this? I would greatly appreciate sample code as well!</p>","5039","","","","","2010-10-19 20:02:34","How to display large amounts of text on Android","<android>","1","1","4","",""
"3972141","1","","","2010-10-19 19:49:02","2","6429","<p>What I'd like to do is sending a HTTP POST request to a REST webservice. However it seems as if my applicaion cannot connect to the host. The application throws the following exception when sending the request:</p><pre><code>10-19 18:54:05.335: VERBOSE/SD(280): java.net.UnknownHostException: http://www.myhost.com10-19 18:54:05.335: VERBOSE/SD(280):     at java.net.InetAddress.lookupHostByName(InetAddress.java:513)10-19 18:54:05.335: VERBOSE/SD(280):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:280)10-19 18:54:05.335: VERBOSE/SD(280):     at java.net.InetAddress.getByName(InetAddress.java:310)</code></pre><p>The host definitely exists and the URL provided is correct. Also I'm able calling the URL using the browser of the Android emulator. The application contains the following in the AndroidManifest.xml:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>Has anybody ever experienced something similar?</p><p>Greetings,Robert</p>","478406","","","","","2012-01-16 10:56:08","Android: UnknownHostException when sending HTTP POST","<android><http><exception>","1","1","1","",""
"3972142","1","","","2010-10-19 19:49:13","1","874","<p>I'm trying to change the font of web pages loaded in to a Browser app developed for Android. Currently my custom font is hosted in a URL &amp; I access the font from there by injecting a JavaScript to the page to change the style sheet (CSS) font face.</p><p>Here is the current code:</p><pre><code>var css = '@font-face {font-family: ""dhanika""; src: url(http://www.sample.lk/DhanikaWeb.ttf);} si {font-family: ""dhanika""}';var style = document.getElementsByTagName(""style"")[0];style.appendChild(document.createTextNode(css));</code></pre><p>This code works perfectly. But it takes some time to load the font from the URL. And also it is not good to load the font each time since it may incur data charges.</p><p>Therefore I wanna know weather there is a method to access my custom font from the JavaScript, if I place my font in my app's 'Assets' folder. Glad if anyone can provide the code.</p><p>Any help is appreciated!</p>","471349","","","","","2011-02-15 23:10:11","Access CSS fonts from Android 'Assets' folder","<android><css><browser><font-face><assets>","1","1","","",""
"3972183","1","5811782","","2010-10-19 19:53:39","6","661","<p>I'm developing a mobile web application and I have a home screen with a number of icons on it, so I tried to use a sprite to serve all the images in one swoop.</p><p>I noticed, however, that the iphone4 scaled the images in my sprite fairly well (they looked a little dithered), but on my HTC Evo the sprite rendered images look really blocky. I switched to standard images (background:(/image_url/) w/o background-position) and the image looked much better - see this <img src=""http://i.stack.imgur.com/zsjwS.png"" alt=""screen shot"">, where the left image is served using the single image, and the ones to the right of it are served from the sprite (but are the same images in the sprite).</p><p>Is there a way to get the Android browser to interpret the sprites better? </p>","273973","","1401895","","2013-03-27 13:07:50","2013-03-27 13:07:50","Android Web Browser Scaling Works More Effectively for Images than Sprites","<android><mobile-website><css-sprites><android-browser>","2","0","1","",""
"3972279","1","4007792","","2010-10-19 20:07:18","0","521","<p>The built-in barcode scanner application on Android (based, I think, on zxing) reads QR Codes and launches that data into an application based on the leading text. For example, ""BEGIN:VCAL"" might launch a calendar application; ""http:"" might launch a browser.</p><p>How can I ""register"" my application so the OS (or the Barcode application) will call it for a specific type (i.e. leading characters) of QR Code text?</p>","29420","","1104926","","2011-12-19 14:10:46","2011-12-19 14:10:46","How can I register my application on Android to handle a ""type"" of QR Code ?","<android><qr-code>","2","0","","",""
"3972438","1","3972613","","2010-10-19 20:24:21","0","1041","<p>I have a navbar included in a linearlayout with another relativelayout as below. This relative layout forms the whole screen while the navbar is on top. I have added a button in the navbar and a listview which becomesvisible when the button is clicked. The problem is: when the button is clicked I am expecting the list to be displayed on top of the below screen contents while it is actually pushing down the contents of the screen and is not overlapping. I have tried relative layouts and framelayouts as in all the examples but with no luck. Please help:.</p><pre><code>&lt;LinearLayout android:orientation=""vertical""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:layout_alignParentTop=""true"" android:background=""@drawable/xxx""&gt;&lt;include android:id=""@+id/navbarx"" layout=""@layout/navbar"" /&gt;&lt;&lt;&lt;-- has the button and the listview for it.&lt;RelativeLayout android:layout_width=""fill_parent""android:layout_weight=""1"" android:layout_marginTop=""10dp""android:layout_height=""0dp"" android:layout_gravity=""top|fill""&gt;&lt;ListView android:id=""@android:id/list""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:background=""#00ffffff"" android:layout_marginLeft=""14dp""android:layout_marginRight=""5dp"" android:layout_marginTop=""10dp""android:layout_marginBottom=""40dp"" android:drawSelectorOnTop=""true""android:divider=""#00ffffff"" android:listSelector=""@drawable/yyy""android:scrollbarThumbVertical=""@drawable/vertical_slider""android:headerDividersEnabled=""false"" android:layout_alignParentTop=""true"" android:layout_alignWithParentIfMissing=""true""/&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;""</code></pre>","480798","","480798","","2010-10-19 20:32:29","2010-10-19 20:45:19","I have a problem with overlapping views in android appication","<android>","1","0","","",""
"3972445","1","3972873","","2010-10-19 20:25:02","10","11773","<p>I'm trying to create a drawable on the fly to use as a background for a custom linearlayout. It needs to have hash marks and such (no big deal), but also have numbers labeling what the hash marks are (like a ruler). I know I can just create text elements and put them inside the linearlayout and just have the hash marks in the drawable, but I'm hoping to have them inside the drawable as well, so I don't have to do measurement calculations twice.</p>","443659","","","","","2012-01-12 06:52:43","How to put text in a drawable?","<android><drawable>","2","0","5","",""
"3972540","1","","","2010-10-19 20:35:29","1","694","<p>Based on the results of my query in <a href=""http://stackoverflow.com/questions/3901796/how-to-access-podcast-metadata"">this thread</a>, I've decided that I need to maintain my own database of metadata for the media that I'll be accessing. It seems like MediaStore is a very good start for this, as it will give me a good deal of information and is regularly updated by the MediaScanner. In an ideal world, I would add a few columns to the MediaStore database and modify the MediaScanner to scan the relevant sources of metadata to update those columns (ideal for me - maybe not ideal in terms of resource allocation).</p><p>For those who understand the way media is stored in Android - what are my options? Should I create my own ContentProvider database or is there a way to do something akin to adding a table to the MediaStore database (i.e. a new table with entries corresponding to every relevant ID and columns for each new piece of information I'd like to store)? Is there a way to ask the MediaScanner to update my database when it is updating the normal media database, and if so would that be considered bad form (i.e. should I wait until my app is opened to update my database)?  What are the best practices for something like this?</p>","467366","","","","","2011-02-04 09:57:40","Proper way to maintain an extended android media database a la MediaStore?","<android><database><media><podcast><mediastore>","1","0","","",""
"3972581","1","3973264","","2010-10-19 20:40:55","1","1315","<p>I want to add an alarm, so I used the following code:</p><pre><code>    public void SetAlarm(Alarm alarm){    mTimeTarget = PendingIntent.getBroadcast(mContext, alarm.getRowID(),             new Intent(HomeScreen.ACTION_CHECK_TIME_ALARMS), PendingIntent.FLAG_UPDATE_CURRENT);    mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, alarm.getAlarmTime().toMillis(true), mTimeTarget);}</code></pre><p>But this doesn't seem to work. (I tried on the emulator, and when the timecomes, nothing happens - my onReceive function on my class that extends BroadcastReceiver isn't called).</p><p>Here is how I initialized mAlarmManager on the constructor (it is private because this class is singleton):</p><pre><code>    private AlarmsManager(Context con){    mContext = con;    mAlarmManager = (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);}</code></pre><p>Any idea what I did wrong?Thanks!</p>","480978","","","","","2010-10-19 22:22:02","Android AlarmManager set function doesn't work?","<android><alarm><alarmmanager>","1","0","","",""
"3972850","1","","","2010-10-19 21:18:37","1","796","<pre><code>locationManager = (LocationManager)context.getSystemService(context.LOCATION_SERVICE);Location location = locationManager.getLastKnownLocation(locationManager.NETWORK_PROVIDER);Geocoder geocoder = new Geocoder(context);List &lt;Address&gt; myLocation = null;try {myLocation = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(), 1);        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }</code></pre><p>The log is below:</p><pre><code>LocationMasfClient: reverseGeocode(): GLS failed with status 20</code></pre><p>I can not find the reason.</p>","481013","","473070","","2010-12-22 16:26:58","2010-12-22 16:26:58","GLS failed with status 20 -Android Get User Location","<android><gps><location>","1","0","","",""
"3972869","1","3973291","","2010-10-19 21:21:21","1","1083","<p>Firstly, I realize this doesn't follow any particular convention.  I'm just wondering if it is possible.</p><p>I'd like to give my users the ability to perform an action on many items in a ListView.  My ListView items already contain a checkbox for something different; and adding another checkbox is not an option (it would look ugly?).</p><p>I was wondering if it's possible to programmatically highlight multiple items by determining which items were covered by a two-finger swipe.</p><p>This would require a few things:</p><p>1) Android's ListView would have to be capable of determining the difference between a two-finger swipe and a single-finger swipe.2) I would need to be able to clarify which code a two-finger swipe invokes.3) Ideally, if I'm two-finger swiping, and my fingers reach the bottom of the screen, the ListView would begin scrolling; so I could continue to highlight items that are originally off the screen.4) The ListView would have to be capable of highlighting more than one option.</p><p>Number 4 could probably be hacked around so long as I could determine which items were passed over with the two-fingers.  I could hack together my own ""selection.""  After doing this, I would provide some functionality via the Menu button to do something to these highlighted items.</p><p>Does any of this seem possible?  What do you think?</p>","406790","","","","","2010-10-19 22:28:14","ListView and multi-touch gestures","<android><listview><gesture>","1","0","","",""
"3972876","1","","","2010-10-19 21:22:05","1","1074","<p>I've extended ViewGroup to achieve something like a FlowLayout.  I put my custom ViewGroup into a ScrollView, dynamically add a bunch of content and it doesn't scroll.  The content that flows off the screen is not viewable.</p><p>What am I missing, how can I allow my ViewGroup to be compatible with ScrollView?</p>","357951","","","","","2010-10-19 21:36:39","My custom ViewGroup doesn't scroll inside a ScrollView","<java><android><scrollview><flowlayout>","1","0","","",""
"3972912","1","","","2010-10-19 21:26:28","3","2214","<p>is it possible to know which direction the phone is pointing while looking at the camera preview, or do you have to have the phone flat like a compass.</p><p>Thanks</p>","481021","","","","","2011-06-05 16:20:22","Android direction sensor","<android><sensor><direction>","1","1","1","",""
"3972919","1","3973353","","2010-10-19 21:27:16","3","137","<p>i developed a home screen widget.  the first release was tested on a nexus one, htc evo 4g and motorola droid.  worked fine.  after release in the android market, someone reported that it didn't work on a samsung fascinate (galaxy s).  it turns out there are 2 incompatibilities (bugs?) with the galaxy android implementation.  one is with layout and the other with intent handling.</p><p>they're easy enough to work around, but where should something like this be reported?</p>","310300","","310300","","2010-10-27 17:54:52","2010-10-27 17:54:52","where should incompatibilities with different android devices be reported?","<android><android-compatibility>","2","3","1","",""
"3972945","1","4001019","","2010-10-19 21:29:14","10","21831","<p>I have a two layouts files in my app. Also I have Activity extends ListActivity. Every item of this activity looks consider item.xml layout file. I am trying to get context menu when make long presss on item, but I don't see it.</p><p>In my activity I trying to registerForContextMenu(getListView()) and override two methods</p><pre><code>  @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Bundle bundle = this.getIntent().getExtras();        registerForContextMenu(getListView());        new PopulateAdapterTask().execute(ACTION_SELECT);        }    @Override        public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {            MenuInflater inflater = getMenuInflater();            inflater.inflate(R.menu.context_menu, menu);        }        @Override        public boolean onContextItemSelected(MenuItem item) {            AdapterView.AdapterContextMenuInfo info;            try {                info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();            } catch (ClassCastException e) {                return false;            }            long id = getListAdapter().getItemId(info.position);            Log.d(TAG, ""id = "" + id);            return true;        }</code></pre><p>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""            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;ListView                    android:id=""@+id/list""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    /&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;     &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""        &gt;    &lt;ImageView            android:id=""@+id/icon""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            /&gt;    &lt;TextView            android:id=""@+id/info""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:padding=""10dp""            android:textSize=""15sp""            android:singleLine=""true""            android:ellipsize=""marquee""            android:scrollHorizontally = ""true""            android:maxWidth=""200dp""            /&gt;    &lt;LinearLayout             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             android:gravity=""right""            &gt;        &lt;ImageButton                android:id=""@+id/button""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:background=""@null""                android:paddingRight=""10dp""                                android:paddingLeft=""10dp""                /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>All this doesn't work. Maybe the reason is in LinearLayout? I also find similar topic <a href=""http://stackoverflow.com/questions/2890529/android-context-menu-doesnt-show-up-for-listview-with-members-defined-by-linear"">http://stackoverflow.com/questions/2890529/android-context-menu-doesnt-show-up-for-listview-with-members-defined-by-linear</a> but I have more complicated list item.</p><p>How to get context menu in my case? </p><p>Also in my activity I have inner class extends ArrayAdapter. In this class in getView method I can set OnCreateContextMenuListener on every View, after that context menu is appears, but I don't know how to handle items clicks. If I am trying to do this in method onContextItemSelected, item.getMenuInfo() object always is null and i can't to get some information from it.</p><pre><code>private class ChannelAdapter extends ArrayAdapter&lt;Channel&gt; {        private List&lt;Channel&gt; channels;        public ChannelAdapter(Context context, int textViewResourceId, List&lt;Channel&gt; objects) {            super(context, textViewResourceId, objects);            this.channels = objects;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.station_item, null);            }                v.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {                    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {                        MenuInflater inflater = getMenuInflater();                        inflater.inflate(R.menu.context_menu, menu);                    }                });</code></pre><p>Thanks. Hope for your help.</p>","423868","","","","","2014-02-20 01:34:16","Custom ListView and context menu. How to get it?","<android><listview><layout><contextmenu>","6","0","10","",""
"3972988","1","","","2010-10-19 21:34:48","0","219","<p>Is it possible to access a webservice through an Android app? So basically a user would be purchasing access to the site by paying for the app? Then deploy rich content to the user through the browser? If so, is it then possible to authenticate who has access to the site from the webserver without the need for signin or signup?</p>","476990","","","","","2010-10-19 21:48:59","Delpoying a web service as an app for android?","<android>","2","0","","",""
"3973092","1","3973409","","2010-10-19 21:52:19","0","477","<p>Here's scenario. Say I have an app that I was using and navigated from activity to activity so now there's some history there. Then I switched to another app so my first one is on the background. If I return to it I would be able to click ""Back"" to navigate the history and traverse 1st app steps.Now imagine that I also have a notification that when clicked will bring one of the activities of the first app. Currently when that happens and I hit ""Back"" I will return to the previous history stack. My requirement - if I call activity using notification then I should have no history, If I hit back, the app should simply exit. Is is doable and how?This is related to my <a href=""http://stackoverflow.com/questions/3473168/clear-the-entire-history-stack-and-start-a-new-activity-on-android"">other former question</a> which in the retrospect didn't really got the answer</p>","135946","","","","","2010-10-19 22:50:46","Android - nuke the previous app history","<android><notifications><history>","1","0","","",""
"3973202","1","3973442","","2010-10-19 22:11:31","0","407","<p>we are confused with designing interface file for android,we have made user interface with Absolute layout and used ""dip"" instead of ""px"" (for different screen size issue) ,but it looks like,Absolute layout  has been depreciated,and developer.android, recommends not to use Absolute layout</p><p>So other option we have is to use1.Linear layout2.Frame layout 3.Table LayoutBut we are unable to bring Combination of above layouts so,that we can make button/widgets to proper position we needHow do we make widgets to desired position of screen with above said layouts and making them compatible with different screen sizes we have in android deviceswould like to get a generic answer about same,</p><p>Tools used are: DrawDroid</p>","481049","","","","","2010-10-19 22:57:27","How to use combination of Layouts to get widgets at desired position","<android><layout><widget><uibuilder>","1","2","","",""
"3973208","1","3974565","","2010-10-19 22:12:51","7","10174","<p>I want to put an icon in the status bar when ever my application is running, including when it is running in the background. How can I do this?</p>","479886","","623518","","2012-05-01 12:21:08","2012-05-01 12:21:08","Icon in the status bar when application is running","<android><icons><statusbar><uistatusbar>","2","0","5","",""
"3973216","1","","","2010-10-19 22:14:17","1","232","<p>I am trying to launch a websearch using data input from a user.  The data is input through TextEdit boxes. Upon submission of the data, i would like my program to: 1) search for a specific webpage based on the user input 2)Find specific elements at the webpage 3) Display the webpage.</p><p>Here is an example:</p><p>User Input (in a non browser/webview page)           1) Store Name: Macey's 2)Zip Code: 77471 </p><p>In the background my program will:    1) Find the Macey's website    2) Find the store nearest zip code 77471    3) Load the Web page for the store nearest zip code 77471</p><p>Obviously there is a lot of error handeling, exceptions, ect that would go along with this. For the sake of making this example ""easy"" lets pretend that 1) A the Macey's main page exists 2)A sperate page for the 77471 store exists. 3)There is a link to the 77471 store on the Macey's main page. </p><p>I have the code for getting the user input variables and i know how to launch the webview.  What i dont know how to do is to search for the Macy's home page, then find the link i am looking for on the homepage and navigate to it.  Loading the webview is not the problem. Find the data is.  </p><p>Below is my current code. Right now i am setup so that the user will navigate to the webpage they are looking for but i would rather handle the searching for them, if it is possible. </p><p>public void InitializeWebView(){</p><pre><code>        portal = (WebView)findViewById(R.id.web_Portal);    WebSettings Settings = portal.getSettings();    Settings.setSavePassword(false);    Settings.setSaveFormData(false);    Settings.setJavaScriptEnabled(true);    Settings.setSupportZoom(true);    Settings.supportZoom();             portal.setWebViewClient(new WebViewClient(){    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {                view.loadUrl(url);                return true;                           }    });  </code></pre><p>}</p><p>public void searchAndShow(String Store, String zip){         portal.loadUrl(""http://www.google.com"");}</p>","481022","","","","","2010-10-20 05:10:49","Launch a background web search","<android>","1","0","","",""
"3973309","1","","","2010-10-19 22:31:03","3","390","<p>The Android ListView widget (2.2) has a default behavior that shrinks all the child views when the ListView scrolls.</p><p>I want to disable this behavior and do no shrinking of the child views so that they always remain the same size -- how can I do this?</p>","480738","","","","","2011-12-01 23:43:37","Android - Prevent ListView from shrinking child views","<android><listview><scroll>","1","4","1","",""
"3973319","1","3973383","","2010-10-19 22:34:23","1","146","<p>If you go into the standard Note pad accessory application, the first available note menu entry is going to be...  </p><pre><code>&lt;untitled&gt;</code></pre><p>My question is this:  Where is ""<code>&lt;untitled&gt;</code>"" coming from in the code?  The code is in the NotePad sample in the SDK if you want to built a project from existing source real fast.  I just can't find where ""<code>&lt;untitled&gt;</code>"" is spelled out anywhere in the source or resources.  </p><p>(Else, is this instead some kind of ultra low level string that Android's API hands to the GUI if there's nothing specified for a title?  Which can't be changed?)</p>","225626","","66708","","2010-10-19 22:43:33","2010-10-19 22:45:58","Android SDK sample app question:","<android><api><title>","1","0","1","",""
"3973415","1","3973524","","2010-10-19 22:51:58","1","685","<p>My question today relates to the android home screen and where it stores icon / widget positions.  Specifically, I am interested in accessing the positions and sizes of any icons that are currently being displayed.  I have, so far, been unable to find a method of retrieving the positions of other applications but i figure it must be possible in some way due to the presence of third-party home screen applications.</p><p>Ideally, I am hoping to query the positions of whatever is on the screen at the moment from a live wallpaper and adjust my rendering accordingly.</p><p>Thank you in advance for your time.</p>","481075","","","","","2010-10-19 23:10:12","Getting Home Screen Positions on Android","<android>","1","0","","",""
"3973427","1","3973453","","2010-10-19 22:54:28","0","709","<p>I created an Matrix object (like the math Matrix, a 4x4 block of numbers for instance) and it works fine, can set row,col,variable just fine, but, I cant have more than one of the same object, I have it creating an ArrayList of a dozen Matrix objects, each with the three variables, but when I call changeVar(Matrix x,int variable) and refresh the printout of the matrix, it changes all of the numbers to what i changed the variable to. So it looks like its just creating the same instance over and over, and if you change one, it changes them all, am i missing anything obvious?</p><pre><code>public class Matrices {    private static int row, col, value, newRow, newCol;    public Matrices(int row, int col, int value) {        this.value = value;        this.row = row;        this.col = col;    }    public static void setRow(int row) {        Matrices.row = row;    }    public static void setValue(int value) {        Matrices.value = value;    }    public static void setCol(int col) {        Matrices.col = col;    }    public static int getCol(Matrices x) {        return col;    }    public static int getRow(Matrices x) {        return row;    }    public static int getValue(Matrices x) {        return value;    }    public static Matrices changeValue(Matrices x, int value) {        newRow = getRow(x);        newCol = getCol(x);        return new Matrices(newRow, newCol, value);    }}</code></pre>","481082","","112500","","2013-07-25 09:44:37","2013-07-25 09:44:37","Creating an Object [multiple of same instance]","<java><android><object><matrix>","3","0","","",""
"3973446","1","3973628","","2010-10-19 22:57:53","2","2926","<p>I have been trying this for a week or so now.</p><p>I have followed the tutorial to get hello android working but while an AVD starts the program doesn't run.</p><p>I am running Windows 7 64 bit with eclipse 3.5.2 running adt 0.9.9 and SDK r7.</p><p>the sdk is installed in C:\android-sdk-windowseclipse is installed in C:\eclipse</p><p>What i can do:</p><ul><li>create an AVD (through console and the manager)</li><li>i can compile the code</li><li>Run my code (on automatic it will start an avd)</li></ul><p>Bad stuff that happens</p><ul><li>when i run my code on manual my running avd does not appear</li><li>when i run on automatic with my avd already started i get the error --> emulator: ERROR: the user data image is used by another emulator. aborting</li></ul><p>what i have tried</p><ul><li>using the correct version of eclipse (i started on 3.6)</li><li>reinstalling everything (inclusind deleting my work space)</li><li>starting the avd with wipe user data</li><li>changing the port for DDMS from 8600 to 8200 (suggested on another post)</li><li>adding the path to sdk tools to environment variables</li><li>SDK location in eclipse -> preferences -> andorid is C:\android-sdk-windows</li></ul><p>Beginning to pulll my hair out.</p><p>Can anyone help</p>","481085","","1039361","","2012-05-23 11:42:36","2013-03-15 22:10:48","Eclipse (with adt) won't see/recognize a running avd","<android><eclipse><sdk><adt>","2","4","2","",""
"3973475","1","3973515","","2010-10-19 23:02:36","0","632","<p>i am working on an application that send and get data from internet each 5 min</p><p>if i press home key and my app goes to background... it will still continue sending/getting data from internet? or i have to do something special?</p><p>thanks</p>","479886","","","","","2010-10-20 00:36:37","If my application goes to background, it still continue working? (sending/getting data from internet)","<android><background>","2","1","","",""
"3973522","1","3973682","","2010-10-19 23:10:02","4","4946","<p>I'm requesting data from my server and receive a string in the form of <code>2|bit.ly|1||1|</code> and <code>|</code> should be the seperator. </p><p>I though the following piece of code should do the work</p><pre><code>BufferedReader br = null;...br = new BufferedReader(new InputStreamReader(inputStream));...String line;String[] columns;ContentValues values;while((line = br.readLine())!=null) {    columns = line.split(""|"");    ...}</code></pre><p>but after the <code>line.split(""|"");</code> the colums contains 15 elements instead of expected 6. Taking a closer look at it's content reveals that each character in the string was stored in one array element. </p><p>Anyone having an idea, what's wrong with it? The code coming from server isn't encoded in any way in in the example I use only ASCII characters appear. </p>","455493","","12707","","2010-10-19 23:23:08","2010-10-19 23:38:41","Strange string split behaviour","<android><string><split>","1","0","","",""
"3973666","1","3976337","","2010-10-19 23:35:23","0","758","<p>I'm having troubles when I want show a JSON response. I extract correctly the strings but when there is characters like 'á' or '¿' instead of these ones appears 'Ãi' or 'Â¿'. I think that the response comes in non-UTF8 enconding, but I cannot find how to convert it.</p><hr><p>EDIT: I'm trying to do a GET request to this URL: <a href=""https://graph.facebook.com/me"" rel=""nofollow"">https://graph.facebook.com/me</a> to retrieve the info of my profile passing the access token.</p><pre><code>HttpGet get = new HttpGet(url);response = client.execute(get);</code></pre><p>To extract the response I do this:</p><pre><code>JSONObject json_object;response.getEntity().writeTo(ostream);json_object = new JSONObject(ostream.toString());String name = json_object.getString(""name"");Log.d(""NAME"",name);</code></pre><p>Note that I'm programming with Android SDK.</p><hr><p>Thanks.</p>","383628","","383628","","2010-10-21 08:31:27","2010-10-21 08:31:27","Getting strange characters from a JSON response from Facebook","<java><android><json><facebook><encoding>","1","3","","",""
"3973684","1","3973749","","2010-10-19 23:38:58","3","2919","<p>im following the tutorial from developers guide but i have a problem...</p><p>tutorial says: ""To clear the status bar notification when the user selects it from the Notifications window, add the ""FLAG_AUTO_CANCEL"" flag to your Notification object""</p><p>but... how i can add the flag to my notification?</p><p>notification doesn't have any kind of function to add flags.... then? how i can do it?</p>","479886","","","","","2012-04-05 11:05:23","How to add flags to a notification (status bar notification)?","<android><notifications>","2","0","1","",""
"3973738","1","","","2010-10-19 23:48:53","0","327","<p>This works great for files.  I marked the location needing refactoring to get it to work with a bitmap.  I can't seem to find a compatible ContentBody for .addPart.</p><p>The problem I am trying to solve is that I already have the image in an ImageView within an Activity, so rather than read it again from the SD cara, I want to pass it to  this method directly.  I will probably scale it while I am at it.</p><p>I found a clue in this code, however it does not appear to be Android compliant</p><pre><code>    Part[] parts = {            new FilePart(""pictureFile"", new </code></pre><p>ByteArrayPartSource(""pictureFile"",getBytes(bitmap))),        };</p><p>I'm so freak'n lost :(</p><p>Any Ideas? TIA.</p><pre><code>public JSONArray uploadUserPhoto(String fileToSend,  boolean isPrimary) {        String url = ""http://www.nationwidearbitrationandmediation.com/ia/android/uploadImage.php"";         JSONArray jsonArray = null;       try {             HttpClient client = new DefaultHttpClient();               client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);             HttpPost post = new HttpPost(url);             //try adding these             post.getParams().setParameter(""http.protocol.expect-continue"", false);             post.getParams().setParameter(""http.protocol.content-charset"", ""UTF-8"");              post.getParams().setParameter(""http.protocol.reject-relative-redirect"", false);             MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);               reqEntity.addPart(""ip"", new StringBody(Boolean.toString(isPrimary), ""text/plain"", Charset.forName( ""UTF-8"" )));               /***  NEED HELP HERE ****/             File fileToUpload = new File(fileToSend);          //get file from name             Log.d(TAG,""FileSize: "" + fileToUpload.length());   //good time to test if file is larger than maxFileSize             FileBody fileBody = new FileBody(fileToUpload, ""image/jpg"");             reqEntity.addPart(""uploadedfile"", fileBody);             /*****  DONE *****/             post.setEntity(reqEntity);               HttpResponse response = client.execute(post);               HttpEntity resEntity = response.getEntity();              String serverResponse = EntityUtils.toString(resEntity);             client.getConnectionManager().shutdown();             Log.i(""RESPONSE"",serverResponse);             return  new JSONArray(serverResponse);    } catch (Exception e) {        Log.i(TAG,""Error: "" + e.toString());        return jsonArray;    }</code></pre><p>} //uploadUserPhoto</p>","465199","","465199","","2010-10-20 01:44:05","2012-01-25 23:37:56","Help Refactoring working method To Load BitMap (Instead of File) To PHP Server ","<android><file-upload><bitmap><imageview>","2","0","","",""
"3973815","1","","","2010-10-20 00:03:55","1","381","<p>I get such stack trace:</p><pre><code>android.database.sqlite.SQLiteException: no such table: someTa???: , while compiling: SELECT COUNT(*) FROM someTa??? WHERE a = ? AND b = ?    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)    at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)    at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:64)    at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:80)    at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:46)    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)    at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)</code></pre><p>Notice that the SQL is corruped, instead of <strong>someTable</strong> I see <strong>someTa???</strong>, where ? stands for char 0x1A. This happens only sometimes (very rare).</p><p>I create SQL query string using StringBuilder and String.format. </p><p>The question is who is corrupting memory? Is this Android runtime, or SQLite? May be this is a known bug?</p>","62192","","","","","2010-10-20 00:03:55","Corrupted memory. SQLite or Android bug","<android><sqlite><memory-corruption>","0","4","","",""
"3973848","1","3973857","","2010-10-20 00:12:41","1","457","<p>As a developer What are your thoughts on UI design when Developing 1 mobile app for both iPhone and android..</p><p>Since the application will not be developed for a specific mobile device there are two options in regards to UI</p><ol><li><p>build the application using native UI (one for iphone, another for android)</p></li><li><p>build the application using custom UI (same custom UI graphics used for both iphone and android). (like paypal?)</p></li></ol><p>Which option is best and why? (saves time, looks and feels better? Etc)</p>","103264","","103264","","2010-10-20 00:23:33","2010-10-20 00:23:33","UI design when Developing 1 mobile app for both iPhone and android","<iphone><android><user-interface><graphics><mobile>","1","0","","",""
"3973862","1","3974040","","2010-10-20 00:17:08","2","1199","<p>How can i do a notification in the status bar but without the expanded message in the ""Notifications"" window?</p><p>i mean, i need just the icon, nothing more</p><p>there is a way to do that?</p>","479886","","","","","2010-10-20 01:06:46","How can i do a notification in the status bar without the expanded message in the ""Notifications"" window? (only want the icon)","<android><notifications><statusbar>","1","1","","",""
"3973882","1","3974010","","2010-10-20 00:22:15","0","371","<p>I want to center the application title/label in my Android app but I can't find a lot of documentation on how to set that property.  I have found a couple of posts saying that I can create a custom title bar and change the theme in my manifest but I just can't help thinking there is a simpler way to just center the title.</p>","387952","","2153784","","2011-08-30 00:29:06","2011-08-30 00:29:06","Properties for application specific attributes in Android","<android><android-manifest><android-titlebar>","2","0","","",""
"3974334","1","","","2010-10-20 02:32:37","1","1639","<p>i'm using the default way to call the contact picker. </p><p><pre><code>public void showContactPicker(View view){    Intent newIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);    startActivityForResult(newIntent, 1);}</pre></code></p><p>but i need to select multiple contacts using checkboxes. how can i put checkboxes in the contacts list? is there a method that i can override that can add checkboxes and get the selected contact ids? thanks.</p>","481187","","","","","2010-10-27 02:14:47","android contact picker with checkboxes","<android><checkbox><contact>","1","0","","",""
"3974601","1","3975105","","2010-10-20 03:43:46","3","2025","<p>I want to develop a application on Android platform to connect to salesforce. From what i have found salesforce provides service API's which can be used to connect to salesforce servers by creating a Web service from the client side application. </p><p>Salesforce developer site has examples of creating such a Web service by using Apache Axis as the SOAP client and using the WSDL file downloaded from the salesforce website. I want to know can this be done from Android platform? </p><p>Is there a version of Apache Axis ported for Android? I did some googling and could find that Android does not have a inbuilt SOAP client and usually Ksoap is used on Android. But I have also read that KSOAP doesnt support WSDL. </p><p>I have seen the above question asked before but quite a while ago, As Android platform has emerged eversince I want to know what is the current situation and options of doing this. </p><p>Also, Since I am new to Android and development on Android if anyone can direct me to a sample code snippet, which creates a Web Service from android to connect to salesforce, I would be higly grateful.</p><p>Thanks in Advance.</p><p>Edit: Is there any other way to develop an Salesforce client on Android without the above approach? I am running out of ideas :( </p>","452307","","452307","","2010-10-20 09:04:39","2010-10-20 15:56:32","Soap Client on Android to access Salesforce APIs","<android><web-services><soap><salesforce>","2","2","1","",""
"3974693","1","","","2010-10-20 04:07:29","2","1139","<p>I'm an Android noob teaching myself debugging in the Eclipse (Galileo 3.52) environment.</p><p>I have a little ""hello world"" app that runs fine in the emulator.   So now I want to practice debugging by setting breakpoints, looking at variablaes, etc.</p><p>But Run > Debug As... has nothing but a grayed-out ""(nothing applicable)"" entry.    What does that mean and how do I configure it to say ""Android application""?  </p><p>I'm guessing it has something to do with the Run > Debug Configurations dialog, but it's not obvious to me.</p><p>Thanks in advance.</p>","424690","","","","","2010-10-20 04:07:29","""Debug As..."" in Eclipse for Android","<android><eclipse><debugging>","0","4","1","",""
"3974779","1","","","2010-10-20 04:33:07","2","838","<p>I have developing apps with google map .I follow material from android developers site and some other guidelines .wen i run the program the icon only point to the location .in background no map view displayed.can any one help to me ?</p><p>Thanks in advanceRegardsLakshmanan.</p><p>Here is my source code,</p><p>public class MapPage extends MapActivity<br>{</p><pre><code>MapView mapView; MapController mc;GeoPoint p;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.icon);    HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);    GeoPoint point = new GeoPoint(19240000,-99120000);    OverlayItem overlayitem = new OverlayItem(point, ""Hola, Mundo!"", ""I'm in Mexico City!"");    itemizedoverlay.addOverlay(overlayitem);    mapOverlays.add(itemizedoverlay);    mc = mapView.getController();    String coordinates[] = {""1.352566007"", ""103.78921587""};    double lat = Double.parseDouble(coordinates[0]);    double lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint(        (int) (lat * 1E6),         (int) (lng * 1E6));    mc.animateTo(p);    mc.setZoom(1);     mapView.invalidate();}@Overrideprotected boolean isRouteDisplayed() {    return false;}}  java class :public class HelloItemizedOverlay extends ItemizedOverlay{  Context mContext; private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;(); public HelloItemizedOverlay(Drawable defaultMarker) {  super(boundCenterBottom(defaultMarker));  // TODO Auto-generated constructor stub } public HelloItemizedOverlay(Drawable defaultMarker, Context context) {    super(defaultMarker);     mContext = context;  } @Override protected boolean onTap(int index) {   OverlayItem item = mOverlays.get(index);   AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);   dialog.setTitle(item.getTitle());   dialog.setMessage(item.getSnippet());   dialog.show();   return true; } @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(); } public void addOverlay(OverlayItem overlay) {     mOverlays.add(overlay);     populate(); }}</code></pre>","450596","","846248","","2012-04-02 21:22:32","2012-04-02 21:22:32","Google map not displayed in my android application","<android>","2","1","2","",""
"3974805","1","3974839","","2010-10-20 04:38:35","0","805","<p>I was wondering if it is possible to intercept keyboard input on a global level on Android. For example a user types in text into an edittext (does not matter which application) I would like to access said text to check for certain words. Is this even possible with Android's security model (yes I am aware this kind of feature could be used for various wrong things too). </p><p>Thanks,<br>b3n</p>","395377","","","","","2010-10-20 04:48:58","Global keyboard input listener on Android","<android>","1","0","","",""
"3974827","1","3974865","","2010-10-20 04:44:05","66","58360","<p>In Javascript/jQuery, how can I detect if the client device has a mouse?  </p><p>I've got a site that slides up a little info panel when the user hovers their mouse over an item.  I'm using jQuery.hoverIntent to detect the hover, but this obviously doesn't work on touchscreen devices like iPhone/iPad/Android. So on those devices I'd like to revert to tap to show the info panel.</p>","77002","","","","","2014-04-08 00:22:51","Detecting touch screen devices with Javascript","<javascript><jquery><iphone><android>","11","7","33","",""
"3974848","1","4028110","","2010-10-20 04:50:46","0","2130","<p>i want to refresh my expandablelistview , but it seems there is no way to use notifyDataSetChanged()??</p><p>how can i refresh my expandablelistview?? thx</p>","422405","","","","","2010-10-26 21:17:23","android expandablelistview can not use notifyDataSetChanged()?","<android>","2","0","","",""
"3974873","1","3974965","","2010-10-20 04:55:54","1","634","<p>My android app sends data to a servlet every 10 seconds. the servlet receives the very first request and responds back. but the servlet doesn't receive the second set of data that the client sends after the next 10 seconds. could some one please tel me how do i go about doing this. is it something related to session?</p>","377337","","157882","","2010-10-21 15:39:03","2010-10-21 15:39:03","maintaining persistent http connection","<java><android><servlets><httpsession>","2","1","","",""
"3974891","1","3974936","","2010-10-20 04:59:15","1","170","<p>I want the row to be scale automatically. The effect of my code is really strange...</p><p>i can't post images, so image is here: <a href=""http://i.stack.imgur.com/NQfkO.jpg"" rel=""nofollow"">http://i.stack.imgur.com/NQfkO.jpg</a></p><p>the code:</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=""horizontal""android:background=""#FFFFF0""</code></pre><p>></p><pre><code>&lt;TextView    android:id=""@+id/number""    android:layout_width=""wrap_content""    android:layout_height=""60dip""    android:gravity=""center_vertical""    android:textSize=""25sp""    android:textColor=""#CBCBCB""/&gt;&lt;TextView    android:id=""@+id/label""    android:minHeight=""60dip""    android:maxHeight=""120dip""    android:layout_width=""220dip""    android:layout_height=""wrap_content""    android:layout_marginLeft=""5dip""    android:gravity=""center_vertical""    android:textSize=""25sp""    android:textColor=""#0f93b8""/&gt;&lt;TextView    android:id=""@+id/people""    android:layout_width=""fill_parent""    android:layout_height=""60dip""    android:gravity=""right""    android:textSize=""12sp""    android:textColor=""#CBCBCB""/&gt;&lt;/LinearLayout&gt;</code></pre>","478375","","","","","2010-10-20 05:08:52","android layout problem","<android><layout>","1","1","1","",""
"3975010","1","3975597","","2010-10-20 05:28:06","1","1339","<p>I'm trying to run a few test packages on my device through a shell script which runs every night and for that I need to run the adb reboot command. My problem is that the 'adb reboot' command does make the system reboot, but it never completes (I need to do a keyboard interrupt if I run it manually in order to issue another command) I was wondering if there is anyway I could make my script go to the next command after a certain fixed amount of time? What could be going wrong with the adb reboot command? Sorry if my question is vague.</p><p>Thanks.</p>","388025","","","","","2011-02-17 08:56:13","adb reboot doesn't complete","<android><bash>","1","0","1","",""
"3975084","1","","","2010-10-20 05:49:04","-1","225","<p>I want to add events ,ie add remainders to the calendar in android.</p><p>Is that possible?</p>","436663","","525478","","2012-09-20 08:52:08","2012-09-20 08:52:08","Adding events to a calendar in android","<android>","1","1","","",""
"3975141","1","","","2010-10-20 06:05:26","2","1583","<p>I have 1 imageButton and i want to hide that button after 5sec in oncreate method. Can anyone please help me</p>","481306","","1069068","","2013-03-19 14:36:30","2013-03-19 14:36:30","How to hide imagebutton?","<android>","3","0","","",""
"3975458","1","","","2010-10-20 07:07:55","1","105","<p>I am android fresher pls help me ,Pls gave me optimal solution of that problem..</p>","479110","","","","","2010-10-20 07:07:55","How to get content of email like as Email ID ,Subject ,Message body text,and Attachment in android?","<android>","0","0","","",""
"3975459","1","","","2010-10-20 07:07:56","0","1428","<p>I want to ask that is that possible do in android catch the in the touch mode catch the scrolling direction ? When user touch on the screen left to right, can I catch the change ?If it is possible which listener can i use ?</p><p>I found some of the methods and listeners but I 'm not sure that therse are represent my requirement .<a href=""http://developer.android.com/reference/android/text/method/Touch.html"" rel=""nofollow"">http://developer.android.com/reference/android/text/method/Touch.html</a></p><p>Public Methodsstatic int  getInitialScrollX(TextView widget, Spannable buffer)static int  getInitialScrollY(TextView widget, Spannable buffer)</p><p>If these methods enough, is there any example that including these methods?</p><p>Thanks </p>","461922","","","","","2010-10-20 07:22:10","Get the touch direction on Android","<android><touch><listener>","2","0","","",""
"3975548","1","3975744","","2010-10-20 07:20:22","3","2386","<p>How much HTML5 android 2.2 's browser supports?</p><p>Is there any place/doc where I can find that what all HTML5 tags are supported by android 2.2 browser.</p><p>Thanks for help.</p>","148869","","","","","2010-10-20 07:49:38","How much HTML5 android browser supports?","<android><html5><webkit>","2","0","","",""
"3975550","1","3975944","","2010-10-20 07:20:25","8","16921","<p>HI I need to change the application title as when i move to new tab.</p><p>i tried to change the app_name with varying string in string.xml but that is not actual dynamic change that i want.</p><p>is there any alternative way of doing this?</p>","286831","","","","","2011-09-09 07:15:29","Android How to change the application title","<android>","3","0","0","",""
"3975616","1","","","2010-10-20 07:30:25","1","1729","<p>Can you help me play Robot Unicorn Attack on my Android phone?</p><p>I downloaded the .swf file, put it on my phone and there is this app called SWF Player that can open SWF files from the SDCard. But, since I don't have a hardware keyboard, I can't play the game because I have no chance pressing X or Z (I heard even with a hardware keyboard you're not able to do this though...).</p><p>No my idea is to write an App that offers an Overlay where you have a custom Gamepad that you can assign key events which are then dispatched to the SWF file. </p><p>But how to hell do I do this? I figured you probably need to use Air for Android...But I have not used it before and a short Google search could not show me how you could pass key events from Air to an SWF file. Any ideas?</p>","481366","","","","","2012-08-23 06:42:22","I want to play any Flash game on Android (as .swf file). How can I pass key events to a SWF app?","<android><flash><air><keyevent>","0","1","","",""
"3975680","1","","","2010-10-20 07:40:16","1","102","<p>I've published an app today mainly for my forum users to use, just avery simple app that displays wallpapers derived from the forum.</p><p>Problem I'm having is one guy says it doesn't appear in the market,and I've even sent him the APK to install manually but it fails.</p><p>My minimum SDK version is 4, I created it with the 1.6 SDK specifiedso not sure why he can't see it or install it.  He has a 1.6 Magichandset.</p><p>So just wondering if anyone has any ideas,  the app is called bocnwallpaper, it uses internet and set-wallpaper permissions.. but Iwouldn't have thought the permissions were the problem...</p><p>Thanks </p><p>My manifest is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      android:versionCode=""1""      android:versionName=""1.0"" package=""net.dbws.bocnwallpaper""&gt;    &lt;application android:icon=""@drawable/launcher_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;meta-data android:value=""xxxxx"" android:name=""ADMOB_PUBLISHER_ID"" /&gt;     &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.SET_WALLPAPER"" /&gt;&lt;/manifest&gt; </code></pre>","333276","","333276","","2010-10-20 12:15:43","2011-01-19 13:27:27","Confusion why a magic 1.6 user cannot find app on market","<android><google-play><magic>","1","1","1","",""
"3975703","1","","","2010-10-20 07:43:28","10","5189","<p>I want to do a listview on android and it contains an alphabet near of the list (like iphone application).</p><p>I couldnt find any way to implement an list and having alphabets, when i click on c letter list scrolling and  start with the c Letter.</p><p>Thanks</p>","461922","","","","","2011-09-22 05:59:28","ListView with Alphabet on Android","<android><list><listview><alphabetical>","4","4","3","",""
"3975847","1","3977390","","2010-10-20 08:05:55","9","2892","<p>my app downloads a zip with about 350 files. A mix of JPG and HTML files. The function i wrote to do it works just fine but the unzipping takes for ever.At first i thought the reason might be that writing to the sd-card is slow. but when i unzip the same zip with an other app on my phone it works much faster. is there anything that i could do to optimize it?</p><p>here is the code:</p><pre><code>private void extract() {    try {        FileInputStream inStream = new FileInputStream(targetFilePath);        ZipInputStream zipStream = new ZipInputStream(new BufferedInputStream(inStream));        ZipEntry entry;        ZipFile zip = new ZipFile(targetFilePath);                    //i know the contents for the zip so i create the dirs i need in advance        new File(targetFolder).mkdirs();        new File(targetFolder + ""META-INF"").mkdir();        new File(targetFolder + ""content"").mkdir();        int extracted = 0;        while((entry = zipStream.getNextEntry()) != null) {            if (entry.isDirectory()) {                new File(targetFolder + entry.getName()).mkdirs();            } else {                FileOutputStream outStream = new FileOutputStream(targetFolder + entry.getName());                for (int c = zipStream.read(); c != -1; c = zipStream.read()) {                    outStream.write(c);                }                zipStream.closeEntry();                outStream.close();                extracted ++;            }            publishProgress(""""+(int)extracted*100/zip.size());        }        zipStream.close();        inStream.close();        //        new File(targetFilePath).delete();    } catch (FileNotFoundException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }}</code></pre><p>thanks to CommonsWare i modified my code like this:</p><pre><code>                    int size;                byte[] buffer = new byte[2048];                FileOutputStream outStream = new FileOutputStream(targetFolder + entry.getName());                BufferedOutputStream bufferOut = new BufferedOutputStream(outStream, buffer.length);                while((size = zipStream.read(buffer, 0, buffer.length)) != -1) {                    bufferOut.write(buffer, 0, size);                }                bufferOut.flush();                bufferOut.close();</code></pre><p>big performance difference.Thanks a lot.</p>","457378","","457378","","2010-10-20 13:06:28","2013-08-01 11:04:52","Extrakting Zip to SD-Card is very slow. How can i optimize performance?","<android><zip><extraction>","1","0","2","",""
"3975989","1","3984505","","2010-10-20 08:27:23","3","1548","<p>I have this in my <strong>main.xml</strong></p><pre><code>&lt;com.adwhirl.AdWhirlLayout    android:id=""@+id/timer_ads""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true"" /&gt;</code></pre><p>And it always results in </p><p><strong>Binary XML file line #117: Error inflating class com.adwhirl.AdWhirlLayout</strong></p><p>and another interesting line says, <strong>Caused by: java.lang.NoSuchMethodException: AdWhirlLayout(Context,AttributeSet)</strong></p><p>Does it mean that I can't use the AdWhirlLayout from the xml?</p>","421372","","","","","2011-01-28 09:21:20","AdWhirlLayout problem","<android><layout><adwhirl>","2","0","","",""
"3976037","1","3977420","","2010-10-20 08:35:34","2","1941","<p>In my activity, I have an AutoCompleteTextView that gets its contents from my custom adapter.  I created my adapter by following <a href=""http://thinkandroid.wordpress.com/2010/02/08/writing-your-own-autocompletetextview/"" rel=""nofollow"">this example</a>.</p><p>The adapter works so far, but I am getting so many errors on leaks and cursors that are not finalized.  My question is: how do I close the db in runQueryOnBackgroundThread?</p><p>Here is my method:</p><pre><code>@Overridepublic 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(DbUtilities.KEY_SEARCH_TERM);        buffer.append("") GLOB ?"");        args = new String[] { ""*"" + constraint.toString().toUpperCase() + ""*"" };    }    final DbUtilities favsDB = new DbUtilities(context);    return favsDB.getAllRecents(buffer == null ? null : buffer.toString(), args);}</code></pre><p>I tried modifying it to this:</p><pre><code>final DbUtilities favsDB = new DbUtilities(context);Cursor c = favsDB.getAllRecents(buffer == null ? null : buffer.toString(), args);favsDB.close();return c;</code></pre><p>But I am getting the <code>Invalid statement in fillWindow()</code> error and the AutoCompleteTextView does not display the dropdown.</p><p>Here's how I set my adapter in my class, which by the way does not extend Activity but instead extends RelativeView (because I am using this to set the content of my tabs):</p><pre><code>AutoCompleteTextView searchTerm = (AutoCompleteTextView) findViewById(R.id.autocomp_search_what);DbUtilities db = new DbUtilities(mActivity.getBaseContext());Cursor c = db.getAllSearchTerms();AutoCompleteCursorAdapter adapter = new AutoCompleteCursorAdapter(mActivity.getApplicationContext(),     R.layout.list_item_autocomplete_terms, c);c.close();searchTerm.setAdapter(adapter);</code></pre><p>I cannot use <code>startManagingCursor()</code>, so I close the cursor manually.  But I still get the Cursor not finalized exception:</p><pre><code>10-20 16:08:09.964: INFO/dalvikvm(23513): Uncaught exception thrown by finalizer (will be discarded):10-20 16:08:09.974: INFO/dalvikvm(23513): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d63338 on search_terms that has not been deactivated or closed10-20 16:08:09.974: INFO/dalvikvm(23513):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)10-20 16:08:09.974: INFO/dalvikvm(23513):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>Any ideas on how I can resolve these errors?  Thanks!</p>","395576","","","","","2010-10-20 11:48:58","Crazy SQLite and cursor leak on AutoComplete","<android><sqlite><autocomplete><adapter>","1","0","1","",""
"3976091","1","3976143","","2010-10-20 08:45:00","0","122","<p>I came across through a presentation(<a href=""http://sites.google.com/site/io/dalvik-vm-internals"" rel=""nofollow"">dalvik-vm-internals</a>) on Dalvik VM, in that it is mentioned as for the below loops, we have <strong>use (2) and (3)</strong> and to <strong>avoid (7)</strong>.</p><p>(1) for (int i = initializer; i >= 0; i--)</p><p>(2) int limit = calculate limit;for (int i = 0; i &lt; limit; i++)</p><p>(3) Type[] array = get array;for (Type obj : array)</p><p>(4) for (int i = 0; i &lt; array.length; i++)</p><p>(5) for (int i = 0; i &lt; this.var; i++)</p><p>(6) for (int i = 0; i &lt; obj.size(); i++)</p><p>(7) Iterable list = get list;for (Type obj : list)</p><p>Comments: i feel that (1) and (2) are the same.(3)(4) every time it has to calculate the length of array, so this can be avoided(5) (6) same as (4), calculating the size everytime(7) asked to avoid as list is of an Iterable type??</p><p>one more, in case if we have infinite data(assume data is coming as a stream) which loop should we consider for better efficiency?)</p><p>request you to please comment on this...</p>","177303","","20402","","2010-10-20 08:48:11","2010-10-20 09:14:36","loops efficiency","<android><loops><performance>","3","2","0","",""
"3976206","1","","","2010-10-20 09:00:51","2","2917","<p>I am HTML/CSS/jQuery coder. And I need to develop the website, which will be ""zoomed-out"" or ""fitted"" to 320x480 (frequently used resolution) Android mobile device screen.Or even this solutions should check my screen resolution and connect the right CSS for that.Somewhere I met that there is android.js file, which connects to HTML and recognizes if the website was open on PC or on android device. But I am not sure at all. I didn't do anything for mobiles before.</p><p>Found this article: <a href=""http://blog.mgpwr.co.uk/2010/09/make-your-website-iphone-compatible/"" rel=""nofollow"">http://blog.mgpwr.co.uk/2010/09/make-your-website-iphone-compatible/</a>Don't think it's a right solution to use PHP for that.Better would be HTML or JS. </p>","481453","","","","","2013-02-08 09:55:50","How to build correctly Android-compatible website?","<iphone><android><mobile><mobile-website>","2","1","","",""
"3976223","1","","","2010-10-20 09:03:55","0","491","<p><a href=""http://pastebin.com/yCvtWtyQ"" rel=""nofollow"">full code</a><br />how do i access the parent activity's mail layout elements? In this case a button. I have it declared in main.xml. When a button in the listview is clicked, i want to change the text of the button in main.</p>","408412","","","","","2011-02-02 17:06:44","How to access an element present in parent view?","<android><activity>","1","0","","",""
"3976284","1","3977316","","2010-10-20 09:12:48","0","1105","<p>i am very new to programming in java however have a lot of experience in .NET (c# &amp; vb.net). </p><p>I am trying to create a new instance of a serversocket class in eclipse IDE and when i type the following code it is giving me an ""Unhandled exception type IOException"" and i havent even tried to run the code yet!!</p><p>I dont understand how my code is exceptioning before runtime or what i can do to fix it.</p><p>Can someone help me?</p><p>Offending code:</p><pre><code>ServerSocket server = new ServerSocket(1234, 5, InetAddress.getLocalHost());</code></pre>","96854","","","","","2010-10-20 11:35:33","Unable to create a ServerSocket in eclipse (java)","<java><android><eclipse><network-programming>","2","0","","",""
"3976389","1","","","2010-10-20 09:27:17","8","2664","<p>There are at least two methods to scale a bitmap in Android,One is to use ""inScaled, inDensity, inTargetDensity"" in ""BitmapFactory.Options"" when decode a bitmap source.The other is to use a ""Matrix"" in ""Bitmap.createBitmap"".</p><p>What I am curious is what the difference between these two method is?What about the quality of produced bitmap? And what about the memory usage?etc...</p>","316435","","1140748","","2012-05-06 16:42:40","2014-03-02 23:18:40","difference between methods to scale a bitmap","<android><matrix><bitmap><scale>","5","0","1","",""
"3976396","1","","","2010-10-20 09:28:37","0","1351","<p>I read <a href=""http://stackoverflow.com/questions/1944369/android-static-object-lifecycle-application-act-crazy"">this Article on StackOverflow</a>. According to this, static variables will be erased, if </p><ol><li>the class is unloaded</li><li>the JVM shuts down</li><li>the process dies</li></ol><p>But how to destroy / to kill my application (application process) and so to erase all static variables programmatically from my application?!</p><p>Thank you,</p><p>Mur</p><p><strong>UPD</strong></p><p>These static variables will be filled by reading some data from server. Here is a test workflow:</p><ol><li>I start application -> static variables will be filled</li><li>I go to home activity pressing back button -> finish() will be called</li><li>I turn off internet connection (I'm sure there is no connection)</li><li>Then I start application againg</li><li>Static variables are still filled </li></ol><p>Some Ideas? </p><p>Is there possibility to close all activities of an aplication? Will be application 'closed' in that case?</p><p>Ps. Yes, I know, it's not the best way to use static variables, but i'm not the the author of that application, I'm just fixing bugs and put some new features to it.</p>","408780","","408780","","2010-10-20 10:20:10","2010-10-20 10:42:14","How to erase static variables in Android","<android><static-variables><erase>","2","2","1","",""
"3976406","1","3976426","","2010-10-20 09:29:44","11","11864","<p>In my android app, I need to design a Welcome Screen which will be shown to the user only once after the app is installed and opened. The app in question is a database driven app and I would love to include some 3 - 4 screens to help the user create re-usable resources for use within the app and a few tips. They would be Dialog Alerts with the last welcome screen showing the ""Do Not Show Again"" checkbox.</p><p>The problem really is, how to show the welcome screen just once. Any help or pointers to that effect are much appreciated.</p>","450534","","114066","","2010-10-20 11:22:30","2010-10-22 11:00:23","How to display a one time welcome screen?","<android>","3","1","8","",""
"3976487","1","","","2010-10-20 09:40:27","1","2155","<p>using the API I am trying to create a contact, using the API 2.x and not the old one. Here <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> it only explains the old API. I haven't found any proper tutorial, example, etc. showing how to create a contact. As far as I have figured out I have to create a raw contact, under raw contacts I found h t t p : / / developer.android.com/reference/android/provider/ContactsContract.RawContacts.html (sorry for the ugly link I am only allowed to post one link...) from there I tried </p><pre class=""lang-java prettyprint-override""><code>ContentValues values = new ContentValues(); values.put(RawContacts.ACCOUNT_TYPE, accountType); //accountType = ""xxxx""values.put(RawContacts.ACCOUNT_NAME, accountName); //accountName = ""aaaa""Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values); long rawContactId = ContentUris.parseId(rawContactUri); values.clear(); values.put(Data.RAW_CONTACT_ID, rawContactId); values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE); values.put(StructuredName.DISPLAY_NAME, ""Mike Sullivan""); getContentResolver().insert(Data.CONTENT_URI, values);</code></pre><p>The last line of code shows that ""Data.CONTENT_URI"" cannot be resolved. It looks a little bit that this line of code is for the 1.6 API, I have changed the Data.CONTENT_URI to ContactsContract.Data.CONTENT_URI. At least the code compiles and executes, but I still don't have a contact Mike Sullivan in my addressbook afterwards. I exchanged now as well the other ""Data"" with ""ContactsContract.Data"" still no changes.</p><p>Has anyone an easy example how to create a person in the addressbook on 2.x?</p><p>Edit: I made some progress, it looks like that I always need an account on my phone to add a contact. My phone has account type com.google and account name xxxxx@gmail.com. The emulator has nothing. I wonder to which account I have to add my contacts? Can I assume that I ALWAYS have exactly one gmail account and take this one? </p><p>Thanks!</p>","481493","","2390083","","2013-10-11 19:19:56","2013-10-11 19:19:56","Android: Create Contact API 2.x","<android><contactscontract>","1","0","","",""
"3976515","1","5243978","","2010-10-20 09:43:02","16","2660","<p>I’m creating ContentProvider which is a proxy of another ContentProvider (for security issues and to give access to part of functionality of full app). </p><pre><code>public class GFContactsProvider extends ContactsProvider implements      DatabaseConstants {    private Context mContext;    private ContentResolver mContentResolver;    @Override     public boolean onCreate() {      mContext = getContext();      mContentResolver = mContext.getContentResolver();     }    @Override     public Cursor query(Uri uri, String[] projection, String selection,       String[] selectionArgs, String sortOrder) {     Cursor result = mContentResolver.query(ContactsContract.getContactsURI(Long.parseLong(address.get(1))), null, null, null, ContactsContract.ContactColumns.SHOW_NAME);  return result;     }    }</code></pre><p>After calling inner CP from my CP I recive unexpected exception:</p><pre><code>java.lang.UnsupportedOperationException: Only CrossProcessCursor cursors are supported across process for now</code></pre><p>The exception concerns the wrapping of the Cursor by the CP and transfer it wrapped, Outer CP can't wrap it again so I have a problem here. When I checked class of returned cursor I received CursorWrapperInner. Is there any way to unwrap cursor (from this CWI to regular Cursor) in my outer CP (but not by transfering all data to MatrixCursor in loop – it’s too time-consuming).</p>","481467","","82118","","2010-10-26 21:12:19","2011-03-09 09:51:41","Cursor Wrapping/Unwrapping in ContentProvider","<android><cursor><wrapping><android-contentprovider>","3","0","9","",""
"3976551","1","","","2010-10-20 09:48:17","2","2148","<p>Is there a process manager or task viewer for android that shows how much CPU percentage each process or even each thread in a process takes up?</p><p>Thanks!</p>","97688","","97688","","2010-10-26 10:14:48","2010-10-26 10:22:39","android: view cpu usage of processes","<android><performance><process><task>","1","0","","",""
"3976554","1","3977436","","2010-10-20 09:48:40","2","632","<p>I am trying to load an XML file from res/raw folder in my Android project when the app first runs. I do this with this line:</p><pre><code>InputStream xmlStream = getResources().openRawResource(R.raw.xmlfile);</code></pre><p>I then want to use a SAX Parser to get data from the XML file. When doing this LogCat shows the following error:</p><pre><code>Data exceeds UNCOMPRESS_DATA_MAX (1290892 vs 1048576)</code></pre><p>Is there anyway around this 1MB limit?</p><p>After a few Google searches, I found people who have split their files into 1MB chunks, but these weren't XML files so I am not sure how I would rejoin them before making the InputSource for my SAX Parser.</p><p>My file is not created by me, so I can't really edit it (although I may have to) and my code works if I retrieve it from Internet. Its around 1,300KB in size, so I want to not have to download it each time app run</p>","67419","","","","","2010-10-20 11:50:04","Is there a way to avoid size limit when using getResources().openRawResource()","<java><android>","1","0","1","",""
"3976557","1","","","2010-10-20 09:48:54","0","247","<p>I am using android and i have an array of bitmap and i want to show these bitmaps on a regular interval on canvas one after another at the same place/position.</p><p>can anyone suggesting me the road map to do this ?</p><p>Note:</p><p>My canvas has multiple bitmaps &amp; later on i will set this canvas a wallpaper.i am free to use animation to change bitmaps one after another</p>","405383","","405383","","2010-10-20 10:12:07","2010-10-20 10:12:07","show bitmap on a regular interval on canvas","<android><canvas>","0","2","","",""
"3976605","1","","","2010-10-20 09:56:13","1","444","<p>I have a srange trouble wit the ListView:I've created the compound control</p><pre><code>public class TopicControl extends LinearLayout....&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;LinearLayout        android:id=""@+id/llTopicHeader""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""    &gt;        &lt;Button             android:id=""@+id/btnTopicTitle""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:tag=""btnTopicTitle""        &gt;&lt;/Button&gt;        &lt;LinearLayout            android:id=""@+id/llTopicBar""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:visibility=""invisible""            android:tag=""llTopicBar""        &gt;            &lt;Button                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:background=""@drawable/bar_calendar""            &gt;&lt;/Button&gt;            &lt;Button                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:background=""@drawable/bar_person""            &gt;&lt;/Button&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;    &lt;TextView         android:id=""@+id/tvTopicText""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""    &gt;&lt;/TextView&gt;&lt;/merge&gt;</code></pre><p>In that control I implemented hiding/showing llTopicBar on btnTopicTitle click.</p><p>The problem is that when I add that component to ListView, after pressing btnTopicTitle, llTopicBar becomes visible not only for the clicked item, but for every <strong>second</strong> LstViewItem.</p><p>after adding ""parent"" verification llTopicBar becomes visible for every <strong>4th</strong> item in the ListView.</p><pre><code>Overridepublic void onClick(View v){    if (v.getParent().getParent() == getThis())    llTopicBar.setVisibility(llTopicBar.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE);}</code></pre><p>Could you please help me with that problem?</p>","481527","","","","","2010-10-20 10:09:13","android: Custom (compund) control in ListView","<android><listview>","1","0","","",""
"3976668","1","","","2010-10-20 10:04:27","2","4060","<p>How to add a new TextView to a layout in run time? is it possible?</p>","436765","","114066","","2010-10-20 11:26:28","2010-10-20 11:49:41","How to add TextView in Runtime?","<android>","2","0","2","",""
"3976728","1","4160989","","2010-10-20 10:11:42","7","17951","<p>I would like to use Charles web proxy to work with the Android emulator in Windows.  I've successfully set up charles and have started the emulator with the command line:</p><pre><code>emulator -http-proxy 127.0.0.1:8888 @NexusOne</code></pre><p>I can see traffic coming from the android emulator in Charles, but the problem is that I'm developing against a live API which uses SSL and I'm not sure how to configure Charles to let me play about the the data which is sent and received.  I'm aware of two areas where SSL is set up in Charles (Proxy -> Proxy Settings -> SSL and Proxy -> Client SSL Certificates) but I can't find any decent documentation which has let me do what I want to do.  Has anyone experience with Charles, or certificates in general, who can explain how to achieve this.  Maybe a primer on certificates would be good too, as I seem to be lacking knowledge as to why this is so difficult.</p>","264276","","627569","","2011-06-29 19:45:48","2014-03-07 21:45:11","How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?","<android><ssl><ssl-certificate><webproxy><charles>","5","0","10","",""
"3976752","1","3976827","","2010-10-20 10:15:00","0","812","<p>The spinning globe application unning on the emulator works on android 1.5 as target but puts out a ""force close application"" error in android 2.2 target. Where should i look to find the problem ?</p><p>I have enclosed the logcat details that I get,</p><pre><code>D/MediaScanner(  183):  prescan time: 4913msD/MediaScanner(  183):     scan time: 693msD/MediaScanner(  183): postscan time: 45msD/MediaScanner(  183):    total time: 5651msD/MediaScannerService(  183): done scanning volume internalI/PackageManager(   67): Removing non-system package:com.android.SpinningGlobeI/ActivityManager(   67): Force stopping package com.android.SpinningGlobe uid=10038D/dalvikvm(  127): GC_EXPLICIT freed 12963 objects / 655936 bytes in 168msD/PackageManager(   67): Scanning package com.android.SpinningGlobeI/PackageManager(   67): Package com.android.SpinningGlobe codePath changed from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk; Retaining data and using newI/PackageManager(   67): /data/app/com.android.SpinningGlobe-1.apk changed; unpackingD/installd(   34): DexInv: --- BEGIN '/data/app/com.android.SpinningGlobe-1.apk' ---D/dalvikvm(  255): DexOpt: load 214ms, verify 229ms, opt 5msD/installd(   34): DexInv: --- END '/data/app/com.android.SpinningGlobe-1.apk' success)---W/PackageManager(   67): Code path for pkg : com.android.SpinningGlobe changing from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apkW/PackageManager(   67): Resource path for pkg : com.android.SpinningGlobe changing from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apkI/ActivityManager(   67): Force stopping package com.android.SpinningGlobe uid=10038D/PackageManager(   67):   Activities: com.android.SpinningGlobe.GLAppI/installd(   34): move /data/dalvik-cache/data@app@com.android.SpinningGlobe-1.apk@classes.dex -&gt; /data/dalvik-cache/data@app@com.android.SpinningGlobe-1.apk@classes.dexD/PackageManager(   67): New package installed in /data/app/com.android.SpinningGlobe-1.apkI/ActivityManager(   67): Force stopping package com.android.SpinningGlobe uid=10038I/ActivityManager(   67): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=256 uid=10028 gids={}D/dalvikvm(  167): GC_EXPLICIT freed 3943 objects / 244424 bytes in 1708msD/dalvikvm(   67): GC_EXPLICIT freed 7297 objects / 468432 bytes in 667msW/RecognitionManagerService(   67): no available voice recognition services foundI/ActivityThread(  256): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProviderI/installd(   34): unlink /data/dalvik-cache/data@app@com.android.SpinningGlobe-2.apk@classes.dexD/AndroidRuntime(  118): Shutting down VMD/jdwp    (  118): adbd disconnectedI/AndroidRuntime(  118): NOTE: attach of thread 'Binder Thread #3' failedD/AndroidRuntime(  266):D/AndroidRuntime(  266): &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;D/AndroidRuntime(  266): CheckJNI is OND/AndroidRuntime(  266): --- registering native functions ---I/ActivityManager(   67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.SpinningGlobe/.GLApp }D/AndroidRuntime(  266): Shutting down VMD/jdwp    (  266): adbd disconnectedI/AndroidRuntime(  266): NOTE: attach of thread 'Binder Thread #3' failedI/ActivityManager(   67): Start proc com.android.SpinningGlobe for activity com.android.SpinningGlobe/.GLApp: pid=273 uid=10038 gids={1015}I/ARMAssembler(   67): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x32b4a0:0x32b5ac] in 3627836 nsD/libEGL  (  273): egl.cfg not found, using default configD/libEGL  (  273): loaded /system/lib/egl/libGLES_android.soD/dalvikvm(  273): GC_EXTERNAL_ALLOC freed 839 objects / 59328 bytes in 151msW/dalvikvm(  273): threadid=7: thread exiting with uncaught exception (group=0x4001d800)I/ActivityManager(   67): Displayed activity com.android.SpinningGlobe/.GLApp: 4870 ms (total 4870 ms)E/AndroidRuntime(  273): FATAL EXCEPTION: GLThread 8E/AndroidRuntime(  273): java.lang.IndexOutOfBoundsExceptionE/AndroidRuntime(  273):        at java.nio.IntArrayBuffer.get(IntArrayBuffer.java:63)E/AndroidRuntime(  273):        at com.android.SpinningGlobe.GLRenderer.onDrawFrame(GLRenderer.java:105)E/AndroidRuntime(  273):        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)E/AndroidRuntime(  273):        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)W/ActivityManager(   67):   Force finishing activity com.android.SpinningGlobe/.GLAppI/ARMAssembler(   67): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x33f9a8:0x33fa64] in 1258819 ns</code></pre><p>Any insights on where the problem could be ?</p>","454711","","3171","","2010-10-21 07:52:35","2010-10-21 07:52:35","Application works in Android 1.5 but not 2.2","<android>","2","0","","",""
"3976754","1","3976820","","2010-10-20 10:15:20","0","88","<p>I have a texture in my Square. The problem is when I assign floating texture points the image gets rotated 45 degrees at right. I want it without the rotation.</p><p>The current texture points:</p><pre><code>texture = new float[]{0.0f, 0.0f,0.0f, 1.0f,1.0f, 0.0f,1.0f, 1.0f,};</code></pre><p>Any ideas? Thanks in advance!</p><p>This is how it ends:</p><p><img src=""http://i.stack.imgur.com/zdfwK.png"" alt=""alt text""></p><p>This is how I want it:</p><p><img src=""http://i.stack.imgur.com/c9jyw.png"" alt=""alt text""></p>","386562","","386562","","2010-10-20 10:35:40","2010-10-20 10:52:42","Texture floating ponts - problem with rotation","<java><android><opengl-es>","2","0","","",""
"3976818","1","4182520","","2010-10-20 10:25:09","0","2252","<p>In my application I have a Tabbar and I am using ActivityGroup to load contents into each tab as shown below.</p><pre><code>public class FirstGroup extends ActivityGroup {        // Keep this in a static variable to make it accessible for all the nesten activities, lets them manipulate the view public static FirstGroup group;        // Need to keep track of the history if you want the back-button to work properly, don't use this if your activities requires a lot of memory. private ArrayList&lt;View&gt; history; @Override protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       this.history = new ArrayList&lt;View&gt;();       group = this;              // Start the root activity withing the group and get its view       View view = getLocalActivityManager().startActivity(""FlightsActivity"", new                   Intent(this,FlightsActivity.class)                   .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))                                      .getDecorView();              // Replace the view of this ActivityGroup       replaceView(view);    } public void replaceView(View v) {                // Adds the old one to history  history.add(v);                // Changes this Groups View to the new View.  setContentView(v); }</code></pre><p>i have an image inside the FlightsActivity activity class and on the onClick event of the image I need a datepicker to be displayed.I have written the code for that and it was working fine when I was directly specifying FlightsActivity as the content of the tab instead of loading it through the ActivityGroup.But now i am getting an error</p><pre><code>10-20 14:11:16.302: ERROR/AndroidRuntime(294): FATAL EXCEPTION: main10-20 14:11:16.302: ERROR/AndroidRuntime(294): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@43e497e0 is not valid; is your activity running?10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.view.ViewRoot.setView(ViewRoot.java:505)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.view.Window$LocalWindowManager.addView(Window.java:424)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.app.Dialog.show(Dialog.java:241)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.app.DatePickerDialog.show(DatePickerDialog.java:129)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.app.Activity.showDialog(Activity.java:2556)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.app.Activity.showDialog(Activity.java:2514)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at tabviewapp.com.FlightsActivity$10.onClick(FlightsActivity.java:166)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.view.View.performClick(View.java:2408)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.view.View$PerformClick.run(View.java:8816)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.os.Handler.handleCallback(Handler.java:587)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.os.Handler.dispatchMessage(Handler.java:92)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.os.Looper.loop(Looper.java:123)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at java.lang.reflect.Method.invokeNative(Native Method)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at java.lang.reflect.Method.invoke(Method.java:521)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-20 14:11:16.302: ERROR/AndroidRuntime(294):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Below is my code for implementing the datepicker:</p><pre><code>mPickDate = (ImageView) findViewById(R.id.pickDate);  mPickDate.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {             showDialog(DATE_DIALOG_ID);            }        });@Override protected Dialog onCreateDialog(int id) {     switch (id) {     case DATE_DIALOG_ID:         return new DatePickerDialog(this,                     mDateSetListener,                     mYear, mMonth, mDay);     case DATE_DIALOG_ID_RETURN:         return new DatePickerDialog(this,           mDateSetListenerreturn,                     mYear, mMonth, mDay);          }     return null; } // updates the date in the TextView    private void updateDisplay(TextView mDateDisplay) {        mDateDisplay.setText(            new StringBuilder()                    // Month is 0 based so add 1                   .append(mDay).append(""-"")                   .append(mMonth + 1).append(""-"")                   .append(mYear).append("""")                    );    }    private DatePickerDialog.OnDateSetListener mDateSetListener =        new DatePickerDialog.OnDateSetListener() {            public void onDateSet(DatePicker view, int year,                                   int monthOfYear, int dayOfMonth) {                mYear = year;                mMonth = monthOfYear;                mDay = dayOfMonth;                updateDisplay(mDateDisplay);            }        };        private DatePickerDialog.OnDateSetListener mDateSetListenerreturn =            new DatePickerDialog.OnDateSetListener() {                public void onDateSet(DatePicker view, int year,                                       int monthOfYear, int dayOfMonth) {                    mYear = year;                    mMonth = monthOfYear;                    mDay = dayOfMonth;                    updateDisplay(mDateDisplayreturn);                }            };</code></pre>","475744","","918472","","2012-12-24 13:51:53","2012-12-24 13:51:53","Android: DatePicker not working inside Activity","<android><datepicker>","2","0","2","",""
"3976855","1","3977501","","2010-10-20 10:30:04","0","1063","<p>I have an Android service which sends broadcast intents. I'm trying to get those intents in another application, which is an Android service. I wrote this in my manifest:</p><pre><code>&lt;!-- Service --&gt;&lt;service android:enabled=""true"" android:name=""...MyService""&gt;&lt;/service&gt;&lt;!-- Receiver --&gt;&lt;receiver android:name=""...MyReceiver""&gt;   &lt;intent-filter&gt;      &lt;action android:name=""...""&gt;&lt;/action&gt;      &lt;action android:name=""...""&gt;&lt;/action&gt;   &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>and this in my MyReceiver class:</p><pre><code>public class ScannerBroadcastReceiver extends BroadcastReceiver {   @Override   public void onReceive(Context context, Intent intent) {      String action = intent.getAction();      // Process action.      Log.d(Globals.LOG_TAG, ""Intent received."");      ...</code></pre><p>Unfortunately I never get the onReceive method invoked. Any idea why?I start this service from another test application, so this is set as an Android library. The service is correctly started but this receiver is receiving nothing. Any idea what I'm doing wrong?Thanks!</p>","427544","","","","","2011-01-09 21:59:55","Broadcast intents not received by a service","<android><android-intent><broadcastreceiver>","2","2","","",""
"3976857","1","3977322","","2010-10-20 10:30:10","0","270","<p>I have two activities A &amp; B. In A i have three ArrayLists. I want to access these ArrayLists in activity B . How can I do that? These two activities are in same package.</p>","383597","","114066","","2010-10-20 11:36:39","2010-10-20 11:36:39","How to use data in different activities?","<android>","3","0","","",""
"3976861","1","3977494","","2010-10-20 10:30:56","1","1474","<p>I'm creating a optimized web page for mobile devices with C#. Is there a way to offer a page for larger screens and one for smaller screens on android devices? With Apple i can differentiate between iPad and iPhone, but how can I do this with the galaxy tab or a regular android phone?</p><p>I don't want to use any javascript in this case.</p>","114318","","114066","","2010-10-20 11:31:10","2010-10-27 07:22:59","How to get the screen resolution of android devices in c#","<c#><asp.net><android><screen-resolution>","2","1","","",""
"3976898","1","3977134","","2010-10-20 10:36:23","0","84","<p>Example:</p><p>That code is run each time, when the listAdapter requests a new row:</p><pre><code>if (textViewTitle != null)          textViewTitle.setTypeface(Controller.getInstance().widgetSettings.getBoldTypeface());</code></pre><p>vs.</p><pre><code>if (textViewTitle != null     &amp;&amp; textViewTitle.getTypeface() != null    &amp;&amp; textViewTitle.getTypeface().equals(Controller.getInstance().widgetSettings.getBoldTypeface()))          textViewTitle.setTypeface(Controller.getInstance().widgetSettings.getBoldTypeface());</code></pre>","433718","","","","","2010-10-20 11:42:48","Is just setting a value faster than the checking of existance and only setting if doesn't exist - like in this Android / Java code?","<java><android><performance>","3","0","","",""
"3976943","1","","","2010-10-20 10:43:11","1","212","<p>Is there any way to start a phone (Android OS) and make it function normally (of course i understand that no phone/sms services would be available) without any simcard.</p><p>I mean i just want to start the phone without simcard inserted and make it work normally w.r.t. Apps installed</p><p>I couldn't find any way to do this or may be i am missing something ?</p><p>Is there any way to do this ?</p><p>Yogurt</p>","475243","","","","","2010-10-20 10:43:11","Android - Function Normally without simcard","<android>","0","3","","",""
"3977009","1","6900591","","2010-10-20 10:53:22","1","673","<p>I have a bitmap file, that serves as a mask for a view. It has multiple rectangular areas with different colors on a white background. When the user touches the View, I use the X and Y coords of this event to look up the color of the mask (which is not displayed) and do things based on the color code returned.</p><p>The problem is: loading this mask with BitmapFactory results in a Bitmap object that is scaled. This way the colors get distorted a bit. If I have e.g. a solid rectangle with color (155, 155, 0), then it'll be like (148, 158, 0), (150, 154, 0), and so on. But I need to get the exact color.</p><p>So how do I load the raw bitmap, without any scaling / compressing / stuff like that?</p>","446529","","","","","2011-08-01 15:17:54","How to load a raw bitmap, without scaling on Android?","<java><android><bitmap>","1","0","","",""
"3977016","1","","","2010-10-20 10:53:58","0","1329","<p>Am using ubuntu .am developing apps with google map.for that i registering for map apikey.I follwed the instruction in this following Link <a href=""http://code.google.com/android/add-ons/google-apis/mapkey.html"" rel=""nofollow"">link text</a></p><p>from this instruction i got MD5 Fingerprint of Your Signing Certificate,also i have keystore ,But i cant able get MD5 Fingerprint of the SDK Debug Certificate, for this I followed the commend keytool -list -alias androiddebugkey \-keystore .keystore \-storepass android -keypass android.</p><p>I specified the path_to_debug_keystore location according to my application location. But wen i execute that commend </p><p>I get the ""bash: my-release-key.keystore: Permission denied.""I dont know which commend will i use to get this  MD5 Fingerprint of the SDK Debug Certificate.can any one give me the solution for this.</p><p>Thanks in advance,regards,Lakshmanan.</p>","450596","","","","","2011-05-02 22:18:13","cant get MD5 Fingerprint of the SDK Debug Certificate","<android>","1","1","1","",""
"3977255","1","3977528","","2010-10-20 11:27:17","0","388","<p>I want to unit test a swipe left/right action on the screen in Android but I haven't been able to find any documentation on it. Can anyone lend a hand? Can it even be done?</p>","348261","","","","","2010-10-20 12:01:03","How can I Unit Test Gestures in android?","<android><unit-testing><junit><gesture><swipe>","1","1","","",""
"3977260","1","5206023","","2010-10-20 11:27:42","1","4402","<p>Long back, android used to have GtalkService that let applications use Gtalk for various purposes, it was removed due to security reasons.Do we still have a method of invoking a Gtalk service that let us interact with gtalk from another application e.g. pinging a friend programmatically.</p>","389161","","","","","2012-08-19 23:14:17","Android Gtalk API?","<android><google-talk>","2","0","2","",""
"3977342","1","3977363","","2010-10-20 11:38:28","0","856","<p>how can i assign value of EditText to a string?I want to pass this value to an another activity through putExtras().</p><h2>my code is :</h2><pre><code> EditText txtquantity=(EditText) findViewById(R.id.EditText01);</code></pre><h2>     quantity_bundle.putString(""quantity"",txtquantity.getText());</h2><p>when I am doing like this an error is occured.Please give me the solution...Thank you...</p>","453607","","","","","2013-05-29 10:44:58","passing EditText value through putExtra()","<android>","2","0","","",""
"3977428","1","3977529","","2010-10-20 11:49:33","3","5061","<p>I am using Ubuntu.  I am developing apps with Google Maps.  For that I am registering for an apikey.  I followed the instruction in this following Link link text</p><p>from this instruction i got MD5 Fingerprint of Your Signing Certificate,also i have keystore ,But i cant able get MD5 Fingerprint of the SDK Debug Certificate, for this I followed the commend keytool -list -alias androiddebugkey \ -keystore .keystore \ -storepass android -keypass android.</p><p>I specified the path_to_debug_keystore location according to my application location. But wen i execute that commend</p><p>I get the ""bash: my-release-key.keystore: Permission denied."" I dont know which commend will i use to get this MD5 Fingerprint of the SDK Debug Certificate.can any one give me the solution for this.</p><p>Thanks in advance, regards, Lakshmanan.</p>","450596","","129475","","2012-01-12 02:46:52","2014-01-17 10:25:56","cant get MD5 Fingerprint of the SDK Debug Certificate","<android>","3","0","2","",""
"3977430","1","","","2010-10-20 11:49:37","0","1619","<p>I am currently developing an application and decided to try Admob ads.</p><p>Unfortunately, after following Admob's guide (pretty simple one, good job on that) I get no ad, whether I run it on the emulator or on my phone (HTC Desire). The weird part is that the ad has shown a couple of times (I really mean just a couple of times), in hundreds of tries. And checking my account on Admob I see that there are 6000 requests from this app.</p><p>I started a new application, from a blank slate, with no changes.</p><p>Any clues?</p><p>This is what I have done so far:</p><ul><li><p>Added Admob's library JAR.</p></li><li><p>Added these in my manifest (with a proper ID):</p><pre><code>meta-data android:value=""axxxxxxxxxxxxx"" android:name=""ADMOB_PUBLISHER_ID"" /  uses-permission android:name=""android.permission.INTERNET"" /</code></pre></li><li><p>Created a <code>attrs.xml</code> file in <code>res/values</code> with this content:</p><pre><code>?xml version=""1.0"" encoding=""utf-8""?&gt;  resources&gt;  declare-styleable name=""com.admob.android.ads.AdView""&gt;  attr name=""backgroundColor"" format=""color"" /&gt;  attr name=""primaryTextColor"" format=""color"" /&gt;  attr name=""secondaryTextColor"" format=""color"" /&gt;  attr name=""keywords"" format=""string"" /&gt;  attr name=""refreshInterval"" format=""integer"" /&gt;  /declare-styleable&gt;  /resources&gt;</code></pre></li><li><p>Added the following to my layout (<code>RelativeLayout</code>):</p><ul><li><p>below RelativeLayout line, with the correct application name instead of xxxx:</p><pre><code>xmlns:app=""http://schemas.android.com/apk/res/com.me.xxxx""</code></pre><p>and:  </p><pre><code>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;</code></pre></li></ul></li><li><p>As the above did not work I tried the following, but also without success:</p><pre><code>AdView example_adview = (AdView) findViewById(R.id.ad);example_adview.setVisibility(AdView.VISIBLE);example_adview.requestFreshAd();</code></pre></li></ul>","481636","","122607","","2011-03-02 15:58:39","2011-03-02 15:58:39","Admob in Android problem","<android><admob>","1","1","1","",""
"3977443","1","","","2010-10-20 11:51:16","0","266","<p>HI All.</p><p>I m working on a app that is exactly like a radio when i start a channel and go to the home screen radio is running successfully but some time it throws an error and crash and quit the application i got the error on my console .What kind of this error is and how can we remove this error.</p><p>INFO/WindowManager(90): WIN DEATH: Window{448521c0 com.cls.radio.app.screen/com.cls.radio.app.screen.StationListScreen paused=false}</p><p>Any code or idea will be helpful.</p><p>Thanks</p>","479110","","479110","","2010-10-20 12:05:13","2011-05-18 15:34:06","App quit after throwing an error on console - win death . !","<android>","1","1","","",""
"3977513","1","","","2010-10-20 11:59:42","1","904","<p>I have an android app that is attempting to upload photos to a web server via API interface. The method works fine as long as the image sizes are not too big (fails somewhere around 1280x800) Heres the code that will work will smaller images but fails with larger ones. Any suggestions?</p><pre><code>public void uploadPhoto(FileInputStream fileInputStream, String session_key) throws IOException, ClientProtocolException {    URL connectURL = new URL(API_ENDPOINT_URL + ""session_key=""            + session_key + ""&amp;method="" + ApiMethods.UPLOAD_PHOTO);    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary = ""*****"";    HttpURLConnection conn = (HttpURLConnection) connectURL.openConnection();    // Allow Inputs    conn.setDoInput(true);    // Allow Outputs    conn.setDoOutput(true);    // Don't use a cached copy.    conn.setUseCaches(false);    // Use a post method.    conn.setRequestMethod(""POST"");    conn.setRequestProperty(""Connection"", ""Keep-Alive"");    conn.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+ boundary);    DataOutputStream dos = new DataOutputStream(conn.getOutputStream());    dos.writeBytes(twoHyphens + boundary + lineEnd);    // Log.d(TAG, ""  dos1: "" + dos);    dos.writeBytes(""Content-Disposition: form-data; name=\""uploadedfile\"";filename=\""""+ ""file.png"" + ""\"""" + lineEnd);    // Log.d(TAG, ""  dos2: "" + dos);    dos.writeBytes(lineEnd);    // Log.d(TAG, ""  dos3: "" + dos);    // create a buffer of maximum size    int bytesAvailable = fileInputStream.available();    int maxBufferSize = 1024;    int bufferSize = Math.min(bytesAvailable, maxBufferSize);    byte[] buffer = new byte[bufferSize];    // read file and write it into form...    int bytesRead = fileInputStream.read(buffer, 0, bufferSize);    Log.d(TAG, "" BytesREad:"" + bytesRead);    while (bytesRead &gt; 0) {        Log.d(TAG, "" BytesREad in while:"" + bytesRead);        dos.write(buffer, 0, bufferSize);        // Log.d(TAG, ""  dos3: "" + dos);        bytesAvailable = fileInputStream.available();        bufferSize = Math.min(bytesAvailable, maxBufferSize);        bytesRead = fileInputStream.read(buffer, 0, bufferSize);        /*         * dos.writeBytes(lineEnd); dos.writeBytes(twoHyphens + boundary +         * twoHyphens + lineEnd);         */    }    // send multipart form data necesssary after file data...    // dos.write(data);    dos.writeBytes(lineEnd);    dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);    // Log.d(TAG, ""  dos4 tostring: "" + dos.toString());    // close streams    // Log.e(Tag,""File is written"");    // fileInputStream.close();    dos.flush();    // Log.d(TAG, ""  dos5: "" + dos.toString());    InputStream is = conn.getInputStream();    // retrieve the response from server    int ch;    StringBuffer b = new StringBuffer();    while ((ch = is.read()) != -1) {        b.append((char) ch);        // Log.d(TAG, ""  b: "" + b.toString());    }    String s = b.toString();    Log.i(""Response"", s);    // Log.d(TAG, ""   response:"" + s);    dos.close();}</code></pre><p>The errors include</p><p>10-20 04:16:26.658: ERROR/dalvikvm-heap(20213): 8957952-byte external allocation too large for this process.10-20 04:16:26.658: ERROR/dalvikvm(20213): Out of memory: Heap Size=4551KB, Allocated=3039KB, Bitmap Size=9496KB10-20 04:16:26.658: ERROR/(20213): VM won't let us allocate 8957952 bytes</p>","461631","","461631","","2010-10-20 12:04:42","2011-05-11 07:45:54","How can I fix my android photo upload to send larger streams of data","<android><api><file-upload><heap>","2","1","1","",""
"3977566","1","4932658","","2010-10-20 12:06:46","2","5669","<p>It appears that Android doesn't offer such a useful widget. However, my screen design requires a view like this:<img src=""http://i.stack.imgur.com/GmNvB.png"" alt=""Design example""></p><p>Also, the interaction design requires that such boxes are displayed and hidden, depending on other data.</p><p>Of course, I could construct such box from separate elements in my XML layout (e.g. from a shape and a textview over it), but then managing their visibility turns into hell...</p><p>So it's clear that what is needed here is a container, like a relative layout. Such container can have children in XML layout and can be shown and hidden with a simple setVisibility(...) call.</p><p>Can someone give me a tip how to do that, please?</p>","457086","","457086","","2010-10-21 07:28:56","2011-06-30 19:59:28","Android: how to make a GroupBox widget?","<android><groupbox>","2","1","","",""
"3977567","1","","","2010-10-20 12:07:02","0","437","<p>I would like to share a url from my android application. I would like to share this url through the installed applications in my device(bluetooth, facebook, google mail, messaging etc.). </p><p>Given below is the code</p><pre><code>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;public class SendURL extends Activity {    /** Called when the activity is first created. */    Button button;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button = (Button) findViewById(R.id.Button01);        button.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                Intent picMessageIntent = new Intent(                android.content.Intent.ACTION_SEND);                picMessageIntent.setType(""plain/text"");                /**                 * //Code for sending image                 * picMessageIntent.setType(""image/jpeg""); File downloadedPic =                 * new                 * File(""/sdcard/download/""+""1287567819_Einstein_1_JPEG.jpg"");                 * picMessageIntent.putExtra(Intent.EXTRA_STREAM,                 * Uri.fromFile(downloadedPic));                 */                startActivity(Intent.createChooser(picMessageIntent,                        ""Send your url using:""));            }        });    }}</code></pre><p>When I press a button called share, the installed applications in the phone which can share this url, should be listed like <a href=""http://www.4shared.com/photo/8jlZgwNB/share.html"" rel=""nofollow"">this</a>. The user can select an application from this list and share the url through the chosen application(gmail, facebook, messaging etc.).With the given code, I get only gmail and bluetooth. I do not get facebook, messaging etc. Please advise, in order that I can send the url through all the applications in the phone which are capable of doing this.</p><p>Any help in this regard is appreciated.Looking forward,Regards</p>","264953","","264953","","2010-10-20 12:24:41","2010-10-20 12:33:01","Sending message through installed applications","<android>","1","0","","",""
"3977650","1","3979793","","2010-10-20 12:16:50","0","2083","<p>I have an application that get/send data from/to a remote DB on internet.</p><p>I need to get my application working in background mode, then i supose that i have to put all the send/get remote data in a service.....</p><p>but.... How can this service change values of variables and UI textfields of my activities?</p><p>i can't find any information about this, all the tutorials i am finding are of simple services that doesn't do something like that</p><p>can someone explain me how to do it please?</p>","479886","","","","","2012-09-10 00:27:39","How can my service change values of variables and UI textfields of my activities?","<android><service>","2","0","1","",""
"3977755","1","3978097","","2010-10-20 12:27:38","3","2240","<p>I’m writing an application (game) where I would like to end the game activity when the user fails the game.  My game is loosely based off lunarlander, so I figure it may be easier to ask for help using lunarlander as an example, since a lot of folks are familiar with it.</p><p>When the user fails the lunarlander game, I want to automatically end the activity (because my app uses more than one activity).  I know that I can use the finish() method inside the activity class, but I can’t use that method inside the surfaceview class or its nested thread.  What can I do from inside this class that can be used to end the activity or create a trigger back to the activity class?</p><p>Or, is there an entirely different way I should approach this?</p><p>Thanks.</p>","432209","","","","","2010-10-20 14:49:35","How can I end an activity from inside a SurfaceView class or nested thread","<java><android><eclipse><activity><surfaceview>","1","0","","",""
"3977784","1","3978126","","2010-10-20 12:31:16","0","422","<p>I want to ask whether it is possible in android to record an ongoing phone conversation. I was able to record what was being spoken in microphone, but not the audio coming from other end. </p><p>I tried it using MediaRecorder.AudioSource.VOICE_CALL value, but with no success.</p><p><br>Any help ????</p>","405521","","","","","2010-10-20 13:06:04","Android: Save the conversation during the call","<android>","1","0","1","",""
"3977793","1","","","2010-10-20 12:32:32","0","824","<p>I'm new to opengl and android and couldn't find an answer in the forums so here I am...</p><p>I need to be able to 'draw' only the intersection of two triangles. I tried to use stencil test but it doesn't work in the android emulator.</p><p>Then I tried to use depth test and it works but only for a fraction of a second, then the screen goes blank.</p><p>I have a config with depth size 8.</p><p>What am I doing wrong?   </p><p>This is the crude code I wrote for drawing the 2D 'scene' to verify that clipping works</p><pre><code>      gl.glEnable(GL10.GL_DEPTH_TEST);  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT   | GL10.GL_STENCIL_BUFFER_BIT);  gl.glColorMask(false, false, false, false);  outlineColor.setAsActive(gl);  triangleOne(gl);  gl.glDepthFunc(GL10.GL_EQUAL);  gl.glColorMask(true, true, true, true);  fillColor.setAsActive(gl);  triangleTwo(gl);  gl.glDisable(GL10.GL_DEPTH_TEST);</code></pre><p>And here are the triangles...</p><pre><code>private void triangleOne(GL10 gl) {  float[] coords = { 1f, height, width, height / 2, 1f, 1f };  drawItem(gl, 2, coords);}private void triangleTwo(GL10 gl) {  float[] coords = { width, height, width, 1f, 1f, height / 2 };  drawItem(gl, 2, coords);}private void drawItem(GL10 gl, int size, float[] coords){  fillColor.setAsActive(gl);  FloatBuffer vertexBuffer;  ByteBuffer vbb = ByteBuffer.allocateDirect(coords.length * 4);  vbb.order(ByteOrder.nativeOrder());  vertexBuffer = vbb.asFloatBuffer();  vertexBuffer.put(coords);  vertexBuffer.position(0);  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);  gl.glVertexPointer(size, GL10.GL_FLOAT, 0, vertexBuffer);  gl.glDrawArrays(GL10.GL_TRIANGLES, 0, vertexBuffer.capacity() / size);  gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);}</code></pre><p>Thanks for helping</p>","481681","","44729","","2010-10-20 15:18:50","2010-10-20 17:53:46","Android Opengl 2d Intersection between two graphic objects","<android><opengl-es><2d><buffer><depth>","1","0","","",""
"3977864","1","3978157","","2010-10-20 12:40:24","4","2750","<p>I'm quite new to Android development and face UI implementation issues. Namely I'm trying to find a good way (design pattern?) that addresses view hierarchy and navigation between views (with history). Does is always has to be about launching new <code>Activity</code>? I don't want to learn bad habits during my first steps with Android SDK, hence my question. Your personal approaches you find good to follow or any links to resources/tutorials elaborating on the subject would be appreciated.</p>","344036","","","","","2010-10-20 13:22:37","Design pattern for view navigation in Android?","<android><user-interface><navigation>","3","0","","",""
"3977908","1","","","2010-10-20 12:44:42","5","762","<p>I have run the sample soft keyboard provided in the Android SDK on a real device.  I now would like to remove it from the list of available keyboards in settings.  I have searched the web without any hits.  It also shows up on one of my emulators too.</p><p>I'm sure it's probably an obvious answer, but I just can't figure it out.</p><p>Any help would be appreciated.</p><p>Thanks,Sam</p>","481676","","13793","","2012-05-01 01:25:43","2012-05-01 01:25:43","How can I remove the Android Sample Soft Keyboard?","<android><android-softkeyboard><sample>","1","0","","",""
"3977998","1","3982314","","2010-10-20 12:51:53","2","792","<p><br/>I need to write an Android app that would download sounds from the internet for further use.<br/>Where should i store these sounds? Is Sqlite an option? And what's the best way to load and play these files?<br/>Thanks in advance.</p>","181915","","","","","2010-10-21 08:38:40","Guidance on Android file storage","<java><android><structure><file-storage>","3","2","","",""
"3978269","1","","","2010-10-20 13:21:52","0","2093","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android"">Activity restart on rotation Android</a>  </p></blockquote><p>I connect to i ip-cam with thread. When I rotate screen, activity restart and new thread restart?? I only want to set ImageView fullscreen when i rotate... How can I stop activity-restart???</p><pre><code>public class ViewCam extends Activity implements OnClickListener {private Bitmap bmp = null;private String bmpl = null;private ImageButton UpButton;private ImageButton DownButton;private ImageButton LeftButton;private ImageButton RightButton;private ImageButton ZoomInButton;private ImageButton ZoomOutButton;private ImageButton butlisten;ImageView imageView;TextView imagetext;long id;Thread My;private Runnable viewCams;private ProgressDialog m_ProgressDialog = null;private ArrayList&lt;ImageView&gt; imageArray;private Gallery gallery;private Handler handler = new Handler() {    public void handleMessage(Message msg) {        try {            bmp = CameraManagerScreen.ActiveCam.getCurrentImage();            bmpl = CameraManagerScreen.ActiveCam.getCurrentLenght();            if (bmp != null) {                if (CameraManagerScreen.ActiveCam.isConnected())                    m_ProgressDialog.dismiss();                imageView.setImageBitmap(bmp);                imagetext.setText(bmpl);            }        } catch (Exception e) {        } finally {            sleep();        }    };    public void sleep() {        this.removeMessages(0);        sendMessageDelayed(obtainMessage(0), 50);    };};protected void onStart() {    super.onStart();    if (CameraManagerScreen.ROTATION == 0) {        My = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam.go();                    // upLoadCam();                } catch (Exception ex) {                }            };        };        My.start();    }}@Overridepublic void onConfigurationChanged(Configuration newConfig) {    // TODO Auto-generated method stub    super.onConfigurationChanged(newConfig);    CameraManagerScreen.ROTATION = 1;}@Overrideprotected void onStop() {    CameraManagerScreen.ActiveCam.cancel();    CameraManagerScreen.ActiveCam.setConnected(false);    super.onStop();}@Overridepublic void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setFullscreen();    setContentView(R.layout.viewcam);    imageView = (ImageView) findViewById(R.id.myView);    imagetext = (TextView) findViewById(R.id.imageText);    gallery = (Gallery) findViewById(R.id.gallery);    UpButton = (ImageButton) findViewById(R.id.UpButton);    DownButton = (ImageButton) findViewById(R.id.DownButton);    LeftButton = (ImageButton) findViewById(R.id.LeftButton);    RightButton = (ImageButton) findViewById(R.id.RightButton);    ZoomInButton = (ImageButton) findViewById(R.id.ZoomInButton);    ZoomOutButton = (ImageButton) findViewById(R.id.ZoomOutButton);    UpButton.setOnClickListener(this);    DownButton.setOnClickListener(this);    LeftButton.setOnClickListener(this);    RightButton.setOnClickListener(this);    ZoomInButton.setOnClickListener(this);    ZoomOutButton.setOnClickListener(this);    // gallery.setOnClickListener(this);    if (CameraManagerScreen.ROTATION == 0) {        m_ProgressDialog = ProgressDialog.show(ViewCam.this,                ""Please wait..."", ""Connecting ..."", true);        m_ProgressDialog.setCancelable(true);        m_ProgressDialog.setCanceledOnTouchOutside(true);        // Thread gThread=new Thread(){        // public void run(){gallery.setAdapter(new ImageAdapter(this));}        // };        handler.sendMessage(new Message());    }}public void setFullscreen() {    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);}private Runnable returnRes = new Runnable() {    public void run() {        // if (cameras != null &amp;&amp; cameras.size() &gt; 0) {        // c_adapter.notifyDataSetChanged();        // for (int i = 0; i &lt; cameras.size(); i++)        // c_adapter.add(cameras.get(i));        // }        // m_ProgressDialog.dismiss();        // c_adapter.notifyDataSetChanged();    }};// private void upLoadCam() {// imageArray = new ArrayList&lt;Bitmap&gt;();// for (int i = 0; i &lt; CameraManagerScreen.cameras.size(); i++) {// if(CameraManagerScreen.cameras.get(i)// .getImageForGallary()!=null)// imageArray.add(CameraManagerScreen.cameras.get(i)// .getImageForGallary());// }// }@Overridepublic void onClick(View v) {    if (v == UpButton) {        Thread t = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam.goPTZ(CameraType.PTZ_UP);                } catch (Exception ex) {                }            };        };        t.start();    }    if (v == DownButton) {        Thread t = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam                            .goPTZ(CameraType.PTZ_DOWN);                } catch (Exception ex) {                }            };        };        t.start();    }    if (v == LeftButton) {        Thread t = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam                            .goPTZ(CameraType.PTZ_LEFT);                } catch (Exception ex) {                }            };        };        t.start();    }    if (v == RightButton) {        Thread t = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam                            .goPTZ(CameraType.PTZ_RIGHT);                } catch (Exception ex) {                }            };        };        t.start();    }    if (v == ZoomInButton) {        Thread t = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam                            .goPTZ(CameraType.PTZ_ZOOM_IN);                } catch (Exception ex) {                }            };        };        t.start();    }    if (v == ZoomOutButton) {        Thread t = new Thread() {            public void run() {                try {                    CameraManagerScreen.ActiveCam                            .goPTZ(CameraType.PTZ_ZOOM_OUT);                } catch (Exception ex) {                }            };        };        t.start();    }}</code></pre><p>}</p>","463888","","463888","","2010-10-20 14:19:30","2010-10-20 14:19:30","When I rotate the screen, my activity restart? how can I stop this?","<android><screen>","0","3","","2012-04-05 13:12:45",""
"3978299","1","","","2010-10-20 13:25:15","2","888","<p>Can you use ADB to type directly on an android device from a computer? If so, how?</p>","439836","","","","","2012-04-27 02:37:14","Typing on an Android Device straight from computer?","<android><adb>","2","0","","",""
"3978380","1","3978496","","2010-10-20 13:33:53","0","497","<p>I have 3 views in my application.My first view (FIRST_VIEW) has 2 buttons (BTN_2 and BTN_3).Each button will start seperate views, means BTN_2 causes to start SECOND_VIEW and BTN_3 will start THIRD_VIEW. In my FIRST_VIEW i have one onActivityResult() function. How can I set two onActivityResult() functions for each button result (that is from SECOND_VIEW and from THIRD_VIEW)? How can I specify that onActivityResult() function for each view?Please Help me.....Thank you..</p>","453607","","","","","2013-03-02 06:14:44","How to specify onActivityResult() for 2 views?","<android>","1","0","2","",""
"3978461","1","3978588","","2010-10-20 13:40:17","0","372","<p>I am wondering how I can make the orientation of the screen permanent, even when the phone has a slide-out keyboard. This is the code I have:</p><pre><code>&lt;activity android:name="".AppName"" android:label=""@string/app_name""android:screenOrientation=""portrait""&gt;</code></pre><p>Thanks.</p>","348261","","","","","2010-10-20 13:53:33","Stopping orientation change with side-keyboard (Android)","<android><static><keyboard><orientation><portrait>","1","0","","",""
"3978469","1","","","2010-10-20 13:41:21","0","556","<p>Starting from Android 2.2, the FileNotFoundException contains additional information about problem:</p><pre><code>java.io.FileNotFoundException: /foo/bar (No such file or directory)</code></pre><p>The error message format is:</p><pre><code>java.io.FileNotFoundException: path (reason)</code></pre><p>I have seen such reasons:</p><ul><li>Invalid argument</li><li>No space left on device</li><li>No such file or directory</li><li>Permission denied</li><li>Read-only file system</li></ul><p><strong>Q:</strong> Where can I find all possible <em>reason</em> messages? Documentation, or the source file where they are thrown from.</p>","62192","","","","","2012-12-26 20:37:57","FileNotFoundException: path (reason) - where can I find all possible ""reason"" messages?","<android><filenotfoundexception><details>","1","3","","",""
"3978675","1","","","2010-10-20 14:02:09","1","110","<p>i m calling soap web service in my application. i m getting an image URI as a response. i want to set it to the image view. i m not able to do that.</p><p>how can i do that?</p><p>pls help me..</p>","383597","","","","","2012-05-17 10:56:54","Android SOAP issue","<android>","0","1","","",""
"3978702","1","3978737","","2010-10-20 14:04:55","6","3903","<p>Developing Java, you have always learned that its best to create an ArrayList by using the List interface as the type for the variable the list is stored in. Like this</p><pre><code>List&lt;String&gt; myList = new ArrayList&lt;String&gt;();</code></pre><p>However, by looking at a lot of the android examples that is included in the bundle, they have created the list by using the Class.</p><pre><code>ArrayList&lt;String&gt; myList = new ArrayList&lt;String&gt;();</code></pre><p>Is there any reason why this is done? Is it faster, lighter or something to explicitly setting the Class?</p>","37298","","114066","","2010-10-20 14:27:10","2010-10-20 15:40:39","Why are most of the examples using ArrayList","<java><android><arraylist>","8","5","","",""
"3978868","1","3978901","","2010-10-20 14:21:50","1","254","<p>I am using Android 2.1 SDK, the application reads from the Sqlite database, a table that has two columns, an id, and a string.</p><p>I read in this into a <code>HashMap&lt;Long, String&gt;</code>, the value part of it gets displayed in a List, now, I wish to obtain the key value, so I cooked up this simple routine:</p><pre><code>private Map.Entry&lt;Long, String&gt; getEntry(String sValue){    for (Iterator&lt;Map.Entry&lt;Long, String&gt;&gt; itMap = this.dbMap.entrySet().iterator(); itMap.hasNext();) {        Map.Entry&lt;Long, String&gt; curr = itMap.next();        if (curr.getValue().equalsIgnoreCase(sValue)) return curr;    }    return null;}</code></pre><p>My problem is being conscious of cpu cycles being chewed up in respect to Android, battery/cpu time, in looking for the value in the <code>HashMap</code>, that could be seen as a potential cycles of cpu lost.</p><p>Is there an easier and more efficient way of doing this instead of iterating?</p><p>The reasoning is that I can home in on the id, and directly delete the record from the table or even update it.</p>","206367","","","","","2010-10-20 14:33:09","How to get the key when a corresponding value is used instead?","<java><android><collections>","3","1","","",""
"3978869","1","","","2010-10-20 14:21:51","2","3669","<p>I want to create a binder service in C++ and be able to bind to thatservice from java. My question is how? I have mimicked theimplementation in frameworks/base/camera/tests/CameraServiceTest/CameraServiceTest.cpp. It compiles nicely without any warnings and Ican run it. But how do I connect to it?</p><p>The code for the service is here:</p><pre><code>/* Imitating frameworks/base/camera/tests/CameraServiceTest/CameraServiceTest.cpp */#include &lt;binder/IInterface.h&gt;#include &lt;binder/IPCThreadState.h&gt;#include &lt;binder/IServiceManager.h&gt;#include &lt;binder/ProcessState.h&gt;#include &lt;binder/IBinder.h&gt;using namespace android;class IPokeService : public IInterface {        protected:                enum {                        POKE = IBinder::FIRST_CALL_TRANSACTION                };        public:                DECLARE_META_INTERFACE(PokeService);                virtual void poke() = 0;};class BnPokeService : public BnInterface&lt;IPokeService&gt; {        virtual status_t onTransact(uint32_t code, const Parcel&amp; data,Parcel* reply, uint32_t flags = 0);};class BpPokeService : public BpInterface&lt;IPokeService&gt; {        public:                BpPokeService(const sp&lt;IBinder&gt;&amp; impl) :BpInterface&lt;IPokeService&gt;(impl) {                }                virtual void poke() {                        Parcel data, reply;                        remote()-&gt;transact(POKE, data, &amp;reply);                }};IMPLEMENT_META_INTERFACE(PokeService, ""PokeService"");status_t BnPokeService::onTransact(uint32_t code, const Parcel&amp; data,Parcel* reply, uint32_t flags) {        switch(code) {                case POKE: {                          poke();                          return NO_ERROR;                } break;                default:                        return BBinder::onTransact(code, data, reply, flags);        }}class PokeService : public BnPokeService {        virtual void poke() {                printf(""Poked\n"");        }};int main(int argc, char **argv){        defaultServiceManager()-&gt;addService(String16(""PokeService""), newPokeService());        ProcessState::self()-&gt;startThreadPool();        android::ProcessState::self()-&gt;startThreadPool();        LOGI(""Poke service is now ready"");        IPCThreadState::self()-&gt;joinThreadPool();        return 0;}</code></pre><p>And here is my Android.mk</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES := main.cppLOCAL_CFLAGS += -DPLATFORM_ANDROIDLOCAL_MODULE := poke# for now, until I do a full rebuild.LOCAL_PRELINK_MODULE := falseLOCAL_SHARED_LIBRARIES += liblogLOCAL_SHARED_LIBRARIES += libutils libui libcutilsLOCAL_SHARED_LIBRARIES += libbinderinclude $(BUILD_EXECUTABLE)</code></pre><p>The service won't show up when I do a listing in java:</p><pre><code>Context context = getBaseContext();ActivityManager am = (ActivityManager)context.getSystemService(Activity.ACTIVITY_SERVICE);List&lt;RunningServiceInfo&gt; serviceInfos = am.getRunningServices(50);for (RunningServiceInfo service : serviceInfos) {        Log.i(""Service"", ""Process "" + service.process + "" with component "" + service.service.getClassName());}</code></pre><p>That will only give me from logcat:</p><pre><code>I/Service (  715): Process system with componentcom.android.internal.service.wallpaper.ImageWallpaperI/Service (  715): Process com.android.phone with componentcom.android.phone.BluetoothHeadsetServiceI/Service (  715): Process com.android.inputmethod.latin withcomponent com.android.inputmethod.latin.LatinIME</code></pre><p>Any help would be appreciated!</p><p>Kind regards,Samuel</p>","481709","","","","","2012-02-02 08:43:12","How to connect to a binder C++ service in java?","<java><c++><android>","2","0","1","",""
"3979218","1","","","2010-10-20 14:56:40","44","70265","<p>I have this code:</p><pre><code>&lt;ListView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:id=""@+id/cashItemsList""     android:cacheColorHint=""#00000000""     android:divider=""@drawable/list_divider""&gt;&lt;/ListView&gt;</code></pre><p>where @drawable/list_divide is:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""line""&gt; &lt;stroke   android:width=""1dp""   android:color=""#8F8F8F""   android:dashWidth=""1dp""   android:dashGap=""1dp"" /&gt;&lt;/shape&gt;</code></pre><p>but I don't see any divider.</p><p>help?</p>","258429","","309412","","2010-10-20 14:58:03","2014-02-26 04:04:55","Android ListView Divider","<android><listview><divider>","9","5","15","",""
"3979226","1","3979262","","2010-10-20 14:57:30","2","3078","<p>I am writing an app that needs to send emails at the end of each transaction.  I am doing the following:</p><pre><code>Intent mail = new Intent(Intent.ACTION_SEND);mail.setType(""text/html"");mail.putExtra(Intent.EXTRA_EMAIL, new String[] { emailTo });mail.putExtra(Intent.EXTRA_SUBJECT, ""Send from Android"");mail.putExtra(Intent.EXTRA_TEXT, ""Sent from Android"");startActivity(Intent.createChooser(mail,""Select Email Software...""));</code></pre><p>What I would like to do is pre-select the email software and store it in a setting.  That way, every time the email is being sent, it does not have to ask the user which email to use.  I just can't seem to figure out how to invoke the chooser and get the selected value.</p><p>Any help would be greatly appreciated.</p>","481868","","","","","2014-03-10 14:36:31","Android email chooser","<android><email><android-intent>","3","0","2","",""
"3979290","1","3980825","","2010-10-20 15:03:55","0","234","<p>I have a TextView in a ScrollView with a specific background image. My problem is that if the text is longer than one line, the TextView will stretch as much as the screen allows it. I would like the text view's sizes to remain the same (the sizes of the background)</p><pre><code>&lt;ScrollView android:id=""@+id/description""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_marginLeft=""@dimen/padding_large""    &gt;    &lt;TextView        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:paddingTop=""@dimen/padding""        android:paddingBottom=""@dimen/padding""        android:paddingLeft=""@dimen/padding_large""        android:paddingRight=""@dimen/padding_large""        android:background=""@drawable/textfield_background_small""        android:inputType=""textMultiLine""        android:text=""@string/step_description""      /&gt; &lt;/ScrollView&gt;</code></pre><p>Thanks a lot</p>","460611","","","","","2010-10-20 17:55:10","TextView not resizeable","<android>","1","0","","",""
"3979405","1","3980340","","2010-10-20 15:14:33","0","720","<p>All,</p><p>I have a need to display information on a MapView object. No problems there. </p><p>The issue is that there are times when the MapView object displays map details that visually compete with my overlay data.</p><p>So, what I'd like to do is provide a way to ""scale back"" the MapView object visually by using an alpha channel.</p><p><strong>bold*<em>Can an alpha value get applied to a MapView object? If so, how?</em>*bold</strong></p><p>Alternatively, I was thinking that perhaps a separate all black overlay might provide the same results. Scale the alpha of this overlay and I might end up with the same overall effect.</p><p>Insight please.</p><p>Thanks.</p><p>Rich</p>","111175","","","","","2010-10-20 16:49:15","How to make MapView object transparent (alpha)?","<android><transparency><android-mapview><transparent><alpha>","1","0","1","",""
"3979438","1","3980047","","2010-10-20 15:17:43","0","2111","<p>I have an activity with its layout set to an XML file.  the root layout is a <code>RelativeLayout</code> and i am setting the background to this layout via <code>rootLayout.setBackgroundResource(R.drawable.default_background);</code></p><p>this drawable, <code>R.drawable.default_background</code> has some transparency in it.</p><p>It seems as though the default background of any layout is black.  when i set the background to this drawable resource, the default black background seeps through the semi-transparent drawable.</p><p>How can i change the default background behind this drawable to white instead of black?</p><p>edit: i do not want to change the theme, as that changes more than just background</p>","416412","","416412","","2010-10-20 15:54:56","2010-10-20 16:18:51","Set default background behind an activity's layout","<android>","1","0","","",""
"3979508","1","3979562","","2010-10-20 15:25:32","3","529","<p>I am relatively new to Android development and a quick google search turned up nothing of interest.</p>","207303","","918414","","2012-06-30 04:04:46","2012-06-30 04:04:46","Is it possible to use a static analysis tool like FindBugs with Android?","<android><static-analysis><findbugs>","1","0","","",""
"3979558","1","3980656","","2010-10-20 15:29:44","0","3710","<p>In Titanium how do I 'dock' a footer menu to the bottom of the screen on Android and iPhone? I want to display 3 icons on the bottom of the screen.</p>","46076","","46076","","2010-10-20 17:23:23","2014-02-25 13:22:58","In Titanium how do I 'dock' a footer menu to the bottom of the screen?","<iphone><android><titanium>","5","0","0","",""
"3979580","1","3979830","","2010-10-20 15:32:25","1","3520","<p>I'd like to provide a Button in the PreferenceActivity. The user should be able to set atime (e.g. via TimePicker), but there's no ButtonPreference or something like that. I don't want to use EditTextPreference.</p><p>So do I have to use a default Button in the PreferenceActivity and save the settings for it manually?</p><p>Regards,</p><p>cody</p>","474326","","","","","2012-09-26 07:54:57","Android: How to use Buttons in Preference Screen","<android><android-preferences><sharedpreferences><preferenceactivity><preferencescreen>","3","0","","",""
"3979692","1","3979746","","2010-10-20 15:44:14","0","316","<pre><code>10-20 18:40:02.097: ERROR/AndroidRuntime(21851): Uncaught handler: thread pool-1-       thread-1 exiting due to uncaught exception10-20 18:40:02.102: ERROR/AndroidRuntime(21851): java.lang.ExceptionInInitializerError10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at com.google.android.voicesearch.RecognitionActivity.startRecognition(RecognitionActivity.jav  a:825)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at com.google.android.voicesearch.RecognitionActivity$RecognitionRunnable.run(RecognitionActivity.java:383)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at java.lang.Thread.run(Thread.java:1096)10-20 18:40:02.102: ERROR/AndroidRuntime(21851): Caused by: java.lang.UnsatisfiedLinkError: Library speech not found10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at java.lang.Runtime.loadLibrary(Runtime.java:489)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at java.lang.System.loadLibrary(System.java:557)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     at com.google.android.voicesearch.endpointer.MicrophoneInputStream.&lt;clinit&gt;(MicrophoneInputStream.java:33)10-20 18:40:02.102: ERROR/AndroidRuntime(21851):     ... 5 more</code></pre>","463888","","","","","2010-10-20 15:57:38","Library speech not found... What should I do?","<android><speech-recognition><speech-to-text>","1","0","","",""
"3979725","1","4118152","","2010-10-20 15:46:59","1","126","<p>I have a ListView of TextViews and to highlight one of these, I want to make the TextView <strong>bold</strong>. This only works if I don't scroll the ListView. After I scroll, the boldness changes to a different position. Does anyone know why, or how I can solve this problem?</p>","348261","","","","","2010-12-28 11:54:38","Problems changing the style of certain items in a ListView","<android><listview><coding-style><bold>","2","1","","",""
"3979852","1","","","2010-10-20 15:58:11","0","921","<p>I am programatically building a ListView that does FILL_PARENT for width, and WRAP_CONTENT for height, then centering it in its parent view.</p><p>The ListView is semi-transparent so the activity behind it is visible, so I use:</p><p>list.setCacheColorHint(0);<br>list.setBackgroundColor(Color.argb(200, 0, 0, 0));</p><p>Other than that, it is a completely standard out-of-the-box ListView.</p><p>Two issues:</p><p>A) The ListView is extremely laggy when scrolling (even with only a few children). Why, and how can I optimize it?</p><p>B) Whenever the list is scrolled, some of the child views contained in the ListView are shrinking and expanding randomly and it looks awful. Sometimes they get stuck being small. I have no idea why it is doing this -- I'm not doing anything special outside of populating a normal ListView.</p><p>The ListView uses this adapter:</p><pre><code>class ActionListAdapter extends BaseAdapter    {        private final ArrayList&lt;MapActionListViewItem&gt; _items = new ArrayList&lt;MapActionListViewItem&gt;();        @Override public final MapActionListViewItem getItem(int position)        {            return _items.get(position);        }        @Override public final long getItemId(int position)        {            return position;        }        @Override public final int getCount()        {            return _items.size();        }        @Override public final View getView(int position, View convertView, ViewGroup parent)        {            return _items.get(position).Row;        }        public final void clear()        {            _items.clear();            notifyDataSetChanged();        }        public final void addItem(MapActionListViewItem item)        {            _items.add(item);            notifyDataSetChanged();        }        public final void removeItem(MapActionListViewItem item)        {            _items.remove(item);            notifyDataSetChanged();        }        public final void refresh()        {            final Iterator&lt;MapActionListViewItem&gt; i = _items.iterator();            while (i.hasNext())                if (!i.next().refresh())                    i.remove();        }    }</code></pre><p>The MapActionListViewItem object is a container class that updates the child views:</p><pre><code>public abstract class MapActionListViewItem{    public final ImageView      Icon;    public final TextView       Title;    public final TextView       Subtitle;    public final TextView       Info;    public final View           Row;    public final int            MapAction;    protected final GlobalState State;    public MapActionListViewItem(GlobalState state, int mapActionType)    {        MapAction = mapActionType;        State = state;        Row = state.Inflater.inflate(R.layout.actionlistviewitem, null);        Icon = (ImageView) Row.findViewById(R.id.actionitem_image);        Title = (TextView) Row.findViewById(R.id.actionitem_title);        Subtitle = (TextView) Row.findViewById(R.id.actionitem_subtitle);        Info = (TextView) Row.findViewById(R.id.actionitem_info);    }    public abstract boolean refresh();}</code></pre><p>I've disabled refreshing for troubleshooting my issues, so that isn't relevant. Each child Row contained in the ListView is inflated from actionlistviewitem.xml:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content"" android:orientation=""vertical""    android:layout_width=""wrap_content""&gt;    &lt;LinearLayout android:layout_height=""wrap_content""        android:layout_width=""fill_parent""&gt;        &lt;ImageView android:id=""@+id/actionitem_image""            android:scaleType=""center"" android:layout_height=""25dp""            android:layout_width=""25dp"" /&gt;        &lt;TextView android:id=""@+id/actionitem_title""            android:textColor=""@color/white"" android:text=""TITLE""            android:textSize=""14dp"" android:layout_height=""wrap_content""            android:layout_gravity=""center"" android:layout_width=""wrap_content"" /&gt;    &lt;/LinearLayout&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/actionitem_subtitle""        android:text=""Sub Title"" android:textSize=""12dp""        android:layout_marginLeft=""25dp"" android:layout_width=""wrap_content"" /&gt;    &lt;TextView android:layout_height=""wrap_content""        android:textSize=""10dp"" android:text=""Information""        android:layout_marginLeft=""25dp"" android:layout_width=""wrap_content""        android:id=""@+id/actionitem_info"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I've been banging my head against this for days with no success. No matter what I try the Child views from the above XML shrink randomly while scrolling in a very ugly and unexpected way, and is nearly useless with scroll lag on my DroidX. Any help would be greatly appreciated.</p><p>(Developing in Eclipse 3.5.2, targeting SDK 8 - 2.2)</p>","481956","","481956","","2010-10-20 16:40:18","2010-10-22 06:57:17","Android ListView Laggy and Child Views Shrinking","<android><listview><scroll><lag>","1","1","","",""
"3979929","1","","","2010-10-20 16:05:51","0","752","<p>I have an app that I have written that works fine on the Samsung Galaxy S series (I have a captivate).  However, the app apparently doesn't work on the Droid's as Motorola has laid out the file structure differently.</p><p>I'm looking for a way to detect the manufacturer so that I can switch out program behavior.</p><p>Does anyone know an easy way to do this?</p>","329174","","21234","","2010-11-26 08:06:56","2010-11-26 08:06:56","Android: How can I detect manufacturer and change program behavior","<android>","2","1","","",""
"3979959","1","","","2010-10-20 16:09:36","3","2911","<p>I'm trying to test an intranet site in the Android emulator, but I can't seem to get the emulator to access our intranet.  For example, the site I'm trying to access is at <a href=""http://compass/messages"" rel=""nofollow"">http://compass/messages</a>, but trying that page in the browser gives me a Google search result page instead of the intranet site.</p><p>I can access the INTERNET with the emulator, but not the INTRANET.  I can access the intranet from the host machine, and from the iPhone simulator on the same machine.</p><p>I'm assuming there's some sort of weird command line thing I need to do, but I'm pretty clueless...any ideas?</p>","481974","","","","","2012-06-15 08:47:16","Accessing intranet in Android emulator","<android><android-emulator>","4","1","","",""
"3979981","1","","","2010-10-20 16:11:54","1","862","<p>I've been developing Android games for the lower res screens (320x480) and then letting Android handle the density adjustments so the games work on high res screens.  It allows me to keep the size of my APK files small and I don't have to create multiple versions of every image in my games.  It actually works fine, the games still look nice on higher res screens.</p><p>However, my question is, is it possible to do the same thing, only backwards?  Can I develop for high res screens (800x480) and then somehow let android handle the density reductions automatically?</p>","179518","","","","","2010-10-20 16:57:25","Delveloping for Android high res screens, but supporting low res screens","<android><screen-resolution>","2","0","","",""
"3980023","1","","","2010-10-20 16:16:17","3","11963","<p>I'm a noob learning Eclipse and Android.    Whenever I close the emulator I get ""DeviceMonitor]Sending jdwp tracking request failed!"" in the Console tab.  Infact that seems to be the ONLY thing I get in the console tab  -  I don't get all the emulator loading messages and other things I used to see. </p><p>Everything else seems to work, I can build, run in the emulator, debug in the emulator (via Run>Debug after setting a Debug configuration . . .  I can't get ""Debug As"" to work, see: <a href=""http://stackoverflow.com/questions/3974693/debug-as-in-eclipse-for-android"">http://stackoverflow.com/questions/3974693/debug-as-in-eclipse-for-android</a> - don't know if that's relevant to this problem).</p><p>What does this message mean, and how do I correct it?    Thanks in advance!</p>","424690","","","","","2014-01-15 13:50:32","""DeviceMonitor]Sending jdwp tracking request failed!"" in Eclipse / Android","<android><eclipse><android-emulator><jdwp>","5","0","","",""
"3980175","1","3980232","","2010-10-20 16:33:05","3","2289","<p>Is an Android ""Service"" considered a process or a thread according to operating system?</p>","167269","","701560","","2012-12-04 23:19:54","2012-12-04 23:19:54","Is an Android Service a process or thread?","<android><service>","4","0","","",""
"3980454","1","3981019","","2010-10-20 17:03:00","0","707","<p>Is it possible to dynamically unregister an intent that was registered with an activity's intent filter in its manifest file?</p>","482027","","","","","2011-08-18 15:17:16","Dynamically unregister/remove intent from activity intent filter","<android>","1","0","","",""
"3980461","1","","","2010-10-20 17:03:33","0","2618","<p>Hello I have an activity that binds to a service and registers some callback methods.</p><p>I would like for the activity to run for as long as the phone is on, the activity will bind register callbacks and unbind from time to time.</p><p>Also I've got a broadcast receiver that starts the service on boot and another that checks in regular times if the service is running and if not starts it.</p><p>My first problem is that only when the activity binds and start the service the service runs propertly, the code for starting that from the activity is as follows:</p><pre><code>bindService(new Intent(IMonitorService.class.getName()),                Iconn, 0);        //start Monitor service.        Intent serviceIntent = new Intent(contxt,MonitorService.class);        contxt.startService(serviceIntent);</code></pre><p>firstly,isn't it enough to just bind to the service? that ensures that the service will start if its not running right?</p><p>also the code for the broadcast receiver is this:</p><pre><code>//start Monitor service.        Intent serviceIntent = new Intent(context,MonitorService.class);        context.startService(serviceIntent);</code></pre><p>since I just want to start the service and let it run.</p><p>my manifest is:</p><p>for the receiver:</p><pre><code>&lt;receiver android:name="".BootReceiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;            &lt;category android:name=""android.intent.category.HOME"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>for the service :</p><pre><code>&lt;service android:name="".MonitorService""        android:process="":remote""&gt;        &lt;intent-filter&gt;            &lt;!--                These are the interfaces supported by the service, which you can                bind to.            --&gt;            &lt;action android:name=""sap.max.IMonitorService"" /&gt;            &lt;!--                This is an action code you can use to select the service without                explicitly supplying the implementation class.            --&gt;            &lt;action android:name=""sap.max.AntiTheft.Monitor"" /&gt;        &lt;/intent-filter&gt;    &lt;/service&gt;</code></pre><p>Note that the service is running under its own process.</p><p>Using the above mentioned receiver the service is never run, it starts but it's onStart method is never called.</p><p>also for the alarm service in the main activity I do this :</p><pre><code>Intent intent = new Intent(AntiTheft.this, LiveCheckerReceiver.class);    PendingIntent sender = PendingIntent.getBroadcast(this, 1234567, intent, 0);</code></pre><p>and I've got this on my manifest:</p><pre><code>&lt;receiver android:name=""LiveCheckerReceiver""         android:process="":remote"" /&gt;</code></pre><p>but this never works as well.</p><p>some final questions, if the service calls a callback method and the activity isn't bind it will throw a bind exception correct?</p><p>also how to test if my service is alive and running?</p><p>sorry for all those questions,regards maxsap</p>","234898","","","","","2011-11-22 06:49:57","android service and broadcast receiver questions","<android>","0","0","2","",""
"3980510","1","3980575","","2010-10-20 17:08:32","0","692","<p>I use the following code to pop up the soft input keyboard in my Activity</p><hr><pre><code>InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);imm.getInputMethodList();imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);</code></pre><hr><p>This displays the alphabetic keyboard.</p><p>But I want to display the numeric keyboard.</p><p>Please note I know that using setInputType() works when used with an Edittext or a TextView but I want to be able to display the keyboard without an input area such as an EditText and simply listen to the key presses on the keyboard.</p><p>Can anyone confirm whether this is possible and if so how can it be achieved?</p>","243999","","243999","","2010-10-21 09:18:17","2010-10-21 09:18:17","Display a numeric keypad on activity without an input area","<android><numeric><android-softkeyboard>","1","0","","",""
"3980589","1","3992590","","2010-10-20 17:21:52","0","3512","<p>I followed this thread to connect to gmail to send email without user intervention:</p><p><a href=""http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-ap"">http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-ap</a></p><p>I got my jars from: <a href=""http://code.google.com/p/javamail-android/downloads/list"" rel=""nofollow"">http://code.google.com/p/javamail-android/downloads/list</a></p><p>I have checked my code over many times to insure compliance.  I have checked my credentials over and over to insure they are correct.  I keep getting the 'Could not connect to SMTP host: smtp.gmail.com, port: 465'</p><p>I am developing using Eclipse on Windows XP SP3.  I am attempting to send from my Nexus One.  Any ideas would be appreciated.</p>","371077","","","","","2011-04-29 05:11:20","Could not connect to SMTP host: smtp.gmail.com, port: 465","<android><gmail>","2","0","0","",""
"3980631","1","3980943","","2010-10-20 17:27:19","0","4641","<p>I am creating an android application in which there are two activites. One activity contains a button. On the button click, i want to switch to other activity which displays a list view containing few options.</p><p>Two switch between the screens or activities , i am using the following code</p><pre><code>Intent intent = new Intent(Activity1.this,Activity2.class);               startActivity(intent);</code></pre><p>Since my Activity2 class extends the 'ListActivity', this code doesn't seem to work. On my button click, i want to display a list view containing some data.</p><p>Any help would be appreciated</p><p>@Siddharthi seem to be doing almost the same thingHere is my actual code</p><p>From Activity 1</p><pre><code>public void onClick(View v) {            Intent intent = new Intent(View_Data.this,CategoryList.class);               startActivity(intent);        }</code></pre><p>In Activity 2</p><pre><code>public class CategoryList extends ListActivity {public TextView selection;public String[] categories;ArrayList&lt;String&gt; type_of_category;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.category_list);    getCategories();    }    public void getCategories() {        DBHelper dbhelper = new DBHelper(this);        type_of_category = new ArrayList&lt;String&gt;();        type_of_category = dbhelper.getTypesOfQuotes();        String[] items = new String[100];        for(int i=0;i&lt;type_of_type_of_category.size();i++)        {            items[i] = type_of_type_of_category.get(i);        }        setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,items));    }</code></pre><p>}</p><p>Here is my XML File</p><pre><code>   &lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;TextView android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In My 2nd Activity, i get the error in this line</p><pre><code> setContentView(R.layout.category_list);</code></pre>","282826","","282826","","2010-10-20 18:46:49","2012-12-05 11:47:31","Displaying List View on Button Click in Android","<android>","1","0","0","",""
"3980750","1","3980840","","2010-10-20 17:44:31","1","5077","<p>I have a table called person and it contains two fields, name (TEXT) and age (INT). I want to sort this table alphabetically but I can seem to get the sql statement to work. The statement i am using is: </p><pre><code>SELECT name FROM person ORDER BY name;</code></pre><p>I have tried three different coded versions, none of which work.</p><pre><code>db.rawQuery(""SELECT name FROM person ORDER BY name;"", null);db.execSQL(""SELECT name FROM person ORDER BY name;"", null);db.execSQL(""SELECT name FROM person ORDER BY name;"");</code></pre><p>rawQuery does absolutely nothing, no messages are displayed in LogCat. the first execSQL crashes with:</p><pre><code>java.lang.IllegalArgumentException: Empty bindArgs</code></pre><p>The second execsql crashes with:</p><pre><code>android.database.sqlite.SQLiteException: unknown error: Queries cannot be performed using execSQL(), use query() instead.</code></pre><p>I also tried using query() but I couldn't make heads or tails of it. Help please.</p>","444707","","","","","2012-01-04 04:43:45","android order sqlite table","<android>","2","0","","",""
"3980891","1","","","2010-10-20 18:02:49","3","2032","<p>As i wanted to use a Custom List Adapter so that I could style the list but the Filter functionality is not working. I got the basic filtering to work but the application crashes as soon as the list of filtered results is less than the number of listItems shown when I start filtering.</p><p>There is also a second problem I am having in this code that I am not sure if it is related but when the <code>clear();</code> gets run in the publishResults, then the application also crashes.</p><p>Here is the code I am using.</p><pre><code>package com.android.example;import java.util.ArrayList;import java.util.Arrays;import java.util.Collections;import java.util.List;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.Filter;import android.widget.TextView;public class CustomListAdapter extends ArrayAdapter&lt;String&gt; {    private Context mContext; private String[] items;private String[] filtered;public CustomListAdapter(Context context, int textViewResourceId, String[] items) {        super(context, textViewResourceId, items);        this.filtered = items;        this.items = filtered;        setNotifyOnChange(true);        mContext = context;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {     View v = convertView;     if (v == null) {         LayoutInflater vi = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);         v = vi.inflate(R.layout.list_item, null);     }     String o = filtered[position];     if (o != null) {             TextView tt = (TextView) v.findViewById(R.id.tvViewRow);             if (tt != null) {                   tt.setText(""Name: ""+o);             }     }     return v;}public void notifyDataSetInvalidated(){    super.notifyDataSetInvalidated();}private Filter filter;public Filter getFilter(){    if(filter == null)        filter = new NameFilter();    return filter;}private class NameFilter extends Filter{    @Override    protected FilterResults performFiltering(CharSequence constraint) {        // NOTE: this function is *always* called from a background thread, and        // not the UI thread.        constraint = constraint.toString().toLowerCase();        FilterResults result = new FilterResults();        if(constraint != null &amp;&amp; constraint.toString().length() &gt; 0)        {            ArrayList&lt;String&gt; filt = new ArrayList&lt;String&gt;();            List&lt;String&gt; lItems = new ArrayList&lt;String&gt;();            synchronized (items)            {                     lItems = Arrays.asList(items);                  //Collections.copy(lItems, Arrays.asList(items));            }            for(int i = 0, l = lItems.size(); i &lt; l; i++)            {                String m = lItems.get(i);                if(m.toLowerCase().startsWith(constraint.toString()))                    filt.add(m);            }            result.count = filt.size();            result.values = filt.toArray(new String[0]);        }        else        {            synchronized(items)            {                result.values = items;                result.count = Arrays.asList(items).size();            }        }        return result;    }    @Override    protected void publishResults(CharSequence constraint, FilterResults results) {        // NOTE: this function is *always* called from the UI thread.            filtered = (String[])results.values;            notifyDataSetChanged();            clear();            notifyDataSetInvalidated();    }}</code></pre><p>}</p>","482073","","3069744","","2014-04-04 12:20:47","2014-04-04 12:20:47","Android ArrayAdapter Filtering problems","<android><listview><filter><android-arrayadapter>","2","0","2","",""
"3980899","1","3981030","","2010-10-20 18:03:41","0","2479","<p>Can I set dynamically within an activity the preferred/default application that's to be launched when I push the Home key?  If that's not possible, can I at least reset current defaults so that the chooser window re-appears?  I tried to implement the latter by calling PackageManager.clearPackagePreferredActivities(""com.android.launcher""), but that doesn't seem to do it(I gave my activity SET_PREFERRED_APPLICATIONS permission).</p>","482027","","","","","2012-08-28 01:27:30","Set default Home app dynamically","<android>","3","0","1","",""
"3981007","1","3982768","","2010-10-20 18:19:51","10","9500","<p>Friends, I need help checking whether a device has a sim card programatically. Please provide sample code.</p><p>Thanks.</p>","393953","","863122","","2012-07-20 12:13:18","2012-07-20 12:13:18","How can I check whether the Sim Card is available in an android device?","<android>","1","4","6","",""
"3981163","1","3981644","","2010-10-20 18:40:44","1","2379","<p>What's best practice for structuring an activity, which should begin by displaying an animated image, and then move to another ""activity"" by intent when the animation is complete?  I understand some of the basic principles, but I am getting lost on structuring the flow here.  </p><pre><code>public class Scanimation extends Activity  {  //create name of animation Animation myFadeInAnimation;/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.scanning_view);//grab the imageview from the layout, and then load the animation listener      ImageView myImageView = (ImageView) findViewById(R.id.blinkingView01);      AnimationListener al= new AnimationListener() {    public void onAnimationStart(Animation animation) {    // do nothing           }    public void onAnimationRepeat(Animation animation) {    // do nothing           }        // at the end of the animation, start new activity    public void onAnimationEnd(Animation animation) {        Intent myIntent = new Intent (view.getContext(), LastActivity.class);         startActivity(myIntent);                   }     // get the animation effects which are in the XML file and defines how to animate it       Animation myFadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_in);};     //okay now start the animation on screen     myImageView.startAnimation(myFadeInAnimation);     // go get the vibration service and vibrate quickly while screen is animated               Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);long milliseconds = 2000;v.vibrate(milliseconds);long[] pattern = { 500, 300 };v.vibrate(pattern, -1);      }   }</code></pre><p>Most of the tutorials I've read appear to use this type of flow.  I'm pulling in my main layout and view, then animating the specific view as well as vibrating the device for a quick second.  At the end of the animation, the intent to start my next or last activity does not fire.  </p><p>What am I missing here?</p>","472323","","","","","2010-10-21 03:22:55","stupid question regarding animationlistener and intent","<android><animation>","2","0","","",""
"3981177","1","3981247","","2010-10-20 18:42:21","1","677","<p>Friend's    anybody provide some sample code to send SMS from android device.</p><p>Thanks in advance.</p>","393953","","","","","2010-10-20 23:25:28","Need help on sending SMS from Android device","<android>","2","0","0","",""
"3981206","1","4017994","","2010-10-20 18:45:27","2","2107","<p>How Do I draw a line in Titanium that works in both Android and iPhone?</p>","46076","","","","","2014-04-02 05:01:58","How do I draw a line in Titanium?","<iphone><android><titanium>","3","1","1","",""
"3981280","1","","","2010-10-20 18:53:08","2","5538","<p>Does anyone know how to use Android device's built-in acoustic echo cancellation? It is located somewhere in silicon and is used for GSM/CDMA speakerphone calls. We'd really like to tap into it for a VoIP application instead of rolling our own.</p><p>Ben</p>","307690","","","","","2012-11-04 13:56:49","Using Android's build-in acoustic echo cancellation","<android><echo><voip><cancellation>","3","1","1","",""
"3981416","1","","","2010-10-20 19:09:19","2","292","<p>The Android app EULA has to be part of the app and is generated using the eula class. It appears to be USA specific. Is there a way to automatically generate country-specific EULAs in Android?</p><p>On the iPhone, iTunes does this automatically.</p><p>Has anyone had any experience in this area? </p>","482156","","","","","2010-10-20 19:23:12","Country-Specific EULAs for Android","<android><eula>","1","0","","",""
"3981427","1","","","2010-10-20 19:10:56","1","969","<p>I have a larger image of 1024 x 768. When the image is displayed in the android device as the background image then it gets compressed. Is there any way that the image can be displayed properly in all screen resolution?</p><hr><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width = ""fill_parent"" android:layout_height = ""fill_parent"" android:background = ""@drawable/titlepage""&gt;&lt;/RelativeLayout&gt;</code></pre><p>This is the code that I am using for setting the background image. But since the image is quite large it appears to be compressed when viewed on emulator or device.</p><p>Any help will be just great.</p>","445541","","1288","","2011-08-16 02:53:25","2012-07-24 15:28:56","Best fit the larger image into android device?","<android><image><compress>","3","2","","",""
"3981484","1","3982164","","2010-10-20 19:18:35","1","797","<p>I want to draw a table/grid by specifying the column count for each row and draw some cells in different colors.A row should span over the whole screen. The column-widths should be the same for the columns for each row.I tried using TableLayout with View or Textviews, but I couldn't figure out how I can distribute the columns evenly for each row.</p><p>The grid should look something like this: <a href=""http://img148.imageshack.us/img148/4239/gridk.png"" rel=""nofollow"">http://img148.imageshack.us/img148/4239/gridk.png</a></p>","482159","","","","","2010-10-20 20:47:57","Table with varying column count and auto column widths","<android>","1","1","","",""
"3981716","1","","","2010-10-20 19:48:35","2","1174","<p>I have an Activity which extends <strong>ListView</strong>The ListView that I use is an extension of <strong>ArrayAdapter</strong> and each row of the ListView primarily consists of a <strong>WebView</strong></p><p>The problem is that touching the WebView does not call <strong>OnListItemClick</strong>.</p><p><em><strong>Any thoughts on how I can be able to touch the webview and call OnListItemClick?Or is there something else that I'm doing wrong?</em></strong>Thanks!</p><p>Here is a skeleton of the Activity class, along with the relevant XML files for the layout</p><p>PS, I've tried setting android:clickable=""false"" in my layout, but this doesn't let me click on the rows of my ListView.Interestingly, I can <em>still</em> scroll through the list, but I just can't click!</p><pre><code>public class ListOfItemsFromTopicActivity extends ListActivity {    private Topic t;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.items_from_topic_skeleton);        TopicFactory tf                 = new TopicFactory();        t                               = tf.build_topic(3);        ListView itemlist               = getListView();        ListOfItemsAdapter adapter      = new ListOfItemsAdapter(this, R.layout.items_from_topic_row, t.getItems());        itemlist.setAdapter(adapter);    }    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        // do some stuff that never gets done    }    private class ListOfItemsAdapter extends ArrayAdapter&lt;Item&gt; {        private ArrayList&lt;Item&gt; items;        private int                     text_view_resource_id;        private LayoutInflater          layout_inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        public ListOfItemsAdapter(Context context, int a_text_view_resource_id, ArrayList&lt;Item&gt; some_items) {            super(context, a_text_view_resource_id, some_items);            this.items                  = some_items;            this.text_view_resource_id  = a_text_view_resource_id;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v              = layout_inflater.inflate(this.text_view_resource_id, null);            Item o              = items.get(position);            WebView page        = (WebView)v.findViewById(R.id.item);            page.loadDataWithBaseURL(""fake://a/bcde"", o.getShort_title(), ""text/html"", ""utf-8"", """");            return v;        }    }}</code></pre><p>items_from_topic_skeleton.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=""fill_parent""              android:layout_width=""fill_parent""              android:orientation=""vertical""        &gt;    &lt;TextView            android:background=""@drawable/blackgrad""            android:gravity=""center""            android:id=""@+id/section_title""            android:layout_height=""50dip""            android:layout_width=""fill_parent""            android:textColor=""#ffffff""            android:textSize=""18sp""            /&gt;    &lt;ListView            android:background=""#ffffff""            android:cacheColorHint=""#ffffffff""            android:id=""@android:id/list""            android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            /&gt;&lt;/LinearLayout&gt;</code></pre><p>items_from_topic_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:padding=""5dip""        &gt;    &lt;LinearLayout            android:gravity=""center""            android:layout_height=""60dip""            android:layout_width=""fill_parent""            android:orientation=""horizontal""            &gt;        &lt;LinearLayout                android:layout_height=""fill_parent""                android:layout_weight=""1""                android:layout_width=""fill_parent""                android:minHeight=""55dip""                android:orientation=""horizontal""                android:padding=""5dip""                &gt;            &lt;WebView                    android:id=""@+id/item""                    android:layout_height=""fill_parent""                    android:layout_width=""fill_parent""                    android:scrollbars=""none""                    /&gt;        &lt;/LinearLayout&gt;        &lt;ImageView                android:id=""@+id/disclosure""                android:layout_height=""29dip""                android:layout_width=""29dip""                android:paddingRight=""5dip""                android:src=""@drawable/disclosure""                /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","141146","","","","","2010-10-20 20:40:00","Can't click on ListView whose rows are made of WebViews","<android><list><listview><webview><android-arrayadapter>","1","0","","",""
"3981781","1","3982035","","2010-10-20 19:59:26","12","15813","<p>I'm a Flash developer looking to get into Android/iPhone game development.Android is more important to me, because I don't have any iOS device to test on, and I don't really like apple either :P (could you blame a flash developer for that?)</p><p>What is a good game framework for developing android games? Multi-platform is always a huge bonus but not everything for me.</p><p>I've been looking at Rokon and it seems ok, but the tutorials/examples are a little sketchy.</p>","451575","","","","","2014-04-14 22:59:04","Android Game Framework","<android><frameworks>","5","0","7","2014-04-15 10:17:22",""
"3982105","1","4801023","","2010-10-20 20:41:11","0","836","<p>First of all apologies if this is a duplicate but I'm browsing via my mobile and am having problems searching.</p><p>I'm new to android development and would like to know how to access the gmail contacts rather than phone contacts, I've followed a couple of tutorials and can list the contacts that are stored on the phone but I am unable to find a ContentProvider Uri for GMail!</p><p>I am presuming that they are accessed in the same way that phone contacts are but using a different Uri but so far have been unable to find any information on this!</p><p>Any help is greatly appreciated.</p><p>Thanks</p><p>OneShot</p>","1996973","","","","","2011-01-26 02:48:22","Android ContentProvider Uri for Gmail Contacts","<android>","1","0","","",""
"3982138","1","3982378","","2010-10-20 20:45:28","0","1002","<p>My team is trying to build an Android application for a tablet that will be dedicated for this sole purpose. One of the requirements is that the application is the only thing running on the device (at least from the user's point of view). The user should not be able to close it or use any other functionality from the OS (settings, other apps, etc.). </p><p>We have been doing some research and so far have not found anything. Is this we are trying to do even possible ? Does anybody have any idea how we could approach this ? Maybe blocking the buttons ?</p><p>Thanks, </p>","146100","","","","","2010-10-20 21:15:25","Android OS - Stop user from closing app or using any OS functionality","<android><security>","4","3","","",""
"3982159","1","3983864","","2010-10-20 20:47:30","12","5703","<p>My probel is that images in my Gallery are bleeding in into each other once I begin scrolling towards the next image.</p><p>I am using a <code>android.widget.Gallery</code> connected to a custom adapter I extended from <code>BaseAdapter</code>.</p><p>The adapter's GetView() method is like this</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {            ImageView i = new ImageView(mContext);            if (mImageBitmap != null &amp;&amp; position &lt; mImageBitmap.length)             i.setImageBitmap(mImageBitmap[position]);            return i;</code></pre><p><img src=""http://i.stack.imgur.com/St59x.png"" alt=""alt text"">            }</p>","271395","","","","","2011-11-02 12:34:24","Gallery items overlapping (bleed in)","<android><gallery>","4","1","3","",""
"3982347","1","","","2010-10-20 21:12:31","0","458","<p>My app uses the MediaPlayer for audio playback and gives the user the option to switch between <code>AudioManager.STREAM_VOICE_CALL</code> and <code>AudioManager.STREAM_MUSIC</code> (Earphone and SpeakerPhone)</p><p>Everything works great on the emulator, HTC Droid Eris, and HTC Incredible. However when we went to test the app on the new HTC G2, the audio was so quiet that it could barely be heard in either mode. Emulators are v1.5 and v2.0.1, Eris is v2.1, Incredible is v2.2, and G2 is v2.2.</p><p>When running other apps on the G2, they work just fine. Just my app is quiet (even when the volume is at its highest).</p><p>This is the code:</p><pre><code>mp = new MediaPlayer();AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE);if (speakerPhoneOn){ mp.setAudioStreamType(AudioManager.STREAM_MUSIC);}else{ mp.setAudioStreamType(AudioManager.STREAM_VOICE_CALL);}try { mp.setDataSource(path); mp.prepare();} catch (IllegalArgumentException e) { e.printStackTrace(); showDialog(FILE_ERROR_DIALOG);} catch (IllegalStateException e) { e.printStackTrace(); showDialog(FILE_ERROR_DIALOG);} catch (IOException e) { e.printStackTrace(); showDialog(FILE_ERROR_DIALOG);}</code></pre><p>Anyone have experience handling device specific problems?</p><p>TIA</p>","339428","","","","","2010-10-20 21:12:31","Android: device specific volume issues","<android><volume><audiomanager>","0","2","","",""
"3982461","1","","","2010-10-20 21:28:34","0","1747","<p>Why does the tab text overlap the drawable in the tab? Is there a way to prevent this? Is the drawable always centered? What's the point of being able to add text as well as a drawable to the indicator if it gives this output.</p><p><img src=""http://i.stack.imgur.com/zrlTu.png"" alt=""alt text""></p><p><strong>xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;LinearLayout                android:orientation=""vertical""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:padding=""5dp""&gt;          &lt;TabWidget                        android:id=""@android:id/tabs""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""/&gt;                &lt;FrameLayout                        android:id=""@android:id/tabcontent""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        android:padding=""5dp"" /&gt;  &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p><strong>java</strong></p><pre><code> host.addTab(host.newTabSpec(""_tab2"")                 .setIndicator(""Authors"",res.getDrawable(android.R.drawable.ic_menu_mapmode))                  .setContent(new Intent(this, AuthorList.class)));</code></pre><p>Can anyone else help? I've tried everythin I can think of and it looks like this both in my phone and my emulator. I've used tabs before and it didn't do this.</p>","375874","","375874","","2010-10-21 16:16:40","2011-05-04 14:15:41","Why is the drawable overlapping the text in my tabview","<android><tabwidget>","2","0","","",""
"3982550","1","3982597","","2010-10-20 21:40:03","12","43752","<p>So, now I've figured out how to make multiple of the same object correctly, I need to know how to make an array of them, changing depending on how many are needed, because it is pretty much an object, that stores 3 numbers. How can I Create an arraylist that is of different objects, because I'm going to have the numbers inside them different</p>","481082","","234009","","2010-10-20 21:46:29","2013-12-09 10:46:14","Creating an Arraylist of Objects","<java><android><object><arraylist>","1","3","8","",""
"3982590","1","","","2010-10-20 21:43:39","2","636","<p>I'd like to add a boolean property to a contact. To store this property I noticed that I can store custom notes with my own mimetype.</p><p>So I created a listview which displays all contacts. The listview contains a checkbox and a text field. When the status of the checkbox changes I'd like to update the contact.</p><pre><code>public static final String MY_MIME_TYPE = ""vnd.android.cursor.item/vnd.myapp.boolean_property"";@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.list);    Cursor c = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null,            ContactsContract.Contacts.DISPLAY_NAME);    setListAdapter(new MyAdapter(this, c));    getListView().setItemsCanFocus(false);}public class MyAdapter extends SimpleCursorAdapter implements OnCheckedChangeListener {    public MyAdapter(Context context, Cursor contactCursor) {        super(context, R.layout.my_item, contactCursor, new String[] { Contacts._ID, Contacts.DISPLAY_NAME },                new int[] { R.id.myName });    }    @Override    public void bindView(View view, Context context, Cursor cursor) {        String noteWhere = ContactsContract.Data.CONTACT_ID + "" = ? AND "" + ContactsContract.Data.MIMETYPE + "" = ?"";        String[] noteWhereParams = new String[] { cursor.getString(cursor.getColumnIndex(Contacts._ID)),                MY_MIME_TYPE };        Cursor noteCur = getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, noteWhere,                noteWhereParams, null);        CheckBox isTrue = (CheckBox) view.findViewById(R.id.isTrue);        TextView myName = (TextView) view.findViewById(R.id.myName);        isTrue.setOnCheckedChangeListener(null);        if (noteCur.moveToFirst()) {            int note = noteCur.getInt(noteCur.getColumnIndex(ContactsContract.Data.DATA1));            isTrue.setChecked(note != 0);        } else {            isTrue.setChecked(false);        }        isTrue.setOnCheckedChangeListener(this);        noteCur.close();        isTrue.setTag(cursor.getString(cursor.getColumnIndex(Contacts._ID)));        myName.setText(cursor.getString(cursor.getColumnIndex(Contacts.DISPLAY_NAME)));    }    @Override    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {        CheckBox c = (CheckBox) buttonView;        String id = (String) c.getTag();        try {            ContentValues values = new ContentValues();            values.put(ContactsContract.Data.DATA1, isChecked ? ""1"" : ""0"");            values.put(ContactsContract.Data.RAW_CONTACT_ID, id);            Cursor rawContactsCursor = getContentResolver().query(RawContacts.CONTENT_URI,                    new String[] { RawContacts._ID }, RawContacts.CONTACT_ID + ""=?"",                    new String[] { String.valueOf(id) }, null);            if (rawContactsCursor.moveToFirst()) {                do {                    int rawID = rawContactsCursor.getInt(0);                    int mod = Pilots.this.getContentResolver().update(                            ContactsContract.Data.CONTENT_URI,                            values,                            ContactsContract.Data.RAW_CONTACT_ID + ""="" + rawID + "" AND ""                                    + ContactsContract.Data.MIMETYPE + ""= '"" + MY_MIME_TYPE + ""'"", null);                    if (mod == 0) {                        values.put(ContactsContract.Data.MIMETYPE, MY_MIME_TYPE);                        MyActivity.this.getContentResolver().insert(ContactsContract.Data.CONTENT_URI, values);                    }                } while (rawContactsCursor.moveToNext());            }            rawContactsCursor.close();        } catch (Exception e) {            Log.v(this.getClass().getName(), ""save failed"", e);        }    }}</code></pre><p>The code above fails when it comes to updating the contact. I have no clue why. Any help is appreciated.</p><p>Thx</p>","482204","","","","","2010-10-20 21:43:39","Update contact notes through listview","<android><listview><contacts>","0","4","","",""
"3982747","1","3982770","","2010-10-20 22:08:17","3","611","<p>I'm sure this can be answered really easily. I just do not find the intent id for this job.</p><p>I want to show up that localization settings page, where the user can select ""turn on localization through wifi...""</p><pre><code>      Intent intent = new Intent( ??? );      startActivity(intent);</code></pre>","433718","","213269","","2010-12-21 16:44:22","2010-12-21 16:44:22","What's the android intent to show up the localization settings?","<android><activity><android-intent>","1","0","","",""
"3982793","1","3982807","","2010-10-20 22:18:27","2","553","<p>I was wondering what the purpose of the function onSizeChanged() is while building custom components. I was going over the tic tac toe sample, and can't really seem to get why it is needed, and how the size of a view can change. Sorry if this is a stupid question :)</p><p>Thanks</p>","388025","","","","","2010-10-20 22:20:55","How can the size of a view change?","<android>","1","0","","",""
"3982813","1","3983068","","2010-10-20 22:23:03","0","442","<p>I am developing an android application where i need to connect to a server socket from my application. The application works fine when i am at home and my android phone and the server using the same Wi-Fi. However, when I am at the university my application can not connect to the server socket. It always shows ""The Operation has timed out Error"".</p><p>Obviously I have changed the code to make sure if i am connecting using the right IP Address.</p><p>Can anyone give me some suggestions please.</p><p>thankskaisar</p>","438383","","","","","2010-10-20 23:20:55","Connecting to a Socket from Android application","<android><sockets>","1","0","","",""
"3982843","1","","","2010-10-20 22:27:08","0","165","<p>I need the sourcecode for these libraries:</p><ul><li>commons-codec-1.3</li><li>commons-httpclient-3.0.1 </li><li>commons-logging-1.1</li><li>log4j-1.2.14</li><li>jaxb-ri-2.1</li></ul><p>I need the code to recompile it in eclipse in android app and use it with javax.xml packages as you know javax.xml can not be used in eclipse in an android project.All of this is to use the Amazon-EC2 SDK to access them from android mobile.</p>","482320","","298479","","2010-11-20 22:47:29","2011-06-30 15:06:44","need sorce code of libraries to run on android","<java><android><amazon-ec2>","2","1","","",""
"3982853","1","3983400","","2010-10-20 22:30:02","8","27479","<p>could some one please tell me if there is a way to load kml file into the google map in android.</p><p>thanks</p>","377337","","","","","2010-10-22 16:44:51","Android: how to load KML","<android><google-maps><google-maps-api-3><kml>","3","0","5","",""
"3982874","1","3984596","","2010-10-20 22:34:13","6","1365","<p>This doesn't appear to be well documented or I missed it, so before I run a bunch of my own tests I was wondering if anyone already knows the answers to some of these questions.</p><p>First off, when I say ""Application"" I am referring to extending the <code>Application</code> class.  <a href=""http://developer.android.com/reference/android/app/Application.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Application.html</a></p><p>The questions I have are as follows, some are related.</p><ol><li><p>When an a user leaves an Activity from within the Application, and goes to the Activity of another application, does the Application somehow get paused as well, even though it doesn't have an onPause()?  Or does it continue to live unpaused until all of it's activities are destroyed?</p></li><li><p>when does the Application stop?  When all of it's Activities are destroyed?</p></li><li><p>Is there ever a chance that one of the Applications Activities could be running without an instance of the Application, or will the Application class always exist if one of the Activities does?</p></li><li><p>If there is some process running on the Application, and it's Activities are all paused, will that process continue to run?</p></li><li><p>Is the Application effected by rotation in any way or does rotation only change Activities?</p></li></ol><p>Thanks</p>","445348","","271999","","2013-04-14 17:23:18","2013-04-14 17:23:18","How does Android's Activity lifecycles work in relation to the entire Application?","<android><activity><lifecycle>","4","0","2","",""
"3983048","1","6999044","","2010-10-20 23:16:58","1","1084","<p>I have two projects, my main android application and another test project that runs on top of that android application.</p><p>I have placed a text file in my android test project, This file contains information xml content. The xml content is what my android application will receive when I hit my server. </p><p>I am using the TestCase class in my Android Test Project to test this bit of functionality. Unfortunately I'm having a problem loading the content to into my Android Test Project. Every time I try to load the file into my Android Test Project it does not find the text file. Am I right to say that the only way I can get to that file is by removing it from my Android Test Project and put it in my Actual Android Project or am I missing something that will let me load the File from my Android Test Project.</p><p>Details:In my Android Test Project I kept my file under /res/raw/testFile When I try doing</p><pre><code>File myFile = new File(""/res/raw/testFile"");</code></pre><p>I get a java.io.FileNotFoundException: /res/raw/testFile (No Such File or directory)</p><p>Thanks</p>","431435","","","","","2011-08-09 15:50:38","Loading a text file from AndroidTestProject","<android><unit-testing><file-io>","2","0","","",""
"3983275","1","3983351","","2010-10-21 00:01:17","0","519","<p>Is there functionality in teh live Wallpaper for the service to know where widgets are placed on the homescreen and the size of the widgets? For instance If I created a Live Wallpaper that changed based on widget position is that possible?</p><p>Also I want to make a widget with buttons that manipulate the live wallpaper, would I use the Intent Service for this? or what is the best way to interact with a live wallpaper through a widget?</p>","478183","","19750","","2011-08-31 14:25:43","2011-08-31 14:25:43","Android Live Wallpaper Interaction with Widgets And Tell Wallpaper where widgets are placed","<android><android-widget><android-manifest><android-intent><live-wallpaper>","1","0","","",""
"3983409","1","3985205","","2010-10-21 00:32:36","2","1486","<p>Is is possible to change TextView text after using Linkify to create links? I have something where I want the url to have two fields, a name and id, but then I just want the text to display the name.</p><p>So I start off with a textview with text that includes both name and id, and linkify to create the appropriate links with both fields. But for the display, I don't want to show the id. </p><p>Is this possible?</p>","324518","","","","","2012-02-22 16:54:02","Can I change TextView link text after using Linkify?","<android><linkify>","1","0","3","",""
"3983492","1","","","2010-10-21 00:53:29","18","4402","<p>I'm looking to optimize generating of slightly different APKs of the same Android app, the only difference being the http API server it's using (dev/staging/prod).</p><p>Ideally, I'd just want my Eclipse to build 2 APKs, one with the prod server and one with the dev one.</p><p>I'm even OK with having 2 Run configurations, but I haven't been able to figure out how to pass parameters to the app and read them from the code.</p><p>I want to target 1.5, BTW, and I'd like to use Eclipse auto-build tools, so I'm looking for the most generic solution.</p><p>Thank you.</p>","47680","","47680","","2011-11-01 01:44:23","2014-02-14 10:48:21","Build multiple (test/prod) versions of Android APKs in Eclipse","<android><eclipse><build><settings>","5","5","8","",""
"3983610","1","4357497","","2010-10-21 01:23:35","0","1136","<p>I'm trying to create an ADT layout configuration to match an EVO 4G screen, with its 800x480 resolution and 4.3"" screen. The emulator I created by just specifying WVGA800 in the SDK Manager seems to match my physical EVO device perfectly.</p><p>However, when I try to create a Layout device config (the one you select when you edit an XML view), I can't match it at all, no matter the values I've tried so far. The default configuration only includes a 3.7"" and then jumps to 5.1"" (whaaa, why did ADT devs think 4.3"" screens weren't important enough?). OK, so I make a custom one, but no matter what values I try, I can't match the emulator size.</p><p>Does anyone know what the exact values I must put in to the layout config for it to match 100%? x dpi, y dpi? Values I found online end up not matching the right size. It looks like the Density needs to be set to High, and Screen Ratio and Screen Size don't matter.</p><p>Thank you.</p>","47680","","","","","2010-12-05 05:17:51","Android Eclipse ADT device configuration for EVO 4G 4.3"" layout","<android><configuration><layout><config><adt>","1","2","","",""
"3983619","1","","","2010-10-21 01:25:01","0","659","<p>I'm coding this in Java for an Android device. I'd just like to read all of the data in the RSS feed and then I have a parser ready to act on the data. The trouble I'm getting is that only a small portion of the data is ever being read by my code. It then says the end of the reader has been reached and proceeds to return the partial data to the parser.</p><p>The code I have is this:</p><pre><code>try{    URL contentUrl = new URL(url);     URLConnection conn = contentUrl.openConnection();    HttpURLConnection httpConn = (HttpURLConnection) conn;    httpConn.setAllowUserInteraction(false);    httpConn.setInstanceFollowRedirects(true);    httpConn.setRequestMethod(""GET"");    httpConn.connect();    if(httpConn.getResponseCode() == HttpURLConnection.HTTP_OK)    {        InputStreamReader inStr = new InputStreamReader(httpConn.getInputStream());                                         int charsRead;        char[] buff = new char[BUFFER_SIZE];        String data = """";        while((charsRead = inStr.read(buff,0,BUFFER_SIZE))!= -1)        {            data += String.copyValueOf(buff, 0, charsRead);            buff = new char[BUFFER_SIZE];        }        Log.d(""Http"",""Data: ""+data.);        return data;    }    else    {        return null;    }}catch(IOException e){    return null;}</code></pre><p>The debug log output looks like this:</p><pre><code>&gt; D/dalvikvm(19134): GC_FOR_MALLOC freed 24 objects / 757272 bytes in 27msD/dalvikvm(19134): GC_FOR_MALLOC freed 2 objects / 48 bytes in 26msD/dalvikvm(19134): GC_FOR_MALLOC freed 3 objects / 301112 bytes in 29msI/dalvikvm-heap(19134): Grow heap (frag case) to 3.677MB for 305028-byte allocationD/dalvikvm(19134): GC_FOR_MALLOC freed 0 objects / 0 bytes in 37msD/dalvikvm(19134): GC_FOR_MALLOC freed 10 objects / 760856 bytes in 27msD/dalvikvm(19134): GC_FOR_MALLOC freed 3 objects / 305112 bytes in 26msD/dalvikvm(19134): GC_FOR_MALLOC freed 10 objects / 770856 bytes in 26msD/dalvikvm(19134): GC_FOR_MALLOC freed 2 objects / 48 bytes in 26msD/dalvikvm(19134): GC_FOR_MALLOC freed 3 objects / 309112 bytes in 27msD/dalvikvm(19134): GC_FOR_MALLOC freed 22 objects / 777648 bytes in 27msD/dalvikvm(19134): GC_FOR_MALLOC freed 2 objects / 48 bytes in 30msD/dalvikvm(19134): GC_FOR_MALLOC freed 3 objects / 309288 bytes in 26msD/dalvikvm(19134): GC_FOR_MALLOC freed 27 objects / 778696 bytes in 27msD/Http    (19134): Data: &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;D/Http    (19134): &lt;?xml-stylesheet type=""text/xsl"" media=""screen"" href=""/~d/styles/atom10full.xsl""?&gt;&lt;?xml-stylesheet type=""text/css"" media=""screen"" href=""http://feeds.feedburner.com/~d/styles/itemcontent.css""?&gt;&lt;feed xmlns=""http://www.w3.org/2005/Atom"" xmlns:openSearch=""http://a9.com/-/spec/opensearch/1.1/"" xmlns:georss=""http://www.georss.org/georss"" xmlns:thr=""http://purl.org/syndication/thread/1.0"" xmlns:gd=""http://schemas.google.com/g/2005"" xmlns:feedburner=""http://rssnamespace.org/feedburner/ext/1.0"" gd:etag=""W/&amp;quot;CUcFSHc7fip7ImA9Wx5UFk8.&amp;quot;""&gt;&lt;id&gt;tag:blogger.com,1999:blog-11300808&lt;/id&gt;&lt;updated&gt;2010-10-20T18:03:39.906-07:00&lt;/updated&gt;&lt;title type=""text""&gt;Google Code Blog&lt;/title&gt;&lt;subtitle type=""html""&gt;Updates from Google's open source projects.&lt;/subtitle&gt;&lt;link rel=""http://schemas.google.com/g/2005#feed"" type=""application/atom+xml"" href=""http://googlecode.blogspot.com/feeds/posts/default"" /&gt;&lt;link rel=""alternate"" type=""text/html"" href=""http://googlecode.blogspot.com/"" /&gt;&lt;link rel=""next"" type=""application/atom+xml"" href=""http://www.blogger.com/feeds/11300808/posts/default?start-index=26&amp;amp;max-results=25&amp;amp;redirect=false&amp;amp;v=2"" /&gt;&lt;author&gt;&lt;name&gt;Chris DiBona&lt;/name&gt;&lt;email&gt;noreply@blogger.com&lt;/email&gt;&lt;/author&gt;&lt;generator version=""7.00"" uri=""http://www.blogger.com""&gt;Blogger&lt;/generator&gt;&lt;openSearch:totalResults&gt;753&lt;/openSearch:totalResults&gt;&lt;openSearch:startIndex&gt;1&lt;/openSearch:startIndex&gt;&lt;openSearch:itemsPerPage&gt;25&lt;/openSearch:itemsPerPage&gt;&lt;atom10:link xmlns:atom10=""http://www.w3.org/2005/Atom"" rel=""self"" type=""application/atom+xml"" href=""http://feeds.feedburner.com/blogspot/Dcni"" /&gt;&lt;feedburner:info uri=""blogspot/dcni"" /&gt;&lt;atom10:link xmlns:atom10=""http://www.w3.org/2005/Atom"" rel=""hub"" href=""http://pubsubhubbub.appspot.com/"" /&gt;&lt;entry gd:etag=""W/&amp;quot;CUcFSHc6fCp7ImA9Wx5UFk8.&amp;quot;""&gt;&lt;id&gt;tag:blogger.com,1999:blog-11300808.post-3825033765857847156&lt;/id&gt;&lt;published&gt;2010-10-20T18:03:00.000-07:00&lt;/published&gt;&lt;updated&gt;2010-10-20T18:03:39.914-07:00&lt;/updated&gt;&lt;app:edited xmlns:app=""http://www.w3.org/2007/app""&gt;2010-10-20T18:03:39.914-07:00&lt;/app:edited&gt;&lt;category scheme=""http://www.blogger.com/atom/ns#"" term=""speed tracer"" /&gt;&lt;category scheme=""http://www.blogger.com/atom/ns#"" term=""gwt"" /&gt;&lt;category scheme=""http://www.blogger.com/atom/ns#"" term=""eclipse"" /&gt;&lt;category scheme=""http://www.blogger.com/atom/ns#"" term=""cloud portability"" /&gt;&lt;title&gt;Advancing cloud computing with integrated developer tools by Google and VMware&lt;/title&gt;&lt;content type=""html""&gt;&amp;lt;p&amp;gt;&amp;lt;i&amp;gt;Cross-posted from the &amp;lt;a href=""http://googlewebtoolkit.blogspot.com/""&amp;gt;Google Web Toolkit Blog&amp;lt;/a&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;D/Http    (19134):D/Http    (19134): &amp;lt;p&amp;gt;D/Http    (19134): Earlier this year at Google I/O, we &amp;lt;a href=""http://googlecode.blogspot.com/2010/05/enabling-cloud-portability-with-google.html""&amp;gt;announced&amp;lt;/a&amp;gt; a collaboration between &amp;lt;a href=""http://www.google.com""&amp;gt;Google&amp;lt;/a&amp;gt; and &amp;lt;a href=""http://www.vmware.com""&amp;gt;VMware&amp;lt;/a&amp;gt; focusedon making it easy to build business-oriented, &amp;lt;a href=""http://code.google.com/cloudportability/""&amp;gt;cloud portable&amp;lt;/a&amp;gt; web apps. We showed how businesses could use our integrated developer tools to build modern web apps that are ÔÇ£cloud readyÔÇØ from the start, and can be deployed to any standard environment, including &amp;lt;a href=""http://code.google.com/appengine/""&amp;gt;Google App Engine&amp;lt;/a&amp;gt; and on &amp;lt;a href=""http://www.springsource.com/products/cloud-application-platform""&amp;gt;VMware vFabric&amp;lt;/a&amp;gt; on-premise solutions. Today we are happy to announce that these tools will be generally available within the next few weeks.D/Http    (19134): &amp;lt;/p&amp;gt;D/Http    (19134):D/Http    (19134): &amp;lt;p&amp;gt;D/Http    (19134): Of course, if youÔÇÖre itching to get a head start, you can jump right in by downloading the release candidate version of &amp;lt;a href=""http://www.springsource.com/landing/best-development-tool-enterprise-java""&amp;gt;SpringSource Tool Suite&amp;lt;/a&amp;gt;.D/Http    (19134): &amp;lt;/p&amp;gt;D/Http    (19134):D/Http    (19134): &amp;lt;p&amp;gt;D/Http    (19134): If youÔÇÖd prefer to wait for the general release, you can &amp;lt;a href=""http://code.google.com/cloudportability/""&amp;gt;sign up&amp;lt;/a&amp;gt; to be notified as soon as they are</code></pre><p>If you check the feed (http://feeds2.feedburner.com/blogspot/Dcni) then you'll see that this is only a tiny fraction of the content. I thought since I'm getting the heap message that the phone may be running out of heap space and therefore quitting, but I found an RSS TTS project which has its own http code: <a href=""http://code.google.com/p/talkingrssreader/source/browse/trunk/talkingrss/src/com/googlecode/talkingrssreader/talkingrss/ReaderHttp.java"" rel=""nofollow"">talkingrssreader</a> and when I pull theirs out and try it with my code it still has the same issue. Trying the talking RSS reader app with that feed doesn't have this issue.</p><p>I'm at a loss now as to what else to try. I can obtain and parse shorter RSS feeds without a problem but it seems after a certain length it just refuses to gather all the data. I've gone through a lot of RSS readers in the Android market and not seen any others cut the feed short, so that makes me believe it's an issue in my code and not the device running out of memory. This is further evidenced by the fact that my code will easily read a 119kb xml file, but will fail on the Google RSS feed, which is only 32kb.</p><p>Can anyone give me some ideas on what the issue could be?</p><p>edit:After adding the changes suggested by the100rabh and Isaac, the code now looks like this:</p><pre><code>InputStreamReader inStr = new InputStreamReader(httpConn.getInputStream());                                 int charsRead;char[] buff = new char[BUFFER_SIZE];StringBuffer data = new StringBuffer();while((charsRead = inStr.read(buff,0,BUFFER_SIZE))!= -1){    data.append(buff, 0, charsRead);}Log.d(""Http"",""Data: ""+data.toString());return data.toString();</code></pre><p>The problem is still there though. It cuts the data short in exactly the same place as it did with the previous code.</p>","482435","","482435","","2010-10-21 10:17:16","2010-11-18 16:23:48","Reading RSS feed, end of reader before end of data","<java><android><http>","2","0","","",""
"3983632","1","3983658","","2010-10-21 01:29:09","0","1910","<p>What I would like to accomplish is to, at runtime, place a button in the middle of the screen, as the very top layer, overlaying anything below it.  (It's not big, so it will not completely cover the screen, just whatever happens to be below it.)</p><p>I looked at creating a custom dialog, however that blocks all other user input.  I want all of the views below this new button to act normally and respond to the user, but I just want to add (and later remove) the button above everything.</p><p>Hopefully that makes sense.  I'm just wondering what might be the best approach to look into?</p><p>Thanks</p>","445348","","","","","2013-01-10 00:24:25","How to overlay a button programmically?","<android><view><dialog><overlay>","2","0","2","",""
"3983785","1","3983866","","2010-10-21 02:07:16","2","912","<p>I have many ImageViews set with OnClickListeners. They extend beyond the screen, contained in a ScrollView. When scrolling down and clicking an ImageView that was previously beyond the screen, onClick(View view) does not seem to execute until the second click. It behaves normally otherwise.</p><p>My Activity implements OnClickListener and uses overridden onClick(View view). </p><p>What is happening? Is this an issue involving touch mode?</p><p>Thanks!</p><p><strong>UPDATE:</strong> The problem I'm experiencing is similar to this bug report: <a href=""http://code.google.com/p/android/issues/detail?id=11357"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=11357</a>. <strong>Works as intended in Eclair, not Froyo.</strong></p>","264734","","264734","","2010-10-22 00:26:49","2010-10-22 00:26:49","Onclicklistener acts weird after scrolling in ScrollView","<android><uiscrollview>","1","1","3","",""
"3983998","1","3984188","","2010-10-21 03:07:38","-1","1070","<p>I am just getting into android development, can anyone guide me how to develop an mp3 player on android platform? any suggestion is greatly appreciated.</p>","407204","","","","","2010-10-21 04:02:17","Develop mp3 player on Android platform","<android><mp3><player>","1","0","","",""
"3984004","1","4043793","","2010-10-21 03:09:11","1","987","<p>I want to identify the an android native app user on my web service. I don't want to include a secret in my java, as that would be trivial to find. Using the javascript sdk on the website, the token is signed and I can verify it with the shared secret on the server, but the android sdk just gets a token.</p><p>I had hoped that I could pass the token and the signature to my web service and then I could verify that the actions the user were taking were authorized. Is there a way to get a signature of an access token (and the shared secret) already granted from facebook?</p>","482494","","","","","2011-02-24 06:04:05","How can I get a signed access token from facebook using OAuth 2.0?","<android><facebook><oauth-2.0>","1","0","","",""
"3984146","1","","","2010-10-21 03:48:09","2","3158","<p>I have a ListView that I'm populating with dummy strings right now. It is currently holding 10 items, but the view itself is only large enough to show 5. So the list has to scroll of course. I've built the list using the following code:</p><p>ListView:</p><pre><code>&lt;RelativeLayout    android:id=""@+id/catList""    android:layout_width=""wrap_content""    android:layout_height=""216dip""    android:layout_marginTop=""120dip""    &gt;    &lt;ListView        android:id=""@+id/categoryList""        android:layout_width=""308dip""        android:layout_height=""216dip""        android:layout_marginLeft=""6dip""        android:background=""#ffffff""        android:divider=""#ffffff""        android:choiceMode=""singleChoice""        android:cacheColorHint=""#00000000""        &gt;    &lt;/ListView&gt;    &lt;ImageView        android:id=""@+id/catListFrame""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""            android:layout_alignParentTop=""true""        android:src=""@drawable/selectorframe""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>So basically there is an image frame around the list. This is all nested inside another layout.</p><p>I have a custom item xml file as well that 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:layout_width=""fill_parent""   android:layout_height=""?android:attr/listPreferredItemHeight""   android:padding=""10dip""   android:background=""#ffffff""   &gt;   &lt;TextView       android:id=""@+id/catTitle""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""       android:textSize=""20dip""       android:textColor=""#000000""   &gt;   &lt;/TextView&gt; &lt;/LinearLayout&gt;</code></pre><p>Here's the java that makes it all work:</p><pre><code>private void setCategoryControls(){    btnBackHome = (ImageView)findViewById(R.id.catHomeBtn);    btnBackHome.setOnClickListener(goHome);    catList = (ListView)findViewById(R.id.categoryList);    catList.setOnItemClickListener(selectCat);    demoCats = new ArrayList&lt;String&gt;();    for(int i=1;i&lt;=10;i++){        demoCats.add(""Item "" + i);    }    m_catAdapter = new CatAdapter(this,R.layout.catitem,demoCats);    catList.setAdapter(m_catAdapter);}private OnItemClickListener selectCat = new OnItemClickListener(){    public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id){        if(selCatView!=null){            selCatView.setBackgroundColor(Color.parseColor(""#ffffff""));        }        v.setBackgroundColor(Color.parseColor(""#ffaa00""));        selCatView = v;    }};private class CatAdapter extends ArrayAdapter&lt;String&gt;{    private ArrayList&lt;String&gt; items;    public CatAdapter(Context context, int textViewResourceId, ArrayList&lt;String&gt; items){        super(context, textViewResourceId, items);        this.items = items;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.catitem, null);            }            String cat = items.get(position);            if (cat != null) {                    TextView catName = (TextView) v.findViewById(R.id.catTitle);                    if (catName != null) {                          catName.setText(cat);                    }            }            return v;    }}</code></pre><p>What happens is when I click an item in the list it should simply change the background color of that item, instead it usually highlights 2 items (one that's visible and one that I have to scroll to), and most of the time it's not even the right item. Also if I scroll while an item is highlighted it will randomly change around which is highlighted as I scroll the highlighted item on and off the screen. If I had to guess, I'd say it's tied to the fact that the ListView apparantly only keeps track of the visible children. Even though it has an adapter with 10 items, if I run a getChildCount on the list view it only shows 5 or 6 depending on if one is partially visible or not, but it never shows more or less than the number of visible items.</p>","469219","","","","","2013-02-19 08:19:57","Android: Custom ListView OnItemClickListener Weird Issues","<android>","1","0","1","",""
"3984199","1","","","2010-10-21 04:04:59","0","342","<p>How can we fill PreferenceScreen dynamically (from JAVA).</p><p>I have one string array. I want all items to be displayed in second preference screen with checkbox.</p><p>Currently I am having <pre>CheckBoxPreference</pre>tags for each item in string array in preferences.xml.</p><p>Any thoughts on how to do this.</p>","465751","","244296","","2010-10-21 04:22:17","2011-10-03 14:17:47","Loading PreferenceScreen from JAVA","<android><preference>","1","0","","",""
"3984281","1","4464798","","2010-10-21 04:28:14","0","2619","<p>Greg</p><p>Here is my New code based on your suggestions. It did not work. I got a bunch of ""Just sent a text message with coords"" in a row. So it still is not sleeping for 15 seconds.</p><pre><code>package com.droid.service;</code></pre><p>import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Timer;import java.util.TimerTask;</p><p>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.Handler;import android.os.IBinder;import android.os.Looper;</p><p>public class DroidService extends Service{</p><pre><code>private LocationManager lm;private LocationListener locationListener;private Location location = null;@Overridepublic IBinder onBind(Intent arg0){    return null;}// @Override// public void onCreate()// {// super.onCreate();// initService();// }private static final int PERIOD = 15000;Handler mHandler;Runnable mRunnable;@Overridepublic void onCreate(){    super.onCreate();    mHandler = new Handler();    mRunnable = new Runnable()    {        public void run()        {            updateNotification();                       mHandler.postDelayed(this, PERIOD);            System.out.println(""PAUSE FOR 15 SECONDS..!!"");        }    };}@Overridepublic void onStart(final Intent intent, final int startId){    super.onStart(intent, startId);    mRunnable.run();}</code></pre><p>//  private void initService()//  {//      System.out.println(""In initService..Droid Service...!!"");//      int initialDelay = 15000; // start after 15 seconds//      // int period = 300000; // repeat every 5 minuets//      // int period = 1800000; // repeat every 30 minuets//      int period = 15000; // repeat every 15 seconds for testing//      Timer timer = new Timer();//      TimerTask task = new TimerTask()//      {//          public void run()//          {//              Looper.prepare();//              updateNotification();//              Looper.loop();//          }//      };//      timer.scheduleAtFixedRate(task, initialDelay, period);//  }</p><pre><code>protected void updateNotification(){    lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    locationListener = new MyLocationlistener();    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);    location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);}public static class DateUtils{    public static final String DATE_FORMAT_NOW = ""yyyy-MM-dd HH:mm:ss"";    public static String now()    {        Calendar cal = Calendar.getInstance();        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);        return sdf.format(cal.getTime());    }}private class MyLocationlistener implements LocationListener{    public void onLocationChanged(Location loc)    {        double lat = loc.getLatitude();        double lon = loc.getLongitude();        String latitude = Double.toString(lat);        String longitude = Double.toString(lon);        String coords = latitude + longitude;        // comment out text message for debug mode        // SmsManager sm = SmsManager.getDefault();        // sm.sendTextMessage(""phoneNumber"", null, coords, null, null);        System.out.println(""Just sent a text message with coords"");    }    public void onProviderDisabled(String provider)    {    }    public void onProviderEnabled(String provider)    {    }    public void onStatusChanged(String provider, int status, Bundle extras)    {    }}</code></pre><p>}</p><p>Here is my code</p><p>I get ""Just sent a text message with coords"" sent like once a second even though my scheduleAtFixedRate is set for 10 seconds.</p><p>I got this to work in a normal program, but on the Android platform, they want you to use Looper....and it appears that my code is caught up in this Looper so therefore it is ignoring my scheduleAtFixedRate(10 seconds)</p><p>Any help is greatly appreciated.</p><pre><code>package com.droid.service;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.os.Looper;public class DroidService extends Service{    private LocationManager lm;    private LocationListener locationListener;    private Location location = null;    @Override    public IBinder onBind(Intent arg0)    {        return null;    }    @Override    public void onCreate()    {        super.onCreate();        initService();    }    private void initService()    {        System.out.println(""In initService..!!"");        int initialDelay = 15000; // start after 15 seconds        // int period = 300000; // repeat every 5 minuets        // int period = 1800000; // repeat every 30 minuets        int period = 15000; // repeat every 15 seconds for testing        Timer timer = new Timer();        TimerTask task = new TimerTask()        {            public void run()            {                Looper.prepare();                updateNotification();                Looper.loop();                Looper.myLooper().quit();            }        };        timer.scheduleAtFixedRate(task, initialDelay, period);    }    protected void updateNotification()    {        lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        locationListener = new MyLocationlistener();        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);        location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);    }    private class MyLocationlistener implements LocationListener    {        public void onLocationChanged(Location loc)        {            double lat = loc.getLatitude();            double lon = loc.getLongitude();            String latitude = Double.toString(lat);            String longitude = Double.toString(lon);            String coords = latitude + longitude;            // comment out text message for debug mode            // SmsManager sm = SmsManager.getDefault();            // sm.sendTextMessage(""phoneNumber"", null, coords, null, null);            System.out.println(""Just sent a text message with coords"");        }        public void onProviderDisabled(String provider)        {        }        public void onProviderEnabled(String provider)        {        }        public void onStatusChanged(String provider, int status, Bundle extras)        {        }    }}</code></pre>","393913","","393913","","2010-10-22 05:13:34","2010-12-16 19:55:18","Why is my scheduleAtFixedRate being ignored in my code..?","<android>","3","0","","",""
"3984308","1","","","2010-10-21 04:34:36","0","54","<p>I am new to this stackoverflow.I have one doubt If I have some answer mean how can i share that to everyone .</p><p>Regards,Lakshmanan</p>","450596","","","","","2010-10-21 04:34:36","How can I Share My answers to all","<android>","0","2","","",""
"3984360","1","","","2010-10-21 04:45:28","0","86","<p>I have an app that plays several different audio files on a loop, via several different buttons. I want to program a single button that will stop the MediaPlayer, regardless of what audio file is currently being played. Any help with this would be greatly appreciated.</p>","482550","","","","","2010-10-21 11:42:23","Android: I need a button that kills anything played by the MediaPlayer","<android>","1","0","","",""
"3984434","1","","","2010-10-21 05:04:50","0","2067","<p>I want to pass a 2-D String Array to another activity.My S2-D String Array  (String[][]) is 'selected_list'.</p><p>code is :</p><pre><code>     Bundle list_bundle=new Bundle();     list_bundle.putStringArray(""lists"",selected_list);      Intent list_Intent = new Intent(v.getContext(), view_selected_items.class);     startActivityForResult(list_Intent, 2);</code></pre><p>But putStringArray(""lists"",selected_list) is showing a error like we can pass only 1-Dimensional Array (String[]).</p><p>Thanks</p>","453607","","510491","","2011-03-07 08:06:30","2013-09-28 13:43:41","putStringArray() using String 2-Dimensional array (String[][] )","<android><arrays><bundle>","3","0","2","",""
"3984480","1","","","2010-10-21 05:14:02","0","138","<ol><li>How to use Customized fonts on Canvas?</li><li><p>I have customized view (PIECHART DRAWN ON CANVAS) on left side of the screen and list view on right  of the screen. When ever I touched on the canvas list view values has to be changed. is it possible. My listview is in Activity A class.And view is in B class.</p></li><li><p>I have piechart with n no of arcs. On tapping on that i have to known which arc is tapped. Is there any formula for it. (Like for rectangle basing on left,top and width hegiht we can check.)</p></li></ol>","446010","","83446","","2011-05-12 05:29:58","2011-05-12 05:34:11","How to Use Customized fonts on Canvas(3 Questions included inside)","<android>","1","0","","",""
"3984518","1","3984812","","2010-10-21 05:21:58","1","786","<p>I am new to android .can any one solve the following problem?I just create the class like below .I need to know how to set property for the Edit text field</p><pre><code>public class CustomEditText extends EditText{public CustomEditText(Context context) {    super(context);    // TODO Auto-generated constructor stub}</code></pre><p>}</p><p>Note: I mean the property like this        Edittext.setText(""Demo"");Thanks in advance.</p>","482568","","","","","2010-10-21 06:23:38","How to set Custom EditTextField properties in android?","<android>","2","0","1","",""
"3984530","1","","","2010-10-21 05:24:47","0","164","<p>i am new to android. I want example how to parse xml file in android.could anybody provide me a program</p>","475349","","","","","2010-10-21 06:02:06","xml parsing in android","<android>","1","1","","",""
"3984604","1","4101834","","2010-10-21 05:42:34","0","251","<p>I'm new to android programming, and I was wondering if there was an event or something for any virtual keyboard input. I was also wondering if there is an event for when you try to send a text message, or maybe a way to send a text message. I want to use 2.2. thanks.</p><p>After doing some reading it looks like this isn't possible. What I wanted to do was globally catch keys from the virtual keyboard. </p>","222054","","222054","","2010-10-21 22:58:58","2010-11-04 22:04:41","Android catch keys","<android><key>","3","0","","",""
"3984718","1","","","2010-10-21 06:07:28","0","128","<p>Ok so I have my app 90% built everything works but my download button. I have been stuck on this for days now so if anyone could help a guy out with something that will work for this. my files are .pkg and I feed the filename from a xml file and here is my buttons code but I dont know what I am doing wrong here. It just does nothing upon clicking it. The appUrl is my file name from the xml file</p><pre><code>Button b_get_book = (Button)v.findViewById(R.id.Button01);        b_get_book.setOnClickListener(                new View.OnClickListener()                {                                  public void onClick(View v) {                         try {                                File root = Environment.getExternalStorageDirectory();                                URL u = new URL(""http://www.mysite.com/"" + appUrl);                                HttpURLConnection c = (HttpURLConnection) u.openConnection();                                c.setRequestMethod(""GET"");                                c.setDoOutput(true);                                c.connect();                                FileOutputStream f = new FileOutputStream(new File(root, appUrl));                                InputStream in = c.getInputStream();                                byte[] buffer = new byte[1024];                                int len1 = 0;                                while ((len1 = in.read(buffer)) &gt; 0) {                                    f.write(buffer, 0, len1);                                }                                f.close();                            } catch (Exception e) {                                Log.d(""Downloader"", e.getMessage());                            }                      }           });</code></pre><p>Any help would be great I have been pulling my hair out over this. I make a pretty complex app and its the easy thing that gets me...... go figure. if anyone can help me out with some working code from a button that would be awesome. even better if it has a progress bar for the downloads. that is my next task after getting the actual download working. Thanks </p>","475994","","","","","2010-10-21 08:30:23","Download button does not work please help","<android>","1","2","","",""
"3984779","1","","","2010-10-21 06:17:42","-1","69","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3984530/xml-parsing-in-android"">xml parsing in android</a>  </p></blockquote><p>what is use of xml prasing in android program</p>","475349","","","","","2010-10-21 08:42:41","xml parsing in android","<android>","1","1","","2010-10-22 12:56:47",""
"3984798","1","","","2010-10-21 06:21:07","2","963","<pre><code>    private void kartyafeleanim(String idx1, String idx2) {    Animation anim1=AnimationUtils.loadAnimation(mycontext, R.anim.scalable_anim);    Animation anim2=AnimationUtils.loadAnimation(mycontext, R.anim.scalable_anim);    try {        for (int i=0; i&lt;6; i++) {            LinearLayout LL = (LinearLayout) myLinearLayout.getChildAt(i);            for (int j=0; j&lt;LL.getChildCount(); j++) {                if (LL.getChildAt(j).getTag().toString().equals(idx1) || LL.getChildAt(j).getTag().toString().equals(idx2)) {                    final View v = LL.getChildAt(j);                    int rtop=0;                    if (v.getTag().toString().equals(idx1)) rtop=110+(53*((int)((Integer.parseInt(idx1)-100)/6)));                    if (v.getTag().toString().equals(idx2)) rtop=110+(53*((int)((Integer.parseInt(idx2)-100)/6)));                    int left=v.getLeft();                    int top =v.getTop()+rtop-30;                    FrameLayout.LayoutParams lp =new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.LEFT);                    lp.setMargins(left, top, 0, 0);                    if (v.getTag().toString().equals(idx1)) {                        final ImageView img1 =new ImageView(mycontext);                        img1.setBackgroundResource(R.drawable.match);                        img1.setLayoutParams(lp);                        myLinearLayoutAll.addView(img1);                        img1.setVisibility(View.VISIBLE);                        img1.startAnimation(anim1);                        anim1.setAnimationListener(new AnimationListener() {                            @Override                            public void onAnimationEnd(Animation animation) {                                //img1.setVisibility(View.INVISIBLE);                                myLinearLayoutAll.removeView(img1);                            }                            @Override                            public void onAnimationRepeat(Animation animation) {}                            @Override                            public void onAnimationStart(Animation animation) { }                        });                    }                    else if (v.getTag().toString().equals(idx2)) {                        final ImageView img2 =new ImageView(mycontext);                        img2.setBackgroundResource(R.drawable.match);                        img2.setLayoutParams(lp);                        myLinearLayoutAll.addView(img2);                        img2.setVisibility(View.VISIBLE);                        img2.startAnimation(anim2);                        anim2.setAnimationListener(new AnimationListener() {                            @Override                            public void onAnimationEnd(Animation animation) {                                //img2.setVisibility(View.INVISIBLE);                                myLinearLayoutAll.removeView(img2);                            }                            @Override                            public void onAnimationRepeat(Animation animation) {}                            @Override                            public void onAnimationStart(Animation animation) { }                        });                    }                }            }        }    } catch (Exception ex) {}   }</code></pre><p>in the animation end, i calling removeview, and then the error occure. Why? </p>","472537","","","","","2011-09-16 13:27:38","Android removeview error when animating","<android><animation>","1","2","1","",""
"3984958","1","","","2010-10-21 06:46:57","0","4319","<p>I want to have dynamic spinner in android e.g one spinner for country and depending upon the value selected in Country, i want to get another spinner for states.</p>","482640","","","","","2010-12-22 20:58:18","How to get multiple spinner in android where value of one spinner depends on value of other spinner?","<android>","1","0","","",""
"3985047","1","3985381","","2010-10-21 07:02:08","0","854","<p>I am dynamically creating layout and text view in android. If the text view content is large, how to wrap the content of text view dynamically? </p>","426344","","23153","","2010-10-21 07:36:28","2010-10-21 07:59:16","Wrap the content of text view in java code in android","<android>","1","0","","",""
"3985066","1","","","2010-10-21 07:04:28","1","2673","<p>I'm trying to add a bottom border my listview in androidThe code i used is </p><pre><code>&lt;ListView   android:id=""@+id/listview""  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_weight=""1""   android:scrollbars=""horizontal""   android:background=""#ffffff""  android:cacheColorHint=""#ffffff""  /&gt; </code></pre><p>It is working when there is only lest no of items. But not working when no of items is moreI mean when the items cannot display in on screenThanks</p><p>The entire layout i used </p><p>    ></p><pre><code> &lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""    android:background=""@drawable/navigationbar""    &gt;&lt;ImageView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:background=""@drawable/search_icon""/&gt; &lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""5dp""    android:layout_height=""wrap_content""/&gt;&lt;EditText       android:layout_width=""220dp""    android:layout_height=""wrap_content""    android:layout_marginTop=""4dp""    android:layout_marginBottom=""2dp""    android:singleLine=""true""    android:id=""@+id/categoryListEditText""/&gt;     &lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""5dp""    android:layout_height=""wrap_content""/&gt;&lt;Button    android:layout_width=""50dp""    android:layout_height=""wrap_content""    android:layout_marginTop=""4dp""    android:layout_marginBottom=""2dp""    android:textSize=""10dp""    android:textStyle=""bold""    android:background=""@drawable/switch_list_button""    android:id=""@+id/switchListsButton""/&gt;&lt;/LinearLayout&gt;    &lt;TextView   style=""@style/firstBannerTextView""    android:text=""Type a category name to filter the List.""/&gt;    &lt;TextView       style=""@style/secondBannerTextView""         android:id=""@+id/categoryList""    /&gt;&lt;ListView   android:id=""@+id/listview""  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_weight=""1""   android:scrollbars=""horizontal""   android:background=""#ffffff""  android:cacheColorHint=""#ffffff""  /&gt; </code></pre><p></p>","477754","","477754","","2010-10-21 09:32:32","2011-10-06 09:02:42","Bottom border for list view in android","<android><listview><border>","1","4","","",""
"3985141","1","3986132","","2010-10-21 07:19:03","2","2330","<p>hi i am new to android what i did is creating a list with strings and implementing the search using edit text,my code for this is as fallows</p><pre><code> ((EditText)findViewById(R.id.EditText01)).setOnKeyListener(new OnKeyListener()     {  public boolean onKey(View v, int keyCode, KeyEvent event)  { String enteredText = ((EditText)findViewById(R.id.EditText01)).getText().toString();      Iterator&lt;String&gt; strIt = strList.iterator();    while(strIt.hasNext()){      String str = strIt.next();      if(str.startsWith(enteredText)){       match.add(str);     }      }     } </code></pre><p>it works when focus is changed form edit text,but i need to work it like quick search box.when ever i enter a letter in edit text,the matching words will be displayed.how can i done this.pls post some code.Thank u in advance.</p>","699226","","","","","2012-08-16 07:09:03","how to implement search function in android","<android>","2","0","4","",""
"3985145","1","3986166","","2010-10-21 07:19:37","1","1077","<p>In my android application i used 3 imageView objects. for performing the touch action i set the touch listener and implement the opereations. when running the application it works for some touches of the imageview, after that the application hangs and finally i saw an error ""keydispatching timeout"". Then i implement asyncTask for the operations of imageView touch. but the problem still arises. Anybody please help me to solve this problem</p>","462695","","","","","2010-10-21 09:47:13","android keydispatching timeout error","<android>","1","2","","",""
"3985204","1","3985320","","2010-10-21 07:29:34","0","908","<p>I have created a simple test game that randomly spawns icons that move around the screen. When you click on an icon, it disappears. I used sample code from SDK, and various internet sites.</p><p>I want to change the background, it is being set to <strong>BLACK</strong>. I would like to use a picture I have.</p><pre><code> public void onDraw(Canvas canvas) {       canvas.drawColor(Color.BLACK);...}</code></pre><p>The background color is set on the <code>onDraw</code>. If I try to draw a bitmap instead, the game will eventually crash from a memory problem. (it runs out of memory). I believe this is because the image is being drawn every time <code>onDraw</code> is called. </p><p>I have tried placing it in various locations, but maybe I'm just missing something. Any help would be great. Below is the code I am using to create the background. My ideal goal would be to only create the background once at the start. And be able to update it when called for. </p><pre><code> Bitmap Background = BitmapFactory.decodeResource(getResources(),R.drawable.background); DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int height = dm.heightPixels; int width = dm.widthPixels; Rect rec = new Rect(0, 0, width, height); canvas.drawBitmap(Background, null, rec, null);</code></pre>","474539","","617801","","2012-10-21 15:35:40","2013-03-18 13:19:36","How to I draw and change background without using too much memory?","<android><background>","2","0","","",""
"3985263","1","3988382","","2010-10-21 07:38:59","2","1614","<p>how can i use an Array of strings to query an sqlite database? i keep getting the exception ""SQliteException: bind or column index out of range"". </p><pre><code>      String[] names = new String[values.size()]; // values is an Arraylist      String[] condition = values.toArray(names);Cursor row = db.query(true,DATABASE_TABLE, resultColumns, NAME +""="" + ""?"", condition, null, null, null,null);</code></pre><p>please any help will be greatly appreciated as usual. Thanks</p><p>P.S values, which is the Arraylist is being poplulated through a loop so i can't have a defined size. thats why i can't use the get() method and seperate the elements in it by commas' which would have been easier. </p>","447570","","447570","","2010-10-21 14:11:31","2010-10-21 14:37:30","using an Array to query an sqlite database android","<android>","1","0","1","",""
"3985299","1","","","2010-10-21 07:45:38","0","405","<p>I've created textview layout into main.xml, i want to see effects onto emulator, but i did not get my changes, it shows old result when i run my app into emulator.....</p><p>eg:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/textview""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:text=""@string/hello""/&gt;</code></pre><p>strings:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello, Android! I am a string resource!&lt;/string&gt;    &lt;string name=""app_name""&gt;Hello, Android&lt;/string&gt;&lt;/resources&gt;</code></pre><p>Please help if anyone know..............</p>","482687","","66353","","2010-10-21 07:49:58","2010-10-21 09:01:38","Android UI XML Layout","<android><android-emulator>","2","3","","",""
"3985419","1","3985557","","2010-10-21 08:04:44","29","17289","<p>I want to upload my first APK/app to the Android Market, but I got this error (which did not lead me to the correct link when searched for in stackoverflow, by the way).</p><p><strong>Market does not accept apks signed with the debug certificate. Create a new certificate that is valid for at least 50 years.Market requires that the certificate used to sign the apk be valid until at least October 22, 2033. Create a new certificate.</strong></p><p>Though it turns out <a href=""http://stackoverflow.com/questions/3853140/android-market-error-while-uploading-apk-file"">this question</a> is similar, the guy just says ""Oh, you reminded me of how to do it"" without actually explaining.  I've looked at the website referred to in the ""answer"", but here's my problem:</p><ul><li>I don't know where my keytool tool is.  The <a href=""http://developer.android.com/guide/publishing/app-signing.html#cert"">Android site</a> is pretty vague; I don't see ""keytool"" of any sort in my ..\android-sdk-windows\tools directory.</li><li>I think I've done this before, but I wish I had a set of steps that is like ""Open up a command prompt, navigate to the directory where keytool is, enter in command 'xyz -flagsforxyz', and then point to the keystore from the 'export release apk' option in Eclipse""... or something similar.</li></ul><p>I hope you can tell that I've tried a few things already!  I might just be overlooking something simple -- so it's time for the steps to be recorded in stackoverflow!  Thanks for your help. </p>","327547","","","","","2013-10-31 10:46:05","How Do I Create A Certificate For My Android Market APK?","<android><debugging><certificate><release><google-play>","2","0","18","",""
"3985475","1","","","2010-10-21 08:15:03","0","329","<p>i want to only read data from the sqlite database. when i am creating database and reading it it is working but i have already a database created and i want to read data from this database. I am pushing the database to the sdcard and trying to run the application but it is not reading form the database. I want to know that if install this .apk file in device then my database will also shift to the device or not. if any one has done it before then please help me. Thanks in advance.... </p>","307585","","","","","2010-10-22 05:37:41","Android sqlite reading","<android><sqlite>","1","0","","",""
"3985532","1","3986189","","2010-10-21 08:23:25","2","3130","<p>I'd like to add 15 minutes to Time Object, so that 09:46 would become 10:01.</p><pre><code> Time time = new Time(); time.hours = 9; time.minutes = 46; time.minute += 15;</code></pre><p>This doesn't work... :-/</p>","474326","","","","","2013-11-20 10:00:59","Android: Time calculations, how to add a specified amount of minutes","<android><time>","3","0","","",""
"3985766","1","","","2010-10-21 08:57:20","0","2381","<p>I'm trying to use an HttpURLConnection in my application. I set my request method to 'GET', but when I try to retrieve the output stream then the method is changed to 'POST' !I'm not sure that is the reason, but my JSON server (I use JAX-RS) returns a blank page when I send a request using a 'POST'.</p><p>Here is a snippet of my code:</p><pre><code>// Create the connectionHttpURLConnection con = (HttpURLConnection) new URL(getUrl() + uriP).openConnection();// Add cookies if necessaryif (cookies != null) {  for (String cookie : cookies) {    con.addRequestProperty(""Cookie"", cookie);    Log.d(""JSONServer"", ""Added cookie: "" + cookie);  }}con.setDoOutput(true);con.setDoInput(true);con.setUseCaches(false);con.setRequestMethod(""GET"");con.setConnectTimeout(20000);// Add 'Accept' property in header otherwise JAX-RS/CXF will answer a XML streamcon.addRequestProperty(""Accept"", ""application/json"");// Get the output streamOutputStream os = con.getOutputStream();// !!!!! HERE THE REQUEST METHOD HAS BEEN CHANGED !!!!!!OutputStreamWriter wr = new OutputStreamWriter(os);wr.write(requestP);// Send the requestwr.flush();</code></pre><p>Thanks for you answer.Eric</p>","482755","","","","","2010-10-21 09:07:51","Android can't send GET request with HttpURLConnection","<android><httpurlconnection>","1","0","","",""
"3985776","1","","","2010-10-21 08:58:49","5","654","<p>Friend's      I'm sending an SMS from my android device,here i enter the number manually in the edittext box,and i have message to send,here how can i check the entered phone  number is valid number from phone directory.help me..</p>","393953","","393953","","2012-11-27 09:36:25","2013-01-23 13:09:01","How to Check entered Phone number is valid from Phone Directory","<android>","1","0","","",""
"3985779","1","3986750","","2010-10-21 08:58:56","1","342","<p>I have an SQLite db and I have to make it work with an Android application.</p><p>So my question is:Is there any way to generate JAVA classes automatically from an SQLite db model?This db has several tables and I would like to get a JAVA class for each table to handle easily my datas.</p><p>Thanks.</p>","460634","","","","","2010-10-21 11:07:28","SQLite model to JAVA classes","<android><sqlite>","1","0","","",""
"3985787","1","3985891","","2010-10-21 08:59:21","12","24114","<p>I have a relativelayout like this:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                              android:orientation=""horizontal""                              android:layout_width=""fill_parent""                              android:layout_height=""wrap_content""                              android:layout_marginTop=""10dip""&gt;                            &lt;Button android:id=""@+id/negativeButton""                                    android:layout_width=""wrap_content""                                     android:layout_height=""wrap_content""                                    android:textSize=""20dip""                                    android:textColor=""#ffffff""                                    android:layout_alignParentLeft=""true""                                    android:background=""@drawable/black_menu_button""                                    android:layout_marginLeft=""5dip""                                    android:layout_centerVertical=""true""                                    android:layout_centerHorizontal=""true""/&gt;                             &lt;Button android:id=""@+id/positiveButton""                                    android:layout_width=""wrap_content""                                     android:layout_height=""wrap_content""                                    android:textSize=""20dip""                                    android:textColor=""#ffffff""                                    android:layout_alignParentRight=""true""                                    android:background=""@drawable/blue_menu_button""                                    android:layout_marginRight=""5dip""                                    android:layout_centerVertical=""true""                                    android:layout_centerHorizontal=""true""/&gt;          &lt;/RelativeLayout&gt;</code></pre><p>I want to be able to programatically set for positiveButton the same effect as:</p><pre><code>android:layout_centerInParent=""true</code></pre><p>How can I make this programatically ?</p>","379865","","635608","","2012-05-04 17:28:16","2013-11-20 08:18:10","Android RelativeLayout programatically set centerInParent","<android><relativelayout>","1","0","5","",""
"3985911","1","3985977","","2010-10-21 09:16:12","0","3500","<p>I am adding <code>Linearlayout</code> dynamically and adding 3 <code>TextView</code> getting the content from <code>webservices</code> for text view if the content of 3 text size is larger it will display in the end of next line .i want display in start line how can i do?</p><p>Thanks</p>","426344","","603744","","2011-06-21 12:19:49","2013-04-19 04:31:30","How to align TextView in android","<android>","3","1","","",""
"3985958","1","3986038","","2010-10-21 09:22:13","1","2600","<p>My android app is simple : a single activity contains a webview which shows user my website,in it I have a link which when user clicks on it ,the default sms program will be called.</p><p>That all works well,but when I return from the sms ,It restarts the program(call the onCreate() method ) instead of returning to the origin state , how can I get back to the state before I turn to the sms program ?</p><p>Thanks :)</p>","404145","","218196","","2010-10-21 09:24:32","2010-10-21 09:31:54","How to restore state after calling another activity?","<android><webview><state><restore>","1","1","","2012-09-27 13:21:53",""
"3986061","1","","","2010-10-21 09:34:12","0","151","<p>i have made an android application that retrieves data from internet and performs further operation on that data.</p><p>i have 4 urls for retrieving data. so i want to make 4 different applications for 4 different urls, each application receiving data from one of the URL. and i also want to run all four application on the single device.</p><p>now my problem is that when i uninstall one of the application all four application gets uninstall, and all the applications are showing the same data.</p><p>Please help.</p><p>Thanks in advance.</p>","443387","","","","","2010-10-21 09:40:40","how to make different user application out of same source code","<android>","1","0","","",""
"3986062","1","4069373","","2010-10-21 09:34:16","2","409","<p>So I've recently been selling away on the Android Market. As of yet, nothing has appeared in my bank but after reading <a href=""https://checkout.google.com/support/sell/bin/answer.py?hl=en-uk&amp;answer=25400"" rel=""nofollow"">this</a>, it appears that payments are supposed to appear in your bank after so many days after being charged from the users account.</p><p>I was just wondering, is this every single sale? Separately appearing in your statement? Or does Google build it up and then deposit it, say at the end of the month?</p>","143979","","","","","2010-11-10 22:57:47","Receiving payments from Android Market","<android><payment><google-play>","3","1","0","",""
"3986076","1","","","2010-10-21 09:36:27","0","128","<p>i am having a program in which i am having 4 edittext name,age,contact,email. I am having 2 buttons save and view.I want a program of how to save values.I will be very thankful to you.</p>","475349","","","","","2010-10-21 09:42:51","storing data in databases in android","<android>","2","0","","",""
"3986175","1","3986998","","2010-10-21 09:48:10","1","5184","<pre><code>&lt;View  android:id=""@+id/first_sep""  android:layout_width=""fill_parent""  android:layout_height=""1dip""  android:paddingTop=""100dip""  android:layout_below=""@id/calculate""  android:background=""#FFCCCCCC"" /&gt;</code></pre><p>I have this <strong>View</strong> in a <strong>RelativeLayout</strong> and the <strong>android:paddingTop</strong> property doesn't seem to work. Tried it with various values and still the View lies close to the Button ""calculate"".</p>","421372","","","","","2010-10-21 11:39:31","Issues with padding in RelativeLayout","<android><user-interface><relativelayout>","1","1","","",""
"3986182","1","","","2010-10-21 09:49:03","1","2087","<p>Hi Here i want to solve the problem regarding multitouch in android. Is this possible to fire events of 2 buttons together if this is possible then how can i do this. please help regarding this. In my game application i want to do something after pressing two buttons together. How can i do this.</p>","339116","","","","","2010-10-21 11:13:48","Multi Touch Events in android","<android><touch><multi-touch>","1","0","0","",""
"3986188","1","3993356","","2010-10-21 09:49:17","1","550","<p>I'm having trouble making my texture rendered correctly in my applications.the artwork I use is precise and already scaled and the right size but when I render it on phone suddenly my texture are not as clear/precise as the original artwork and I can't figure out why.</p><p>has anybody had this issue before?</p>","440336","","","","","2010-11-26 10:20:55","Android Textures appear unclear/fuzzy","<android><opengl-es>","3","0","","",""
"3986248","1","","","2010-10-21 09:58:05","2","3754","<p>My objective is to generate <strong>sine</strong>, <strong>square</strong>, <strong>triangle</strong> and <strong>sawtooth</strong> signals with Android's <strong>AudioTrack</strong> Class. </p><p>I have made an attempt based on a <a href=""http://www.badlogicgames.com/wordpress/?p=228"" rel=""nofollow"">tutorial</a>. It works relatively well, although I'm not always sure how accurate the frequency generated corresponds with the frequency aimed at.</p><p>I would like to make square, triangle etc. functions. The tutorial only implements sine. My question is therefore:</p><p>How exactly does the sample work</p><pre><code>  new Thread( new Runnable( )   {     public void run( )     {                        final float frequency = 440;        float increment = (float)(2*Math.PI) * frequency / 44100; // angular increment for each sample        float angle = 0;        AudioDevice device = new AndroidAudioDevice( );        float samples[] = new float[1024];        while( true )        {           for( int i = 0; i &lt; samples.length; i++ )           {              samples[i] = (float)Math.sin( angle );              angle += increment;           }           device.writeSamples( samples );        }                 }  } ).start();</code></pre><p>Can I make the sine into a square like follows (using the signum function)?</p><pre><code>samples[i] = (float)Math.signum(Math.sin( angle ));</code></pre><p>Basically, I would like to fundamentally understand the samples being written, so I can generate various signals and also eventually <strong>superposition</strong> them.</p><p>Thank you for your time!</p>","482800","","","","","2011-10-15 02:58:52","Generating sine, square, triangle, sawtooth audio signals using Android's AudioTrack Class","<java><android><generator><frequency>","1","0","1","",""
"3986642","1","","","2010-10-21 10:53:45","-1","86","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3984530/xml-parsing-in-android"">xml parsing in android</a>  </p></blockquote><p>i am new to android . hows can i do parsing of the url <a href=""http://simplyappointments.com/businessinfoxml.php?email=sujit_jitu06@rediffmail.com"" rel=""nofollow"">http://simplyappointments.com/businessinfoxml.php?email=sujit_jitu06@rediffmail.com</a>can anyone help me in doing parsing.I will be very thankful to you.</p>","475349","","","","","2010-10-21 11:00:39","xml parsing in android","<android>","1","0","","2010-10-22 12:56:55",""
"3986721","1","3986733","","2010-10-21 11:01:44","6","1634","<p>I'm a C++ programmer and have a need to set up some UDP communications between a java android app and the C++ server running on a PC.</p><p>I have structure that I need to receive on the PC that consists of the following:</p><pre><code>intintfloat</code></pre><p>Unfortunately I'm totally at a loss as to how I can do this with Java.</p><p>I need to create a DatagramPacket but the constructor only takes a byte array.  Now with C++ this would be an easy cast from a struct to a char*.  However casting like this is not possible with Java.  </p><p>I've create a simple class that has the above fields in it.  That seems to be fine.  My remaining issue is how to turn that into a byte array.  Can anyone help a Java noob on this front?</p><p>Cheers!</p><p>Edit: I've created a function in the class that does the following</p><pre><code>        public byte[] GetBytes() throws IOException        {            ByteArrayOutputStream   byteOut = new ByteArrayOutputStream();            DataOutputStream        dataOut = new DataOutputStream( byteOut );             dataOut.writeInt( Integer.reverseBytes( int1) );            dataOut.writeInt( Integer.reverseBytes( int2 ) );            dataOut.writeFloat( float1 );            return byteOut.toByteArray();        }</code></pre><p>Is there a better way to do this?</p><p>I'd rather not use the google protocol buffer mentioned in Steve's answer because, while its interesting, it would require too many changes to other platform implementations that I'd really rather not do.</p>","131140","","131140","","2010-10-21 11:16:28","2010-10-21 11:50:27","Sending a C++ struct over UDP in Java","<java><c++><android><udp><casting>","2","1","1","",""
"3986822","1","","","2010-10-21 11:15:27","1","515","<p>At the time of application installation i need to set the progress bar .How to create this? thanks in advance !!</p><p>Note:I have the Android application.When i Install that application it will take some time to install at that time i wish to show some Progress Message.Is it Possible?</p>","482568","","482568","","2010-10-22 05:05:29","2010-10-22 05:05:29","Progress bar in Android","<android>","0","3","","",""
"3986844","1","3986930","","2010-10-21 11:18:44","0","743","<p>Hey, I need to have both earlier and later versions of App I write in Eclipse.What do I need to change (activity name?) to upload new version of the app to my phone without overwriting the old one? Any fast way to do it?</p>","475861","","","","","2010-10-21 11:29:17","Android: how to install twice 1 app I write?","<android><eclipse><upload><phone>","2","0","","",""
"3986854","1","3986953","","2010-10-21 11:19:58","1","691","<p>I know my question caption must have sounded really vague. But let me clear it out here.</p><p>Say I have an android application over a middleware stack. In onCreate() of my activity, I initialise my middleware modules. </p><p>In its onDestroy(), I must de-initialise the middleware. Now my middleware calls may take quite some time to process. So I want to know how much time the onDestroy() function has, and see whether my deinitialisation can take place within that time.</p><p>Is it reasonable to keep my de-init in the onDestroy()?</p><p>Also, suppose I initialise the middleware in onCreate() of activity A1. On a button click, activity A1 switches to activity A2. In low memory situations, the LMK will kill the activity that has not been in use for some time. In such a case, won't activity A1 be killed? When activity A1 is killed, will all instances I create in A1 also get destoryed?</p><p>Regards,kiki</p>","454660","","113158","","2012-07-10 14:40:10","2012-07-10 14:43:33","How much time can be taken inside onDestroy() before the activity is killed?","<android><activity><destroy>","2","0","","",""
"3986913","1","3987067","","2010-10-21 11:27:48","1","1120","<p>i am trying to create a interface where its methods are protected or only visible to the class that implements it.</p><p>The issue is this. i have two classes that do more or less the exact same thing but with different parameters and behaviour, but the actual steps it takes is identical.</p><p>i was thinking ok i have two similar classes so lets just create a interface that both these classes implement. Should be ok right? well it is. it does the job but with a serious flaw, All and i mean all of the methods it overrided in these two classes are now visible to the naked eye.</p><p>They can be accessed as they are defined ""public"". there goes encapsulation :(</p><p>Another solution i thought of was using a abstract class but wait, you can only extend one abstract class and the two classes i am using already extend a class(in my case a android Service class) so out goes that idea too.</p>","444668","","","","","2010-10-21 12:37:18","Java Protected method in an Interface?","<java><android>","3","0","","",""
"3986938","1","","","2010-10-21 11:31:17","1","597","<p>I am using Load data as below, however getContentHeight never changes value.  How can I force it to update.  I have called this many times and the content height does not update till I manually click on the webVeiw. </p><p>Any ideas? TIA</p><p>private void UpdateMessageDisplay() {  //loadData fires onPageFinished but without the new data   browser.loadData("""" + msgInnerHTML + """", ""text/html"", ""utf-8"");   browser.reload(); //required or page never refreshes  // browser.invalidate(); // did not work</p><p>}</p>","465199","","","","","2013-08-27 14:29:37","WebView how to force ContentHeight to update","<android><webview>","2","0","","",""
"3986950","1","3988613","","2010-10-21 11:33:16","0","208","<p>I have never tried out the Android SDK and do not own an Android phone. However it seems that certain libraries are excellent, for example the text to speech lib. Is it possible to use this library with a desktop VM and did anybody here try this?</p>","44232","","","","","2010-10-21 14:36:51","Using Android libs on a desktop Java VM (like OpenJDK or OracleJDK)","<java><android>","1","0","","",""
"3987025","1","","","2010-10-21 11:42:41","0","970","<p>I want to display String Array values inside a for loop. I need to display the each value to each TextView. How can I create TextView dynamically corresponding to the size of Array? How can I specify ID for each one ? Please give me the solution... Thank You.. </p>","453607","","1288","","2010-10-21 12:39:59","2010-10-21 13:28:46","TextViews inside a loop","<android>","1","3","0","",""
"3987040","1","3987071","","2010-10-21 11:44:19","0","674","<p>There are some string resources in my android application and some helper-classes, which are only java-classes (no android classes).</p><p>Is it possible to get string value of string resource variable from an java class?!</p><p>Mur</p>","408780","","","","","2010-10-21 11:48:25","Get string value in Android","<java><android><string>","1","0","","",""
"3987336","1","3988935","","2010-10-21 12:20:19","5","4778","<p>what i am trying to do: the user selects start and destination on a map and then from their coordinates i want to show the closest point location from a list of locations on map. i have a simple Sqlite database containing the longitude,latitude and name of the possible locations.</p><p>i did some research and this is what i found:</p><p><a href=""http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL"" rel=""nofollow"">http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL</a></p><p>but this is meant for using it with mySql and some kind of spatial search extension. is there a possibility i can do something similar using android api or external libs?</p><pre><code>public Point dialogFindClosestLocationToPoint(geometry.Point aStartPoint){List&lt;PointWithDistance&gt; helperList=new ArrayList&lt;PointWithDistance&gt;();try {openDataBase();Cursor c=getCursorQueryWithAllTheData();if(c.moveToFirst()) do{  PointWithDistance helper=new PointWithDistance(c.getDouble(1),c.getDouble(2),c.getString(3));  int distance=returnDistanceBetween2Points(aStartPoint, helper);  if(distance&lt;MAX_SEARCH_DISTANCE){   helper.setDistance(distance);   Log.i(""values"", helper.name);   helperList.add(helper);  } }while (c.moveToNext());Collections.sort(helperList,new PointComparator());if(helperList!=null) return helperList.get(0);else return null;}catch(SQLException sqle){throw sqle;}finally{ close();}</code></pre><p>this is the code in the PointComparator() class:</p><pre><code>   public int compare(PointWithDistance o1, PointWithDistance o2) {  return (o1.getDistance()&lt;o2.getDistance() ? -1 : (o1.getDistance()==o2.getDistance() ? 0 : 1)); }</code></pre><p>where <code>PointWithDistance</code> is a object that contains: lat, long , distance, name</p><p>however this solution doesn't provide the right return info... and i realize that is it not scalable at all and very slow. i need a solution that will execute fast with a database with max of 1000 rows.</p><p>edit: my there was a mistake in this code in the sorting now i have it changed( should be &lt; instead of >)</p>","448192","","448192","","2010-10-29 07:47:42","2010-10-29 07:47:42","find nearest Gps point to the user location form a list","<java><android><database><location>","3","0","4","",""
"3987361","1","","","2010-10-21 12:22:51","0","423","<p>how to bundle array of File objects or array of Json objects or array of user-defined objects in one activity and send it to another and how to access them correctly. ?</p><p>Primitive types like string is quite easy with    </p><pre>Intent in = new Intent();Bundle bundle = new Bundle();bundle.putString(""name"", ""test"");in.putExtras(bundle);startActivity(in);</pre><p>Some reading suggested to use Parcelable , some serializable !! What is the right way and how to do it. ? </p>","207646","","66708","","2010-10-21 13:24:50","2010-10-21 13:24:50","Bundle array of json/File/user-defined objects in Android","<android><arrays><json>","1","0","","",""
"3987491","1","5410980","","2010-10-21 12:35:40","2","1785","<p>I use the following code to listen for the key presses of 0 - 9 from the soft input keyboard on Android:</p><hr><pre><code>@Override        public boolean onKeyDown(int keyCode, KeyEvent event)  {            if(keyCode == KeyEvent.KEYCODE_0)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_1)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_2)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_3)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_4)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_5)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_6)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_7)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_8)            {                return super.onKeyDown(keyCode, event);            }            if(keyCode == KeyEvent.KEYCODE_9)            {                Log.d(""Keycode"", ""Got KeyCode 9"");                return super.onKeyDown(keyCode, event);            }            return true;        }</code></pre><hr><p>The code works when i display the soft input keyboard in the following mode:</p><p><img src=""http://i.stack.imgur.com/Snasz.png"" alt=""alt text""></p><p>However it does <strong>not</strong> work when I display the soft input keyboard in the following mode:</p><p><img src=""http://i.stack.imgur.com/wf0Kt.png"" alt=""alt text""></p><p>Why is this?</p>","243999","","","","","2011-03-23 20:06:13","Android - Listen for key presses on Numeric keypad?","<android><keycode><keyevent><android-softkeyboard><numeric-keypad>","1","0","","",""
"3987526","1","","","2010-10-21 12:39:38","0","540","<p>I want get data or character stream from Audio jack 3.5 mm.</p><p>Please anybody tell me.</p>","483005","","142162","","2011-09-24 13:32:30","2011-09-24 13:32:30","working with audio jack 3.5 mm in Android","<android><audio><jack>","0","2","1","",""
"3987534","1","5338332","","2010-10-21 12:40:16","4","8632","<p>We have to port our software to android. One of the main feature of our software should be that the software can download a new version of itself from the net (our own server) and install it's new version too. All this thing should be done programmatically.</p><p>I'm new to android, so haven't got any clue how should it be done.</p><ul><li>How to create apk? - solved</li><li>How to sign apk? - solved</li><li>How to download apk? - solved</li><li>How to copy the downloaded file overwriting /data/apk/my.software.name.apk? - unsolved</li><li>How to restart the software by the running version? - unsolved</li></ul>","482989","","881229","","2014-01-22 22:10:34","2014-01-22 22:10:34","self upgrading own apk via net programmatically on android","<android><apk>","3","1","2","",""
"3987562","1","","","2010-10-21 12:43:20","1","317","<p>I'm trying to enable foreign keys on a sqlite3 database doing this:</p><pre><code>sqlite&gt; PRAGMA foreign_keys=ON;</code></pre><p>But it doen't work.</p><p>How can I do it?</p><p><strong>Note: the database is on an Android device.</strong></p><p>Thanks.</p>","68571","","","","","2013-05-31 21:58:03","Enable foreign keys on Sqlite3 version 3.5.9","<android><sqlite3><foreign-keys>","1","1","0","",""
"3987574","1","3987861","","2010-10-21 12:44:42","13","4356","<p>I've just spent a lot of time looking into the best ways to create iphone and android apps for an existing rails app that I've built and I feel that I haven't actually gotten any closer to knowing how to best achieve this.</p><p>What I want:</p><ul><li>I would like to have the rails app and the mobile code cleanly separated. I'm not looking to just render a different layout in my rails app. I'd prefer to use something like phone gap that allows me to use roughly the same codebase to run the mobile apps.</li><li>I'd like to have offline/sync capabilities in the mobile apps (hence if a user creates a record on their iphone while they are out of coverage the app should save the record on the phone and continue to try to to sync that record to the web app until success.</li><li>Having access to the hardware features will be needed down the road. GPS, accelerometer, etc.</li></ul><p>My questions:</p><ul><li>Is this a good situation to use oauth? Would I just build an oauth provider into my web app and then build the two mobile apps as clients to the web app?</li><li>Is there an easier method for <strong>secure</strong> authorization that I'm missing?</li><li>Does Devise work with oauth? My app is built on top of devise at the moment.</li><li>Is this syncing something that should be abstracted to a middleware or metal?</li></ul><p>Sorry, I know this is actually a lot of questions but I'd like someone who is familiar with the situation to answer in a comprehensive manner rather than just a couple little pokes that leave more questions. I feel like this has to be a common situation now-a-days but I can't seem to find anything up-to-date in my searches.</p><p>Cheers!</p><p>ps. - If you've done something like this yourself and know how to pull it off, I'd love to talk to you directly. I'll even buy the beers. Seriously... no takers?</p>","298410","","298410","","2010-11-23 08:10:30","2013-05-03 22:02:50","Creating iphone & android apps for existing rails app","<iphone><android><ruby-on-rails><oauth><devise>","3","1","8","",""
"3987596","1","","","2010-10-21 12:47:51","4","3385","<p>I'm new to android,I'm using tabHost adding some tabs to it,its working quite fine but when i rotate my device in landscape mode it also work there fine but i don't need tab bar there because it covers much space and i also have google ads so both of them cover half of the screen and leave a little space for user to interact.All i need is a solution to somehow hide tab bar just like we can do it in iphone to make a bit room for user to interact.I need some solution urgent.Thanks </p>","349590","","66708","","2010-10-21 13:01:35","2014-02-17 07:44:22","tab bar hiding issue android","<android><android-tabhost>","4","0","1","",""
"3987614","1","","","2010-10-21 12:49:47","1","158","<p>I want to know the total length in kb of mp3 file .how to do this in android</p><p>Thanks in advance...</p>","461972","","66708","","2010-10-21 13:03:12","2010-10-21 13:03:12","MediaPlayer on Android","<android><mp3><filesize>","1","0","","",""
"3987650","1","8377079","","2010-10-21 12:53:14","1","3078","<pre><code>public class FtpDownloadDemo {public static void Connection(String filename) {    FTPClient client = new FTPClient();    FileOutputStream fos = null;    try {        client.connect(""ftp.domain.com"");        client.login(""admin"", ""secret"");        //        // The remote filename to be downloaded.        //       ftpClient.setFileType(FTP.IMAGE_FILE_TYPE);        fos = new FileOutputStream(filename);        //        // Download file from FTP server        //        client.retrieveFile(""/"" + filename, fos);    } catch (IOException e) {        e.printStackTrace();    } finally {        try {            if (fos != null) {                fos.close();            }            client.disconnect();        } catch (IOException e) {            e.printStackTrace();        }    }}</code></pre><p>}</p><p>I am using this code to download some image file. but at  <strong><em>fos = new FileOutputStream(filename);</em></strong> getting file.jpeg is readonly file exception. i am using commons.net jar file for ftp connection. please help me where i am wrong.</p>","304961","","304961","","2010-10-21 13:24:34","2012-01-29 09:43:46","FTP file download problem. Getting readonly file exception","<android><ftp><file-download>","1","3","","",""
"3987736","1","","","2010-10-21 13:05:06","6","558","<p>I have a public transport app for one country and I want to create a separate app for another country. Most of the code will be shared, but I need some classes to have different implementations for example TransitProvider.</p><p>Is it possible to share code using Android Library Project? Can I do the following?</p><ol><li>Have TransitProvider (that extendsAbstractTransitProvider) in thelibrary project. The class has methods left unimplemented.</li><li>In application project > AndroidManifest.xml I have different package name than in library's manifest. I have also TransitProvider in this project, that is in the same package as the library's TransitProvider.</li><li>When I use TP in library project code, the implementation from app. project should be used (ie application project's TP overrides library's TP).</li></ol>","243225","","243225","","2010-10-21 13:11:03","2010-10-21 13:17:10","What to do with multiple Android apps that share about 90% of source code?","<android>","1","0","1","",""
"3987770","1","","","2010-10-21 13:10:00","0","81","<p>hi i have two classes in android and in one class i have write an array and i want to access it in the main class but the error is give me that ""force closed"" here is my code </p><pre><code>package com.semanticnotion.DAO;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class DAO extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);WordsDAO DAO = new WordsDAO(new String[]{""Arte"",""Arquitectura"",""Familia"",""Moda"",""Cotilleos"",""Cine"",""Libros"",""Historia"",""Pintura"",""Musica"",""Tendencies"",""Modernimso"",""Pop art"",""Masteialismo"",""realities"",""filosofia"",""moda"",""fotografia"",""religion""});Button next = (Button) findViewById(R.id.Button01);next.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(), WordsDAO.class);        startActivity(myIntent);        }    });    }}</code></pre><p>and the second class code is</p><pre><code>package com.semanticnotion.DAO;public class WordsDAO  { String[] words = new String[]{""Arte"",""Arquitectura"",""Familia"",""Moda"",""Cotilleos"",""Cine"",""Libros"",""Historia"",""Pintura"",""Musica"",""Tendencies"",""Modernimso"",""Pop art"",""Masteialismo"",""realities"",""filosofia"",""moda"",""fotografia"",""religion""}; public  WordsDAO(String[] words ) {  this.words=words;   }</code></pre><p>please any one tell what well be the error in this code thaks        </p>","467591","","24054","","2010-10-21 13:14:29","2010-10-21 13:20:15","accessing array with object","<android>","1","1","","",""
"3988032","1","","","2010-10-21 13:39:42","0","529","<p>I want the android source to check at boot time if sdcard is inserted and if yesthen override the default crypto package in the android source code with the onein sd card, else it does nothing.</p><p>Now I have 2 questions:1. How can i override a default package?2. How to check the status of sdcard at boot time?</p><p>I know how to check the status of sdcard in an application, which i got from one of theposts here, but how to utilize this boot time</p><p>if(android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))</p><p>Regards,Yogesh</p>","482419","","","","","2010-10-21 13:49:44","How to override a package in android source code at boot-time?","<android>","1","3","","",""
"3988223","1","","","2010-10-21 13:58:22","0","645","<p>I am developed application with google map in android 2.2 version using eclipse and ubuntu.in that case I can get the google map as well as the location perfectly.</p><p>but now i have to run that same apps in Xp machine with android 2.1 version It run properly but the google map not displayed ,only white screen with boxes  displayed.</p><p>Reason for this running in xp is i have to run that application in android device.I have android 2.1 device in samsung ,This only support XP not supporting ubuntu.</p><p>So any one help me what are the changes i have to include in my application that will run in android 2.1 in Xp machine.</p>","450596","","","","","2010-10-21 14:07:54","Google map displayed in android version 2.2,not displayed in android version 2.1","<android><android-emulator>","1","0","1","",""
"3988268","1","3988420","","2010-10-21 14:03:06","0","700","<p>Since working with Android I'm curious about how I can let Android do everything in respect to orientation change (layout vs. layout-land).</p><p>Currently I have to feed the correct number of db columns and views to the cursor adapter. Is this the correct way or do I miss something? How do you guys do that?</p><p>Please have a look at the two SimpleCursorAdapter where I feed the same layout name of  both existing layouts (there's on in layout and one in layout-land). The only difference is the additional db column ""type"" and the additional view ""R.id.activities_row_text3"".</p><p>Is this the correct way?</p><pre><code>Cursor cursor;SimpleCursorAdapter simpleCursorAdapter = null;if ((cursor = db.fetchActivities(connection)) != null) {    startManagingCursor(cursor);    int orientation = getResources().getConfiguration().orientation;     if (orientation == Configuration.ORIENTATION_PORTRAIT) {        simpleCursorAdapter = new SimpleCursorAdapter(                                      this,                                      R.layout.activities_row,                                      cursor,                                      new String[] {                                          ""name"",                                          ""time"" },                                      new int[] {                                          R.id.activities_row_text1,                                          R.id.activities_row_text2 });    } else if (orientation == Configuration.ORIENTATION_LANDSCAPE) {        simpleCursorAdapter = new SimpleCursorAdapter(                                      this,                                      R.layout.activities_row,                                      cursor,                                      new String[] {                                          ""name"",                                          ""time"",                                          ""type"" },                                      new int[] {                                          R.id.activities_row_text1,                                          R.id.activities_row_text2,                                          R.id.activities_row_text3 });    }    if (simpleCursorAdapter != null) {        setListAdapter(simpleCursorAdapter);    }}</code></pre>","471681","","213269","","2010-12-08 10:18:07","2010-12-08 10:18:07","Layout orientation changes without activity interaction","<android><layout><orientation>","1","0","","",""
"3988316","1","4084931","","2010-10-21 14:06:44","2","3739","<p>I'm trying to convince an <code>EditText</code>-view to only use the SoftKeyboard that I wrote. It's bugging me for a few days already and I can't believe that this isn't possible to do. I might not see the obvious...</p><p>So far I managed to write my own SoftKeyboard based on the sample that comes with the Android SDK. I'm able to manually select it as the input method (long click, input method, *pick*). The SoftKeyboard then works fine and does everything I want. I also cleaned up the context menu to disallow changing the input method (obviously I currently needed it to be in the menu otherwise I wouldn't be able to choose my SoftKeyboard).</p><p>In other words the only thing left is to tie the SoftKeyboard to the <code>EditText</code>.</p><p>I noticed the bunch of <code>ime*</code>-attributes on the <code>EditText</code>, but they don't seem to be useful for my problem as I don't want to change anything about the action key. <code>inputMethod</code> requires a <code>KeyListener</code>, which the SoftKeyboard is not (I tried to make it one, but there seems to be a problem with the class-loader as it wouldn't find my class => <code>ClassNotFoundException</code>).</p><p>Can anyone please point me to some useful information?</p>","483113","","483113","","2010-11-24 13:39:50","2012-06-11 10:24:39","Android: Tie a SoftKeyboard (InputMethodService) to an EditText","<android><keyboard><android-softkeyboard>","2","0","3","",""
"3988337","1","","","2010-10-21 14:08:19","7","13433","<p>I use </p><blockquote>  <p>SimpleExpandableListAdapter</p></blockquote><p>in my </p><blockquote>  <p>ExpandableListActivity</p></blockquote><p>When user click the group row, the children list is expanded and show, when user click each child item in the expanded list, user will be navigated to the next second_Activity. Currently, when user click the back button to go back from second_Activity to the ExpandableListActivity, the expandable list is initialized as un-expanded, I would like the expandable list keep in expanded status, so that user know previously which item he has selected. How to do that? Which method from ExpandableListActivity should be override?</p><p>PS: I know I should put <code>getExpandableListView().expandGroup(groupPosition);</code> somewhere, but where? I tried to put this code in <code>onGroupClick()</code> and <code>onChildClick()</code>, but this does not help. </p>","475850","","475850","","2010-10-21 14:18:42","2013-09-13 10:00:27","How to keep ExpandableListView in expanded status?","<android>","4","0","3","",""
"3988454","1","3988822","","2010-10-21 14:20:02","5","4445","<p>I'm planing an app where i need to edit a system file.</p><p>I can only edit that file with root rights. I have a rooted dev phone with Superuser.apk installed. Other apps that require root do request root access on first start.I want to do the same but I can't find any hints on how to request superuser rights for my app.</p><p>I found something about an intent android.intent.action.superuser but when I try to launch an activity for that intent action I get an <code>ActivityNotFoundException</code>.</p><p>Any ideas?</p>","373138","","1288","","2012-08-04 17:28:50","2012-08-04 17:28:50","Request superuser rights to edit file","<android>","2","0","1","",""
"3988478","1","3988567","","2010-10-21 14:22:39","5","5639","<p>I want to block hardware back button in android ,in order to prevent from going back to other activity..  Thanks in advance...</p>","461972","","","","","2011-05-26 15:32:46","Block Back Button in android","<android>","2","2","3","",""
"3988508","1","3988704","","2010-10-21 14:27:03","0","498","<p>I have created four tabs using tabhost, and placed four listviews in each like below:</p><pre><code>public class prem extends ListActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    String[] names = new String[] { ""Pr""};    this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,            R.layout.simple_list_item_checked, names));}</code></pre><p>Problem is I have created background images for each listview but when I scroll the listview goes black, I know that I should add android:cacheColorHint=""#00000000""to the xml file to make the listview transparent, so I have created a new xml and id and tried to add android:cacheColorHint=""#00000000"" in the xml to make transparent, but it just force closes;</p><p>this.setListAdapter(new ArrayAdapter(this,                R.layout.list_item, R.id.listb, names));</p><p>?xml version=""1.0"" encoding=""utf-8""?></p><p>LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""</p><pre><code>android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textSize=""30px""&gt;&lt;/TextView&gt; &lt;ListView android:id=""@+id/listb""  android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt; &lt;/ListView&gt;</code></pre><p></p>","445174","","","","","2010-10-21 15:03:29","Help with a transparent listview","<java><android><eclipse>","3","2","0","",""
"3988521","1","3988553","","2010-10-21 14:28:22","2","797","<p>Eclipse doesn't accept the less than symbol for the button text, is there a way to escape it so it shows on the button?</p><pre><code>    &lt;Button android:id=""@+id/button_prev_line""        android:text=""&lt;line""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;</code></pre>","317033","","","","","2012-08-09 10:34:31","How to put < or > in an android button","<android><layout><button>","4","1","","",""
"3988609","1","3988668","","2010-10-21 14:36:39","1","666","<p>Ideally I would like to send an object of type </p><pre><code> ArrayList&lt;ArrayList&lt;ASimpleClass&gt;&gt; </code></pre><p>from a remote service in one APK to an application in another. I'm not sure if this is even possible as the API demo code suggests that it isn't:</p><pre><code>/** * This demonstrates the basic types that you can use as parameters * and return values in AIDL. */void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,        double aDouble, String aString);</code></pre><p>whilst the autocomplete for writeTo/readFromParcel suggests that other types are an option (though read options don't match write). I would settle for just ArrayList if necessary. If it is possible, I'd much appreciate a pointer to some sample code, or a way to cast the above types into something acceptable to the remote interface AIDL. Can anyone shed any light on this question please?</p>","440010","","","","","2010-10-21 14:42:07","Complex types from a remote service to an application through AIDL","<android><aidl>","1","0","","",""
"3988654","1","3991531","","2010-10-21 14:40:39","0","743","<p>I just send some coordinates to the android emulator. </p><p>I used this commands for sending the fixes: </p><pre><code>geo fix 8.494062000 52.038213000</code></pre><p>This will send my emulator near the bielefeld university in the google maps app.The next command I issued was: </p><pre><code>geo fix 8.495543000 52.038180000</code></pre><p>Sadly my position does not change on the emulator. Even mytracks tells me in the logcat output that the position of the user has not changed. </p><pre><code>geo fix 8.501787000 52.036614000 </code></pre><p>and  </p><pre><code>geo fix 8.508524000 52.033138000</code></pre><p>don't do anything either. And if the position changes it is nowhere near the position I recoreded the track at. All this coordinates are picked from a track that I recorded with my motorola droid with mytracks on a multiple kilometer streetcar ride. Loading the gpx file in google earth displays a neat and accurate overlay over the streetcar line. Playing the track as a gpx file gives me similar results. There are 300 points recorded but only 4 of them will change my position on the emulator.</p><p>Is there some kind of accuracy setting effecting the emulator? This way the load gpx track feature does not help a bit for testing.</p><p>Somebody else had strange issues with the load gpx file features?</p><p><strong>Edit</strong></p><p>This issue does not only affect the geo fix or load gpx file feature it affects all mock locations that are send to the emulator. </p>","114066","","114066","","2010-10-22 08:33:14","2010-12-07 16:04:55","Why is the android emulator innaccurate if i send a mock location?","<android><gps><android-emulator>","2","2","","",""
"3988712","1","","","2010-10-21 14:45:47","9","4678","<p>Can android <code>MediaRecorder</code> capture video with resolution higher than <code>320*240</code>?</p><p>When I used <code>MediaRecorder::setVideoSize()</code> to set the video size, the captured video were all at the resolution of <code>320*240</code>. Whats even worse, the higher ones can not get a clear video, they were somehow greenish. (encoder used is <code>h263</code>, format is <code>mpeg4</code>)</p><p>Android version used here is <code>1.6</code></p><p>Could you please anyone help me out?</p>","483135","","213269","","2011-08-12 09:11:32","2012-06-20 16:43:53","Problem with android MediaRecorder setVideoSize()","<android><mediarecorder>","2","0","","",""
"3988753","1","3988930","","2010-10-21 14:50:23","3","6846","<p>This has me baffled.  I need to copy the Bitmap from one ImageView into another.  I do not want to simply copy one ImageView to another because I need to do some changes to the bitmap on its way over.</p><p>Here is some code that doesn't work.</p><pre><code>ImageView ivSrc = (ImageView) findViewById(R.id.photo);ivSrc.setDrawingCacheEnabled(true);    Bitmap bmSrc1 = ivSrc.getDrawingCache(); // will cause nullPointerException    Bitmap bmSrc2 = Bitmap.createBitmap(ivSrc.getDrawingCache());//bmSrc2 will be null    View vSrc = (View) ivSrc.getParent();    vSrc.setDrawingCacheEnabled(true);    Bitmap bmSrc3 = Bitmap.createBitmap(vSrc.getDrawingCache());  //black bitmap </code></pre><p>//To test the bitmaps:</p><pre><code>     ImageView ivDest = (ImageView) findViewById(R.id.photo2);      ivDest.setImageBitmap(bmSrc1); //bmSrc1, 2, 3 results shown above</code></pre><p>I have to going about this wrong because doing a copy should be so easy. TIA</p>","465199","","","","","2010-10-21 15:06:49","Copy Bitmap contents of one ImageView to anoher","<android><imageview>","1","0","3","",""
"3988824","1","4001698","","2010-10-21 14:55:47","0","283","<p>Is it possible to share a same webview object in two different activities in android ? Here is my use case. I have an Activity A that has a webview W. W occupies 50% of A. Now When I click on Webview W, in activity A, I want to launch Activity B with whole of it occupying webview W. In acitivity B, I do not want webview to requery the URI. Is it possible to do this in android ? Please help.</p>","248132","","","","","2010-10-22 23:42:05","Android: Sharing webview across activites","<android>","1","0","","",""
"3989173","1","3989215","","2010-10-21 15:33:02","2","2840","<p>I am trying to make a table to display something like this:</p><pre><code> ________|__|__|__||__|__|__|</code></pre><p>All boxes need to be split evenly, and the middle box in the bottom row will have a very large image that will be forced into a smaller size. This is my current XML layout, but I wind up with a layout like this:</p><pre><code> ________|_|____|_||_|____|_|</code></pre><hr><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:stretchColumns=""1""&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""1""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:text=""Unused""            android:padding=""3dip"" /&gt;        &lt;TextView            android:layout_column=""2""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:text=""Top Center""            android:padding=""3dip"" /&gt;        &lt;TextView            android:layout_column=""3""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:text=""Unused""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""1""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:text=""----&amp;gt;"" /&gt;        &lt;ImageView            android:id=""@+id/mainImg""            android:layout_column=""2""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_weight=""1""        /&gt;        &lt;TextView            android:layout_column=""3""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_weight=""1""            android:text=""&amp;lt;----"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>What am I doing wrong?</p>","12243","","","","","2013-09-03 11:03:24","Divide the width between the table elements evenly","<android><table><layout>","3","0","1","",""
"3989228","1","","","2010-10-21 15:39:15","0","710","<p>I want to find out wether Videos on Mobile Websites play inline or in a video application. If they play in an video application: are these applications device specific or is it always the same? Does someone have a link to the look of the controls so that I can build a photoshop preview on how my web video will look on Android?</p><p><strong>EDIT</strong></p><p>By inline, I mean that it does not play in an external app like it does on the iphone (opens quicktime player whenever you click a video on m.youtube.com) but that it just plays inside the browser.</p>","473331","","107899","","2013-10-24 18:28:52","2013-10-24 18:28:52","Do Videos on the Web on Android Devices play inline or in an video app?","<android><mobile-website><android-video-player>","1","1","0","",""
"3989268","1","3989622","","2010-10-21 15:43:58","1","2749","<p>I have four tabs that hold four listviews, I want to set a background for each list view but whenever I try to add the background it puts the image in each cell of the listview instead of behind the list. </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""android:background=""@drawable/pre""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:padding=""10dp""android:textSize=""21sp""&gt;&lt;/TextView&gt;</code></pre><p>I've realised that this is beacuse I've tried to add the background in a textview so it adds the image in each cell  in the listview, so I have tried to add a linearlayout, listview and a imageview and put the background there but it force closes.  I think this is becuse the tabhost uses main.xml to draw the main page and it conflicts, so I even tried to add the listview there still it nforce closes, it will only work if I have a textview only, howe can I add a background to each listview, below is the listview code;</p><pre><code>public class prem extends ListActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    // Create an array of Strings, that will be put to our ListActivity    String[] names = new String[] { ""Pre""};    ListView lv = getListView();        lv.setCacheColorHint(00000000);        lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,            R.layout.list_item, names));}</code></pre>","445174","","1333975","","2013-05-11 23:36:38","2013-05-11 23:36:38","set a background for a listview","<java><android><eclipse>","2","0","","",""
"3989299","1","3989711","","2010-10-21 15:46:26","1","876","<p>I developed an application in portrait mode in Android.<br>What changes do I have to do, that my application  will be also fit for landscape orientation?</p><p>Thanks in advance.</p>","461972","","469983","","2012-07-31 10:52:40","2012-07-31 10:53:49","Android Screen Orientation","<android>","3","0","1","",""
"3989314","1","3992794","","2010-10-21 15:47:50","0","540","<p>I need to set a break point in code that is handling an exception inside Froyo.  I am using Eclipse and have built a local copy (not customized) of Froyo so it should line up for my device.  Is there a way to tell ADB and/or Eclipse to load symbols so I can step into the code?</p>","157804","","","","","2010-10-21 23:26:07","how do I load debug symbols for Android Froyo (using Eclipse)?","<android><eclipse><debug-symbols>","1","3","1","",""
"3989411","1","4632396","","2010-10-21 15:57:28","0","223","<p>I have to create progressbar so that i need the size of a file.so please give me the sample code that i can calculate size of server side file.  </p>","477301","","","","","2011-01-08 04:47:21","how to calculate size of a file ,when file resides on server","<android>","1","1","","",""
"3989525","1","","","2010-10-21 16:09:03","2","762","<p>I want to know how to implement java code to parse the apk file, get the android application version number and so on, such as after you uploaded android application in Android Market, it will get the version number, permissions.</p><p>Anyone can give me idear? Thanks a lot.</p>","429079","","","","","2014-01-21 03:16:19","How to parse the uploaded apk file with Java code?","<android><parsing><google-play><apk>","3","0","1","",""
"3989564","1","","","2010-10-21 16:13:33","2","994","<p>I am trying to implement a dynamic autocomplete widget in android. I am done with the major functionalities and the autocompletion implemented is for youtube video search.</p><p>When I start typing a letter or two, the auto-completion is not working. But when I type three letters or more it works prfect. It also works when I type two letters and hit a backspace. I do not know what is wrong with the code. </p><p>I have uploaded the code <a href=""http://www.4shared.com/file/4xuD7jXy/YoutubeAutoComplete.html"" rel=""nofollow"">here</a></p><p>Experts, kindly guide me. I would be obliged if you can point out where I have gone wrong with the code.</p><p>Any help in this regard is well appreciated.</p><p>Looking forward,Regards,Rony</p><pre><code>import org.json.JSONArray;import org.json.JSONException;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.text.Editable;import android.text.TextWatcher;import android.widget.ArrayAdapter;public class YoutubeAutoComplete extends Activity {Youtube yt = new Youtube();CustomAutoComplete myAutoComplete;ArrayAdapter&lt;String&gt; adapter;private JSONArray js;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    myAutoComplete = (CustomAutoComplete) findViewById(R.id.autocomplete);    adapter = new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_dropdown_item_1line);    myAutoComplete.addTextChangedListener(textWatcher);    myAutoComplete.setAdapter(adapter);    adapter.notifyDataSetChanged();}TextWatcher textWatcher = new TextWatcher() {    public void onTextChanged(final CharSequence s, int start, int before,            int count) {        Thread t = new Thread() {            public void run() {                try {                    js = yt.GetSuggestions(s.toString()).getJSONArray(1);                    messageHandler.sendEmptyMessage(0);                } catch (JSONException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        };        t.start();    }    public void beforeTextChanged(CharSequence s, int start, int count,            int after) {    }    public void afterTextChanged(Editable s) {    }};private Handler messageHandler = new Handler() {    public void handleMessage(Message msg) {        adapter.clear();        for (int i = 0; i &lt; js.length(); i++) {            try {                adapter.add(js.getJSONArray(i).getString(0));                System.out.println(js.getJSONArray(i).getString(0));            } catch (JSONException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }        adapter.notifyDataSetChanged();    }};}</code></pre>","264953","","264953","","2010-10-21 18:21:33","2011-04-19 16:01:56","Android dynamic auto-complete - minor fix - code attached","<android>","1","3","1","",""
"3989619","1","","","2010-10-21 16:19:09","0","1167","<p>Here I write camera snapshot on the db.</p><pre><code> `private SQLiteDatabase db;// SOME CODE HERE ///InputStream is =new ByteArrayInputStream(data);BufferedInputStream bis = new BufferedInputStream(is,128);ByteArrayBuffer baf = new ByteArrayBuffer(128);int current = 0;while ((current = bis.read()) != -1) {     baf.append((byte) current);}baf.toByteArray();ContentValues initialValues = new ContentValues();initialValues.put(""mapimg"", baf.toByteArray();db.insert(DATABASE_TABLE, null, initialValues);</code></pre><p>`This writes correctly in the db a new row.</p><p>When I try to show the image :</p><pre><code>DbUtil db = new DbUtil(this);List&lt;Row&gt; rows = db.fetchAllRows();db.close();byte[] imageByteArray= rows.get(10).getMapimg();ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);Bitmap theImage = BitmapFactory.decodeStream(imageStream);ImageView imageView ;imageView = (ImageView)findViewById(R.id.ImageView01);imageView.setImageBitmap(theImage);</code></pre><p>In the xml :</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;   &lt;ImageView         android:id=""@+id/ImageView01""        android:layout_width=""300px""        android:layout_height=""300px""        android:scaleType=""center""         /&gt;&lt;/LinearLayout&gt;</code></pre><p>But no image appears on screen.Where is the problem  ? </p>","483270","","","","","2010-10-21 17:35:24","Android : Store an image from camera to database and the show it","<android>","1","0","","",""
"3989760","1","3990542","","2010-10-21 16:33:46","3","2377","<p>I'm trying to create a gallery in my Android project, but can't seem to make it work as it should.</p><p>Here is what I am trying to do:</p><p>Basically, I want a gallery that displays only one picture, but still has the same controls (sliding left and right). I'm getting the pictures asynchronously from the internet.</p><p><strong>Where am I at that?</strong></p><p>Well, for now I'm just trying to display the gallery... I'll see the ""one picture"" step after.</p><p><strong>What is my problem?</strong></p><p>Well... My gallery doesn't show on my layout. At all.</p><p><strong>What seems to be the problem?</strong></p><p>Log information give me that the height and the widht of my gallery object are... 0. </p><p><strong>Speaking about code...</strong></p><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:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:background=""@drawable/fond""&gt;  &lt;ImageView android:background=""@drawable/banniere"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""/&gt;  &lt;Gallery    android:id=""@+id/gallery""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Activity</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.galleryfullscreen);    Gallery gal = (Gallery) findViewById(R.id.gallery);    ArrayList&lt;Photo&gt; photos = (ArrayList&lt;Photo&gt;) this.getIntent().getExtras().getSerializable(""Photos"");    int pos = this.getIntent().getExtras().getInt(""Index"");    Log.i(""Season"",photos.toString());    gal.setAdapter(new PhotoAdapter(this, photos, false));    gal.setSelection(pos);    Log.d(""Bottom"", String.valueOf(gal.getBottom()));    Log.d(""Right"", String.valueOf(gal.getRight()));    Log.d(""Width"", String.valueOf(gal.getWidth()));    Log.d(""Height"", String.valueOf(gal.getHeight()));       }</code></pre><p>Extras are correctly set.</p><p>Adapter</p><p>public class PhotoAdapter extends BaseAdapter {</p><pre><code>private ArrayList&lt;PhotoView&gt; views;private ArrayList&lt;Photo&gt; season;public PhotoAdapter(Context c, ArrayList&lt;Photo&gt; images, boolean mini) {    season = images;    views = new ArrayList&lt;PhotoView&gt;();    for (int i = 0; i &lt; images.size() ; i++)        if (mini)        views.add(new PhotoView(c,images.get(i).getUrlMini(),false));        else{            views.add(new PhotoView(c,images.get(i).getUrlBig(),true));        }}@Overridepublic int getCount() {    return views.size();}@Overridepublic Object getItem(int position) {    return views.get(position);}   @Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    return views.get(position);}public ArrayList&lt;Photo&gt; getSeason() {    return season;}</code></pre><p>}</p><p>This adaptor is working fine for other objects (such as gridview)</p><p>And the PhotoView...</p><p>public class PhotoView extends ImageView {</p><pre><code>Bitmap image;public PhotoView(Context context, String url, boolean Gallery) {    super(context);    if (!Gallery){    this.setLayoutParams(new GridView.LayoutParams(GridView.LayoutParams.WRAP_CONTENT,GridView.LayoutParams.WRAP_CONTENT));    this.setScaleType(ImageView.ScaleType.FIT_CENTER);    this.setImageDrawable((getResources().getDrawable(R.drawable.blk)));    new DownloadImageTask().execute(url);    }    else{        this.setLayoutParams(new Gallery.LayoutParams(100,100));        this.setScaleType(ImageView.ScaleType.FIT_CENTER);        this.setBackgroundDrawable(((getResources().getDrawable(R.drawable.blk))));        this.setImageDrawable((getResources().getDrawable(R.drawable.blk)));    }}public Bitmap getImage(){    return image;}public void setImage(Bitmap img){    image = img;    this.setImageBitmap(image);}</code></pre><p>The same, it's working fine for a grid view. With the download task, that is not set up for the Gallery yet. I'm at least trying to display a ressource before setting this up, so I'm sure the problem doesn't come from here. </p><p>Sooo... why are my logs showing ""0"" for gallery width and height? LayoutParams are set for the object (I tried both XML and code), and for the views inside. The items are created, and the ""getView"" method is called. I tried seeting up LayoutParams here, doesn't change anything.</p><p>I also tried adding the xmlns:android=""http://schemas.android.com/apk/res/android"" part in the layout for the gallery, doesn't change a thing.</p><p>I really don't know what I'm missing. I tried to adapt many tutorials on gallery objects, but still... don't know!If you have any idea of what I should do/try, please...</p><p>Thanks all!</p><p>Cheers</p>","483291","","","","","2010-10-22 18:08:14","Gallery layout problems","<android><layout><gallery><params>","1","0","","",""
"3989767","1","3989846","","2010-10-21 16:34:42","0","920","<p>is there something like dialog's order in Android?</p><p>I explain what I mean.</p><p>There is a dialog builder with ""OK""-Button. When user press ok, dialog will be closed.</p><p>Wenn I call more than one dialogs after each other in an activity, I see first the last one, then next to last and so on. But I would like to see first the first dialog, then the second, then ...</p><p>Is there the possibility for that?</p><p>Or is it possible not to call second dialog until first dialog isn't closed?</p><p>Mur</p>","408780","","","","","2010-10-21 16:45:02","Dialogs order in Android","<android><dialog>","1","0","1","",""
"3989775","1","3990030","","2010-10-21 16:35:38","1","342","<p>I need to guarantee that my Android application won't be launched twice. How to do it? I mean in ideal I would need in case of second launch just switch to primary copy.</p>","472270","","","","","2010-10-21 17:18:02","How to prevent launching of second copy of application?","<android>","3","0","","",""
"3989785","1","3989966","","2010-10-21 16:36:34","1","171","<p>I have a legacy C++ code which is ported to Android. When calling free on strings, a random crash is occurring. Crash is observed in random places. Is there a tool which can be used to check the memory overruns?</p>","28641","","","","","2010-10-21 16:57:06","Finding memory overruns","<c++><android><jni>","2","1","","",""
"3989806","1","","","2010-10-21 16:39:22","1","3057","<p>Need to send a POST request to a Service provider using HTTPS protocol, response from the service provider will be an xml file, need to read that also.</p>","349086","","349086","","2010-10-21 16:58:57","2010-10-21 18:16:29","HTTPS request/response in Android","<android><https>","1","0","1","",""
"3989835","1","","","2010-10-21 16:43:37","0","643","<p>I am using android 2.2 &amp; creating live wallpaper based on cubewallpaper example in android sample</p><p>I am loading array of bitmap one by one on a canvas after few interval of time at the same place/position i,e, X and Y position (it is one type of rotated image banner).</p><p><strong>Now the problem is</strong></p><p>If i am locking the canvas using following code</p><blockquote>  <p>canvas = holder.lockCanvas();</p></blockquote><p>and after that i am loading some bitmap in on canvas and then lock it using following code</p><blockquote>  <p>holder.unlockCanvasAndPost(canvas);</p></blockquote><p>then again if i lock the canvas and lode some more bitmaps then previously drawn bitmaps are getting wiped out. so how can i preserve/retain the old bitmaps. </p>","405383","","405383","","2010-10-27 16:23:23","2011-05-19 15:55:31","retain bitmaps on canvas in android","<android><canvas>","1","0","","",""
"3989883","1","3990346","","2010-10-21 16:48:07","8","15747","<p>I'm trying to construct a layout where there is a text view at the top of the screen and a bottom bar at the bottom of the screen.Each of these views should stay fixed in place and in between the 2 should be a ListView.</p><pre><code>TOPBARLISTVIEW (scrollable)BOTTOM BAR</code></pre><p>My layout (see below) <em><strong>almost</strong></em> works: the top and bottom components stay fixed and the listview scrolls.  The ""problem"" is that the final row of my ListView remains hidden behind the bottom bar.</p><p>Any suggestions on how to adjust the layout?</p><p>Thanks!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;LinearLayout            android:layout_alignParentTop=""true""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:orientation=""vertical""            &gt;        &lt;TextView                android:background=""@drawable/blackgrad""                android:gravity=""center""                android:id=""@+id/title""                android:layout_height=""50dip""                android:layout_width=""fill_parent""                android:text=""blah blah""                android:textColor=""#ffffff""                android:textSize=""18sp""                /&gt;        &lt;ListView                android:background=""#ffffff""                android:cacheColorHint=""#ffffffff""                android:id=""@android:id/list""                android:layout_height=""fill_parent""                android:layout_width=""fill_parent""                /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout            android:background=""#efefef""            android:layout_alignParentBottom=""true""            android:layout_centerHorizontal=""true""            android:layout_width=""fill_parent""            android:layout_height=""50dip""            android:orientation=""horizontal""&gt;        &lt;Button                android:layout_height=""wrap_content""                android:id=""@+id/back""                android:text=""Back""                android:layout_width=""wrap_content"" /&gt;        &lt;Button                android:layout_height=""wrap_content""                android:id=""@+id/home""                android:text=""Home""                android:layout_width=""wrap_content"" /&gt;        &lt;Button                android:layout_height=""wrap_content""                android:id=""@+id/next""                android:text=""Next""                android:layout_width=""wrap_content"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","141146","","","","","2012-10-23 07:22:08","Android Layout with ListView between a ""top bar"" and ""bottom bar""","<android><layout><footer><android-linearlayout><relativelayout>","6","0","4","",""
"3989944","1","","","2010-10-21 16:54:57","7","252","<p>On Android 2.1, just as on most graphical computer OSes, pressing the mouse while in a button, then dragging away, then dragging back, then releasing (while within the button rectangle) would result in a button press.  It would also highlight while the mouse pointer was within (or actually near) the button, going off as the pointer left the zone, then back on when the pointer returned.</p><p>This behavior allows the user to cancel, mid-press, by dragging away from the button until its highlight is off and releasing; it also allows the user to change her mind about cancelling, so long as the mouse is still down, and go back into the button to ""rescue"" the click.</p><p>In 2.2, it appears that Android no longer allows a return to the button.  Dragging away cancels the highlight, but returning with the mouse still held down does not re-highlight the button, nor does an away-and-return click generate a click event.</p><p>So, my questions: Is this change real (has anyone else seen it)?  and: Is it intentional?  What is the rationale for this change, if it is intentional?</p>","82118","","","","","2012-06-26 08:00:29","Button highlight behavior changed on Froyo?","<android><user-interface><button>","1","3","","",""
"3990110","1","7405992","","2010-10-21 17:15:30","31","16496","<p>I have a application where I want to show different locations (one at the time, picked by user input) by launching Google Maps with their specific geo-coords.</p><p>I'm currently using this: (with real lat. and long. values of course)</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(""geo:&lt;lat&gt;,&lt;long&gt;?z=17""));startActivity(intent);</code></pre><p>It's quite exactly what I want, except that it doesn't show any indicator or marker for the specified point. It only centers at it's location.</p><p>Is there some way to get the marker or something else included without using a MapView?</p>","336525","","","","","2014-02-04 16:29:49","How to show marker in Maps launched by geo uri Intent?","<android>","8","0","18","",""
"3990165","1","","","2010-10-21 17:21:42","0","307","<p>I am loading the data using http connection,when it does i am using progress dialog box.The problem is when i press the hardware back button , dialog box is removed before loading all the data,but data is showed successfully,</p><p>the code for back button is i have used is,</p><pre><code>   public boolean onKeyDown(int keyCode, KeyEvent event)   {    if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0)     {        return true;    }    return super.onKeyDown(keyCode, event);}    public void onBackPressed()    {        return;    }</code></pre>","461972","","66708","","2010-10-21 18:27:37","2010-10-21 18:27:37","Dialog box issue on android","<android><dialog><onkeydown>","1","2","","",""
"3990209","1","","","2010-10-21 17:27:49","0","192","<p>HI all,</p><p>First of all i want to know that what are the index of list view items??? is something like the index of array (a[0],a[1]....).</p><p>Actually i want to get the index of list item. it always showing me -1 here is the code.</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        Object index = getListAdapter().getItem(position);      Intent myIntent = new Intent(this, newsdisplay.class);      //Create the view using FirstGroup's LocalActivityManager        View view = newsgroup.group.getLocalActivityManager()              .startActivity(""show_city"", myIntent              .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))              .getDecorView();        //Again, replace the view        newsgroup.group.replaceView(view);   } </code></pre><p>pls help me how to get the index of list view items and is this unique to other items??</p>","383597","","137350","","2010-10-21 17:31:30","2010-10-21 18:00:53","Android LIst view","<android>","1","0","","",""
"3990397","1","3991748","","2010-10-21 17:51:32","0","546","<p>An Android Application that I created for a client some months ago has the ability to email a link to a PDF with a ton of text in it. The client now wants that text to go directly in the email, in HTML form (with links, bullets, etc). </p><p>Using Android's Mail Intent, I am trying to send this long string over the EXTRA_MESSAGE field, but since I have to wrap the text in double-quotes, I have to '\' almost every double-quote I want in the String, which is rather unpleasant for thousands of lines, not to mention (if I remember correctly), using the += operator for multiple lines didn't seem to work.</p><p>Is there any way around this, and what's the easiest way to put long HTML code into a String object for sending?</p><p>Thanks!</p>","312390","","","","","2010-10-21 20:43:32","Easier way to put an extremely long HTML string into a String object in Java (Android)","<java><html><android>","2","2","1","",""
"3990428","1","3990723","","2010-10-21 17:55:29","0","225","<p>i wanted to do an application which use a rss feed from the web, and i wanna know if someone have a tutorial somewhere or could just explain to me how to do it. (I started coding in android like two months ago)</p>","439058","","","","","2010-10-21 18:33:49","how to creat a rss feed from an internet website with android?","<java><android><rss><internet><feed>","1","0","1","",""
"3990548","1","4053164","","2010-10-21 18:11:03","2","2030","<p>I'm developing my first Android game and I'm having a bit of difficulty making the UI as smooth as I would like. I've spent a couple of hours googling around with no luck, I'm probably just searching for the wrong thing.</p><p>I have two different XML layout resources where each layout contains just one SurfaceView subclass. When I call activity.setContentView(R.layout.second_layout) to transition from the first layout to the second layout there is a noticeable period of time where a black screen (with a small white bar along the top) is displayed in between the two views.</p><p>I've tried various things such as; constructing the second view manually at runtime (i.e not using a layout XML file), calling activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out) after activity.setContentView(R.layout.second_layout) and attempting to render to the canvas before the view has loaded (turns out the canvas is unavailable).</p><p>I don't see other games (or apps) having this issue so I presume there is a reasonably simple solution.</p><p>If you need some more information about my particular situation in order to help out then please let me know what information is missing. Any help would be largely appreciated.</p>","199685","","","","","2011-05-29 18:27:32","Android Activity.setContentView(), smooth transition?","<gui><android><animation>","1","1","","",""
"3990846","1","3990928","","2010-10-21 18:49:13","0","359","<p>I have a background thread that is sending data about the application's current status to a server. The thread is supposed to constantly - or at least whenever the status changes - send this data.</p><p>The data is coming from the UI and the user is able to change the status any moment (by moving with the finger over the screen), so I need to tell the background thread to send the updated data.</p><p>Is there any Android way to do this? My solution would be to keep the thread's instance available and add some method to allow setting the thread's internal data that is to be send. However I'm not even sure if that even works (given that the thread doesn't run on the main thread where the command to update it would come from). I looked at AsyncTask before, as that seems to be the standard solution for background workers, but I didn't see anything that makes it possible to push data into that task (it only reports data/progress back to the UI thread).</p>","216074","","","","","2010-10-21 18:59:29","Send updated data to background thread","<android><multithreading><backgroundworker>","2","0","","",""
"3990870","1","","","2010-10-21 18:51:05","0","470","<p>I'm making my alarm app. There is  an Activity to show alarm infomation.I want turn on the screen and unlock it. I wrote these code</p><p><b>AlarmActivity.java:</b></p><pre>public class AlarmActivity extends Activity {  ......  void onCreate(Bundle bl) {    .....    final Window win = getWindow();    win.requestFeature(android.view.Window.FEATURE_NO_TITLE);       win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED               | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD               | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON               | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);    LayoutInflater inflater = LayoutInflater.from(this);    setContentView(inflater.inflate(R.layout.alarm, null));  }  ......}  </pre><p><b>AndroidManifest.xml</b></p><pre>{activity android:name=""AlarmTaskActivity""                android:excludeFromRecents=""true""                android:theme=""@android:style/Theme.Wallpaper.NoTitleBar""                android:launchMode=""singleInstance""                android:taskAffinity=""""                android:configChanges=""orientation|keyboardHidden|keyboard|navigation""/}</pre><p>It's ok,but when I change<br/><b>android:theme=""@android:style/Theme.Wallpaper.NoTitleBar""</b>to<b>android:theme=""@android:style/Theme.Dialog""</b>the screen did not turn on nor unlock, I am really confused....</p><p>Can you please tell me how to make the screen turn on and unlock when I use ""@android:style/Theme.Dialog""?</p><p>Thanks</p><p>by the way,I have android 2.0 in my test device. </p>","483367","","","","","2011-07-07 08:27:26","Need help,Screen didn't turn on after I change Activity's theme","<android>","1","0","2","",""
"3991041","1","","","2010-10-21 19:13:12","6","848","<p>I'm trying to sort the layout for one of my Android apps, but I'm finding layouts a nightmare.  </p><p>Principally I have to have a portrait and landscape layout for normal, small and large screens.  So thats 6 layouts to maintain to start with, let alone having to launch the app on three emulators each time because my UI widets don't load in the built in previewer.</p><p>I might be showing my ignorance as a fairly new developer, but there must be a better way!</p><p>Are there any tools out there to help with Android layouts?</p><p>Thanks</p>","483445","","","","","2010-10-22 09:04:13","Managing Android layouts, there must be a better way","<android><android-layout>","4","4","1","",""
"3991193","1","3999709","","2010-10-21 19:32:59","5","2088","<p>All,</p><p>I'm aware that by default an activity will be killed and restarted when the screen orientation changes, or a keyboard is slid in or out.  (See <a href=""http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android"">http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android</a>).  My question is, what is the correct way to handle this from a Native code perspective?  e.g. if I have a static block loading a native library and my app is restarted, how do I ensure that any memory in the native land is dealt with appropriately?  The problem is </p><blockquote>  <p>When we rotate the device, it looks  like a separate Thread pool is created  and the old ones are never removed.   This means that every time someone  turns the device, we have a ton more  threads sitting idle and taking up  memory</p></blockquote><p>How do I ensure that this doesn't happen?  I see from the <a href=""http://android.wooyd.org/JNIExample/"">JNIExample page</a> some notes at the bottom:</p><blockquote>  <p>[*]Unresolved issues and bugs Even  though the example is fully  functional, there are a couple  unresolved issues remaining, which I  was not able to figure out so far.  Problems appear when you start the  activity, then press the Back button  to hide it, and then start it again.  In my experience, calls to native  functions in such restarted activity  will fail spectacularly. callVoid()  simply crashes with a segmentation  fault, while calls to getNewData() and  getDataString() cause JVM to abort  with an error, because it is no longer  happy with the globally cached object  reference. It appears that activity  restart somehow invalidates our cached  object references, even though they  are protected with NewGlobalRef(), and  the activity is running within the  original JVM (activity restart does  not mean that JVM itself is  restarted). I don't have a good  explanation on why that happens, so if  you have any ideas, please let me  know.</p></blockquote><p>Has this been solved?</p>","155392","","155392","","2010-10-21 19:45:41","2010-10-22 18:14:37","Android NDK: How to clean up native code after restarting activity?","<java><android><jni><native><android-ndk>","2","0","4","",""
"3991422","1","3991456","","2010-10-21 20:02:34","1","3725","<p>HelloI want to create month-view calendar for android with clickable days. What kind of layout/view should I use, TableLayout or GridView. I didn't find any examples for this...</p><p>Thanks for help in advance</p>","295141","","","","","2011-08-07 18:24:06","GridView vs. TableLayout | Android","<android>","2","0","0","",""
"3991470","1","3991809","","2010-10-21 20:08:46","0","1103","<p>I'm using the TabHost and TabWidget to create some tabs for an Android application. I see that the tabs show up vertically one next to the other. Is there any way to make tabs that are aligned horizontally (one on top of the other) ?.</p><p>I'm creating the tabs like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""/&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:id=""@+id/textview1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""this is a tab"" /&gt;        &lt;TextView            android:id=""@+id/textview2""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""this is another tab"" /&gt;                &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>Something like this is what I need to do:</p><p><img src=""http://i.stack.imgur.com/FMaPT.png"" alt=""alt text""></p>","146100","","","","","2010-11-22 21:52:47","Is it possible to create Horizontal Tabs in Android OS?","<android>","2","1","2","",""
"3991526","1","","","2010-10-21 20:15:07","1","115","<p>I published an app to the market one month ago but in English only.I called it Version 1.0 (after the recommendation).I have since added four more locales to this exact same app (no otherchanges!). So it is avail now in 5 languages:</p><p>1) English2) French3) Italian4) Japanese5) German</p><p>So, exact same app but localized for four new locales. How should Irelease it? Version 1.1? Version 1.01?Or leave it as 1.0 but call it an upgrade. I don't know and wouldappreciate some guidance from more experienced developers.</p>","483506","","","","","2010-10-22 23:42:36","Does localizing an existing Android app to several new locales constitute a new version?","<android>","2","2","","",""
"3991606","1","4063183","","2010-10-21 20:26:42","1","3582","<p>I am currently have two seperate applications, both perform seperate tasks, but there is on limited occasion times when I need one application to use the other if its there.</p><p>So I use a function to check the required application exists:</p><pre><code>public static boolean isIntentAvailable(Context context, String action) {    final PackageManager packageManager = context.getPackageManager();    final Intent intent = new Intent(action);    List&lt;ResolveInfo&gt; list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);    return list.size() &gt; 0;} </code></pre><p>If it does, then I use the following to start the activity with an extra on there:</p><pre><code>if (isIntentAvailable(ListPOI.this, ""com.me.myapp.MY_MAP"")){    Intent i = new Intent(""com.me.myapp.MY_MAP"");    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    i.putExtra(""place"", true);    startActivity(i);}</code></pre><p>The setFlags means if the user presses home, and they go back to the first app, it opens, it doesn't open the second app called here.</p><p>This all works fine, the first time. However after calling the this the second time, the second app resumes, so it doesn't pick up the 'extra' which has been passed, how can I ensure I get the extra?</p>","232565","","","","","2010-10-31 13:00:38","Activity lifecycle - startActivity() with extras","<android><android-intent>","2","2","","",""
"3991608","1","3997455","","2010-10-21 20:27:08","3","235","<p>I'm trying to set up a tab host as an element of a layout. All the examples I've seen show the TabHost by itself in the view. The examples work fine, but when trying to make it part of another layout it doesn't seem to work. I haven't found any documentation specifying one way or another. </p><p>Something like this works (Not all code shown for illustration purposes):</p><pre><code>            &lt;TabHost&gt;                    &lt;LinearLayout&gt;                        &lt;TabWidget/&gt;                        &lt;FrameLayout&gt;                            &lt;TextView                                android:text=""this is a tab"" /&gt;                            &lt;TextView                                android:text=""this is another tab"" /&gt;                            &lt;TextView                                android:text=""this is a third tab"" /&gt;                        &lt;/FrameLayout&gt;                    &lt;/LinearLayout&gt;            &lt;/TabHost&gt;</code></pre><p>However this doesn't work:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""&gt;</code></pre><p>                                                                                                                    <br></p><p>Am I doing something wrong or is this just not possible ?</p><p>This is my onCreate method:</p><pre><code>public class MyActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);           }}</code></pre><p>Is there something that needs to be set there ?</p><p>When I say it doesn't work I mean that after running the application on the emulator I get a popup saying: <strong>""The application xxx (process com.example) has stopped unexpectedly. Please try again.""</strong> </p><p>If I remove the tab code it works again. I'm developing for android 1.6 if that makes a difference.</p>","146100","","146100","","2010-10-22 13:24:34","2010-10-22 13:52:24","Can a TabHost be used within another element in Android?","<android>","1","2","","",""
"3991731","1","3991753","","2010-10-21 20:41:06","0","49","<p>I currently have the android sdk running with eclipse. It happens to be that I also want to download stanford's customized version of eclipse in order to learn some other stuff. Will there be a problem downloading and installing this customized version if I already another version of eclipse installed on my computer?</p>","479180","","","","","2010-10-21 20:43:55","customized version of eclipse","<java><android><eclipse>","1","0","","",""
"3991754","1","3991818","","2010-10-21 20:44:07","2","262","<p>Is it possible to change the background image of the home screen from an app? </p><p>If so how?</p>","478297","","597607","","2011-08-24 20:34:03","2011-08-24 20:34:03","Changing Home Background","<java><android><xml>","1","0","","",""
"3991770","1","4060081","","2010-10-21 20:46:05","0","139","<p>My app may launch a sub-activity for a specific purpose. When that activity finishes, I get the results in onActivityResult. These results are then processed in the subsequent onResume. This consists of a setContentView and also starting an AsyncTask that puts up a ProgressDialog.</p><p>This all works well when initiated the normal way, which is via a user request (i.e., menu selection) after the app is up and running. However, under some conditions I need to do this right as the app is starting up, so I initiate this sequence right from my onCreate. What then happens is that I get fatal ResourceNotFound errors within any o/s call that implicitly calls the layout inflater. I got around this with setContentView by pre-inflating the view in my onCreate method, but the AsyncTask's onPreExecute still fails on ProgressDialog.show() as it ""fails to find"" Android's own progress_dialog.xml!</p><p>Anyone know what's happening here?</p><p>I suspect it's something to do with the timing, where this is occurring before the main activity has even had a chance to display its screen. These calls are all being made on the main UI thread, but maybe something hasn't completed within the o/s under these conditions.</p>","446874","","","","","2010-10-30 18:24:26","ResourceNotFound on layout inflation","<android>","1","2","","",""
"3992024","1","","","2010-10-21 21:17:04","2","739","<p>Is it possible to set up a ListView so when it scrolls it only scrolls in intervals related to the height of the List Item. In other words if my item height is a number h and a swipe of the list is given a number p to represent how hard the swipe is so it can go further if the swipe is harder is it possible to set the ListView so that it always scrolls a distance d related to the the height and swipe strength.i.e. d = h x p</p><p>I figure I could do this myself by building a list from scratch using a linear layout and catching the swipe event, but it'd be a whole lot easier if the ListView can already do something like this.</p><p>The reason I want this is so that if I have, let's say, 10 items in a list and 5 are visible I want the 5 visible to always be in the same relative position so that they line up with an element that is laid over the list.</p>","469219","","","","","2010-10-21 21:17:04","Android: Control ListView Scroll Animation Interval?","<android><listview><scroll>","0","1","","",""
"3992086","1","3992185","","2010-10-21 21:25:22","1","1030","<p>I'm using this code to change the wallpaper of the android home</p><pre><code>WallpaperManager wm = WallpaperManager.getInstance(this);wm.setBitmap(myBitmap);</code></pre><p>I would like to set the background to a drawable. Is this possible?</p>","478297","","","","","2012-05-13 13:02:21","Android: Changing Wallpaper to Drawable","<java><android>","2","2","","",""
"3992168","1","3992496","","2010-10-21 21:34:28","0","582","<p>I have a custom view in src > myproject.test > HomeView</p><p>In my main layout xml I have the following:</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/home_root""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;myproject.test.HomeView        android:id=""@+id/home_view""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;    &lt;/myproject.test.HomeView&gt;&lt;/LinearLayout&gt;</code></pre><p>In the HomeActivity I have a call like this in the onCreate method.</p><pre><code>setContentView(R.layout.main);HomeView mHomeView = (HomeView) this.findViewById(R.id.home_view);</code></pre><p>The app force closed when the setContentView method is called. It seems that my main xml is not correct.</p><p>Any ideas?</p>","128327","","","","","2010-10-21 22:29:46","Android custom view causing force close","<android><custom-view>","3","8","","",""
"3992432","1","3993059","","2010-10-21 22:14:41","0","522","<p>My Activity locks its orientation by using setRequestedOrientation().  However, once this is set to something other than ActivityInfo.SCREEN_ORIENTATION_SENSOR, onConfigurationChange() is no longer called (since it is not changing anymore) when the user rotates their device.</p><p>Is there a way, after the orientation is set with setRequestedOrientation(), to still detect when the orientation of the phone changes?  Or to say it another way, when onConfigurationChange() would have been called, even though it's no longer being called?</p><p>I want to know when the orientation physically has changed, even though I have already locked the view with setRequestedOrientation().</p><p>Hope that makes sense...</p>","445348","","","","","2010-10-22 00:31:58","How to be notified when orientation would have changed, after using setRequestedOrientation()?","<android><locking><screen-orientation>","1","0","","",""
"3992447","1","3992597","","2010-10-21 22:17:48","1","376","<p>One of the design sessions from Google I/O this year showcased this app as an example of putting their design principles to good use.  They said it would be open sourced but I'm having trouble finding it.</p>","460887","","","","","2010-10-21 22:42:26","Where is Twitter App Source Code","<android>","1","1","0","2010-10-22 00:13:16",""
"3992456","1","3992585","","2010-10-21 22:19:10","4","2100","<p><em><strong>I'm new, so links and images are <a href=""https://sites.google.com/site/nolanramy/"" rel=""nofollow"">here</a></strong></em></p><p>Hi,</p><p>I'm likely making a silly mistake... hoping to find out what that is.</p><p>I'd like to use a few of the standard menu icons (ic_menu_refresh, etc.) in my app's Options Menu. And I'd like to set the icons in the xml file for the menu. I read in a few places that I can use the following:</p><pre><code>&lt;item android:id=""@+id/quit""      android:icon=""@android:drawable/ic_menu_close_clear_cancel""      android:title=""Quit"" /&gt;</code></pre><p>to make a quit button in my menu. And this works nicely. However, I'd also like to use some other icons, like ic_menu_stop.png, which are apparently ""not public"" <strong>[link1]</strong>. Also, I've read in a few places that it's not a great idea to ""reference internal graphics like that"" <strong>[link2]</strong>. Likewise, I don't want to use the asterisk workaround <strong>[link3]</strong> to allow access to private resources. The solution offered is to make a local copy of the drawables.</p><p>So I copied the image files I wanted from <code>C:\...\android-8\data\res\drawable-hdpi</code> into my project's <code>res\drawable</code> folder, and then changed the above xml to:</p><pre><code>&lt;item android:id=""@+id/quit""      android:icon=""@drawable/ic_menu_close_clear_cancel""      android:title=""Quit"" /&gt;</code></pre><p>However, this causes the icon to stretch (I believe the icon is stretched - and not simply a bigger (hdpi) image file - because it's slightly blurred) and either obscure or crowd out the title text, so all I see is the oversized, blurry icon. Of course, I also tried copying the icon from the <code>drawable-mdpi</code> folder: using the mdpi icon doesn't obscure the title, but the icon is slighlty undersized and blurry. </p><p>I wanted a screenshot, so I switched to running the app on my emulator. However, the blurring isn't apparent, and the local mdpi image seems to match the internal one I'm referencing:</p><p><strong>[screenshot]</strong> (follow the link at the top!)</p><p>I have double-checked :), and it really is blurred on my phone (Motorola Droid).</p><p>It also occurred to me that the referenced one might be getting the icon via an xml file (like a state-list drawable), and that the xml file somehow defined how the image was to be drawn. I tried making one with a bitmap element, and tried setting a couple of the properties in ways I thought might help:</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/ic_menu_close_clear_cancel"" android:gravity=""top"" android:filter=""false"" /&gt;</code></pre><p>It worked to display the icon (I was proud of myself), but didn't affect the stretching issue.</p><p>I also found these <strong>[link4 and link5]</strong> pages, but they seemed to have different issues.</p><p>Perhaps I should be copying the icons from another location? Am I on the right track with the xml file? Help?</p><p>Thanks,</p><p>Nolan</p>","483520","","","","","2012-03-21 03:21:28","Local icons in Android Options Menu stretch to fill menu item, obscure Title","<android>","2","1","","",""
"3992621","1","","","2010-10-21 22:46:55","3","960","<p>I am playing a setLooped enabled audio file in my app, but every time the audio file loops, there is a noticeable, though very brief, gap in the audio playback... is there any way to get around this?</p>","482550","","","","","2012-08-25 18:41:37","Android: Gapless playback of a looped audio file in MediaPlayer","<android>","2","0","2","",""
"3992664","1","3992678","","2010-10-21 22:56:49","1","890","<p>I am migrating from Symbian to Android. For symbian based nokia mobile phones, the support for accelerometer sensing using java is by the Mobile Sensor API (JSR 256) which is provided in the technical specifications of every nokia mobile phone that supports it.</p><p>However, for Android based ""HTC Desire"" mobile phone, I am not sure whether the HTC mobile has to provide for sensor APIs or whether the mobile's support of Android 2.2 is enough to get java code to access the mobile's accelerometer data. Please advise.</p><p>To be more specific, I was thinking of writing a java application that uses the accelerometer to act like a wireless mouse for a PC. And then add some extra functionality to it to serve as a general purpose pc controller that takes the z axis into consideration apart from the standard x-y axes the mouse uses. For this, should HTC provide for any APIs to access accelerometer data? If so, what APIs? or is HTC's Android 2.2 enough to achieve this feat? Please advise. Thank you in advance.</p>","483628","","","","","2010-10-21 23:01:08","Will a general accelerometer based android code work on htc mobiles? (HTC Desire to be specific)","<android><accelerometer><htc>","1","0","","",""
"3992736","1","3992766","","2010-10-21 23:12:36","0","743","<p>i am sorry to ask again since i asked something similar to this earlier, but am in serious need of help here. situation is this, i have an Arraylist with values of strings, which i have converted to an array i want to query a ""NAME"" column in my sqlite database and return rows that have the string values in the name column. </p><p>e.g the `String [] a = {""do this"", ""do that"", ""help here""}; but it grows dynamically and can have a lenght with respect to the database column.(i mean it can't grow past the size of the database table.)</p><p>how can i construct an sqlite query to return rows that have this string in their array? Am having sqlite error of ""incorrect syntax"" or ""bind or column index out of bounds"" when using the suggestions from this post.   </p><p>[http://stackoverflow.com/questions/3985263/using-an-array-to-query-an-sqlite-database-android][1]</p><p>i have no idea how to query the table anymore. please help, any help will be greatly appreciated. Thank you</p>","447570","","447570","","2010-10-22 06:22:52","2010-10-22 06:22:52","query a column in an sqlite database with a set of array values","<android>","1","1","","",""
"3992820","1","4134384","","2010-10-21 23:31:12","4","15438","<p>I've got a DialogPreference which implements a simple TimePicker.OnTimeChangedListener (see below). Setting the time by clicking the +/- buttons works great. But I don't know how to save the state of the timepicker when the user typed in the time directly into the textfield. It could be sufficient to access to the current textfield value, so I'd be able to persist it in onDialogClosed. But timePicker.getCurrentHour() won't do it. Please help...</p><pre><code>public class TimePreference extends DialogPreference implements        TimePicker.OnTimeChangedListener {// ...@Overridepublic void onTimeChanged(TimePicker view, int hours, int minutes) {    selectedHours = hours;    selectedMinutes = minutes;}@Overridepublic void onDialogClosed(boolean positiveResult) {    if(positiveResult) {        String timeString = selectedHours + "":"" + selectedMinutes;        if(isPersistent()) {            persistString(timeString);        }    }}// ...}</code></pre>","474326","","","","","2012-09-10 18:30:52","Android: How to get the time from a TimePicker when it is typed in","<android><dialog><android-preferences><sharedpreferences><timepicker>","2","1","4","",""
"3992981","1","","","2010-10-22 00:10:56","1","4219","<p>So an android browser or a webview works fine with urls like this - abc.com/xyz.txt</p><p>However, if your URL looks like this - abc.com/xyz.php and what's sent to the browser in the headers is - Content-Disposition: attachment; filename=""xyz.txt"", then the Android browsers and web view seems to get terribly confused.</p><p>It looks like it saves the correct file name on the phone, but the contents is filled with the webpage that was previously being viewed. This works perfectly well on PC based browsers and on an iPhone and Blackberry, it's only a problem on the Android 2.1 and 2.2 (haven't tested others).</p><p>Anyone have a solution? Will be very grateful. I <em>really</em> don't want to start storing static files and want to generate my download content on the fly. The log on the phone has revealed no clues.</p><hr><p>Here's what's sent by the server to the browser</p><pre><code>===================== start content ====================================HTTP/1.1 200 OKDate: Thu, 21 Oct 2010 21:22:11 GMTServer: ApacheContent-Disposition: attachment; filename=""Wafty.txt""Content-length: 30Content-Type: text/plain; charset=ISO-8859-1Hello this is a test of a file========= There was no carriage return at the end of the above line ====</code></pre>","483670","","298479","","2013-06-07 14:20:38","2013-06-07 14:20:55","Android browser/webview bug? Content-Disposition: attachment; filename=""xyz.txt""","<android><webview><file-download><content-disposition>","1","3","1","",""
"3993141","1","3993168","","2010-10-22 00:56:14","2","6664","<p>I'm guessing this is very simple, but for some reason I am unable to figure it out. So, how do you pick a random integer out of two numbers. I want to randomly pick an integer out of 1 and 2.</p>","478297","","","","","2010-10-22 01:05:19","Random Integer: Android","<java><android>","1","0","2","",""
"3993142","1","","","2010-10-22 00:56:16","5","1499","<p>I'm calling a custom dialog thusly</p><pre><code>        CustomDialog dialog = new CustomDialog(this);        dialog.setCancelable(true);        dialog.show();</code></pre><p>Now, if I have a bunch of buttons in the dialog, how do I return the user's choice when I dismiss() the dialog?</p>","92259","","","","","2013-05-24 05:44:00","Return data from Custom Dialog","<android>","2","0","3","",""
"3993175","1","","","2010-10-22 01:05:36","0","380","<p>I have a list of data which I am showing in linearlayout. I am not using ListView as I dont want scrollbar, I want all my data visible at once. I am already processing using AsyncTask but now I want to fetch the images also. I want 1st AsynTask to complete its task and call another AsyncTask to load the images, but when I trying to call imageloader asyncTask from 1st asyncTask I  get10-21 17:55:47.935: ERROR/AndroidRuntime(280): java.util.concurrent.RejectedExecutionException</p><p>Can anyone help ???</p>","477254","","","","","2010-10-22 05:00:42","lazy image loading NOT IN listview","<android>","1","0","","",""
"3993193","1","3993573","","2010-10-22 01:11:41","1","701","<p>I'm trying to write a graphical effect where a circle moves around an image smudging the image as it goes (like the way the smudge tool in Gimp or Photoshop would work). The basic algorithm I'm using is:</p><ol><li>the circle moves from position A to position B on the bitmap</li><li>copy a circle of pixels from position A into a temporary bitmap</li><li>draw this circle of pixels from the temporary bitmap to position B using alpha of about 50%.</li></ol><p>This works fine and looks like what I would expect, where the image will look like it's getting smudged if the circle moves 1 pixel at a time over the image.</p><p>I now want to add some texture to the smudge effect. I have a bitmap that contains a picture of a paint blob. The algorithm from the above is modified to the following so the smudge takes the shape of this paint blob:</p><ol><li>as before</li><li>replace the temporary bitmap pixels with the paint blob texture then copy the circle of pixels from position A into the temporary bitmap but only keep the pixels that match up against paint blob pixels (i.e. use Porter-Duff ""source in destination"" mode when drawing the circle into the temporary bitmap).</li><li>as before</li></ol><p>This almost works and it looks like it's fine initially but gradually the smudging makes the colors in my image darker! If the circle passes over the same area several times, the colors eventually change to black. Any ideas what I could be doing wrong?</p><p>I've implemented the above in Android. I happened upon this post about bitmaps in Android (like my paint blob texture) being loaded with ""premultiplied alpha"", where the author says it caused his images to become darker because of it:<a href=""http://www.kittehface.com/2010/06/androidbitmap-and-premultiplied-alpha.html"" rel=""nofollow"">http://www.kittehface.com/2010/06/androidbitmap-and-premultiplied-alpha.html</a></p><p>I suspect I'm suffering from a similar problem but I don't understand what's going on well enough and don't know how to fix it. Does anyone have hints at what might be going on?</p>","483701","","44729","","2011-05-26 15:44:28","2011-05-26 15:44:28","Why does my smudge image algorithm make the image darker?","<java><android><graphics><opengl-es>","1","0","1","",""
"3993221","1","3994001","","2010-10-22 01:17:53","0","33","<p>Is there a way to get this behavior in android? Views which tile horizontally until they run out of space, and then flow to the next line.</p>","92259","","","","","2010-10-22 04:57:50","Views which wrap like a float does in HTML?","<android>","1","1","","",""
"3993311","1","4234320","","2010-10-22 01:36:55","0","861","<p>Some background. I currently have a class that is instantiated multiple times and inside the class resides a Bitmap member variable that is set using BitmapFactory.decodeResource on instantiation. At any time I may need to apply a matrix to the bitmap and it's currently done via:</p><pre><code>public void applyMatrix(Matrix matrix) {    mBitmap = Bitmap.createBitmap(mBitmap, 0, 0, mBitmap.getWidth(), mBitmap.getHeight(), matrix, true);}</code></pre><p>I am making the assumption that every time I instantiate this class it must load the Bitmap into memory (again). Is that in fact the case? I was also considering pre-loading all bitmaps into an array and referencing the index instead, but I would still run into a problem when I need to transform the Bitmap - I would have to create a new Bitmap from the one in memory. Is there a better way to do this? </p>","437414","","","","","2010-11-20 18:34:54","Android BitmapFactory.decodeResource multiple times","<android><bitmap>","1","2","","",""
"3993638","1","3993695","","2010-10-22 03:14:45","1","426","<p>I have an ArrayList() that I want to display as a Spinner. Problem is, I need to display something other than the File.toString(). I would like to set the Spinner's view text to the file name (formatted), not the full file path returned by File.toString(), so I believe this rules out just using ArrayAdapter? Thanks!</p>","145279","","","","","2010-10-22 03:36:59","ArrayList<File>() as a Spinner","<java><android>","1","0","","",""
"3993658","1","","","2010-10-22 03:20:28","6","18522","<p>I try to get the correct speed in updates for the function onLocationChanged, this is my class:</p><pre><code>public class LocationService extends Service implements LocationListener {</code></pre><p>Putting the minTime on 6000 does not help, it wil keep updating constantly, what am i doing wrong?</p><pre><code>public void requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener, Looper looper) {</code></pre><p>Greetings</p>","483766","","","","","2010-12-27 06:13:33","requestLocationUpdates interval in Android","<android><gps><location>","2","0","5","",""
"3993679","1","","","2010-10-22 03:26:36","0","787","<p>Hi I am trying to login salesforce through a webservice on Android platform. But I am facing some problems. I am getting a <strong><em>""Socket Exception:Operation timed out""</em></strong> error. I am using the Ksoap2 soap cient ported for Android and WSDL details are from the Partner WSDL of my developer account at Salesforce.I have anabled the ""api access"".Also, username and password are valid. I am trying this through development enviornment(Eclipse) on my desktop emulator for Android.<br>Can anyone please help me figure out if I am missing something and resolve this problem.<br>Following is the source code:  </p><pre><code>import android.app.Activity;//Soap importsimport org.ksoap2.SoapEnvelope;import org.ksoap2.SoapFault;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.AndroidHttpTransport;//Android Importsimport android.app.Activity;import android.os.Bundle;import android.util.Log;import android.widget.TextView;import org.xmlpull.v1.*;import java.io.IOException;import android.os.Bundle;public class SalesForceLogin extends Activity {    private static final String NAMESPACE = ""urn:sobject.partner.soap.sforce.com"";    private static final String URL = ""https://login.salesforce.com/services/Soap/c/20.0"";    private static final String SOAP_ACTION = """";    private static final String TAG = ""SALESFORCE-SERVICE"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        //New        SoapObject binding = new SoapObject(NAMESPACE, ""login"");        binding.addProperty(""username"", ""username""); //Valid username        binding.addProperty(""password"", ""password""); //Valid password appended by security token        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.setOutputSoapObject(binding);        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);        androidHttpTransport.debug = true;         SoapObject result=null;        try         {            androidHttpTransport.call(SOAP_ACTION, envelope);            result = (SoapObject)envelope.getResponse();            // At this point, Soap login success.            Log.v(TAG, result.toString());            Object serverUrl=result.getProperty(""serverUrl"");            Log.v(TAG,""serverUrl=""+serverUrl);            Object passwordExpired=result.getProperty(""passwordExpired"");            Log.v(TAG,""passwordExpired=""+passwordExpired);             Log.v(TAG, ""Ending Login with Success."");        }         catch (SoapFault aSoapFault)         {            Log.d(TAG, ""SoapFault actor=""+aSoapFault.faultactor);            Log.d(TAG, ""SoapFault code=""+aSoapFault.faultcode);            Log.d(TAG, ""SoapFault message=""+aSoapFault.faultstring);            // do something – Soap Fault occurred        }        catch (XmlPullParserException reso)        {            Log.v(TAG, ""XmlPullParserException"");            reso.printStackTrace();        }        catch (IOException reso) //Socket Exception caught here!        {            Log.v(TAG, ""IOException"");            reso.printStackTrace();        }    }}</code></pre><p>Edit: For reference of anyone who refers this thread, I was able to get above web service to run, problem was discrepancy between url and namespace. With following modifications the above code runs perfectly fine.</p><pre><code>NAMESPACE = ""urn:partner.soap.sforce.com"";URL = ""https://login.salesforce.com/services/Soap/u/20.0"";SOAP_ACTION = ""soap"";</code></pre>","452307","","452307","","2010-10-26 03:07:35","2010-10-26 03:07:35","Help required in resolving problem with Webservice","<android><soap><salesforce>","2","2","2","",""
"3993692","1","3993719","","2010-10-22 03:30:47","0","188","<p>I am developed application with google map in android 2.2 version using eclipse in  ubuntu machine.In that case I can get the google map as well as the location perfectly.</p><p>But now i have to run that same apps in Xp machine,there also  am having android 2.2 .The apps run properly but the google map not displayed ,only white screen with boxes displayed.</p><p>can any one help me ,what are the changes i need to apply in my apps to get the same output in xp machine too?</p><p>Thanks &amp; Regards,Lakshmanan.</p>","450596","","","","","2010-10-22 03:39:17","Google map displayed in my Ubuntu machine ,not displayed in Xp machine","<android>","1","0","","",""
"3993705","1","3993772","","2010-10-22 03:33:05","0","1216","<p>my issue is this: </p><p>i need the phone to create a MediaPlayer object called smp when:</p><p>it sees that it's been shaken, it confirms that smp isn't already created, it sees that a button called hilt isChecked.</p><p>when it satisfies these conditions, it should create the player, play a sound, and destroy the player.  the problem i have is that it will play the sound at most twice and then force close.  i'm not sure why my logic doesn't work when i've used it for buttons in the app and it causes no problems.</p><p>my thinking is that i've got too many unused MediaPlayer objects but i can't see how since the OnCompletionListener should be calling release() every time the player is finished.</p><p>anyway, i'm sure it won't be that hard to better minds than mine.  here's the code.  thanks for any help.  </p><p>UPDATE:  this is the code i'm running now:</p><pre><code>public void onSensorChanged(int sensor, float[] values) {    synchronized (lock){        if (!jobRunning){            jobRunning = true;        }else{             return;        }    }    if (sensor == SensorManager.SENSOR_ACCELEROMETER) {        long curTime = System.currentTimeMillis();        if ((curTime - lastUpdate) &gt; 100) {            long diffTime = (curTime - lastUpdate);            lastUpdate = curTime;            x = values[SensorManager.DATA_X];            y = values[SensorManager.DATA_Y];            z = values[SensorManager.DATA_Z];            float speed = Math.abs(x+y+z - last_x - last_y - last_z)                              / diffTime * 10000;                if (speed &gt; SHAKE_THRESHOLD &amp;&amp; hilt.isChecked() == true) {                    smp = MediaPlayer.create(getBaseContext(), swingSoundFx[rnd.nextInt(SWING_NUM)]);                     smp.setOnCompletionListener( new OnCompletionListener(){                        @Override                        public void onCompletion(MediaPlayer mp) {                            if (smp != null){                                smp.stop();                                smp.release();                            }                        }                       }                    );                    smp.start();            }        last_x = x;        last_y = y;        last_z = z;        }    }    synchronized (lock){        jobRunning = false;    }}</code></pre>","2451972","","2451972","","2010-10-22 21:49:48","2010-10-23 03:48:51","problems with onSensorChanged method","<android><media-player>","1","0","","",""
"3993725","1","","","2010-10-22 03:40:44","4","3994","<p>i want to get android camera gallery folder path to save images in that</p><p>in different mobile phones it is different for example in galaxy it is</p><p>/sdcard/DCIM/camera/image.jpg</p><p>and in other phones for example </p><p>/sdcard/media/images/image.jpg</p><p>hot get path up to gallery folder dynamically?</p><p>any help would be appreciated.</p>","249991","","","","","2012-11-08 01:02:58","how to get path of android galley folder dynamically?","<android>","1","0","","",""
"3993732","1","3993860","","2010-10-22 03:43:01","0","2340","<p>I am using Http get and post methods for Http ConnectionI just wanted to ask that what all exception can occur in using them.I know list may be too long but can someone tell me the general and frequent exceptions that occur and must be handled?my code is :</p><pre><code>public class httpconnection    {    HttpClient client=new DefaultHttpClient();      InputStream in=null;    public InputStream httpreponse_post(String url,List&lt;NameValuePair&gt; params)     {      try {    HttpPost post = new HttpPost(url);         UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);        post.setEntity(ent);        HttpResponse responsePOST = client.execute(post);          HttpEntity resEntity = responsePOST.getEntity();          in=resEntity.getContent();        in.close();} catch (ClientProtocolException e) { Log. e (""Client Protocol Exception"", e.toString ()); } catch (IOException e) { Log. e (""Input Output Exception"", e.toString ());  }  return in;    } public InputStream httpreponse_get(String url)  {     try     {  //String getURL = ""http://www.google.com""; HttpGet get = new HttpGet(url); HttpResponse responseGet = client.execute(get); HttpEntity resEntityGet = responseGet.getEntity();     in=resEntityGet.getContent();     in.close(); }  catch (IOException e) { Log. e (""Input Output Exception"", e.toString ());  }  return in;        }     }</code></pre>","424831","","","","","2010-10-22 04:22:24","Http Get and Post method exceptions in android?","<android><http>","1","0","1","",""
"3993854","1","","","2010-10-22 04:20:28","2","6371","<p>""java.lang.RuntimeException: Unable to start activity ComponentInfo : android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.LinearLayout""</p><p>I am getting this error can anyone help me?</p>","468695","","","","","2013-10-23 12:16:25","android.view.InflateException : Error inflating class android.widget.LinearLayout","<android>","3","0","","",""
"3993924","1","3993933","","2010-10-22 04:38:24","68","40366","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2768806/programmatically-obtain-the-android-api-level-of-a-device"">Programmatically obtain the Android API level of a device?</a>  </p></blockquote><p>How do I get the Api level of the phone curently running my application? I am sure its simple but I can not find it as all my searches bring up tons of junk.</p>","310678","","85950","","2013-01-24 20:38:24","2014-03-26 15:20:33","Get android api level of phone currently running my application","<android><api><level>","4","0","20","2013-01-25 03:24:41",""
"3993945","1","3993970","","2010-10-22 04:43:01","0","593","<p>I want to put an ImageView in the middle of the screen, and it stays in the middle in all screen resolutions. There is nothing else in the view.</p>","343679","","","","","2010-10-22 04:47:13","Android: How to put an ImageView in the middle of the Screen?","<android>","1","0","","",""
"3994000","1","3998855","","2010-10-22 04:57:37","2","1194","<p>Which is favourable, efficient and faster? storing information in xml format and retrieving it or storing information in a db on android?</p><p>and also, in terms of portability, xml could be stored as an asset...can the same be done with db? do db come in as default package in all phones.</p><p>application involves dealing with over 1000 records of data.</p>","377337","","73488","","2010-10-22 05:09:17","2010-10-22 16:22:33","android db or xml/kml?","<android><xml><sqlite>","3","0","2","",""
"3994045","1","","","2010-10-22 05:07:16","0","201","<p>I have two classes and one class contain string array and its constructor how to call it in main with its object?</p>","467591","","73488","","2010-10-22 05:09:55","2011-03-10 19:34:00","calling array in main class","<android>","1","4","","",""
"3994106","1","4052170","","2010-10-22 05:17:51","3","2342","<p>I have different screen to work in an android application.I'm using ViewFlipper for this.I decided to used different class for different view children </p><pre><code>public main extends Activity{{public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.sign_in);    ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);HomeScreen s = new HomeScreen(getApplicationContext(), getCurrentFocus(), viewFlipper);  }} </code></pre><p>and this the Homescreen class is :-</p><pre><code>public class HomeScreen {private Button signIn;private Button createAccount;private View v;private Context context;private ViewFlipper viewflipper;public HomeScreen(Context context,View v,ViewFlipper viewflipper ) { this.v=v; this.context = context; this.viewflipper = viewflipper; signIn = (Button) v.findViewById(R.id.button_sign_in_homeScreen); createAccount = (Button)v.findViewById(R.id.button_createAccount_homeScreen); signIn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {   viewflipper.setDisplayedChild(1);  } });   }</code></pre><p>but is shows run exception java.lang.RuntimeException: Unable to start activity ComponentInfoCan anyone please help me<br>is getCurrentFocus() is the correct way to get the view?  </p><hr><p><strong>What i try to implement is</strong>  </p><ul><li>I need to use different class for defining, listening the controls of each child of view flipper </li><li>In the above example HomeScreen is one of my the child screen of view flipper</li><li>But the line <code>v.findViewById</code> is showing error <em>i think that getCurrentFocus() is not the correct way to sent the view</em></li></ul><p>I don't know weather i'm moving in the correct way? When i define and listen all the controls of all children of viewflipper in the Class where i define that viewflpper, that class become very big. That made me to think so.. </p><p>Thanks...</p>","477754","","477754","","2010-10-29 11:53:32","2010-10-29 13:17:38","android: Can i use different class for different child of viewflipper","<android><activity><viewflipper>","1","0","5","",""
"3994173","1","","","2010-10-22 05:31:50","1","452","<p>When i run my android application it shows an exception ""android runtime exception"" with a message ""Error: thread attach failed"". it happens before the execution of ""OnCreate"" mathod of main class. what will be reason for that error?? anybody please help. </p>","462695","","","","","2010-10-22 05:31:50","android Runtime Exception","<android>","0","2","","",""
"3994190","1","","","2010-10-22 05:36:09","-3","115","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3984530/xml-parsing-in-android"">xml parsing in android</a>  </p></blockquote><p>i have to parse  the below give file in xml format  -      <p>The url for above file is <a href=""http://simplyappointments.com/businessinfoxml.php?email=sujit_jitu06@rediffmail.com"" rel=""nofollow"">http://simplyappointments.com/businessinfoxml.php?email=sujit_jitu06@rediffmail.com</a></p><p>Can anybody help me in this.... I will be very thankful to you.</p>","475349","","","","","2010-10-22 07:03:37","parsing in android","<android>","1","2","","2010-10-22 12:57:11",""
"3994277","1","4870730","","2010-10-22 05:56:41","2","1161","<p>I've done some searching around and haven't found any good references for non-touch events provided to mobile browsers. Does anyone know of any good resources for what tilt events are supported or have experience with such things?</p><p>I'm really looking forward to adding some yaw controls.</p>","68210","","","","","2014-02-25 21:33:11","Is it possible to receive tilt events in JavaScript on mobile Webkit for iOS or Android phones?","<android><javascript-events><ios><mobile-website>","2","1","","",""
"3994315","1","3994333","","2010-10-22 06:06:03","3","17295","<p>How can I display an Integer value in TextView?</p>","483861","","302328","","2010-10-22 06:18:05","2014-03-03 18:57:32","Integer value in TextView","<android><textview>","5","0","1","",""
"3994464","1","4732362","","2010-10-22 06:35:57","1","1650","<p>I have an application that has one service and 2 activities.One activity (the main one) is a preferences activity and the other one is a dialog themed activity. The service from time to time needs to open only the dialog themed activity (using FLAG_ACTIVITY_NEW_TASK).The problem is that when the preferences activity is opened in background (for example the user pressed HOME key instead of BACK, so the activity is OnPause) and the service tries to open the dialog themed activity, also the main activity is opened (comes in foreground).I don't want this. So, how can I open only the themed activity from the service, without the main activity pop up ?</p><p>Android Manifest .xml</p><pre><code>    &lt;service android:name="".SimpleService""&gt; &lt;/service&gt;&lt;activity    android:name="".Preferences"" 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="".popup_activity"" android:theme=""@android:style/Theme.Dialog"" 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;intent-filter&gt;                    &lt;action android:name=""android.intent.action.VIEW"" /&gt;                    &lt;category android:name=""screenon.popup.activity"" /&gt;                    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;           &lt;/intent-filter&gt;                       &lt;/activity&gt;</code></pre><p>And from the service :</p><pre><code>           Intent intent = new Intent(Intent.ACTION_VIEW);               intent.addCategory(""screenon.popup.activity"");               intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);               startActivity(intent);</code></pre>","467780","","168868","","2012-01-29 16:41:01","2012-01-29 16:41:01","Open only one activity, without the main activity","<android><android-activity>","2","5","1","",""
"3994508","1","4225384","","2010-10-22 06:44:42","0","2709","<p>I am trying to develop a Facebook application for Android. I am unable to integrate the ""Add Comment"" feature to photos in Facebook Albums. Using the Graph API, I can show the previously made comments on a photo. However, I just can't add new comments to a photo.</p><p>Can somebody provide me some helpful advice?</p>","142588","","","","","2013-05-16 11:35:33","Can't add comments to photos in Facebook Android application","<android><facebook><facebook-graph-api>","1","0","","",""
"3994577","1","4592388","","2010-10-22 06:59:03","0","734","<p>I am having a problem with facebook. I have registered an application with facebook, written the code for updating status via application. But when the status is posted facebook does not shows the application's icon on the wall. It only shows the small logo and not the big icon.</p><p>I have re-verified that the application icon exists in the profile page of my application.</p><p>Any help ???????</p>","405521","","405521","","2010-10-22 08:09:01","2011-01-04 10:00:27","Android : facebook not showing application icon","<android>","1","0","","",""
"3994581","1","3994734","","2010-10-22 06:59:22","1","1344","<p>I override the function getView(), but when debug I found it never be invoked, really weird...</p><pre><code>public class EntriesActivity extends ListActivity { private static final String TAG = ""EntriesActivity""; private EntriesAdapter mArrayAdapter; private List&lt;Entry&gt; mEntries = new ArrayList&lt;Entry&gt;(); String mGoalId; @Override protected void onCreate(Bundle savedInstanceState) {  // TODO Auto-generated method stub  super.onCreate(savedInstanceState);  setContentView(R.layout.entries_activity);  Bundle extras = getIntent().getExtras();  mGoalId = extras.getString(""goal_id"");  mArrayAdapter = new EntriesAdapter(this);  setListAdapter(mArrayAdapter);  new EntriesRefreshTask().execute(); }  class EntriesAdapter extends ArrayAdapter&lt;Entry&gt; {  Activity context;  EntriesAdapter(Activity context) {   super(context, R.layout.entries_row, mEntries);   this.context = context;  }  @Override  public View getView(int position, View convertView, ViewGroup parent) {   Log.v(""EntriesActivity"", position + """");   LayoutInflater inflater = context.getLayoutInflater();   View row = inflater.inflate(R.layout.entries_row, null);   TextView title = (TextView) row.findViewById(R.id.entry_title);   TextView name = (TextView) row.findViewById(R.id.entry_name);   TextView content = (TextView) row.findViewById(R.id.entry_content);   Entry e = EntriesActivity.this.mEntries.get(position);   title.setText(e.getTitle());   name.setText(e.getName());   content.setText(e.getContent());   return (row);  } } private class EntriesRefreshTask extends AsyncTask&lt;Void, Void, Boolean&gt; {  private static final String TAG = ""EntriesRefreshTask"";  private static final boolean DEBUG = Things43Settings.DEBUG;  private Things43HttpApi mHApi = ((Things43App) getApplication())    .getHttpApi();  @Override  protected void onPreExecute() {   if (DEBUG)    Log.d(TAG, ""onPreExecute()"");   // showProgressDialog(""load"");   Toast.makeText(EntriesActivity.this, ""Loading entries..."",     Toast.LENGTH_LONG).show();  }  @Override  protected Boolean doInBackground(Void... params) {   if (DEBUG)    Log.d(TAG, ""doInBackground()"");   try {    // GoalActivity.this.    getEntries(mGoalId);    return true;   } catch (Exception e) {    if (DEBUG)     Log.d(TAG, ""Caught Exception logging in."", e);    // Preferences.logoutUser(foursquare, editor);    return false;   }  }  @Override  protected void onPostExecute(Boolean success) {   try {    if (success) {     Log.d(TAG, ""success"");     mArrayAdapter.notifyDataSetChanged();    } else {     Toast.makeText(EntriesActivity.this,       R.string.request_failed_toast, Toast.LENGTH_LONG)       .show();     mArrayAdapter.notifyDataSetChanged();    }   } catch (Exception e) {    if (DEBUG)     Log.d(TAG, ""GoalActivity:onPostExecute():"", e);   }   // dismissProgressDialog();  }  @Override  protected void onCancelled() {   // dismissProgressDialog();  }  public boolean getEntries(String goal_id) {   ArrayList&lt;Entry&gt; entries = mHApi.GetGoalEntries(mGoalId);   Log.v(TAG, entries.size() + """");   if (entries.size() &gt; 0) {    mEntries = entries;   }   return true;  } }</code></pre>","478375","","","","","2010-10-22 07:28:59","android listview problem, override getView() but it never be invoked","<android><listview>","1","0","","",""
"3994622","1","3996397","","2010-10-22 07:06:41","0","1254","<p>Json object is returned to a webservice which gets the i/p as</p><pre><code>[OperationContract(Name = ""Create"")][WebInvoke(UriTemplate = ""/Create/Data"", Method = ""POST"",           RequestFormat = WebMessageFormat.Json,           ResponseFormat=WebMessageFormat.Json)]bool CreateCustomer(StringBuilder objCustomer);</code></pre><p>//in my service file im deserializing the i/p obj to my class object and inserting</p><pre><code>public bool Create(StringBuilder strObj)    {        JavaScriptSerializer js = new JavaScriptSerializer();        Customer custObj = js.Deserialize&lt;Customer&gt;(strObj.ToString());        bool Inserted = false;</code></pre><p>//            connection established and data is put into it</p><p>from im asp.net client the obj is serialized to json format  and it can be inserted into my DB but from android, the JSON object which they are sending could not be recognised by my service.. but the response to them goes as ""OK 200"" .. </p><p>the android code is </p><pre><code>HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit HttpResponse response; JSONObject json = new JSONObject();String URL =""http://10.242.48.54/restinsert/Service1.svc/Create/Data"";try{     HttpPost post = new HttpPost(URL);     json.put(""CNo"",200);    json.put(""CName"",""addme"");    StringEntity se = new StringEntity(json.toString());    se.setContentType(""application/json; charset=utf-8"");    se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, ""application/json; charset=utf-8""));    post.setHeader(""Accept"",""application/json"");    post.setHeader(""Content-type"",""application/json; charset=utf-8"");    String ss= post.toString();    response = client.execute(post);</code></pre><p>created a new class for serialize and deserialize</p><pre><code>public class Json{    public string JsontoString(string obj)    {        JavaScriptSerializer js = new JavaScriptSerializer();        StringBuilder sb = new StringBuilder();        js.Serialize(obj, sb);        return sb.ToString();    }    public string StringtoJson(string obj)    {        JavaScriptSerializer js = new JavaScriptSerializer();        Customer custObj = js.Deserialize&lt;Customer&gt;(obj.ToString());        return custObj.ToString();    }}</code></pre><p>}</p>","483898","","483898","","2010-10-22 12:44:55","2011-11-30 06:44:57","Android JSon Object Not readable in dotnet webservice for insert operation in REST","<android><json><rest>","2","6","","",""
"3994814","1","","","2010-10-22 07:45:35","2","291","<p>I want to create a book reader and implement the page effect. I think I can spare text in separated views and make an animation when the user wants to go to the next or previous page. The problem is that I don't find a method to spare the text correctly. I can set the max lines number for a text view, but I don't know how to get the last character from that view to calculate the text for the next view. There is a method to get from a textView only the visible text?Is there a better solution for my ideea? Any advice will be helpfull.</p><p>Thank you!</p>","475480","","199972","","2012-06-12 21:48:00","2012-06-12 21:48:00","TextView page scroll","<android><android-widget>","0","0","2","",""
"3994843","1","","","2010-10-22 07:50:17","35","25538","<p>I try to understand the Android synchronization logic. What I don't understand is the file <code>syncadapter.xml</code> contained in the Android SDK sample project <code>SampleSyncAdapter</code>. If you downloaded the SDK samples it should be in the following folder:</p><pre><code>SDK/android-sdk-PLATFORM/samples/android-VERSION/SampleSyncAdapter/res/xml/syncadapter.xml</code></pre><p>I read, the authority of a content provider should be a string or a reference to a resource. What exactly is the content authority and where is <code>com.android.contacts</code>? Here is the content of the file (w/o license information and comments, API level 16).</p><pre><code>&lt;sync-adapter xmlns:android=""http://schemas.android.com/apk/res/android""    android:contentAuthority=""com.android.contacts""    android:accountType=""com.example.android.samplesync""    android:supportsUploading=""false""    android:userVisible=""true""/&gt;</code></pre>","132257","","356895","","2012-08-03 21:45:16","2013-07-27 11:38:38","How do I use the Android SyncAdapter?","<android><android-contentprovider><android-syncadapter><reverse-dns>","3","1","27","",""
"3994881","1","3994947","","2010-10-22 07:56:17","0","628","<p>I want to change progress bar default(yellow) color to green color.Please help me</p>","437833","","1069068","","2013-03-19 14:35:00","2013-03-19 14:35:00","How to change progress bar fore color?","<android>","1","0","","",""
"3994923","1","","","2010-10-22 08:04:15","3","3883","<p>I've got the Android SDK downloaded, got a AVD booted and running, but haven't been able to find the Marketplace application.  Do the images available through the SDK utility not include a marketplace app?  If not, is there somewhere I can get it?</p>","483955","","162407","","2010-10-22 08:08:07","2011-02-14 11:12:07","No marketplace application on the Android emulator","<android><android-emulator>","4","0","","",""
"3995058","1","4077478","","2010-10-22 08:24:44","8","18815","<p>So I see we can have alertdialogs with gray and white (when setinverse...) background colors.</p><p>To learn why I checked themes.xml of the sdk, checking it I was led to drawables and there I realized the alertdialog background is not done programatically but via some images. And these images guarantee that there are two gray(or white when inverse color) horizontal lines on top(title area) and bottom(just above button area) of the dialog when we use LayoutInflater to just set a different backgroundcolor.</p><p>So my question is, as LayoutInflator is useless and guessing I have to subclass alertdialog, what do you suggest I do to generate an AlertDialog with a different backgroundcolor? What should I override? </p>","191198","","522150","","2012-06-10 09:25:17","2012-06-10 09:25:17","Android - Custom AlertDialog Background Color","<java><android><alertdialog>","2","0","3","",""
"3995063","1","3995077","","2010-10-22 08:25:06","0","1745","<p>I want to compare 2 strings.My first value is in 'list[0][0]' variable and the second value is in item[0].But when I am comparing the 2 strings using 'if' statement, I don't get the answer.</p><p>if(selected_list[0][0]==items[0]){// some code}it is not working.But when I am hard-coded these values, it is working fine.if(""banana""==""banana""){// some code}Please give me the solution? Thank you..</p>","483861","","","","","2010-10-22 08:33:05","comparing string values","<android><string>","3","0","","",""
"3995150","1","3995261","","2010-10-22 08:38:48","0","231","<p>I would like to create my first real time game for the android platform.I am searching for good resources to get started from, I have little knowledge about game development (just the basic ideas) and would appreciate any helpful websites or books you could recommend.</p><p>Thanks,Jason </p>","407133","","","","","2011-05-12 17:32:17","Recomendations for books / other resources to learn android real time game dev?","<android>","1","0","","",""
"3995156","1","3995187","","2010-10-22 08:39:08","1","253","<p>My application is using a REST based webservice to show multiple activity. To enable the user offline browsing, I am storing the REST data into local SQLiteDatabase with AsyncTask (with some dialogue to wait). However, it takes a long time to load the db (10 mins) and its just bad experience for the user. So I was wondering if there is a way to run the DBLoading thread in background and let the user continue using the app (With multiple activity) with the REST service. When DBLoading thread is done, I want to push a notification in the current Activity in focus letting the user know the Loading is done. </p>","321098","","73488","","2010-10-22 08:40:17","2010-10-22 08:42:54","Any way to run a background thread behind multiple Activity and show alert when done?","<android>","1","1","","",""
"3995213","1","","","2010-10-22 08:45:56","0","335","<p>i hav displayed the text in a textview.........i want to do animations like rotate etc.......how to do it? which classes are used for it?i want a example program for it?</p>","482875","","","","","2010-10-22 08:48:31","android programming for creating animations","<android>","1","0","","2012-08-21 20:11:36",""
"3995215","1","","","2010-10-22 08:46:00","33","60018","<p>How do I add and remove views such as <code>TextView</code>s from Android app like on the original stock Android contacts screen where you press a small icon on the right side of a field and it adds or deletes a field which consists of a <code>TextView</code> and an <code>editTextView</code> (from what I can see).</p><p>Any examples on how to achieve this?</p>","444668","","1267021","","2012-10-28 06:21:53","2012-10-28 06:21:53","Add and Remove Views in Android Dynamically?","<android><android-view>","4","0","12","",""
"3995218","1","","","2010-10-22 08:46:19","1","355","<p>Friend's     I implemented map with search option in my application,when i run the application in HTC,SonyEricson it's working well,but when i make the search in Motorola Droid 2.2,i'm getting numberformat exception,here my code for search option</p><pre><code>findViewById(R.id.map_search).setOnClickListener(     new OnClickListener() {      public void onClick(View v) {       try{       onSearchRequested();       }       catch(Exception e)       {        Log.v(""Error"",""""+e);       }      }     });</code></pre><p>Here i fetching the data from database to search list data to user.Here my code for database side </p><pre><code>@Override public Cursor query(Uri uri, String[] projection, String selection,   String[] selectionArgs, String orderBy) {if (uriMatcher.match(uri) == BRUMAPS_ID) {   long id = Long.parseLong(uri.getPathSegments().get(1));   selection = appendRowId(selection, id);  }if (uriMatcher.match(uri) == BRUMAPS) {   db = news.getReadableDatabase();   cursor = db.query(TABLE_NAME2, projection, selection,     selectionArgs, null, null, orderBy);  }}</code></pre><p>below the exception i'm getting in Moto-Droid 2.2 even in Droid 2.1 is working good</p><pre><code>10-22 14:14:20.832: DEBUG/ThrottleService(60): onPollAlarm - roaming =false, read =0, written =0, new total =010-22 14:14:21.442: ERROR/SuggestionsAdapter(319): error changing cursor and caching columns10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): java.lang.NumberFormatException: 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.Long.parseLong(Long.java:347)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.Long.parseLong(Long.java:320)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.SearchDialog.onDataSetChanged(SearchDialog.java:612)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.SuggestionsAdapter.notifyDataSetChanged(SuggestionsAdapter.java:193)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:260)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.SuggestionsAdapter.changeCursor(SuggestionsAdapter.java:238)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.CursorFilter.publishResults(CursorFilter.java:67)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.os.Handler.dispatchMessage(Handler.java:99)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.os.Looper.loop(Looper.java:123)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.reflect.Method.invokeNative(Native Method)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.reflect.Method.invoke(Method.java:521)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at dalvik.system.NativeStart.main(Native Method)10-22 14:14:21.493: DEBUG/AndroidRuntime(319): Shutting down VM10-22 14:14:21.493: WARN/dalvikvm(319): threadid=1: thread exiting with uncaught exception (group=0x4001d800)10-22 14:14:21.522: ERROR/AndroidRuntime(319): FATAL EXCEPTION: main10-22 14:14:21.522: ERROR/AndroidRuntime(319): java.lang.NumberFormatException: 10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.Long.parseLong(Long.java:347)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.Long.parseLong(Long.java:320)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.os.Handler.dispatchMessage(Handler.java:99)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.os.Looper.loop(Looper.java:123)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.reflect.Method.invokeNative(Native Method)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at java.lang.reflect.Method.invoke(Method.java:521)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-22 14:14:21.522: ERROR/AndroidRuntime(319):     at dalvik.system.NativeStart.main(Native Method)10-22 14:14:21.563: WARN/ActivityManager(60):   Force finishing activity com.example.brown/.Bru_Maps10-22 14:14:22.172: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{44eed238 com.example.brown/.Bru_Maps}10-22 14:14:23.671: WARN/InputConnectionWrapper.ICC(108): Timed out waiting on IInputContextCallback10-22 14:14:25.813: WARN/InputConnectionWrapper.ICC(108): Timed out waiting on IInputContextCallback10-22 14:14:26.451: DEBUG/dalvikvm(108): GC_EXTERNAL_ALLOC freed 2450 objects / 141280 bytes in 320ms</code></pre><p>what reason for getting this problem in Droid2.2 alone,but it works ion other devices.how can i fix this problem.</p><p>Thanks in advance</p>","393953","","393953","","2010-10-22 12:42:58","2010-10-22 12:42:58","Map Search NumberFormat Exception in android platform 2.2","<android>","0","6","","",""
"3995230","1","","","2010-10-22 08:48:23","0","77","<p>I'm confused how the the android scripting enviornment is supposed to work. Is there a relatively easy way to include python scripts that I run from my java code without making the users download any new applications or anything? Or am I completely misunderstanding how ASE works?</p>","375874","","","","","2012-03-21 06:19:32","Disribute program with scripts in android","<android><android-scripting>","2","0","","",""
"3995351","1","","","2010-10-22 09:05:33","7","1214","<p>I am trying to write some skeleton for a game on android, using OpenGL. I would like to know, where should I place my main game loop code?</p><p>So far, my best candidate is Renderer.onDrawFrame(...) method, which seems to be called per-frame, so the code looks like this:</p><pre><code>void onDrawFrame(GL10 gl) {     preLoopActions();     m_gameScene-&gt;onUpdate();     m_gameScene-&gt;onRender(gl);     postLoopActions();}</code></pre><p>Is there any better approach? I dislike this one because 1) I have to mix updating and rendering in the place, where android expects me just to render, and 2) this method seems to be called from a separate ""rendering thread"", which increases game complexity.</p>","123012","","213269","","2012-02-05 01:39:24","2012-02-05 01:39:24","Where to place main game loop in android game","<java><android><game-loop>","2","0","2","",""
"3995501","1","","","2010-10-22 09:27:05","0","464","<p>Hi can anybody tell how to add webview in list view in android</p><p>Thanks</p>","426344","","","","","2010-10-22 09:47:31","how to add webview in listview in android","<android>","1","0","","",""
"3995510","1","3995808","","2010-10-22 09:28:53","5","8335","<p>I have an ImageView declared in main.XML . I want it to be Zoomed .How can this be done in Android?</p><p>Thanks in Advance</p>","429501","","","","","2010-10-22 10:08:54","How To Zoom ImageView in Android","<android>","1","1","0","",""
"3995511","1","3995612","","2010-10-22 09:29:00","4","9059","<p>How i can share a image from from my app to facebook in android? </p>","436765","","","","","2011-02-22 17:13:33","Image share from android to facebook?","<android>","2","0","2","",""
"3995541","1","","","2010-10-22 09:33:19","-6","8280","<p>I am assigned a project in which I have to send an SMS message from Android SDK automatically.Can anybody help me in this concern?</p>","475349","","1288","","2011-06-22 14:35:41","2013-10-18 14:42:16","SMS manager in Android","<android>","4","2","","2011-12-20 16:21:26",""
"3995600","1","3997314","","2010-10-22 09:40:30","1","1642","<p>Can someone please point to me what is wrong with my code? </p><pre><code>try{MediaPlayer p = new MediaPlayer();p.setDataSource(getCacheDir() + ""/temp.mp3"");p.prepare();p.start();}catch(Exception e){}</code></pre><p>MediaPlayer p catches Exception whenever it calls prepare(). File temp.mp3 is already inside the cache folder and it is not corrupt or what so ever but it doesn't get played. Is it that MediaPlayer can't play files on cache?</p><p>I hope someone can give me an idea of what I have done wrong. Thanks in advance!            </p>","82350","","","","","2011-09-28 13:34:32","Android Simple MediaPlayer problem","<android><caching><mp3><media-player>","2","1","","",""
"3995608","1","","","2010-10-22 09:41:31","0","168","<p>I want to set volume control to my audio streaming project in android .how to do this</p>","461972","","","","","2011-03-20 22:16:49","Media player on android","<android>","1","0","","",""
"3995611","1","3995674","","2010-10-22 09:41:38","0","176","<p>I want to know a data structure for storing values of tags. My XML structure is :</p><pre><code>&lt;personaldetails&gt;    &lt;name&gt;Michael&lt;/name&gt;    &lt;age&gt;28&lt;/age&gt;    &lt;gender&gt;Male&lt;/gender&gt;    &lt;address&gt;123 Streeet 7&lt;/address&gt;    &lt;country&gt;India&lt;/country&gt;    &lt;pincode&gt; 1234877&lt;/pincode&gt;    &lt;contactno&gt;35646445&lt;/contactno&gt;    &lt;emailid&gt;michael@abc.com&lt;/emailid&gt;&lt;/personaldetails&gt;</code></pre><p>I want to store the values at a single place using data structure.Presently i am using setter and getter methods for retrieving values which is making my code large.Can someone suggest something?</p>","424831","","","","","2010-10-22 10:11:26","which data structure should be used for storing different tag values of XML after parsing it","<java><android><data-structures>","2","0","","",""
"3995639","1","4089233","","2010-10-22 09:44:09","3","356","<p>Can someone tell me how I can create a Spinner control using Airplay SDK for Android?</p>","189006","","","","","2010-11-03 16:27:40","Creating a Spinner control in a Airplay Application","<android><cross-platform>","1","0","","",""
"3995675","1","","","2010-10-22 09:49:51","1","45","<p>I need to register an receiver when i click a contact in android ,Is it possible ,I have tried PICK , GET_CONTENT , CALL but still no luck Any help would be appreciated,Thanks in advance. </p>","95877","","","","","2010-10-22 09:49:51","Event when contact is clicked Android","<java><android>","0","0","","",""
"3995791","1","3996042","","2010-10-22 10:05:51","0","294","<p>im doing an application that will use GPS in background mode, then i need that it works also when my phone is blocked and with black screen.</p><p>but i can't find any information about if gps is off when phone is blocked</p><p>can someone tell me please?</p><p>thanks</p>","479886","","","","","2010-10-22 10:46:32","When phone is blocked and with screen black... GPS is still working?","<android><gps>","1","0","","",""
"3995798","1","4001691","","2010-10-22 10:06:40","2","759","<p>I want to return array of string from JNI to java(actully in android). How to do it?</p>","484073","","484073","","2011-01-01 09:16:26","2011-01-01 09:16:26","Returning array of string from JNI to android","<java><android><jni>","1","0","1","",""
"3995825","1","3996104","","2010-10-22 10:10:58","211","97743","<p>I don't understand how to use this attribute. Can anyone tell me more about it?</p>","473659","","26853","","2012-01-03 18:52:37","2014-02-23 15:42:39","What does android:layout_weight mean?","<android><android-layout><android-widget>","10","0","74","",""
"3995868","1","4002293","","2010-10-22 10:16:42","0","2125","<p>suppose I have the following tables </p><pre><code>sqlite&gt; SELECT * FROM Artists;ArtistID|ArtistName1       |Peter Gabriel2       |Bruce Hornsby3       |Lyle Lovett4       |Beach Boys5       |Supernaturalsqlite&gt; SELECT * FROM CDs;CDID|ArtistID|Title              |Date1   |1       |So                 |19842   |1       |Us                 |19923   |2       |The Way It Is      |19864   |2       |Scenes from the Southside|19905   |1       |Security           |19906   |3       |Joshua Judges Ruth |19927   |4       |Pet Sounds         |1966</code></pre><p>I want to make this kind of query </p><pre><code>sqlite&gt;SELECT ArtistID as _id, ArtistName, Title FROM Artists, CDs WHERE Artists.ArtistID=CDs.ArtistID;  </code></pre><p>How can I use that using the Android <code>SQLiteQueryBuilder</code> class, what do I need to put for my projectionMap?</p><p>Or would it be easier just using the <code>SQLiteDataBase</code> class?</p>","384306","","384306","","2010-10-23 00:04:31","2010-10-23 03:15:33","Database query with relationships in Android","<android><sqlite3><cursor><relationships>","2","0","2","",""
"3995881","1","4956789","","2010-10-22 10:18:39","17","4175","<p>I am trying to evaluate couchdb and its potential for solving the sync problem on Android but I can't find any documentation that answers my questions regarding how replication to Android devices works.</p><p>It looks like the focus todolist couchapp is intended to demonstrate what I am looking for.  Does it automatically sync todo's between webapp and device?  </p><p>Also, how do I get the focus couchapp onto the Android device?</p>","139346","","","","","2011-12-19 10:27:17","Couchdb on Android","<android><couchdb><sync>","2","0","7","",""
"3996039","1","3997747","","2010-10-22 10:45:54","0","951","<p>the users of my app will provide me the recipient's phone numbers of the text messages they will be writing. How can I ensure the usage of the international phone number format when the user provides a NATIONAL format while sending a message to a person who is located in his own country? Would I have to actually KNOW all the national syntaxes for phone numbers that are used in every single country I have users in? If that is the case (what I SO wish that it is not), does anyone know a list of the syntaxes? And if not, what is the alternative? An out-of-Android-solution maybe? :)</p><p>Thanks in advance! </p><p>Best regards<br>S.</p>","419501","","","","","2010-10-22 14:22:54","Ensure international format for phone numbers provided by an Android app?","<android><localization><phone-number>","1","2","","",""
"3996070","1","","","2010-10-22 10:49:43","2","6021","<p>How can I give values to ListView?When I am trying to create a ListView using String array, my process is suddently stopped.</p><pre><code>     public String[] items_list=new String[100];     items_list[0]=""11"";     items_list[1]=""22"";     items_list[2]=""33"";     items_list[3]=""44"";     ListView listitems=(ListView)findViewById(R.id.list);     adapter=new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,items_list);     listitems.setAdapter(adapter);</code></pre><p>But if i am initializing the string array with ite declaration, it is working. Why this is happend?</p><pre><code>     public String[] items_list={""chocolate"",""lime juice"",""icecreame""};</code></pre><p>Please help me...Thnk you..</p>","483861","","","","","2011-08-12 18:59:27","ListView using String Array","<android><string><listview>","2","2","","",""
"3996076","1","","","2010-10-22 10:51:13","0","2605","<p>I am developing Android application for the company. They want me to create digital newspaper that would:</p><ul><li>Display list of headlines for each category/subcategory</li><li>Will have 4-6 categories and 4-8 subcategories for each category</li><li>Display article with text and images,</li><li>Play podcast,</li><li>Save downloaded articles/headlines in db</li></ul><p>They already have the web-service almost adopted for this app.This app will be quite similar to: TechnologyReview or CNET News (but the article will be larger)</p><p>I have estimated this project for 160 hours of development. That doesn't include design but includes design implementation.</p><p>I would love to hear your opinion on this estimate. Do you think 160h is too short or too long? How much I should charge for this project or 1 hour of development(more or less of course)? I am living in London, UK</p><p>I need this estimation by the end of today so I will be really grateful for fast replies.</p><p>Thanks,marqs</p>","400493","","","","","2013-08-17 22:31:10","Android application - cost estimation","<android><project><cost>","2","5","0","",""
"3996103","1","","","2010-10-22 10:55:26","3","745","<p>Can you get signal strength measurements of Mobile Networks in iOS and/or Android?</p><p>On developer.apple.com I have found CoreWLANWirelessManager sample code for OSX, that shows how to get measurements for WiFi networks.</p>","484114","","428381","","2010-10-22 11:18:28","2010-10-22 11:18:28","Signal strength measurements of Mobile Networks in iOS and/or Android?","<iphone><android><networking><ios4>","1","0","","",""
"3996133","1","3996462","","2010-10-22 10:59:16","1","4221","<p>I was advised to use this code to make my method execute after a definite period of time, i modified it a bit and now I have:</p><pre><code>private Handler mHandler = new Handler();private Runnable mUpdateTimeTask = new Runnable() {    public void run() {        final long start = mStartTime;        // Get the difference in ms        long millis = SystemClock.uptimeMillis() - start;        // Format to hours/minutes/seconds        int mTimeInSec = (int) (millis / 1000);        // Do your thing        Location location = tracker.getLastKnownLocation(best);        RetrieveAvgPower(location);        // Update at the next second        mHandler.postAtTime(this, 1000);//start + ((mTimeInSec + 10) * 1000));    }};</code></pre><p>And I try to start and stop it with:</p><pre><code>public void onClick(View v) {         switch (v.getId()) {            case R.id.start:                    mStartTime = System.currentTimeMillis();                    mHandler.removeCallbacks(mUpdateTimeTask);                    mHandler.postDelayed(mUpdateTimeTask, 1000);                    break;                case R.id.stop:                    mHandler.removeCallbacks(mUpdateTimeTask);                    break;}}</code></pre><p>However, there is an issue. First of all, my method sets text and writes a line to log file, but if I use the code above text is not being set, however all info is being written to log file automatically. Another thing is i can't stop runnable - after it starts executing program seems to be not responding and crashes if I try to press stop button. What am I doing wrong and how it can be solved?</p>","458024","","","","","2013-01-23 10:26:08","Problems with runnable","<java><android><runnable>","2","1","1","",""
"3996144","1","","","2010-10-22 11:00:15","5","1712","<p>I have an Android view that I am detecting a fling gesture on to perform an operation, and I want to write some tests to verify that the gesture is working correctly. I have tried <code>TouchUtils.dragViewTo</code> and <code>TouchUtils.drag</code> (with a very small number of steps) but neither of these seem to trigger the event. </p><p>Is there a way to simulate the fling gesture?</p>","79432","","","","","2012-10-03 06:02:14","Simulate a fling gesture in Android ActivityInstrumentationTestCase2","<android><android-sdk-2.2>","3","4","","",""
"3996191","1","","","2010-10-22 11:08:33","0","485","<p>what I am trying to do is to display an item on text on the screen and then following the user input chage that text to the next/previous item.</p><p>I have created a string arry with all the items in (xml)I have then called the array in the Java code and set up the OnclickListners.My problem is that I don't know what is write in the switch case(s) to make the screen display the next/last item in the list.</p><p>Any suggestions?</p>","484123","","","","","2010-10-23 15:33:24","Iterate an array Android","<android><arrays>","1","0","","",""
"3996255","1","4009794","","2010-10-22 11:16:50","3","2600","<p>I am starting to game development adding bitmap images in to array list how can implemented</p><pre><code>for(int i =0;i&lt;9;i++){  resizedBitmap[i] = Bitmap.createBitmap(bitmapOrg, (i%3)*newWidth, (i/3)*newHeight,newWidth, newHeight);            }</code></pre><p>Given 9 images are storing array list display random order how can implemented its urgent</p>","254790","","251173","","2010-10-22 11:20:23","2010-10-24 18:47:37","how can add more images in array list in android","<android>","1","2","1","",""
"3996314","1","3997286","","2010-10-22 11:25:53","-2","152","<p>my android application shows an error of keydispatching timeout. i does'nt happen every time when i touch the screen. i happens after some seconds of application starting. What will be the reason for this?? I used 4 imageviews,oncreate(). When i touch the imageview, it has to download images from the server through GPRS. I implemented main thread's full operations in onCreate() method. Is my probem with this?? Should i implement onStart(),onResume(),onPause(),onRestart() and onDestroy() methods??  </p>","462695","","","","","2010-10-22 14:20:52","android showing error","<android>","3","1","0","",""
"3996328","1","","","2010-10-22 11:27:36","0","1901","<p>Hi is their a calendar view component i can use to display the month week and day?</p><p>In j2me there was no such thing and we had to develop and implement one ourselves which was a pain and took months to complete</p>","444668","","","","","2012-10-12 15:46:34","Android calendar view?","<android>","1","0","","2013-08-02 15:35:01",""
"3996418","1","3997122","","2010-10-22 11:40:46","1","7775","<p>I want to create custom ImageButton, but to work like on/ off button. On click on button image to be changed to pressed(until another button is pressed)!</p><p>On picture This month button is on , This year off .</p><p>How can I create button like this? </p><p>Do I need to use  and how ?</p><p>Thanks</p><p><img src=""http://i.stack.imgur.com/OGm7s.png"" alt=""alt text""></p>","432848","","","","","2011-01-22 01:52:22","Android custom image on/off button","<android>","2","0","","",""
"3996421","1","","","2010-10-22 11:41:14","0","230","<p>Hello In my android application when the user reinstall the app again  i would like to delete the existing database and create a fresh new one.</p><p>How could i know that the user is reinstalling the app or is quering for the updates request.</p><p>How could i delete a file in raw folder?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-10-22 13:04:31","Delate database while reinstallation android","<android>","2","0","","",""
"3996430","1","","","2010-10-22 11:42:50","0","180","<p>I have set up four tabs that each hold a listview, I have added code in the listview java file to make the lists transparent, however, I have a semi transparent grey box covering 75% of the screen and I cannot figure out why, I have a background on my other listviews and they are completely transparent, but the lists within the tabhost have the grey box.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p><pre><code>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=""2dp""&gt;   &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""3dp""        android:layout_weight=""1""/&gt;    &lt;TabWidget        android:id=""@android:id/tabs""       android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""0""/&gt;</code></pre><p></p><p>import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;</p><p>public class Tabs extends TabActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    Resources res = getResources(); // Resource object to get Draw    TabHost tabHost = getTabHost();  // The activity TabHost    TabHost.TabSpec spec;  // Reusable TabSpec for each tab    Intent intent;  // Reusable Intent for each tab    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, prem.class);    // Initialise a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""Prem"").setIndicator(""Prem"",                      res.getDrawable(R.drawable.icontabs))                  .setContent(intent);    tabHost.addTab(spec);    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, champ.class);    // Initialise a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""Champ"").setIndicator(""Champ"",                      res.getDrawable(R.drawable.champ))                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, l1.class);    spec = tabHost.newTabSpec(""League 1"").setIndicator(""L"",                      res.getDrawable(R.drawable.l1))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, ll2.class);    spec = tabHost.newTabSpec(""l2"").setIndicator(""Le"",                      res.getDrawable(R.drawable.l2))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);}</code></pre><p>}</p><pre><code>enter code hepublic class l1 extends ListActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    // Create an array of Strings, that will be put to our ListActivity    String[] names = new String[] {""Le""};    ListView lv = getListView();      lv.setBackgroundResource(R.drawable.le2);    lv.setCacheColorHint(00000000);     this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,            R.layout.list_item, names));}// Get the item that was clicked@Overridepublic void onListItemClick(ListView l, View v, int position, long id) {      if (position == 0) {re</code></pre><p>Any Idea's</p><p>Thanks in Advance</p>","445174","","","","","2010-10-22 16:47:26","Help with ListView transparency","<java><android>","1","0","","",""
"3996537","1","3996643","","2010-10-22 11:57:33","0","120","<p>I use the below code to create listview without listactivity.I need to know how to get the selected list item from this.</p><pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     String[] myList = new String[] {""Hello"",""TEST"",""TEST"",""TEST4""};                   ListView lv = new ListView(this);     lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,myList));     setContentView(lv);}</code></pre>","482568","","66353","","2010-10-22 12:01:57","2010-10-22 12:11:36","getclicked list item from listview in android?","<android>","2","1","","",""
"3996702","1","","","2010-10-22 12:19:51","2","5240","<p>I am using this code to display an image from a URL. My code is run and it does not give an error but the image is not displayed.Any help?</p><p>Here is the code:</p><pre><code>public class MainActivity extends Activity {    ImageView i;    String imageUrl = ""http://64.250.238.26:1111/clips/sunsetsofmauisplash.jpg"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            i = (ImageView) findViewById(R.id.image);            Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(imageUrl).getContent());            i.setImageBitmap(bitmap);        } catch (MalformedURLException e) {        } catch (IOException e) {        }    }}</code></pre>","484194","","900873","","2013-08-29 17:58:09","2013-08-29 17:58:09","Display Image(From Url) In ImageView","<android>","1","0","2","",""
"3996793","1","","","2010-10-22 12:34:24","24","19890","<p>Is it possible to do cross platform game engine for iphone and android. if its how can i do this. what are all thinks i need to study to do this.</p>","470993","","1065190","","2012-09-26 06:05:22","2013-10-15 22:25:23","Game engine for iPhone/Android","<iphone><android><game-engine>","10","2","14","2013-10-15 22:49:46",""
"3996850","1","4000690","","2010-10-22 12:41:23","0","5784","<p>I am developing a game.I have drawn images on a surface view which is residing in a relative layout.I want that my game's look and feel should be the same in all resolutions.          So now i want to measure the surfaceview/canva's width and height so that I can launch the images in proper proportion rather than hard coded values. But I am unable to retrieve the height and width so please help me.</p><pre><code>  I tried canvas.getWidth() and all but it returns 0.</code></pre>","472336","","4071","","2011-03-09 14:00:12","2011-03-09 14:00:12","How do you get the width and height of a surface view","<android>","2","0","1","",""
"3996861","1","","","2010-10-22 12:42:23","1","1139","<p>I added two APN configurations and then scanned the APN database.I noticed that both APN entries are marked as ""current=1"".</p><p>how can I identify the currently active APN configuration programmatically?</p><p>thanks!</p>","445548","","","","","2011-10-06 15:10:04","Current used APN?","<android><configuration><apn>","1","0","1","",""
"3996938","1","4014580","","2010-10-22 12:52:08","16","12084","<p>The app has a ListView with multiple-selection enabled, in the UI it works as expected. But when I read the values out using this code:</p><pre><code>Log.i(TAG,""Entered SearchActivity.saveCategoryChoice()"");SparseBooleanArray checkedPositions = categorySelector.getCheckedItemPositions();Log.i(TAG,""checkedPositions: "" + checkedPositions.size());if (checkedPositions != null){    int count = categoriesAdapter.getCount();    for ( int i=0;i&lt;count;i++)    {        Log.i(TAG,""Selected items: "" + checkedPositions.get(i));    }}</code></pre><p>I get this output, no matter what state each checkbox is in:</p><pre><code>Entered SearchActivity.saveCategoryChoice()checkedPositions: 0Selected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: falseSelected items: false</code></pre><p>The SparseBooleanArray seems to return false for any non-existent item, so the source of the problems seems to be that getCheckedItemPositions() is returning an empty array. The method is behaving as if there are no items in the ListView, but there are.</p><p>I can see from the docs that no values are returned when the ListView is not set up as multi-select, but it is, using this statement:</p><pre><code>categorySelector.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);</code></pre><p>In my scenario, the adapter I'm using is a subclass of ArrayAdapter, and (without any solid evidence) I suspect this may be the cause, though I can't see why it shouldn't work.</p>","477415","","","","","2013-12-04 22:52:19","Why is ListView.getCheckedItemPositions() not returning correct values?","<android><listview>","12","0","4","",""
"3996992","1","","","2010-10-22 12:58:05","-1","1950","<p>i want some sample code for animations</p>","482875","","","","","2013-12-03 07:37:55","sample codes for animations on android","<android><android-emulator>","4","0","","2013-12-03 17:58:29",""
"3996998","1","","","2010-10-22 12:58:27","0","272","<p>Friend's          I have list of places in my database,when i click search option from my UI i have to fetch the data from database and the listed below the textbox,and then i select the corresponding place to search on google maps,it works fine for android platform below 2.1,but when i use 2.2 i'm getting force close Exception.Is there any other way to implement search option in android.</p><p>here the exception i'm getting in 2.2 platform<strong>10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): error changing cursor and caching columns10-22 14:14:21.442: ERROR/SuggestionsAdapter(319): java.lang.NumberFormatException: 10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.Long.parseLong(Long.java:347)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at java.lang.Long.parseLong(Long.java:320)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)10-22 14:14:21.442: ERROR/SuggestionsAdapter(319):     at android.app.SearchDialog.onDataSetChanged(SearchDialog.java:612)</strong></p><p>Thanks in advance.</p>","393953","","393953","","2010-10-22 13:10:48","2010-10-22 13:11:25","Need help on implementing Search option","<android>","1","0","","",""
"3997123","1","","","2010-10-22 13:14:04","0","233","<p>HelloIn my android application i am using a table inside which am using a text view to display the content.The issue is like i would like to scroll the text automatically like in marquee if the text content is greator than screen size.</p><p>Is there any way that i can achieve this in android.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2012-02-28 10:57:55","scroll text if textsize is greater in android","<android>","1","0","","",""
"3997124","1","5122818","","2010-10-22 13:14:14","5","1179","<p>I haven't seen this mentioned anywhere. Usually Android app icons feature a transparent background, unlike the squared status quo of the iOS family.</p><p>However, the Samsung Galaxy S's launcher sets different icon backdrops for my various apps. On my own app, he attributed a green sunshine, and I see that pattern on some other apps I have installed. The default apps also have various backdrops.</p><p>Can I specify what backdrop to show for my app?</p>","169786","","","","","2011-02-25 21:23:01","Samsung Galaxy S features icon backdrops in Launcher, any way to specify it?","<android><icons>","1","3","1","",""
"3997229","1","3997602","","2010-10-22 13:27:19","1","1967","<p>I'm attaching a PNG image to an e-mail with the following code:</p><pre><code>ContentValues values = new ContentValues();values.put(MediaStore.Images.Media.TITLE, title);values.put(MediaStore.Images.Media.DESCRIPTION, title);values.put(MediaStore.Images.Media.MIME_TYPE, ""image/png"");Uri uri = activity.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);OutputStream stream = activity.getContentResolver().openOutputStream(uri);bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);stream.close();Intent intent = new Intent(Intent.ACTION_SEND);intent.setType(""image/png"");intent.putExtra(Intent.EXTRA_SUBJECT, ""Message title"");intent.putExtra(Intent.EXTRA_TEXT, ""Message body"");intent.putExtra(Intent.EXTRA_STREAM, uri);activity.startActivity(Intent.createChooser(intent, activity.getString(R.string.share)));</code></pre><p>The native HTC e-mail app copes with this fine but the GMail app insists on giving the attachment a "".jpg"" extension even though the image is definitely a PNG.  This may just be a bug in the GMail app but I thought I'd ask anyway.</p><p>This is what logcat shows when the attachment is attached:</p><pre><code>I/Gmail   (  285): &gt;&gt;&gt;&gt;&gt; Attachment uri: content://media/external/images/media/11I/Gmail   (  285): &gt;&gt;&gt;&gt;&gt;           type: image/pngI/Gmail   (  285): &gt;&gt;&gt;&gt;&gt;           name: 1287752711300.jpgI/Gmail   (  285): &gt;&gt;&gt;&gt;&gt;           size: 0</code></pre><p>Is there some way to control the file name used by the GMail app?  I couldn't find anything obvious in the Intent extras documentation.  Ideally I would be able to specify the full name, but even just getting it to use the right file extension would be a victory.</p>","5171","","","","","2012-06-25 14:06:47","Sending PNG attachment via Android GMail app","<android><email><png><gmail>","1","0","1","",""
"3997289","1","3997349","","2010-10-22 13:33:58","8","5624","<p>How do I get the temperature of the battery in android?</p>","25282","","","","","2014-04-08 23:40:25","Get temperature of battery on android","<android>","5","0","8","",""
"3997345","1","3997429","","2010-10-22 13:40:27","0","397","<p>Just a simple problem without any idea of how to do it. Does anyone know how/if this can be done?</p><p><strong>Reason:</strong> I just want one solid dialog box with no partitions as it looks a little better in my application.</p><p><strong>EDIT</strong></p><pre><code>public void showCustomDialog() {    Dialog dialog = new Dialog(this);    dialog.setContentView(R.layout.customdialog);    TextView thisText = (TextView) dialog.findViewById(R.id.customDialogThisText);    thisText.setText(""This"");    TextView thatText = (TextView) dialog.findViewById(R.id.customDialogThatText);    thatText.setText(""That"");    ImageView image = (ImageView) dialog.findViewById(R.id.customDialogImageView);    image.setImageResource(R.drawable.icon);    //Crashes the program with an AndroidRuntimeError    //dialog.requestWindowFeature(dialog.getWindow().FEATURE_NO_TITLE);    dialog.show();}</code></pre><p><IMG SRC=""http://i.stack.imgur.com/A5LM1.png""></p>","348261","","50776","","2012-09-03 17:12:01","2012-09-03 17:12:01","Is there a way to make the Title part of a Custom Dialog Box invisible?","<android><title><visible><customdialog>","2","0","","",""
"3997462","1","3998764","","2010-10-22 13:53:19","0","174","<ul><li>I've got an array of images, which I want to display in a gallery.</li><li>I want each image to have a small icon overlayed inside it, on the bottom right hand corner (e.g. a light bulb).</li><li>When the user clicks on the image or the icon, the icon will change from the 'lighbulb_off' image to the 'lightbulb_on' image, and the index of the clicked image will be added to a Vector of 'clicked images'.</li></ul><p>Is there a way to have a custom layout for each item in a gallery? If so, each gallery item could be the original image, with the icon positioned within it using a RelativeLayout.</p>","421636","","383124","","2012-08-05 15:13:38","2012-08-05 15:13:38","How to have a gallery with a changeable icon overlayed upon each image in Android?","<android><layout><gallery>","1","0","","",""
"3997520","1","","","2010-10-22 13:59:54","1","1262","<p>I currently pop up a custom dialog with an EditText in it.Currently the keyboard will only pop up when the user clicks ""into"" the EditText.</p><p>Is it possible to get the keyboard to pop up for the EditText as soon as the Dialog loads?</p><p>I have tried:</p><pre><code>editText = (EditText) findViewById(R.id.EditTextd);editText.setFocusable(true);editText.requestFocus();</code></pre><p>But it hasn't worked.</p><p>Has anyone any ideas?</p>","243999","","243999","","2010-10-22 14:08:53","2010-10-22 14:08:53","Android - Get soft keyboard to automatically pop up when a dialog is displayed?","<android><edittext><android-keypad>","0","5","","",""
"3997636","1","","","2010-10-22 14:11:40","0","391","<p>Simple question - if I am developing and Android application that wants to access Amazon cloud (AWS services) - can you suggest me options?More detailed for what I have done till now: I am trying to include existing AWS libraries for Java - but Dalvik does not support them all - finally the issue I am still not able to resolve is with AWS SDK third-party library stax-api-1.0.1.jar as it cannot be recompiled for Dalvik as others (Android complains I try to recompile a core-library)...</p><p>Please give any suggestions on those issues,Best,Sanja  </p>","484288","","","","","2011-01-09 21:05:56","aws support on android","<android><amazon-web-services>","2","0","","",""
"3997748","1","3998170","","2010-10-22 14:23:00","49","88411","<p>What are the steps to create a keystore for android (in an eclipse environment)?I need to use google maps in my app and I dont know what steps I missed.Please provide me with the specific details steps (I didnt understand it from the guides).</p><p>Thank in advance.</p>","482762","","29995","","2010-10-22 14:58:05","2014-03-14 08:43:03","How can I create a keystore?","<android><eclipse><keystore>","5","10","11","",""
"3997772","1","","","2010-10-22 14:25:51","-1","230","<p>HI all,</p><p>Client given me a particular area map image. Here i need to get the longitude and latitude of the location at the Touch point on the image.</p><p>Is there any way i can work on this issue. To get the location of touch point on the image programatically.</p><p>Thank you In advance</p>","341443","","","","","2010-10-22 15:41:16","Mapping on a image programatically","<android>","1","6","","",""
"3997993","1","4000280","","2010-10-22 14:50:15","1","1909","<p>I am struggling with a memory leak associated with a ListView.  I have created the following small program which exhibits this behavior.</p><p>What I do is create 2 LinearLayouts.  The first has a Button and a GListView control.  The code for GListView is below, but it just sub-classes ListView, and implements the ListAdapter interface.  When the GListView is created, it sets it's adapter to itself.  </p><p>Now when you press the button I switch to the second LinearLayout.  This layout has only a single button.  When you press this button, I create a new 1st layout with a new GListView and set it as the active view.</p><p>Run the program, and switch between the two views 20 times.  Then bring up the DDMS and force a garbage collection.  Then Dump the memory, and use the Memory Analyzer and you will find 21 GListView objects remaining.  That is, the 20 GListViews that are not longer connected to anything have NOT been freed.</p><p>If I do a memory dump and take a look at one of the GListViews that should have been recycled, and list the incomming references using the Memory Analyzer, I get the following:</p><pre><code>Class Name                                                              | Shallow Heap | Retained Heap -------------------------------------------------------------------------------------------------------com.gabysoft.memoryleak.GListView @ 0x43e72270 Unknown                  |          672 |         3,528 |- host android.view.View$ScrollabilityCache @ 0x43e72560               |           80 |           584 |- this$0 android.widget.AbsListView$RecycleBin @ 0x43e72830            |           40 |           160 |- mCallback android.graphics.drawable.StateListDrawable @ 0x43e728a8   |           64 |         1,464 |- this$0 android.widget.AdapterView$AdapterDataSetObserver @ 0x43e730b8|           16 |            16 -------------------------------------------------------------------------------------------------------</code></pre><p>Now if I comment out the 'setAdapter(this)' function in the GListView constructor and repeat the above, I find that there is only 1 GListView that remains.  That is, in this case, all of the unused GListViews have been properly recycled.</p><p>Someone suggested that I create a private class within my GListView to handle the ListAdapter interface, and I tried that, but it did not help.  I have also tried creating a completely separate public class to handle the ListAdapter, but, alas, that doesn't seem to work either. </p><p>Surely there is some way to make these objects go away when they are no longer used anywhere.  (Isn't that what garbage collection is all about?)</p><p>Any help would be appreciated.  I am really pulling my hair out on this one.</p><p>Thanks.</p><pre><code>/* * Activity */package com.gabysoft.memoryleak;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.LinearLayout;import android.widget.ListView;public class MemoryLeak extends Activity implements android.view.View.OnClickListener {    LinearLayout ll2;    boolean page2 = false;    private LinearLayout CreateLayout()    {        LinearLayout ll = new LinearLayout(this);        Button btn1 = new Button(this);        ListView    lv    = new GListView(this);        btn1.setText(""Press"");        btn1.setLayoutParams(new LinearLayout.LayoutParams(100, 40));        btn1.setOnClickListener(this);        ll.addView(btn1);        ll.addView(lv);        return(ll);    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        CreateLayout();        LinearLayout ll = CreateLayout();        ll2 = new LinearLayout(this);        Button btn2 = new Button(this);        btn2.setText(""Back"");        btn2.setLayoutParams(new LinearLayout.LayoutParams(100, 40));        btn2.setOnClickListener(this);        ll2.addView(btn2);        setContentView(ll);    }    @Override    public void onClick(View v)     {        if (page2)        {            LinearLayout ll = CreateLayout();            setContentView(ll);            page2 = false;        }        else        {            setContentView(ll2);            page2 = true;        }    }}/* * GListView */package com.gabysoft.memoryleak;import android.content.Context;import android.database.DataSetObserver;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.ListAdapter;import android.widget.ListView;import android.widget.TextView;public class GListView extends ListView implements ListAdapter{    Context m_context;    DataSetObserver m_observer = null;    public GListView(Context context)     {        super(context);        m_context    = context;        setAdapter(this);        setChoiceMode(CHOICE_MODE_SINGLE);    }    /*     * ListAdapter      */    @Override    public boolean areAllItemsEnabled()     {        return true;    }    @Override    public boolean isEnabled(int position)     {        return true;    }    @Override    public int getCount()     {        return(0);    }        @Override    public Object getItem(int position)     {        return null;    }    @Override    public long getItemId(int position)     {        return(position);    }    @Override    public int getItemViewType(int position)     {        return 0;    }     @Override    public View getView(int position, View convertView, ViewGroup parent)     {        TextView tv = new TextView(m_context);        tv.setText(""Item"");        return(tv);    }    @Override    public int getViewTypeCount()     {        return 1;    }    @Override    public boolean hasStableIds()     {        return false;    }    @Override    public boolean isEmpty()     {        return false;    }    @Override    public void registerDataSetObserver(DataSetObserver observer)     {        m_observer    = observer;    }    @Override    public void unregisterDataSetObserver(DataSetObserver observer)     {        m_observer    = null;    }}</code></pre>","457607","","","","","2010-10-22 19:29:15","Memory lead when using ListView in Android","<android>","1","6","1","",""
"3997995","1","7516114","","2010-10-22 14:50:22","0","484","<p>So, I'm working inside the android framework classes (AOSP). Since I'm technically working on Cyanogenmod, I'm supposed to set the settings for my patch in an app called CMParts, which just throws the strings and ints into the system settings via Settings.System. </p><p>Unfortunately, down in the framework (non application) code, I don't have access to a Context object (because I'm not inside an Activity or Application) to give to the usual method call to get those settings back out. Passing a null doesn't work.</p><p>Anyone know ANY way to get to those settings from framework-level-code? Passing down a context reference isn't really an option down that far...</p>","368918","","368918","","2010-10-22 15:15:43","2011-09-22 14:07:49","Access Settings.System from framework/base code","<android><android-source><cyanogenmod>","1","0","","",""
"3998205","1","","","2010-10-22 15:11:49","3","2161","<p>I have the problem that my service which has the LocationListener implemented, receives a GPSupdate every 500ms it seems. No matter what minTime i put in the requestLocationUpdates function.</p><p>Piece of my code:</p><pre><code>public class LocationService extends Service implements LocationListener {    LocationManager locMan;    @Override    public int onStartCommand(Intent intent, int flags, int startId) {        locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE);         locMan.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER;        locMan.requestLocationUpdates( LocationManager.GPS_PROVIDER, 60000, 1, this);     }    public void onLocationChanged(Location location) {        Log.d( ""Loc"", ""Location has been changed"" );    }</code></pre><p>From a button in my main activity i will call startService();, after this it should run in de background but it gives continuous updates.</p><pre><code>}</code></pre>","484353","","","","","2011-08-09 01:58:59","requestLocationUpdates does not update on interval in Android","<android><gps><location><locationmanager>","1","0","","",""
"3998214","1","4002084","","2010-10-22 15:12:55","1","2334","<p>I have a service on Android that listens and responds to packets it receives via multicast.</p><p>This works most of the time, but unfortunately, I'm finding that every now and again it'll just stop receiving packets. The thread remains blocked on the call to MulticastSocket.receive(), but nothing comes out. I've been slowly trying to track down what triggers this, and I've discovered that turning the wireless off and on again, or changing wireless connection will do it.</p><p>In order to successfully continue to listen for my packets I need to close the MulticastSocket and recreate it again. However, I haven't found any way of doing this --- I don't appear to get any notification that something's happened: no intents, no Java exceptions, nothing. I would expect the receive to throw an IOException if the socket became invalid, but this appears not to be happening.</p><p>Can anyone offer any insight as to (a) what's actually going on, and (b) how to work around it? Right now my best guess is to continually destroy and recreate the socket every ten seconds or so, and that's just evil.</p>","404568","","","","","2012-04-04 12:19:17","Android Multicast socket stops listening","<android><sockets><multicast><multicastsocket>","2","0","","",""
"3998650","1","","","2010-10-22 16:00:37","2","3033","<p>I have a service which is listening to the phone.  When the phone goes IDLE, I want to send a message to my Activity.  It looks like I have two options to accomplish this.  BroadcastReceiver and binding to the Service.  BroadcastReceiver looked like an easier mechanism, so I tried the following test.</p><p>In my Activity:</p><pre><code>@Overrideprotected void onStart() {    super.onStart();    IntentFilter filter = new IntentFilter(""MyAction"");    registerReceiver(new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            Log.d(TAG, ""Yay......."");            abortBroadcast();        }    }, filter);}</code></pre><p>In my Service which is listening for events, when I detect my desired event:</p><pre><code>    Intent localIntent = new Intent(_context, MainActivity.class);    intent.setAction(""MyAction"");    _context.sendOrderedBroadcast(localIntent, null);</code></pre><p>In my test, the onReceive() method is never called after I have watched the broadcast being sent with the debugger.  What am I missing?  Also, is a BroadcastReceiver the simplest way for a local service to communicate with an Activity?</p>","467507","","","","","2011-03-28 09:31:36","What is the simplest way to send message from local service to activity","<android>","1","1","2","",""
"3998713","1","13602910","","2010-10-22 16:06:58","11","11561","<p>I can get total available memory by:</p><pre><code>ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();activityManager.getMemoryInfo(memoryInfo);memoryInfo.availMem;</code></pre><p>However, how do you get Total memory (RAM) of the device?</p><p>I did read:<a href=""http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android"">http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android</a></p><p>It doesn't seem like adding pidMemoryInfo.getTotalPss() gives me the total memory either.</p>","432056","","1228","","2013-08-27 14:38:05","2013-08-27 14:38:05","Android How do you get total memory RAM in the device?","<android><api><memory>","4","0","1","",""
"3998756","1","3998807","","2010-10-22 16:11:21","0","1534","<p>i have come into quite a funny hole here. i can't seem to be able to create a 2nd database table to my existing one. i basically want them to be of the same structure and the same of columns, in other words a copy of my existing table. my goal is to copy the values from my first table to the second table. The first table i created works cos i have used it already.</p><p>i have tried everything i know, unistalled and reinstalled the app to clear the database, changed the name of the tables, version..etc  but i keep getting a ""table not found exception"". please any ideas what could be causing this and how to go about it?.. thanks</p><p>here is the creation for both of them:</p><pre><code>/* tables variable*/public static final String DATABASE_TABLE = ""Memo"";    public static final String ROUTE = ""Route""; public static final String KEY_ID = ""_id"";public static final String NAME = ""Title"";public static final String DATE = ""date"";public static final String TIME = ""time"";public static final String VENUE = ""venue"";public static final String CATEGORY = ""category"";    public static final String PRIORITY = ""priority"";    public static final String NOTES = ""notes"";  private static final String DATABASE_CREATE = ""create table Memo (_id integer primary key autoincrement,""     + ""Title text, date text, time text,""
    + ""venue text, category text,""
     + ""priority text, notes text);"";  private static final String DATABASE_CREATE_ROUTE = ""create table Route (_id integer primary key autoincrement,""     + ""Title text, date text, time text,""
    + ""venue text, category text,""
     + ""priority text, notes text);"";public void onCreate(SQLiteDatabase db) {        db.execSQL(DATABASE_CREATE);        Log.d(TAG, ""created Memo table"");        db.execSQL(DATABASE_CREATE_ROUTE );        Log.d(TAG, ""created Route table"");    }    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(TAG,""upgrading Database from version""+ oldVersion+ ""to""                +newVersion+ ""which old data will be lost"");        db.execSQL(""DROP TABLE IF EXITS Memo"");        db.execSQL(""DROP TABLE IF EXITS Route"");        onCreate(db);    }}public void copyData(long rowId){db.execSQL(""insert into ROUTE select * from DATABASE_TABLE WHERE KEY_ID = rowId"");}</code></pre><p>Logcat Exception is:</p><pre><code>10-22 15:47:17.326: ERROR/Database(807): Failure 1 (no such table: ROUTE) on 0x1d7f20 when preparing 'insert into ROUTE select * from DATABASE_TABLE WHERE KEY_ID = rowId'.10-22 15:47:17.356: ERROR/AndroidRuntime(807): Uncaught handler: thread main exiting due to uncaught exception10-22 15:47:17.526: ERROR/AndroidRuntime(807): android.database.sqlite.SQLiteException: no such table: ROUTE: insert into ROUTE select * from DATABASE_TABLE WHERE KEY_ID = rowId10-22 15:47:17.526: ERROR/AndroidRuntime(807):     at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)10-22 15:47:17.526: ERROR/AndroidRuntime(807):     at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1496)10-22 15:47:17.526: ERROR/AndroidRuntime(807):     at com.MemoManager.DBAdapter.copyData(DBAdapter.java:265)</code></pre>","479908","","479908","","2010-10-22 20:47:24","2010-10-22 20:47:24","can't seem to create new table in sqlite android","<android>","2","0","","",""
"3998828","1","11475334","","2010-10-22 16:19:34","2","861","<p>Here's the setup:</p><ul><li>I have an activity with a list of items (updated from server, represented by a plain java class). The items are rendered via a custom BaseAdapter and custom View for each row.</li><li>The items implement Parcelable, so that when the screen is rotated, the items are saved in the bundle as a ParcelableArrayList, then restored without going back to the server.</li></ul><p>So far, this is a fairly straightforward setup, however I want to pass one of these items to another activity. Bundle has a ""pubExtra(String, Parcelable)"" method, which I wanted to use to put the object there, then pass via the intent. When I did this, the device started getting a force close due to an OutOfMemoryException. It seems when trying to unparcel the object, it requests ~30mb(!)</p><p>It seems like the object must be holding references to something else, since the object itself only contains a few int/float/String fields and related methods. I haven't been able to track this down by looking at the code or debug inspector and I don't know how to use the Heap viewer effectively.</p><p>Any suggestions?</p><p>Here's the stacktrace</p><pre><code>/dalvikvm-heap( 5876): Out of memory on a 29098436-byte allocation.I/dalvikvm( 5876): ""main"" prio=5 tid=1 RUNNABLEI/dalvikvm( 5876):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001d8d0 self=0xccc8I/dalvikvm( 5876):   | sysTid=5876 nice=0 sched=0/0 cgrp=default handle=-1345017816I/dalvikvm( 5876):   | schedstat=( 1107116708 1124999998 2626 )I/dalvikvm( 5876):   at java.util.ArrayList.&lt;init&gt;(ArrayList.java:~84)I/dalvikvm( 5876):   at android.os.Parcel.readArrayList(Parcel.java:1460)I/dalvikvm( 5876):   at android.os.Parcel.readValue(Parcel.java:1792)I/dalvikvm( 5876):   at android.os.Parcel.readMapInternal(Parcel.java:2007)I/dalvikvm( 5876):   at android.os.Bundle.unparcel(Bundle.java:208)I/dalvikvm( 5876):   at android.os.Bundle.containsKey(Bundle.java:249)I/dalvikvm( 5876):   at &lt;mypackage&gt;.BaseDetailsActivity.isInModifyState(BaseDetailsActivity.java:184)I/dalvikvm( 5876):   at &lt;mypackage&gt;.DetailsActivity.onCreate(DetailsActivity.java:230)I/dalvikvm( 5876):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)I/dalvikvm( 5876):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)I/dalvikvm( 5876):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)I/dalvikvm( 5876):   at android.app.ActivityThread.access$2300(ActivityThread.java:125)I/dalvikvm( 5876):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)I/dalvikvm( 5876):   at android.os.Handler.dispatchMessage(Handler.java:99)I/dalvikvm( 5876):   at android.os.Looper.loop(Looper.java:123)I/dalvikvm( 5876):   at android.app.ActivityThread.main(ActivityThread.java:4627)I/dalvikvm( 5876):   at java.lang.reflect.Method.invokeNative(Native Method)I/dalvikvm( 5876):   at java.lang.reflect.Method.invoke(Method.java:521)I/dalvikvm( 5876):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)I/dalvikvm( 5876):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)I/dalvikvm( 5876):   at dalvik.system.NativeStart.main(Native Method)</code></pre>","109482","","109482","","2010-10-22 16:26:56","2013-05-21 14:18:56","Android: unparceling causes out of memory exception. How to inspect objects?","<android><parcelable>","2","0","","",""
"3998916","1","4643231","","2010-10-22 16:31:10","58","13726","<p>In my <code>WebView</code>, I have some block elements that have a background color (different than white). However, the background color does not go <em>all the way across the sky</em>.. um, screen. Instead, it leaves a small white strip to the right, for where the scrollbar would go. Now, I want the scrollbars to appear only when scrolling (and fade away once the user has finished scrolling). I tried:</p><pre><code>android:fadingEdge=""vertical|horizontal""android:fadeScrollbars=""true""android:scrollbarStyle=""insideOverlay"" (and all other options)</code></pre><p>Also, my HTML contains the following in <code>&lt;head&gt;</code>:</p><pre><code>&lt;meta name=""viewport"" content=""target-densitydpi=device-dpi"" /&gt;</code></pre><p>So that it doesn't allow zooming and doesn't zoom out by default.</p><p>However, I can't figure out how to get rid of the white strip. Any ideas?</p>","180784","","","","","2011-12-15 20:50:43","Android WebView leaves space for scrollbar","<android><android-webview>","2","2","20","",""
"3998956","1","3999133","","2010-10-22 16:35:36","9","4064","<p>Is there a decent mechanism for doing asynchronous I/O using sockets on Android?</p><p>I'm aware of the existence of nio channels, but they don't work for me because I need to be able to use MulticastSockets and BluetoothSockets, neither of which support channels.</p><p>I'm aware the answer is probably that there isn't one, but as this is a fairly big piece of work I thought I'd ask first to be sure. And if anyone knows of a decent third-party library I might be able to use...</p>","404568","","","","","2012-11-08 12:10:21","Asynchronous socket I/O on Android","<java><android><sockets><asynchronous>","2","0","4","",""
"3999087","1","3999223","","2010-10-22 16:50:59","77","14354","<p>Under <code>DDMS</code>, there is a <code>HEAP</code> tab, and then I click my android application under 'Devices'. But it said:</p><pre><code>Heap updates are NOT ENABLED for this client</code></pre><p>How can I enable Heap update for my android application?</p>","286802","","119895","","2013-03-19 19:41:30","2014-02-05 09:58:22","How to enable Heap updates on my android client","<android>","2","0","5","",""
"3999290","1","","","2010-10-22 17:18:10","1","4911","<p>i made my own application in Android that use compass and accelerometer sensors to display the degrees of rotation and inclination of my device. I initialized all the listener and objects i needed (i followed some tutorials), and now i can catch the degrees as i wished. The problem is that the measures that sensors return aren't accurate. I mean even if i try to round the values of degrees i catch from the sensor, they oscillate between -/+ 7 (or 8) degrees every fraction of a second, even if i stay in a grass field away from any disturbing source. What i want to have is a accurate measure of the degrees, something like a method to round the values i recieve from the sensors.</p><pre><code>    float[] mags = null;    float[] accels = null;    float[] R = new float[matrix_size];    float[] outR = new float[matrix_size];    float[] I = new float[matrix_size];    float[] values = null;    private void startSensor() {    sensorMan.registerListener(this, sensorMan.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_UI);    sensorMan.registerListener(this, sensorMan.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_UI);}@Overridepublic void onSensorChanged(SensorEvent event) {    if (event.accuracy == SensorManager.SENSOR_STATUS_UNRELIABLE) {        return;    }    switch (event.sensor.getType()) {    case Sensor.TYPE_MAGNETIC_FIELD:        mags = event.values.clone();        break;    case Sensor.TYPE_ACCELEROMETER:        accels = event.values.clone();        break;    }    if (mags != null &amp;&amp; accels != null) {        SensorManager.getRotationMatrix(R, I, accels, mags);        // Correct if screen is in Landscape        SensorManager.remapCoordinateSystem(R, SensorManager.AXIS_X,                SensorManager.AXIS_Z, outR);        SensorManager.getOrientation(outR, values);        azimuth = (float) Math.round((Math.toDegrees(values[0]))*7)/7;        azimuth = ( azimuth + 360)%360;         //here is inclination. The problem is just the same with compass        //inclination=-Math.round((float) (values[1]*(360/(2*Math.PI))));        //other code to update my view        //in azimuth i have the degree value. It changes continuously        //even if i aim still the same direction    }}</code></pre>","484489","","","","","2012-10-22 13:40:58","Compass and Accelerometer precision","<android><accelerometer><compass-geolocation><sensor>","3","1","4","",""
"3999330","1","","","2010-10-22 17:23:15","0","1290","<p>I am attempting to make a ListView inside a table consume all of the available vertical space minus the space needed for an EditText control.</p><p>I have set every attribute I can think of here to make it work:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code> &lt;TableRow android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:background=""#FF0000""&gt;    &lt;ScrollView android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;     &lt;ListView android:id=""@+id/conversation""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:drawSelectorOnTop=""false""/&gt;    &lt;/ScrollView&gt; &lt;/TableRow&gt; &lt;TableRow android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:background=""#00FF00""&gt;     &lt;EditText android:id=""@+id/messagetext""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:inputType=""text|textAutoCorrect|textMultiLine|textImeMultiLine""        android:imeOptions=""actionDone""/&gt; &lt;/TableRow&gt;</code></pre><p></p><p>I must be missing something, as the result is a fully filled horizontal, but both the ListView and EditText appear to be behaving as if their attributes were wrap_content.</p>","484493","","","","","2010-10-22 17:41:35","How to allow an Android ListView to consume remaining space when inside a TableLayout","<android>","3","0","","",""
"3999481","1","3999730","","2010-10-22 17:42:34","0","2004","<p>I have used the following code to create table row</p><pre><code>TableRow TRow = new TableRow(a);TextView TxtViewProvider = new TextView(a); TxtViewProvider.setText(gradeText);  // TxtViewProvider.setBackgroundColor(Color.RED);  if (bold == 1)   TxtViewProvider.setTypeface(Typeface.DEFAULT_BOLD);  TxtViewProvider.setTextColor(Color.BLACK);  TxtViewProvider.setPadding(Static.getDipOf(15, a), 0, 0, 0); TxtViewProvider.setWidth(getDipOf(240, a));  TRow.addView(TxtViewProvider);TxtViewProvider = new TextView(a);TxtViewProvider.setText(gradeCode); TxtViewProvider.setBackgroundColor(Color.GREEN); if (bold &gt; 0)   TxtViewProvider.setTypeface(Typeface.DEFAULT_BOLD);  TxtViewProvider.setTextColor(Color.BLACK);  TRow.addView(TxtViewProvider);  TRow.setBackgroundColor(Color.WHITE);  TableLayout.LayoutParams params = new TableLayout.LayoutParams();   params.setMargins(0, 0, 0, Static.getDipOf(1, a));  table.addView(TRow, params);</code></pre><p>and i'm using this in a viewflipper but i need to reload this page again and again. But the problem i face is all the data i created first are there when i load it again ,  </p><p>Can anyone please suggest me a way to remove this dynamically created TableRows ?</p>","477754","","571593","","2011-02-24 15:18:12","2011-02-24 15:18:12","Remove dynamically created Items from view in Android","<android><view><clear><tablerow>","1","0","","",""
"3999544","1","3999689","","2010-10-22 17:50:46","0","387","<p>I'm using searching in my map search from database content using <code>MatrixCursor</code>. I have a  <code>NumberFormatException</code> in <code>Android SDK</code> version <code>2.2</code>. In my declaration I did:</p><pre><code>private static final String[] COLUMNS = {   _ID, // must include this column   SearchManager.SUGGEST_COLUMN_TEXT_1,   SearchManager.SUGGEST_COLUMN_INTENT_DATA };</code></pre><p>and I also created the object for <code>MatrixCursor</code> that has:</p><pre><code>MatrixCursor cursor = new MatrixCursor(COLUMNS);cursor.addRow(columnValuesOfQuery(query, s));</code></pre><p>Here is the exception I'm getting:</p><pre><code>10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): error changing cursor and caching columns10-22 23:11:33.734: ERROR/SuggestionsAdapter(456): java.lang.NumberFormatException: 10-22 23:11:33.734: ERROR/SuggestionsAdapter(456):     at java.lang.Long.parseLong(Long.java:347)10-22 23:11:33.734: ERROR/SuggestionsAdapter(456):     at java.lang.Long.parseLong(Long.java:320)10-22 23:11:33.734: ERROR/SuggestionsAdapter(456):     at android.database.MatrixCursor.getLong(MatrixCursor.java:255)10-22 23:11:33.734: ERROR/SuggestionsAdapter(456):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)10-22 23:11:33.734: ERROR/SuggestionsAdapter(456):     at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)</code></pre><p>Why I'm getting this exception and how can I fix it?</p>","393953","","493939","","2012-04-16 09:05:29","2012-04-16 09:05:29","NumberFormatException at MatrixCursor column for searching in maps from database","<android><search><matrixcursor>","1","0","","",""
"3999619","1","","","2010-10-22 18:02:13","0","325","<p>I have an apk that is built with make, and so it has an Android.mk file associated with it. Now, I want to make sure that this apk is rebuilt every time a specific file (that is not related to the apk at all) has changed. So I need to somehow specify a dependency from my apk to this specific file but I can't figure out how to do that. Any advice?</p><p>Any input is appreciated!</p><p>Thank you!</p><p>Some more information:</p><p>The problem that I am seeing is that the Android.mk files for apk:s don't have any ""targets"" in them. They basically just look something like  this:</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES := $(call all-java-files-under, src)LOCAL_PACKAGE_NAME := MyAppinclude $(BUILD_PACKAGE)</code></pre><p>Since there is no target, I cannot add any dependency.</p>","484526","","484526","","2010-10-24 13:03:58","2010-10-24 13:03:58","How can I trigger a rebuild of my Android apk?","<android>","1","0","","",""
"3999736","1","","","2010-10-22 18:18:37","2","493","<p>When the Android phone is on its side (horizontal orientation), the Roll represents the tilt, so to speak.  When the phone is perpendicular to the ground (looking directly at the screen), the roll says 90.  However, when you start tilting it forward or backward, as if you wanted to look down or up, the angle just decreases either way.  </p><p>This means looking up or down 45 degrees gives the same roll or 45 degrees. </p><p>How is it possible to know if you are rolling it forward or backward?  </p><p>I have been looking around for an answer to this, and can't find anyone else with this problem.  Judging from different apps, it seems to be possible, so I think I am just missing some relationship to something, and was hoping someone might be able to nudge me in the right direction.  Thanks!</p>","484527","","1849664","","2013-06-07 21:52:38","2013-06-07 21:52:38","Determining roll angle (up/down) when Android phone is horizontal?","<android><orientation><pitch>","1","0","","",""
"3999839","1","3999899","","2010-10-22 18:33:17","9","7648","<p>This must be an easy one but I'm really at a loss... The following code draws a rectangle with a linear gradient going from left to right, from white to black, </p><pre><code>int x1 = 0, y1 = 0, x2 = 100,  y2 = 40;Shader shader = new LinearGradient(x1, y1, x2, y2, Color.WHITE, Color.BLACK, TileMode.CLAMP);Paint paint = new Paint();paint.setShader(shader);canvas.drawRect(new RectF(x1, y1, x2, y2), paint);</code></pre><p>Ok, fine. Now what I'd like to do is to change this gradient into a <strong>horizontal</strong> one, so that the color goes from white to black, from top to bottom. What I tried to do is to add:</p><pre><code>Matrix trans = new Matrix();trans.setRotate(90);shader.setLocalMatrix(trans);</code></pre><p>but instead the gradient goes at a funny angel, or there is just a single color... I also tried to play with the coordinates of the gradient in all sorts of way (thinking that maybe they should be transformed) to no avail. What am I missing?</p>","284428","","383676","","2013-07-04 13:21:28","2013-07-04 13:36:15","Horizontal LinearGradient with android","<android>","1","0","1","",""
"3999846","1","","","2010-10-22 18:33:56","0","423","<p>I have a question:</p><p>How to handle nested tag in KSOAP webservice in android ?</p>","412168","","","","","2010-11-02 16:56:29","nested tag in KSOAP","<android><web-services>","1","3","","",""
"3999909","1","4008357","","2010-10-22 18:42:00","1","149","<p>as  we all see Google was increased his country list on android market on ( 30 countries for selling)  and  I  saw some talks here about this theme ,  but  I  did not find quality answer ..</p><p>My question is  there  any company or person etc. who make some service  for publishing android app on android market from developers from countries who are not on Google list ???</p><p>Is there any company  and if  yes Is there any experience in dealing with ??</p><p>(I know  for a alternative market like andappstore,slideme this  are fine but not even close Google market)</p>","365860","","","","","2010-10-24 13:16:02","Android: Contributor for Distributing app on android market?","<android><distribution><google-play>","1","0","1","",""
"4000032","1","","","2010-10-22 18:56:58","2","1930","<p>Im trying to align two elements in my xml file.I want to display a TextView called ""Description"" and a TextView called ""Value"" on the same line. The Description should right aligned to the center, the Value should be left aligned the center. But the following gravity doesnt seem to affect them.<br/><br/>I assume I should avoid using AbsoluteLayout because of different screen sizes.</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=""wrap_content"" &gt;    &lt;TextView        android:id=""@+id/TextViewDescription""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""right""        android:text=""@+id/TextView01"" &gt;    &lt;/TextView&gt;    &lt;TextView        android:id=""@+id/TextViewValue""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""left""        android:text=""@+id/TextView02"" &gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>I also looked at TableLayout but struggled with that too.</p><p>What is the correct way to create a set of description/values down the screen that are center aligned so they appear fine on both portrait and landscape view?</p>","478482","","403455","","2012-09-07 17:58:53","2012-09-07 17:58:53","Android SDK Align two elements in center","<android>","2","0","","",""
"4000092","1","4007148","","2010-10-22 19:05:26","1","1899","<p>On my screen I have a list view and a button. my list has like 8 item. I would like my screen to scroll if both these items does not fit in. I don't want my list to have scroll but the complete layout including both list &amp; button. If I use the below layout it only shows on item inside the list and I have to scroll within the list to go to next item.</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:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;        &lt;ListView android:id=""@android:id/list""            android:layout_height=""wrap_content"" android:layout_width=""fill_parent""            android:background=""@drawable/round_background"" /&gt;        &lt;Button android:text=""Search"" android:id=""@+id/carSearchButton""            android:layout_gravity=""center_horizontal"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","470682","","390989","","2011-02-04 03:45:24","2013-09-14 14:57:48","list inside scrollview","<android><list><scroll><scrollview>","3","0","0","",""
"4000140","1","4464849","","2010-10-22 19:12:05","1","240","<p>If there is no GPS FIX (because the person is in a metal building or something)....does it just stay in the Looper..?? OR does it keep trying for a fix via requestLocationUpdates..??    </p><p>If I do have a good GPS FIX....my code works fine...and in onLocationChanged()...I update the current location to the database.</p><p>Also...when is onLocationChanged() called..?? Is it only called when there is a GPS FIX..??Just wondering..</p><pre><code>    public void run()    {        Looper.prepare();        LocationManager lm = (LocationManager)            getSystemService(Context.LOCATION_SERVICE);        LocationListener ll = new mylocationlistener();        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ll);        Looper.loop();    }</code></pre>","393913","","","","","2010-12-16 20:01:04","What does the following code do if there is no GPS fix..?","<android>","2","0","","",""
"4000207","1","","","2010-10-22 19:19:27","0","163","<p>i need a way to use aws-java-sdk-1.0.11 in android as when i try to import the jar files of third-party it give me an error delvik conversion error i want to use only ec2</p>","482320","","","","","2011-06-30 15:21:03","use amazon aws-java-sdk-1.0.11 in android","<android><amazon-ec2><amazon-web-services>","1","1","","",""
"4000258","1","","","2010-10-22 19:25:21","0","593","<p>After performing an update to a new version of the Eclipse Android Plugin, it stopped working. There is no Android Tool visible anywhere. The Window/Preferences tool does not show the Android plugin to configure. And yet, it is installed (says the ""Eclipse Installation Details"").</p><p>I tried uninstalling the Plugin, and re-installing, but it still does not show anywhere.</p><p>Currently, I try to download a new version of Eclipse (I used 3.4) and restart everything. Hopefully I can continue with the new version. I am so fed up with this kind of errors!</p><p>Thanks for any hints,</p><p>René</p>","447111","","","","","2010-10-23 10:48:29","Android Plugin for Eclipse Update Problem","<android>","1","0","","",""
"4000319","1","","","2010-10-22 19:34:03","0","2877","<p>I have the following code to open a database on the SDCARD and then update a value.  If I run the code as is, it will generally run through without throwing an error but nothing gets updated.</p><p>If I single step through each line, it works perfectly.  I have also tried adding SystemClock.Sleep(2000) in between each statement.  Still, it does not run properly unless I single step through this section.</p><p>Any ideas?</p><pre><code>SQLiteDatabase db = openOrCreateDatabase( sdDIR + ""/DBNAME.db"", SQLiteDatabase.CREATE_IF_NECESSARY, null);db.execSQL(""UPDATE tableName SET value='"" + newValue + ""' WHERE name='field_name';"");db.close();</code></pre>","329174","","","","","2011-08-16 20:20:54","Android problem using built in SQLiteDatabase execSQL to update function","<android><sqlite>","1","3","","",""
"4000428","1","","","2010-10-22 19:49:11","0","1426","<p>by default for an android listview, when you touch it, it has an orange color.does anyone know how to override this?  there doesn't seem to be a method for it.</p>","436605","","","","","2010-11-22 17:51:33","android: how to override a listview's touch background","<android>","3","0","1","",""
"4000552","1","4000807","","2010-10-22 20:06:48","1","3279","<p>Is there an Image cropping Activity in Android?  I know that when you save an images as your wallpaper, it pops up an image cropper... and I've looked into the sourcecode for that, but it depends on a LOT of gallery specific stuff.  Not very reusable.</p><p>Does anyone know how this might be done, or are there any third party libraries that can help me out on this one?</p>","238849","","","","","2013-06-28 00:04:38","Image cropping activity/widget","<android>","2","0","1","",""
"4000610","1","4000839","","2010-10-22 20:14:55","0","683","<p>The Android developer guide (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) states:</p><p>`You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity, or use the tabs to change between entirely separate activities. Which method you want for your application will depend on your demands, but if each tab provides a distinct user activity, then it probably makes sense to use a separate Activity for each tab, so that you can better manage the application in discrete groups, rather than one massive application and layout.</p><p>In this tutorial, you'll create a tabbed UI that uses a separate Activity for each tab.`</p><p>In my cases, it <em>doesn't</em> make sense to have separate activities for the tabs so I want to switch views, but it would be nice to see an example.</p><p>Gee, thanks Google!</p>","246793","","","","","2010-10-22 20:48:18","Anyone have example code using switched Views instead of Activities inside a TabHost on Android?","<android><views><android-tabhost><switching>","1","0","1","",""
"4000686","1","","","2010-10-22 20:26:57","7","2765","<p>I'm currently building an app in Android, and using Robotium to do functional tests (By the way, don't use Robotium on anything less that Android 1.6, it is way too buggy).</p><p>Some of these tests have a random tendency to fail, mainly Robotium missing a text field, or timing out, not reading text.  I am trying to use the <code>@FlakyTest</code> annotation, so they will run two or three times before throwing out a failed test error.  However, the annotation is not working, the tests do not re-run after a failure.</p><p>Here is how I am using the annotation:</p><pre><code>public class ClassName extends ActivityInstrumentationTestCase2&lt;HomeActivity&gt;{        @LargeTest        @FlakyTest(tolerance=3)        public void testMethod(){        //Here I run my roboitium scripts.        }}</code></pre><p>Then I run it from the command line:</p><blockquote>  <p>adb shell am instrument -w com.jayway.test/android.test.InstrumentationTestRunner</p></blockquote><p>Neither eclipse nor the command line execution of the tests takes into account the flaky test annotation.  Does anyone see an error with how I am trying to apply <code>@FlakyTest</code>?</p>","484644","","1642079","","2014-01-14 16:32:58","2014-01-14 16:32:58","Android test annotations with Robotium","<android><robotium>","3","1","2","",""
"4001042","1","","","2010-10-22 21:18:12","1","642","<p>We are currently developing an android app for our client. Client would like to include a barcode on a it’s mailing about the Android app, such that when the user scans the barcode, s/he will be taken directly to the application on the Android marketplace for download. To do this, client will need to know the exact URL on the marketplace, but we are not sure if a URL can be reserved in advance of actually putting the app on the market</p>","484694","","","","","2011-05-05 14:34:51","Reserve the App Market URL in advance","<android><url><google-play>","2","0","","",""
"4001047","1","4017145","","2010-10-22 21:18:41","0","2783","<p>Can anyone please tell me how to add multiple spinners with only one onItemSelected().Right now i am doing something like this:Spinner s[] = new Spinner[5];I am using this for displaying hierarchy in spinners.</p><p>For index = 0; it works fine. But problem arises with next index as there is only one onItemSelected().</p><p>What can you suggest on this?</p><p>Note: I am coding to have spinners created dynamically and filled with corresponding cursor. Cursor is not an issue so far.</p><p>Thanks!</p>","484691","","21234","","2010-10-22 21:23:06","2012-05-22 08:19:44","Having Multiple spinners in android","<android><spinner>","1","4","","",""
"4001091","1","4054588","","2010-10-22 21:27:42","1","462","<p>I have a conceptual question to ask:</p><p>I created a custom dialog (extends Dialog) and I want to draw a chart (dynamic data, not static) in the top third of the dialog.</p><p>What's the best (only?) way to approach this?</p><p>A) Get a canvas to the dialog and draw to it? Seems like I need access to the dialog's draw, yes, or can I do this outside of the draw?</p><p>B) Subclass a view within the dialog layout (e.g. LinearLayout) and override it's draw and draw the chart?</p><p>C) Other? I've read that one approach would be to draw to a bitmap and then blt (or equivalent) to the canvas. This sounds closer to what I want to do, as once I create the chart, I have no need to alter it (no direct user interaction).</p><p>I haven't yet found any good sample code that deals with custom drawing in a dialog, so if I'm missing something, an example would be great.</p><p>Thanks much,</p><p>Rich</p>","111175","","","","","2010-10-29 18:01:44","Drawing chart in a dialog","<android><graph><view><dialog><charts>","1","1","","",""
"4001253","1","4001423","","2010-10-22 21:54:27","0","534","<p>I have a series of activities that share a database. In the primary activity the user will be doing things will the program automatically logs data into the db. This continues until the user would like to view the database by starting the view database activity. How I have it set up is that onPause will close the database so the the DBViewer onStart() will reopen it. Inefficient but I can't think of a better way to do it. Any who, on pause is never being called. All the threads of the Activity A are still running as Activity B begins onStart().Any clues or help would be appreciated.</p><p>~Aedon</p>","480691","","3043","","2010-11-22 22:04:48","2010-11-22 22:04:48","Android proper use of setId()?","<android><activity><lifecycle>","1","0","","",""
"4001257","1","","","2010-10-22 21:55:16","9","19685","<p>I have an Activity where I want to display a heading that takes up the top quarter of the app and displays a dynamic set of text. In some cases it'll all fit on one line and I'd like the font size to get sized up so it's large and easy to read. In some cases it'll be on multiple lines (usually less than 4) and need to be smaller.</p><p>The complication is that if I explicitly set the newlines in setText sometimes it will insert a newline where I didn't expect one, i.e.:</p><pre>""My first line of text\nMy Second line of text""Might get turned into (it's right adjusted in this version):""My first line of             text   My second line          of text""</pre><p>I'm not sure how to go about either keeping the TextView from trying to insert newlines or letting it just take care of formatting the whole thing. If I set some text to be one really long single word it'll insert a newline in the middle at some chosen point. And other times I just sort of randomly get the last few lines of text.</p><p>Should I just explicitly set the font size to be really small to get it laid out correctly and then manually adjust the size? Is there a 'best practice' that I should use for this? If I set the font size to be a reasonably large font it kind of works but it would be nice to figure out what the 'right' way to do this would be. And I'd rather not have to manually add in 4 single line TextViews and format them myself.</p><p>The layout xml I'm using is:</p><pre><code>&lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_alignParentRight=""true""        android:layout_marginTop=""10dip""        android:layout_marginRight=""8dip""        android:singleLine=""false""        android:ellipsize=""marque""        android:gravity=""right|bottom""        android:textAppearance=""?android:attr/textAppearanceMedium""        android:textSize=""30sp""/&gt;</code></pre>","466254","","","","","2012-12-16 04:42:46","Sizing an Android multi-line TextView","<android><textview><android-layout><android-ui><sizing>","4","2","1","",""
"4001434","1","","","2010-10-22 22:32:43","2","1185","<p>I'm trying to get json data from a django view (login required)into a new android app I'm working on.</p><p>I would like to authenticate the user against the django loginand keep the cookie/session for all the django view calls to get data from the server.</p><p>I did some googling but nothing helped me,even if I guess it should be a quite common task.</p><p>Maybe I'm facing the problem from a wrong point of view..So I'll switch the question to: how can I do some user authenticated json request/response to a django server?</p><p>Any clue?</p>","484729","","","","","2011-07-18 23:17:20","android to django - how to authenticate users","<android><django><json><authentication>","2","0","3","",""
"4001440","1","4301892","","2010-10-22 22:33:45","2","1173","<p>I want to override the default activity transition in Android with something a bit fancier. What I want to do can't be done with the XML set that one would typically use, so I can't use <code>overridePendingTransition</code> because it only accepts integer references to XML-based animation resources.</p><p>What I'd like to do instead is create my own object that inherits from <code>Animation</code> and overrides the <code>getTransformation</code> and <code>applyTransformation</code> methods to do my own thing. This much I can do, but I can't seem to find a way to tie this new animation object into the transition. Is there a method like <code>overridePendingTransition</code> that accepts an Animation object? Or am I going about this all wrong?</p>","357629","","","","","2010-11-29 08:14:16","Custom Animation Object for Transition in Android?","<android><animation><transition>","1","0","","",""
"4001441","1","4001465","","2010-10-22 22:33:46","8","4002","<p>So, I'm both new to Java and to creating android apps, but not new to programming. I've read through most of the developer.android.com site, but I haven't been able to find this:</p><p>I want to make sure that a certain activity isn't running more than once at the same time. So we have a task somewhat like this:<br>Activity A) a TabActivity, which launches<br>Activity B) a ListView that, on-click, opens up<br>Activity C) which is the interface for a mediaplayer object</p><p>Right now, whenever somebody presses the back-button whilst in C (Which is a likely thing, because they're going to listen to a streaming 1-hour long mp3) and then presses another list item, instead of returning to C, C is opened a second time, and two streams are playing. Of course, I'd want only one instance of C running, and I want a second click on the list item to bring C back to the front. This could also be useful for notification intents.</p><p>I've been messing around with the flags (especially FLAG_ACTIVITY_NEW_TASK, FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_REORDER_TO_FRONT), but no success so far. </p><p>If someone could help me out here I could focus on my next challenge - making it a real feed reader :P</p><p>Thanks in advance,</p>","484475","","139985","","2010-10-23 00:50:04","2013-07-13 18:20:15","Android - prevent duplicate activities","<java><android>","3","7","2","",""
"4001625","1","4374194","","2010-10-22 23:23:57","0","911","<p>I have tried to implement the searchable dictionary sample app.Everything seems to be working except when I try to pull the results from global search.I have tried to follow everything that has been described in the docs too.</p><p>My searchable.xml</p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""        android:label=""@string/search_label""        android:hint=""@string/search_hint""        android:searchSettingsDescription=""@string/settings_description""        android:searchSuggestAuthority=""sd2.com.achie.DictionaryProvider""        android:searchSuggestIntentAction=""android.intent.action.VIEW""      android:searchSuggestIntentData=""content://sd2.com.achie.DictionaryProvider/dictionary""        android:searchSuggestSelection="" ?""        android:searchSuggestThreshold=""1""        android:includeInGlobalSearch=""true""        &gt; &lt;/searchable&gt;</code></pre><p>And the authorities, mime types</p><pre><code>public static String AUTHORITY = ""sd2.com.achie.DictionaryProvider"";public static final Uri CONTENT_URI = Uri.parse(""content://"" + AUTHORITY + ""/dictionary"");public static final String WORDS_MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +""/vnd.sd2.com.achie"";public static final String DEFINITION_MIME_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +""/vnd.sd2.com.achie"";</code></pre><p>My Manifest is</p><p>                                            </p><pre><code>    &lt;!-- Receives the search request. --&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.SEARCH"" /&gt;        &lt;!-- No category needed, because the Intent will specify this class component--&gt;    &lt;/intent-filter&gt;    &lt;!-- Points to searchable meta data. --&gt;    &lt;meta-data android:name=""android.app.searchable""               android:resource=""@xml/searchable"" /&gt;            &lt;/activity&gt;&lt;!-- Displays the definition of a word. --&gt;&lt;activity android:name="".WordActivity""          android:theme=""@android:style/Theme.NoTitleBar"" /&gt;&lt;!-- Provides search suggestions for words and their definitions. --&gt;&lt;provider android:name="".DictionaryProvider""          android:authorities=""sd2.com.achie.DictionaryProvider"" /&gt;&lt;!-- Points to searchable activity so the whole app can invoke search. --&gt;&lt;meta-data android:name=""android.app.default_searchable""           android:value="".SearchableDictionary"" /&gt;</code></pre><p></p><p>What might be the problem?</p><p>Thank you,Achie</p>","229266","","","","","2012-12-30 23:50:34","android Searchable dictionary results are not being shown in global search","<android><android-manifest>","1","3","","",""
"4001751","1","4001846","","2010-10-23 00:00:30","0","197","<p>i have parsed xml using dom parser,but when the xml element contains no value it throws null pointer Exception.how to check this?...here my code</p><pre><code>NodeList TrackName1 = fstElmnt2.getElementsByTagName(""Artist_Name"");                        Element TrackElement1 = (Element) TrackName1.item(0);                    TrackName1 = TrackElement1.getChildNodes();                     result=result+((Node) TrackName1.item(0)).getNodeValue()                     String  Artistname=((Node)TrackName1.item(0)).getNodeValue();                                            }</code></pre>","461972","","","","","2012-04-09 12:12:30","Dom parsing in android","<android>","2","0","","",""
"4001815","1","","","2010-10-23 00:19:39","0","1244","<p>I have a small xml file called 'xmlview.xml' which is something like:</p><pre><code>&lt;tablelayout&gt;   &lt;tablerow&gt;      &lt;view id=""view1"" /&gt;</code></pre><p>I created a class which extends view, and I inflated that xml file and now i have a view obtained due to inflation.</p><pre><code>xmlView = layoutInflater.inflate(R.layout.xmlview, this);</code></pre><p>I am wondering is there a way to draw on the view 'view1' inside the view 'xmlview'</p><p>I tried something like:</p><pre><code>View view1 = (View)xmlview.findById(R.Id.view1);</code></pre><p>and then I tried in the overriden onDraw to draw on view1 but nothing worked,</p><p>any ideas ??</p>","484779","","141661","","2010-10-23 00:22:28","2010-11-12 14:35:46","Android: draw on a view inside an inflated xml (another view)","<android><view><draw><inflate><ondraw>","2","0","","",""
"4002298","1","","","2010-10-23 03:18:12","0","436","<p>I am writing an android application and am having problems with overlapping views. My layout is</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         ...   /&gt;   &lt;EditText       ...   /&gt;   &lt;Button       ...   /&gt;   &lt;Button       ...   /&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/surface_view""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""    /&gt;    &lt;CustomView       android:id=""@+id/custom_view""       android:background=""#0000""       android:layout_alignTop=""@id/surface_view""       android:layout_alignBottom=""@id/surface_view""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""    /&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>As you can see I am trying to overlap surface_view and custom_view. Only custom_view is shown on screen. If I define custom_view first and then surface_view, then only surface_view is shown but custom_view methods are being called as I could see log messages in adb logcat. Am I missing some thing.</p><p>The same above layout ( overlapping ) works fine in a different project.</p><p>Any thoughts would be helpful. Thanks.  </p>","484834","","484834","","2010-10-23 03:44:43","2010-10-23 12:08:12","Problem with overlapping views?","<android><android-sdk-2.2>","1","2","","",""
"4002445","1","","","2010-10-23 04:15:19","1","885","<p>hey guys i am developing a final year location-based project(gps) in android.I have to create a server using php and mysql which contains name and location(in latitude and longitude) of important hospitals in Mumbai.The android client should be able to retrieve the the latitude and longitude of locations in mysql(external) database and then plot it on a google map.</p><p>ppl have suugested me to use default http client to communicate with server(apache web services)...Could u plzz tell me whether this is possible?If yes, then can someone plzz suggest me some good tutorials (basics)for learning client server communication using apache (http client and http server) on the web...and also if possible its implementation in android(so that i can use it in my final project to connect to my php-mysql server ) ....in order to make it more efficient... Any help would be appreciated....cheers</p>","484843","","","","","2011-02-21 17:04:37","android connectivity with php-mysql using web services","<android><connectivity>","1","1","","",""
"4002482","1","4734507","","2010-10-23 04:30:58","2","417","<p>hi friends i want to pop up a button from the bottom of my screen when the default menu button is pressed on the android key pad. i want to navigate from that pop button to other screens.  </p>","400942","","","","","2011-01-19 11:06:41","how to display button when menu button is pressed in android","<android><menu>","1","3","1","",""
"4002539","1","4002946","","2010-10-23 04:56:28","2","1214","<p>The title maybe a little vague, let me give you an example:if we change a colorful image into black and white, we still can recognize the objects in it.My question is, can I change the color to RED or GREEN or other color rather than black and white in programs(I prefer Java).</p><p><strong>[Update]</strong> : what I want to do is just like this question: </p><p><a href=""http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone"">http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone</a></p><p>However, I want to do this on Android instead of iphone ....</p>","325241","","325241","","2010-10-23 05:12:23","2013-03-15 06:01:21","how to change the color of an image but can still recognize the object?","<java><android><image><image-processing>","2","0","1","",""
"4002571","1","","","2010-10-23 05:07:59","0","198","<p>I am in middle of learning application development.</p><p>I have created an application in 2.2 and tested that in my HTC Nexus One device.</p><p>I looks like fine. My client testing same application setup in his device (Droid2). I don't have that device to test.</p><p>He said there are some font sizes are vary and button alignments are missing. When I testing in my device everything looks fine.</p><p>So, I need to test my application in Simulator which resembles like Droid2 device. Can anyone tell me how to create emulator and setup like Droid2.</p><p>And also, is there any need to adjust my code or anything in manifest file.</p><p>Any help/suggestion will be much helpful for me to fix this problem.</p><p>Thanks in advance for your replies.</p>","484850","","","","","2010-10-23 20:19:24","Application for different versions and different resolution","<android><android-emulator>","1","0","","",""
"4002647","1","","","2010-10-23 05:32:56","0","382","<p>I want to display the near by schools and airports and their related information in the google maps. </p><p>I have considered using google places api but the registration process for Adsense and Google Places API will take long time. So, is there any other alternative to my problem...???</p><p>Any suggestions are welcome !!!</p>","303155","","303155","","2010-10-23 06:13:52","2010-10-23 06:13:52","displaying nearby schools and airports in google maps android","<android><google-maps><google-maps-api-3>","0","2","","",""
"4002687","1","4002713","","2010-10-23 05:43:44","0","351","<p>I'm a newbie Android App Developer, also new with xml. I was just wondering if there is an easier way to view xml output other than using eclipse to compile the android application (java + xml) and then see output in the android emulator. Just asking because it takes forever to check my UI through eclipse IDE to turn on android emulator then open my application, and I feel that there must be an easier way. I have searched for solutions but either I'm wording it incorrectly or I just do not know the correct terminology or there is no other way(hopefully not this option). Please help me figure out to how to run XML code to check and see the proper UI output (its layout, widgets in correct places etc.) without having to compile my application code every time.</p><p>I have already looked into DroidDraw - it provides one output within the the application and another output in android emulator. I find it quite inconsistent.</p><p>Any help would be highly appreciated.</p><p>Thank you</p>","484881","","","","","2010-10-23 05:55:49","How to view .xml output on the go? (Android App-building help)","<android><xml><ide><android-emulator>","1","2","","",""
"4002754","1","4005264","","2010-10-23 06:09:36","2","4016","<p>i'm trying to work out how to organize an android application that will have multiple themes. here's a simplified example of my problem,</p><p>2 themes, ""light"" and ""dark"",within each theme, two text colors: ""enabled"" and ""disabled""</p><p>now the problem is that when i define my TextView, i don't want to call out ""light"" or ""dark"" there, i want to just specify the theme at the application level and have it applied. basically, i want CSS selectors. i want to be able to define my theme like,</p><pre><code>&lt;style name=""Light.enabled"" .../&gt;&lt;style name=""Light.disabled"" .../&gt;</code></pre><p>and my text view like,</p><pre><code>&lt;TextView style=""@style/.enabled"" .../&gt;&lt;TextView style=""@style/.disabled"" .../&gt;</code></pre><p>and have it apply ""enabled"" or ""disabled"" based on whether i've called out ""light"" or ""dark"" at the application level.</p><p>this page,<a href=""http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html"" rel=""nofollow"">http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html</a></p><p>shows an app that </p><ol><li><p>defines a style, say ""light.enabled""</p><p>  #000000</p></li><li><p>defines an attribute reference, say ""enabled""</p><p></p></li><li><p>defines a style (theme) item like,</p><p>  @style/light.enabled</p></li><li><p>uses the attr to define the style in the view,</p><p></p></li></ol><p>this is what i want, but it doesn't work for me. the only diff is that i'm using an appwidget. the author sets the theme on the activity. the only place i can set it is Context.setTheme(), and at the ""application"" tag in the manifest. neither of which seems to make a difference. </p>","337455","","337455","","2010-10-23 08:02:02","2010-10-23 17:42:02","best practice for providing multiple android application themes","<android><coding-style><themes>","2","1","4","",""
"4002820","1","","","2010-10-23 06:29:59","4","8837","<p>I'm trying to create a multi-table database for my android application. I'm following the suggestion given on this site <a href=""http://androidforbeginners.blogspot.com/2010/01/creating-multiple-sqlite-database.html"" rel=""nofollow"">http://androidforbeginners.blogspot.com/2010/01/creating-multiple-sqlite-database.html</a> for doing it. I keep on getting the error below. The error seems to be cause by the onCreate of the databaes tables.</p><p>If you look at my onCreate in the the DBHelper class I have two commented out. This allows it to work no matter which one is left uncommeted. </p><p>There has to be a way to create a multi-table database because a single table in a database almost defeats the purpose of having a database.</p><pre><code>10-23 02:11:35.383: ERROR/AndroidRuntime(300): Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 0 to 1: /data/data/com.parkingticket/databases/Tickets.db</code></pre><p>Thanks in advance.</p><p>Here is my code</p><pre><code>   package com.parkingticket;   import java.sql.SQLException;   import android.content.ContentValues;   import android.content.Context;   import android.database.Cursor;   import android.database.sqlite.SQLiteDatabase;   import android.database.sqlite.SQLiteDatabase.CursorFactory;   import android.database.sqlite.SQLiteException;   import android.database.sqlite.SQLiteOpenHelper;   import android.util.Log;   public class TicketDBAdapter    {private static final String DATABASE_NAME=""Tickets.db"";private static final int DATABASE_VERSION = 1;private static final String PARKEDCARS_TABLE = ""ParkedCars"";private static final String PARKINGMETERS_TABLE = ""ParkingMeters"";private static final String PARKINGTICKETS_TABLE = ""ParkingTickets"";private static final String POLICEOFFICERS_TABLE = ""PoliceOfficers"";// The name and column index for each column in PARKEDCARSpublic static final String KEY_CARID = ""carID"";    public static final int CARID_COLUMN = 0;public static final String KEY_CARMAKE = ""Make"";    public static final int CARMAKE_COLUMN = 1;public static final String KEY_CARMODEL = ""Model"";    public static final int CARMODEL_COLUMN = 2;public static final String KEY_CARCOLOR = ""Color"";    public static final int CARCOLOR_COLUMN = 3;public static final String KEY_CARLICENSENUMBER = ""LicenseNumber"";    public static final int CARLICENSENUMBER_COLUMN = 4;public static final String KEY_CARMINUTESPARKED = ""MinutesParked"";    public static final int CARMINUTESPARKED_COLUMN = 5;// The name and column index for each column in PARKINGMETERSpublic static final String KEY_METERID = ""meterID"";    public static final int METERID_COLUMN = 0;public static final String KEY_MINUTESPURCHASED = ""MinutesPurchased"";    public static final int MINUTESPURCHASED_COLUMN = 1;// The name and column index for each column in PARKINGTICKETS    //TODO create the columns and indexs for parking tickets// The name and column index for each column in POLICEOFFICERSpublic static final String KEY_OFFICERID = ""officerID"";    public static final int OFFICERID_COLUMN = 0;public static final String KEY_OFFICERNAME = ""Name"";    public static final int OFFICERNAME_COLUMN = 1;public static final String KEY_OFFICERBADGE = ""BadgeNumber"";    public static final int OFFICERBADE_COLUMN = 2;//Variable to hold the database instanceprivate SQLiteDatabase ticketDB;//Context of the application using the database.private final Context context;//Database open/upgrade helperprivate TicketDBHelper ticketDBHelper;public TicketDBAdapter(Context _context){    context = _context;    ticketDBHelper = new TicketDBHelper(context, DATABASE_NAME, null, DATABASE_VERSION);}public void open() throws SQLiteException{    try    {        ticketDB = ticketDBHelper.getWritableDatabase();    }    catch(SQLiteException ex)    {        ticketDB = ticketDBHelper.getReadableDatabase();    }}public void close(){    ticketDB.close();} //Insert a new ParkedCarpublic long insertParkedCar(ParkedCar _car){    //Create a new row of values to insert    ContentValues newParkedCarValues = new ContentValues();    //Assign values for each row    newParkedCarValues.put(KEY_CARMAKE, _car.getMake());    newParkedCarValues.put(KEY_CARMODEL, _car.getModel());    newParkedCarValues.put(KEY_CARCOLOR, _car.getColor());    newParkedCarValues.put(KEY_CARLICENSENUMBER, _car.getLicenseNumber());    newParkedCarValues.put(KEY_CARMINUTESPARKED, _car.getMinutesParked());    //Insert the row    return ticketDB.insert(PARKEDCARS_TABLE, null, newParkedCarValues);}//Remove a ParkedCar based on its indexpublic boolean removeParkedCar(long _rowIndex){    return ticketDB.delete(PARKEDCARS_TABLE, KEY_CARID + ""="" + _rowIndex, null)&gt;0;}//Update a ParkedCar's MinutesParked//TODO Create an update for ParkedCar's minutesParked.public Cursor getAllParkedCarsCursor(){    return ticketDB.query(PARKEDCARS_TABLE, new String[] {KEY_CARID, KEY_CARMAKE, KEY_CARMODEL, KEY_CARCOLOR, KEY_CARLICENSENUMBER, KEY_CARMINUTESPARKED}, null, null, null, null, null);}public Cursor setCursorParkedCar(long _rowIndex) throws SQLException{    Cursor result = ticketDB.query(true, PARKEDCARS_TABLE, new String []{KEY_CARID}, KEY_CARID + ""="" + _rowIndex, null, null, null, null, null);    if ((result.getCount() == 0) || !result.moveToFirst())    {        throw new SQLException(""No ParkedCar found for row: "" + _rowIndex);    }    return result;}public static class TicketDBHelper extends SQLiteOpenHelper{    public TicketDBHelper(Context context, String name, CursorFactory factory, int version)    {        super(context, name, factory, version);    }    //SQL Statement to create PARKEDCARS table    private static final String PARKEDCARS_CREATE = ""create table "" + PARKEDCARS_TABLE + "" ("" + KEY_CARID + "" integer primary key autoincrement, "" + KEY_CARMAKE + "" text not null,"" + KEY_CARMODEL + "" text not null,"" + KEY_CARCOLOR + "" text not null,"" + KEY_CARLICENSENUMBER + "" text not null,"" + KEY_CARMINUTESPARKED + ""int not null);"";    //SQL Statement to create ParkingMeters table    private static final String PARKINGMETERS_CREATE = ""create table"" + PARKINGMETERS_TABLE + "" ("" + KEY_METERID + "" integer primary key autoincrement, "" + KEY_MINUTESPURCHASED + "" int not null);"";    //SQL Statement to create ParkingTickets table    //TODO create the statement for parkingTickets    //SQL Statement to create PoliceOfficers table    private static final String POLICEOFFICERS_CREATE = ""create table"" + POLICEOFFICERS_TABLE + "" ("" + KEY_OFFICERID + "" integer primary key autoincrement, "" + KEY_OFFICERNAME + "" text not null,"" + KEY_OFFICERBADGE + ""text not null);"";    //Called when no database exists in disk and the helper class needs to create a new one.    @Override    public void onCreate(SQLiteDatabase _db)    {                //_db.execSQL(PARKEDCARS_CREATE);          _db.execSQL(PARKINGMETERS_CREATE);                 //_db.execSQL(POLICEOFFICERS_CREATE);    }    //Called when there is a database verion mismatch meaning that the version of the database on disk needs to be upgraded to the current version    @Override    public void onUpgrade(SQLiteDatabase _db, int _oldVersion, int _newVersion)    {        //Log the version upgrade.        Log.w(""TaskDBAdapter"", ""Upgrading from version "" + _oldVersion + "" to "" + _newVersion + "", which will destroy all old data"");        //Upgrade the existing database to conform to the new version        //Multiple previous versions can be handled by comparing _oldVersoin and _newVersion values        //The simplest case is to drop teh old table and create a new one.        _db.execSQL(""DROP TABLE IF EXISTS "" + PARKEDCARS_TABLE);        _db.execSQL(""DROP TABLE IF EXISTS "" + PARKINGMETERS_TABLE);        _db.execSQL(""DROP TABLE IF EXISTS "" + POLICEOFFICERS_TABLE);        onCreate(_db);    }}  }</code></pre>","434455","","1839336","","2013-01-18 11:11:32","2013-03-23 18:42:35","Creating a multi-table SQL database in android","<sql><android><multi-table>","4","0","","",""
"4002857","1","","","2010-10-23 06:46:03","0","486","<p>Is it possible to develop one app that can be used on mobile phones, tablets and GoogleTV?</p><p>Thanks!</p>","484893","","19750","","2011-03-19 16:38:29","2011-03-19 16:38:29","Can the same Android App be used for mobile phones, tablets and Google TV?","<android><google-tv>","1","0","","",""
"4002925","1","7123344","","2010-10-23 07:15:17","8","1168","<p>I have a paid app that's been out in the Android Market for a few months now, and up to this point that app had no type of copy protection or license verification scheme.</p><p>I have just finished adding an modified version of the LVL code to my app. To test out the code's license response handling, I signed into my dev account on the emulator and went through all of the test responses successfully, and then did the same thing on my real phone (Droid running 2.2).</p><p>I thought I should be good to go after the successful testing, but I did one last internet search to see if people have had problems once they allowed their LVL implementation to go live. To my horror, I came across story after story of developers saying that they had successfully tested all of the test responses like I have done, but when they actually uploaded their app with LVL included, all of their users were getting responses saying that they had unlicensed versions of the app, when this wasn't really the case.</p><p>With that said, can someone who has successfully deployed the LVL tell me the best way to test and verify that the LVL implementation works as it should (from the perspective of an end-user), before I have to actually publish it to the market? Currently, I have my old, non-licensed, version of my app published on the market, and the testing I've done is using the same version code in the manifest file, and I've only loaded the updated apk onto the emulator and onto my phone (i.e. new apk is NOT uploaded to the market). Sorry for the paranoia, but I'd rather remove the LVL implementation altogether rather than give unlicensed responses to valid users.</p>","449070","","","","","2011-08-19 14:48:20","Live Testing of the Android LVL","<android><licensing>","1","1","2","",""
"4002948","1","","","2010-10-23 07:22:36","0","78","<p>I want to create an activity that uses the intent action for Screen_off - is there an easy way to do this? I keep getting lost as to where I should start - does the screen_off activity need to be defined somewhere and then referred to?</p>","484920","","","","","2010-10-23 17:34:39","create one activity application","<android>","1","1","","",""
"4003181","1","","","2010-10-23 08:51:26","0","199","<p>Trying to build android src.</p><p>Followed all instructions from <a href=""http://www.source.android.com"" rel=""nofollow"">source.android.com</a></p><p>I know it says Snow-Leopard is not supported, but have googled and have found many guys are able to build android src </p><p>So , installed Macports 1.9.1 dmg file and repo sync the codeRan '<code>make</code>' , got some kind of error that said ""<code>object_error_freed</code>"" </p><p>In some post it was pointed out that it mainly happened due '<strong>Newest version of Macports</strong>'</p><p>So completely uninstalled macports and installed macport 1.9.0</p><p>Now in this step :</p><pre><code>POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg</code></pre><p>I get error as :</p><pre><code>""---&gt;  Dependencies to be installed: xorg-libXext xorg-libX11 xorg-libxcb python26 db46 gdbm openssl zlib readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderproto---&gt;  Building db46Error: Target org.macports.build returned: shell command failedLog for db46 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db46/main.logError: The following dependencies failed to build: xorg-libXext xorg-libX11 xorg-libxcb python26 db46 gdbm openssl zlib readline sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXrandr xorg-randrproto xrender xorg-renderprotoError: Status 1 encountered during processing.To report a bug, see &lt;http://guide.macports.org/#project.tickets&gt;""</code></pre><p>I am just unable to understand what should be the next step.</p><p>Where to debug ?</p>","475243","","45382","","2013-01-04 06:14:05","2013-01-04 06:14:05","Android SRC build - Snow Leopard","<android>","0","4","","",""
"4003225","1","4003844","","2010-10-23 09:08:11","1","5167","<p>I have an activity which handles configuration changes. But now i have to change layout.I tried in onConfigurationChanged callback just to set again the layout and hoping will get the correct layout(land) but it's still showing the first layout for portrait view ( there two layout(same name) are placed in res/ layout and res/layout-land :)</p><p>if I delete android:configChanges=""orientation"", it works should be, but i need to handle onConfigurationChanged. What should I do?? </p>","483988","","483988","","2010-10-23 11:51:44","2010-10-23 11:59:40","onConfigurationChanged-it's still showing the first layout","<android><android-manifest>","1","0","","",""
"4003263","1","4003299","","2010-10-23 09:20:09","1","453","<p>I have recently installed the most recent Android Plugin for Eclipse on the most recent Eclipse version. The problem is that the syntax proposals are now very, very slow. I have to switch them off.</p><p>To be precise. If I press ""."" after an Android class instance, it takes several seconds, before the proposals for the methods appear, and I can continue typing. After I type a letter, it takes again seconds before I can continue.</p><p>Looks like the program is download something from a very slow server. This problem does not exist with Java core classes, and it did also not exist in the previous version I was using.</p><p>Is there anything I can do about that?</p><p>Rene</p>","447111","","","","","2011-02-03 15:28:12","Eclipse Android Plugin sluggish","<android>","5","0","1","",""
"4003339","1","4003491","","2010-10-23 09:36:51","0","1927","<p>I want to get device phone number through JavaScript for validating user.</p><p>I am sending sms to client when he clicks on a URL I need to perform some <em>operation</em>.</p><p>For that, I want to get device phone number on smartphones.</p>","1746300","","811","","2011-09-12 20:32:04","2011-09-12 20:32:04","How can I get the device's phone number through JavaScript in Android?","<iphone><android>","2","2","1","",""
"4003467","1","4004573","","2010-10-23 10:11:54","0","1318","<p>How do I achieve the following?</p><p><img src=""http://i.stack.imgur.com/Tarmq.png"" alt=""Expected""><img src=""http://i.stack.imgur.com/QtV5N.png"" alt=""Actual""></p><p>The first image shows the result I want to achieve. The second one is the current result I'm getting from my layout. <strong>Note</strong> The image I'm using is the one from <em>android 1.6</em> jar.</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;SlidingDrawer    android:id=""@+id/drawer""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:handle=""@+id/handle""    android:content=""@+id/content""&gt; &lt;ImageView     android:id=""@id/handle""     android:src=""@drawable/drawer_handle""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt; &lt;Button    android:id=""@id/content""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""Button"" /&gt; &lt;/SlidingDrawer&gt;&lt;/LinearLayout&gt;</code></pre>","421372","","","","","2011-04-15 04:47:31","SlidingDrawer using a 9 patch handle image","<android><slidingdrawer>","2","1","2","",""
"4003701","1","4698687","","2010-10-23 11:16:56","5","8452","<p>I've seen the Mario live wallpaper uses admob ads in the settings screen, but I haven't been able to do it myself. If I put the adview into the settings.xml like you would with a normal layout I get a class cast exception.</p><p>Here's a screenshot of the mario live wallpaper to illustrate what I'm trying to do.</p><p><img src=""http://i.stack.imgur.com/lrax1.png"" alt=""example screenshot""></p>","350678","","","","","2014-03-18 04:48:54","How do I put an admob adview in the settings screen for a live wallpaper?","<android><layout><admob>","5","0","15","",""
"4003715","1","","","2010-10-23 11:21:01","1","1222","<p>I've experienced a strange issue running (my own) applications on the HTC Desire. </p><p>When I call getApplicationContext().getCacheDir() or getApplicationContext().getFilesDir() from my activity this always returns null. In the emulator /data/data/com.myapp.android/cache respectively /data/data/com.myapp.android/files is returned.</p><p>Because of that I'm not able to use the webview class as it tries to create cache files and crashes with a null pointer exception. The logs:</p><p>10-23 12:24:38.055: ERROR/Database(16692): sqlite3_open_v2(""/data/data/com.myapp.android/databases/webview.db"", &amp;handle, 6, NULL) failed10-23 12:24:38.055: ERROR/Database(16692): sqlite3_open_v2(""/data/data/com.myapp.android/databases/webviewCache.db"", &amp;handle, 6, NULL) failed</p><p>10-23 12:24:38.545: WARN/cache(16692): Unable to create webviewCache directory10-23 12:24:38.665: ERROR/webviewdatabase(16692): Exception: java.lang.NullPointerException10-23 12:24:41.555: ERROR/AndroidRuntime(16692): FATAL EXCEPTION: WebViewWorkerThread10-23 12:24:41.555: ERROR/AndroidRuntime(16692): java.lang.NullPointerException10-23 12:24:41.555: ERROR/AndroidRuntime(16692):     at android.webkit.WebViewDatabase.getCacheTotalSize(WebViewDatabase.java:793)10-23 12:24:41.555: ERROR/AndroidRuntime(16692):     at android.webkit.CacheManager.trimCacheIfNeeded(CacheManager.java:548)10-23 12:24:41.555: ERROR/AndroidRuntime(16692):     at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:190)10-23 12:24:41.555: ERROR/AndroidRuntime(16692):     at android.os.Handler.dispatchMessage(Handler.java:99)10-23 12:24:41.555: ERROR/AndroidRuntime(16692):     at android.os.Looper.loop(Looper.java:144)10-23 12:24:41.555: ERROR/AndroidRuntime(16692):     at android.os.HandlerThread.run(HandlerThread.java:60)10-23 12:24:41.575: WARN/ActivityManager(92):   Force finishing activity com.myapp.android/.StockDetailActivity</p><p>I noticed that other apps have issues as well. For example the google finance app logs the following message:</p><p>10-23 12:18:59.415: ERROR/ApplicationContext(16073): Couldn't rename file /data/data/com.google.android.apps.finance/shared_prefs/com.google.android.apps.finance_preferences.xml to backup file /data/data/com.google.android.apps.finance/shared_prefs/com.google.android.apps.finance_preferences.xml.bak</p><p>Why I cannot create folders in this directory?</p><p>Is there a possibility to set the fileDir and cacheDir paths to the sd card or somewhere else? I looked at some classes like Context, Webview and CacheManager but I could not find a way to change it. </p><p>Do I need to set a permission to create cache files?</p><p>Thank you for your help!</p><p>Kind regards,Dominik</p>","485013","","","","","2011-02-17 00:09:13","Issues creating cache files and directories on HTC Desire","<android>","1","0","2","",""
"4003773","1","4003990","","2010-10-23 11:36:39","0","765","<p>I have a radiobutton group in Android that I populate with data from a database. To get the data to show next to each radiobutton I have used the ListAdapter: </p><pre><code>String[] columns = new String[] {DataHelper.KEY_WORD, DataHelper.KEY_ALT1 , DataHelper.KEY_ALT2 ,DataHelper.KEY_ALT3 ,DataHelper.KEY_ALT4 };            // the XML defined views which the data will be bound to            int[] to = new int[] { R.id.word, R.id.q1, R.id.q2, R.id.q3 , R.id.q4 };SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, R.layout.game, c, columns, to);this.setListAdapter(mAdapter);</code></pre><p>In order to get the ListAdapter to work I need a listview, but the listview seems to disable my OnClickListener. </p><p>How could I solve this? Is there anyway to not use a listview to populate the radiogroup, or a way to keep the onClickLIsteners active inside it?</p>","455479","","","","","2011-01-30 03:52:44","Radio button click doesn't register inside ListView","<android><database><listview><radio-button>","1","0","","",""
"4003862","1","","","2010-10-23 12:03:26","1","277","<p>While browsing through various apps in the market, I noticed that there's a ""New in version xyz: ... "" text, just above the number of downloads and comments. Did I miss something, or is there a dedicated field to provide this kind of information while uploading a new version of your app in the market instead of just changing your application description?</p><p>Thanks</p><p>Edit: Here a picture to clarify what I'm talking about:</p><p><img src=""http://i.stack.imgur.com/z3mml.jpg"" alt=""what's new dialog""></p>","485032","","338479","","2014-01-23 01:30:36","2014-01-23 01:30:36","Android market ""Whats new in version xyz"" - information","<android><google-play>","2","1","","",""
"4003892","1","4003912","","2010-10-23 12:11:24","2","5994","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3358984/why-is-my-android-alarm-manager-firing-instantly"">Why is my android alarm manager firing instantly?</a>  </p></blockquote><p>I have this code which will call alarm notification</p><pre><code>public static  Calendar cal = Calendar.getInstance();cal.setTimeInMillis(System.currentTimeMillis());cal.add(Calendar.HOUR_OF_DAY,hour);cal.add(Calendar.MINUTE, min);Intent intent = new Intent(this,  OnetimeAlarmReceiver.class);PendingIntent pendingIntent = PendingIntent.getBroadcast(this, REQUEST_CODE, intent,0);AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis() , pendingIntent); Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();</code></pre><p>but the alarm is fired instantly , it dosent wait after the given hour and minutes ?should I add anything to to the manifest file ?</p>","325296","","","","","2010-10-23 12:17:48","set the time in Alarm manager Android - alarm fired instantly","<android><time><calendar><alarm><alarmmanager>","1","0","","2011-12-17 18:48:32",""
"4003930","1","4004236","","2010-10-23 12:22:49","0","1091","<p>I'm a newbie in android, working on list adapters right now. I know some type of list adaptors need _id column to process the data. I provide an _id column but I couldn't make it work. I follow notepad example, so here is my code :</p><p>I create the db by this statement :</p><pre><code>private static final String DB_TABLE = ""radios"";public static final String KEY_NAME = ""name"";public static final String KEY_URL = ""url"";public static final String KEY_ROWID = ""_id"";</code></pre><p>private static final String DB_CREATE =        ""create table "" + DB_TABLE +"" (""+ KEY_ROWID +"" integer primary key autoincrement, ""        + KEY_NAME + "" text not null, ""+ KEY_URL +"" text not null);"";</p><p>Using a dbhelper class :</p><pre><code> private static class DBHelper extends SQLiteOpenHelper {    DBHelper(Context context) {        super(context, DB_NAME, null, DB_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(DB_CREATE);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to ""                + newVersion + "", which will destroy all old data"");        db.execSQL(""DROP TABLE IF EXISTS "" + DB_TABLE);        onCreate(db);    }}</code></pre><p>Here I get all the records in db :</p><pre><code>public Cursor getAllRadios() {    return db.query(DB_TABLE, new String[] {KEY_ROWID,KEY_NAME,KEY_URL}, null, null, null, null, null);}</code></pre><p>And my adapter :</p><pre><code>String[] from = new String[] { DBAdapter.KEY_NAME };    int[] to = new int[] { R.id.text1 };    try{     SimpleCursorAdapter radios = new SimpleCursorAdapter(this, R.layout.list_item, cursor , from, to);      setListAdapter(radios);    }    catch(Exception e){     e.printStackTrace();    }</code></pre><p>I couldnt find any problems but I still get <strong>no such column as ""_id""</strong> error. Any ideas?</p>","246414","","","","","2010-10-23 13:42:13","Android SQLite _id column problem","<android><listadapter>","1","0","0","",""
"4003965","1","4004029","","2010-10-23 12:33:04","1","302","<p>Its been around 2 years since Android's first release and already there are 6 to 7 Android releases, unlike Windows mobile. And I found between 2.1 and 2.2 there are lots of changes. The way to call my local services, and other methods have been deprecated etc..</p><p>So how stable is Android 2.2. Are we gonna have more frequent release? Developing in 2.2 is it going to bite me down the road? 2.2 sounds like a sub version, its not base lined yet. What are your thoughts? </p>","284606","","284606","","2010-11-18 12:34:09","2010-11-18 12:34:09","How reliable is Android 2.2","<android><android-2.2-froyo><android-2.1-eclair>","4","0","1","",""
"4004189","1","","","2010-10-23 13:31:58","0","299","<p>Can someone tell me how to skip to a position in an alphabetically sorted ListView when given a char or string input from an onClick method?  </p><p>For example, I have a dialog that passes back a char.  If that char is a B I want the listview to skip to the first B entry.</p><p>Any help would be greatly appreciated.</p><p>Thanks,Josh</p>","453305","","","","","2010-10-23 15:44:50","Android : Skipping to Listview position given input char or string","<android><listview><char><skip>","1","0","","",""
"4004294","1","4045800","","2010-10-23 13:53:08","2","796","<p>In my activity I need a <code>ProgressDialog</code> with a horizontal progress bar to visualise the progress of a background task. To make the activity care for the dialog e.g. in case of screen rotation, I would like to use a managed dialog created in <code>onCreateDialog</code>. The problem is that I need to update the progress bar of the dialog after it has been created and therefor I need a reference to the managed progress dialog: Does anyone know how to retrieve a reference to a dialog created by <code>onCreateDialog</code>?</p><p>At the moment I am storing a reference to the dialog created in <code>onCreateDialog</code>, but that my fail with a <code>InvalidArgumentException</code> in the <code>onFinished()</code> method after the screen has been rotated (and the activity has been recreated):</p><pre><code>public final class MyActivity extends Activity {  private static final int DIALOG_PROGRESS = 0;  private ProgressDialog progressDialog = null;  // [...]  @Override  protected Dialog onCreateDialog(int id) {    switch (id) {    case DIALOG_PROGRESS:      progressDialog = createProgressDialog();      return progressDialog;    default:      return super.onCreateDialog(id);    }  }  // [...]  public void updateProgress(int progress) {    progressDialog.setProgress(0);  }  public void onFinished() {    progressDialog.dismiss();  }  // [...]}</code></pre><p>I would have expected something like a <code>getDialog(int)</code> method in the <code>Activity</code> class to get a reference to a managed dialog, but this doesn't seem to exist. Any ideas?</p>","280384","","280384","","2010-10-28 17:53:16","2010-10-28 18:02:50","Gettring a reference to a managed ProgressDialog","<android>","1","0","1","",""
"4004331","1","4152776","","2010-10-23 14:00:10","2","1753","<p>I'm using Android's Browser Bookmark ContentProvider to create a new bookmark programatically. The bookmark is created (I can retrieve it programatically via the ContentProvider) but the bookmark isn't visible in the browser bookmark view. Thoughts?</p><pre><code>// Saving the bookmark via ContentProviderfinal ContentValues bookmarkValues = new ContentValues();bookmarkValues.put(Browser.BookmarkColumns.TITLE, title);bookmarkValues.put(Browser.BookmarkColumns.URL, url);final Uri newBookmark = getContentResolver().insert(Browser.BOOKMARKS_URI, bookmarkValues);// Retrieving       Cursor cursor = getContentResolver().query(Browser.BOOKMARKS_URI,         null, null, null, Browser.BookmarkColumns.CREATED);cursor.moveToFirst();final String stitle = cursor.getString(cursor.getColumnIndex(""title""));final String surl = cursor.getString(cursor.getColumnIndex(""url""));</code></pre>","279199","","","","","2014-02-16 07:53:27","android bookmark ContentProvider makes bookmark but not visible in browser's bookmarks","<android><android-contentprovider><bookmarks>","1","0","1","",""
"4004382","1","","","2010-10-23 14:10:20","3","8296","<p>I have to call .net web services in android using ksoap2 api.My code is working well for passing parameter as String or int. But it showing ""<strong>java.lang.RuntimeException: Cannot serialize: java.util.GregorianCalendar.....""</strong> while passing Calendar object as parameter. I converted date into string and parsed it into date object but it is not woriking. </p><p>Anybody help me.</p><p>Thank you.</p>","485060","","","","","2012-03-28 05:41:02","Android 1.6 ksoap2 ""RuntimeException: Cannot serialize: java.util.GregorianCalendar.."", while passing datetime parameter","<android><ksoap2>","3","2","","",""
"4004387","1","4004618","","2010-10-23 14:10:58","3","8264","<p>Is it possible to draw a circle on a canvas in android with a different colour border using only one drawCircle method?</p><p>I have noticed the PaintStyle of FILL_AND_STROKE but cant seem to have different colours for both the fill and the border.</p><p>I really don't want to have to call two drawCircle methods.</p><p>Thanks</p>","128327","","128327","","2011-08-08 13:06:02","2012-06-10 00:11:29","Android drawCircle with different colour border","<android><canvas>","4","0","","",""
"4004397","1","4004468","","2010-10-23 14:13:42","4","5298","<p>How can I set the TextView properties like width, height using Java Code?</p>","485061","","234009","","2010-10-23 14:31:12","2010-10-23 14:31:12","Setting a TextView width in java","<java><android><textview>","2","0","","",""
"4004463","1","4006371","","2010-10-23 14:29:13","2","1279","<p>I'm trying to implement a smudge tool like one you would find in Gimp or Photoshop. I've tried lots of variations but they all have problems. The basic method I've tried for smudging from position P1 to P2 on an image is:</p><ol><li>Copy a rectangle the size of the current brush from P1.</li><li>Draw this rectangle at P2 with a low opacity.</li></ol><p>It looks fine and smudges as expected but the main problems I'm having is that the smudge seems to make things darker. Especially when using a small brush spacing, repeated smudging will turn the area to black. Any suggestions on what I'm doing wrong or some standard algorithms I can look at? I've had a look at the Gimp source but it's very hard to follow.</p><p>If it matters, I'm working on a mobile device (Android, Java) so something fast would be preferable.</p>","483701","","483701","","2010-10-23 19:18:12","2011-07-22 05:01:05","Algorithm for a smudge tool?","<java><android><graphics><image-processing>","2","0","","",""
"4004528","1","4044713","","2010-10-23 14:45:07","0","1254","<p>I have a webview in my app that generally works fine for loading websites. But I <strong>cannot get www.gmail.com to work</strong>: when I open www.gmail.com I see the login page, try to login, afterwards the screen goes black and my app/process is killed.</p><p>I don't see much in my logcat, just some strange debug information is being dumped as below.</p><p>But generally https sites work fine, and even more complicated login procedures like opening stackoverflow.com, logging in via openid through https, back to stackoverflow, all work without a problem in my webview. Only gmail.com is giving me these problems. </p><p>Edit:I found that if I don't assign my custom MyWebViewClient to the webview, the app doesn't crash but opens the gmail site in the default system browser. But I don't want that. I want it to open in my own webview only.</p><p>I created a bug report at <a href=""http://code.google.com/p/android/issues/detail?id=12097"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=12097</a>, attached to it is a working very simple sample project that reproduces the crash.</p><pre><code>I/DEBUG   ( 2173): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   ( 2173): Build fingerprint: 'Samsung/GT-I9000/GT-I9000/GT-I9000:2.1-update1/ECLAIR/XWJM6:user/release-keys'I/DEBUG   ( 2173): pid: 6753, tid: 6793  &gt;&gt;&gt; com.myapplication.android &lt;&lt;&lt;I/DEBUG   ( 2173): signal 11 (SIGSEGV), fault addr 0000004cI/DEBUG   ( 2173):  r0 00000000  r1 00000000  r2 00000000  r3 aa476ae0I/DEBUG   ( 2173):  r4 00000000  r5 4c2f5b74  r6 aa476ae0  r7 00595decI/DEBUG   ( 2173):  r8 4c2f5da8  r9 444a7eb8  10 444a7ea0  fp 004be758I/DEBUG   ( 2173):  ip aa4770fc  sp 4c2f5b50  lr aa1112bf  pc aac0a5ac  cpsr 48000030I/DEBUG   ( 2173):          #00  pc 0000a5ac  /system/lib/libsqlite.soI/DEBUG   ( 2173):          #01  pc 001112bc  /system/lib/libwebcore.soI/DEBUG   ( 2173):          #02  pc 001118e2  /system/lib/libwebcore.soI/DEBUG   ( 2173):          #03  pc 00111a80  /system/lib/libwebcore.soI/DEBUG   ( 2173):I/DEBUG   ( 2173): code around pc:I/DEBUG   ( 2173): aac0a59c f7ff60e3 2000fd49 bf00bd70 4604b570I/DEBUG   ( 2173): aac0a5ac 460d6cc0 f7ff4616 f8c4fd9d 230150e0I/DEBUG   ( 2173): aac0a5bc 60e4f8c4 508cf8d4 f885e002 68ad30ffI/DEBUG   ( 2173):I/DEBUG   ( 2173): code around lr:I/DEBUG   ( 2173): aa1112ac 68004905 e0021859 68002100 f6f9460aI/DEBUG   ( 2173): aa1112bc bd10ec32 0036583c ffc9a849 4604b570I/DEBUG   ( 2173): aa1112cc 46281d05 fd64f20b 46286826 60263e01I/DEBUG   ( 2173):I/DEBUG   ( 2173): stack:I/DEBUG   ( 2173):     4c2f5b10  00000000I/DEBUG   ( 2173):     4c2f5b14  aa31c6d3  /system/lib/libwebcore.soI/DEBUG   ( 2173):     4c2f5b18  00000000I/DEBUG   ( 2173):     4c2f5b1c  aa011171  /system/lib/libwebcore.soI/DEBUG   ( 2173):     4c2f5b20  00000000I/DEBUG   ( 2173):     4c2f5b24  afe3ae08  /system/lib/libc.soI/DEBUG   ( 2173):     4c2f5b28  afe3db7cI/DEBUG   ( 2173):     4c2f5b2c  afe0f170  /system/lib/libc.soI/DEBUG   ( 2173):     4c2f5b30  00000000I/DEBUG   ( 2173):     4c2f5b34  afe3ae08  /system/lib/libc.soI/DEBUG   ( 2173):     4c2f5b38  00595dec  [heap]I/DEBUG   ( 2173):     4c2f5b3c  afe0f170  /system/lib/libc.soI/DEBUG   ( 2173):     4c2f5b40  00595ddc  [heap]I/DEBUG   ( 2173):     4c2f5b44  4c2f5b74I/DEBUG   ( 2173):     4c2f5b48  df002777I/DEBUG   ( 2173):     4c2f5b4c  e3a070adI/DEBUG   ( 2173): #00 4c2f5b50  00595ddc  [heap]I/DEBUG   ( 2173):     4c2f5b54  4c2f5b74I/DEBUG   ( 2173):     4c2f5b58  aa476ae0  /system/lib/libwebcore.soI/DEBUG   ( 2173):     4c2f5b5c  aa1112bf  /system/lib/libwebcore.soI/DEBUG   ( 2173): #01 4c2f5b60  00595ddc  [heap]I/DEBUG   ( 2173):     4c2f5b64  aa1118e7  /system/lib/libwebcore.soD/Zygote  ( 2181): Process 6753 terminated by signal (11)I/ActivityManager( 2237): Process com.myapplication.android (pid 6753) has died.</code></pre><p>XML:</p><pre><code>    &lt;WebView        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:theme=""@style/Theme.NoBackground""        android:id=""@+id/webView""/&gt;</code></pre><p>Code:</p><pre><code>    webView = (WebView)findViewById(R.id.webView);    webView.getSettings().setJavaScriptEnabled(true);    webView.getSettings().setLoadsImagesAutomatically(true);    webView.getSettings().setAllowFileAccess(false);            webView.getSettings().setBuiltInZoomControls(true);    webView.getSettings().setPluginsEnabled(true);    webView.getSettings().setAllowFileAccess(true);    webView.getSettings().setAppCacheEnabled(true);     WebViewClient wv = new MyWebViewClient();    webView.setWebViewClient(wv);/** * Customized webview client to allow mp4 to play in mediaplayer. */final class MyWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url) {    if (url.endsWith("".mp4"")) {        Intent intent = new Intent(""android.intent.action.VIEW"", Uri.parse(url));        view.getContext().startActivity(intent);                    return true;    } else {                    return super.shouldOverrideUrlLoading(view, url);        // instead of the line above, I have also tried this before without any difference:        // view.loadUrl(url);        // return true;    }}</code></pre>","241475","","241475","","2010-10-23 15:50:41","2013-04-05 10:22:56","gmail.com not working on webview (after login)","<android><gmail><webview><android-webview>","1","1","1","",""
"4004650","1","","","2010-10-23 15:16:00","6","1940","<p>I am writing an android app that stores a lot of media files.  They are not the type (and are far too many) to clutter up the users notification or other media directories, but they also must be user-updatable, so I can't put them in the resources.  I can use getExternalFilesDir to get a path on the sdcard, but I only want to do that if the app itself is installed on the sdcard.  If the app is installed internally, I want to put the media in the internal memory.</p><p>So how can I determine if my app is running in internal or external memory?</p>","485117","","","","","2013-03-29 06:00:46","Android 2.2 - How do I detect if I am installed on the SDCard or not?","<android><android-emulator><android-sdk-2.2><android-sdcard>","3","0","4","",""
"4004738","1","","","2010-10-23 15:37:06","1","176","<p>I have an android app with a lot of media files.  The files have to be user-updatable, so I can't put them in the resources.  I have been having to use a bash script to use adb and push out my test files every time I recompile.  Is there any way to package the media so that it is installed to the applications file directory (on the SDCard if the app is installed on the SDCard, and internal if the app is installed internally) when the package is installed?</p>","485128","","","","","2010-10-23 16:02:34","How can I package private media files for Android 2.2?","<android><android-emulator><android-sdk-2.2>","2","0","","",""
"4004749","1","","","2010-10-23 15:41:07","6","678","<p>I have a simple card game where the user can drag and drop cards around the screen. On some of the 2.2 android phones like the Droid and EVO the card drawing is very slow. This is strange because it happens on some of the faster phones. However it's not all phones I test on the Droid and Droid X and the program runs great also runs good on slower phone like the G1. I started getting reports about this after Motorolla released the 2.2 update for the Droid.</p><p>Here's the fix I came up with but it really lowers the quality of my graphics. Gradients look horrible. </p><p>I changed this</p><pre><code>Bitmap.createBitmap(newBmp.getWidth(), newBmp.getHeight(), Bitmap.Config.ARGB_8888);</code></pre><p>to this</p><pre><code>Bitmap.createBitmap(newBmp.getWidth(), newBmp.getHeight(), Bitmap.Config.ARGB_4444);</code></pre><p>The problem goes away but the looks suffer. I need to keep the alpha channel so I can't use RGB_565. Is there some way to keep my quality images and not make it run so slow?</p>","399310","","321731","","2014-02-27 19:26:02","2014-02-27 19:26:02","Why is drawing bitmaps is very slow on some android 2.2 phones?","<android><animation><bitmap><android-canvas>","1","5","2","",""
"4004947","1","4245039","","2010-10-23 16:27:44","0","1995","<p>My Android app, which uses a TabActivity to display its contents, has 4 tabs which all use a state-list drawable for the icon. They all have the same structure, just with different images:</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/icon_options_dark"" android:state_selected=""true"" android:state_focused=""false"" /&gt;        &lt;item android:drawable=""@drawable/icon_options_white"" /&gt;&lt;/selector&gt;`</code></pre><p>However, when selecting tabs with the trackball on my HTC Desire (green highlight), the dark image is used instead of the light one. As soon as a tab is actually selected, it does become white. What am I doing wrong?</p>","238180","","","","","2013-09-20 07:22:23","In an Android state-list drawable, state_focused is ignored","<android><drawable><tabwidget>","1","0","","",""
"4005019","1","","","2010-10-23 16:43:48","0","540","<p>The android NDK supports c++, but does it support c++ classes??If so can you give a simple example and the steps needed to implement the class with the java source.</p>","471196","","471196","","2010-10-23 17:15:55","2011-01-31 07:54:36","C++ Classes with android","<c++><android><class><android-ndk>","1","0","","",""
"4005029","1","4047054","","2010-10-23 16:45:35","9","4546","<p>On my preference screen I have a preference that when clicked opens a color picker dialog.  What I would like to do is when the user selects a color, that the text summary of the preference is displayed in that color.</p><p>I know I can have the summary set up like this, <code>Currently &lt;font color=""#ff0000""&gt;this color&lt;/font&gt;</code> and have it display in that color.  The problem is the color I am getting back is the android int color.</p><p>I could use the red(), green(), blue() methods and then convert those to Hex and then combine them into a string so I could set the summary text with the new value and that works: <code>String colorString = String.format(""#%02x%02x%02x"",Color.red( defaultColor ), Color.green( defaultColor ), Color.blue( defaultColor ));</code> I was just curious if there is an easier way to do this.</p><p>Thanks ahead of time.</p><p>Sean</p>","153683","","153683","","2010-10-23 17:25:20","2014-03-13 22:37:39","How can I set the android preference summary text color?","<android><text><colors><summary><preference>","5","0","2","",""
"4005030","1","","","2010-10-23 16:45:38","0","632","<p>I wrote an android application that scans for wifi connection.</p><p>i used the following code</p><pre><code>package com.android.wifitester;</code></pre><p>import java.util.List;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.net.wifi.ScanResult;import android.net.wifi.WifiManager;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.widget.TextView;</p><p>public class WifiTester extends Activity {    TextView mainText;    WifiManager mainWifi;    WifiReceiver receiverWifi;    List wifiList;    StringBuilder sb = new StringBuilder();</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mainText = (TextView) findViewById(R.id.mainText);    mainWifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);    receiverWifi = new WifiReceiver();    registerReceiver(receiverWifi, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));    mainWifi.startScan();    mainText.setText(""\nStarting Scan...\n"");}public boolean onCreateOptionsMenu(Menu menu) {    menu.add(0, 0, 0, ""Refresh"");    return super.onCreateOptionsMenu(menu);}public boolean onMenuItemSelected(int featureId, MenuItem item) {    mainWifi.startScan();    mainText.setText(""Starting Scan"");    return super.onMenuItemSelected(featureId, item);}protected void onPause() {    unregisterReceiver(receiverWifi);    super.onPause();}protected void onResume() {    registerReceiver(receiverWifi, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));    super.onResume();}class WifiReceiver extends BroadcastReceiver {    public void onReceive(Context c, Intent intent) {        sb = new StringBuilder();        wifiList = mainWifi.getScanResults();        for(int i = 0; i &lt; wifiList.size(); i++){            sb.append(new Integer(i+1).toString() + ""."");            sb.append((wifiList.get(i)).toString());            sb.append(""\n"");        }        mainText.setText(sb);    }}</code></pre><p>}</p><p>when I run the application on the emulator, it crashes</p><p>the manifest file is: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                                                                            </p><pre><code>&lt;/application&gt;&lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE"" /&gt;</code></pre><p></p><pre><code>&lt;uses-sdk android:minSdkVersion=""8"" /&gt;</code></pre><p> </p><p>my question is why it crashes although i added the permission line</p>","480401","","","","","2011-05-11 09:16:03","android Wifi application craches","<android><emulator><wifi>","1","1","","",""
"4005103","1","5571448","","2010-10-23 17:01:53","2","2685","<p>I have a map in my application that shows locations from Gowalla. I use an ItemizedOverlay with a simple default marker, but as the items are drawn, I swap the default marker out with the location's icon downloaded 9and cached on disk) from Gowalla. </p><p>The problem is that if there are a lot of locations on screen (say 30), the size of the bitmaps in memory is enough to crash the activity. To prevent this, I only keep SoftReferences to the bitmaps. Unfortunately, this means that locations will flicker between the default marker and the icon (i.e., icons are loaded, but then there is memory pressure, so they're removed, but then reloaded because they're on screen...).</p><p>When I download the images from Gowalla, I'm already scaling them down based on the screen size (48x48 for HDPI, so 32x32 for MDPI, etc.), so these aren't huge images, but I'm still forced to choose between potentially crashing my app or having the icons flicker in and out. Is there some other way I can reduce the memory that a Bitmap uses?</p>","12034","","","","","2014-02-12 02:09:09","Android - Reduce the memory usage of Bitmap Drawables","<android><memory><map><bitmap>","2","0","1","",""
"4005195","1","4005431","","2010-10-23 17:25:21","1","1028","<p>I've got an TabActivity implementing TabContentFactory, which starts an AsyncTask in onCreate() to fetch the data for the tabs. When the AsyncTask has finished, onPostExecute() could directly update the UI-elements, right? Meaning, since that method runs in the UI-Thread no further thread-synchronization would be required when accessing UI-elements?</p><p>Anyway, the problem I have is that my UI-Thread calls createTabContent() in the TabActivity while the AsyncTask is still busy. I have to add at least one tab, or I get a NullPointerException. But how do I only add tabs when my AsyncTask has finished and the ProgressDialog has been dismissed?</p><p>I'd be glad if someone could help...</p>","474326","","","","","2010-10-23 18:23:18","Android: TabActivity - add no Tabs before AsyncTask has finished","<android><android-asynctask><tabactivity><ui-thread>","1","0","","",""
"4005202","1","4024212","","2010-10-23 17:26:45","0","294","<p>I need to create an account on my server for a user when they process a payment through Google checkout.  I will be using a php script to process the payment notification.  Has anyone done this?  Are there some sample PHP scripts already out there?  I read something about the notification history API and the Polling API - the both seem the same to me...</p><p>What is the best solution?</p>","248521","","248521","","2010-10-23 17:39:39","2010-10-26 13:37:37","Android and Google Checkout, recieving a notification of payment to my server","<android><google-checkout>","1","0","","",""
"4005205","1","","","2010-10-23 17:27:06","1","439","<p>I get the fault ""CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.""</p><p>The problem commes from the onDraw call in TutorialThread. The code works if the call tostartAnimation in onDraw is removed. Why does the code work if startAnimation is removed?Why is this call different than the call to drawRect? </p><p>Below is the code:</p><p>public class GamePanel extends Activity {    private Panel mPanel;</p><pre><code>public void onCreate(Bundle savedInstanceState) {           super.onCreate(savedInstanceState);    mPanel = new Panel(this);    setContentView(mPanel);    mPanel.requestFocus(); }</code></pre><p>}</p><p>class Panel extends SurfaceView implements SurfaceHolder.Callback{    private TutorialThread _thread;    private Paint mPaint;    Context context;    private final GamePanel game;</p><pre><code>public Panel(Context context) {    super(context);     this.game = (GamePanel) context;    getHolder().addCallback(this);    _thread = new TutorialThread(getHolder(),this);    setFocusable(true);    mPaint = new Paint();}  @Overridepublic void onDraw(Canvas canvas) {                 canvas.drawARGB(255, 0, 0, 0);                  mPaint.setColor(Color.WHITE);    mPaint.setStyle(Paint.Style.FILL);    canvas.drawRect(100, 100, 150, 150, mPaint);    startAnimation(AnimationUtils.loadAnimation(game,R.anim.shake));}               @Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width, int height){}@Overridepublic void surfaceCreated(SurfaceHolder holder){    _thread.setRunning(true);    _thread.start();}@Overridepublic void surfaceDestroyed(SurfaceHolder holder){    boolean retry = true;    _thread.setRunning(false);    while(retry) {        try {            _thread.join();            retry = false;        } catch(InterruptedException e) {        }    }}class TutorialThread extends Thread {    private SurfaceHolder _surfaceHolder;    private Panel _panel;    private boolean _run = false;    public TutorialThread(SurfaceHolder surfaceHolder,Panel panel){        _surfaceHolder = surfaceHolder;        _panel = panel;    }    public void setRunning(boolean run){        _run = run;    }    @Override    public void run(){        Canvas c;        while(_run){            c=null;            try{                c = _surfaceHolder.lockCanvas(null);                synchronized(_surfaceHolder){                                           _panel.onDraw(c);                }            }finally{                if(c!=null){                    _surfaceHolder.unlockCanvasAndPost(c);                }            }            try            {                Thread.sleep(500);            }                catch(InterruptedException Ie) {            }                           }               }       }</code></pre><p>}</p>","485199","","","","","2011-02-11 02:16:40","Android how to solve problem with touching a View from the wrong thread?","<android><multithreading><view>","1","0","","",""
"4005239","1","4501902","","2010-10-23 17:34:34","3","1774","<p>i'm trying to define a theme for an appwidget, and have it applied at the application level. i have a theme like, </p><pre><code>&lt;style name=""theme.dark""&gt;   &lt;item name=""android""background""&gt;#000000&lt;/item&gt; &lt;/style&gt; </code></pre><p>in my manifest, i set <code>android:theme=""@style/theme.dark""</code> at the application. however, when i run the appwidget, it does not pick up the items from the style. i tried setting <code>style=""@style/theme.dark""</code> on an individual element in my view layout, and that does work ... but that's not what i want. i don't want to call out a specific style=""..."" for each element in my view. this page,</p><p><a href=""http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html"" rel=""nofollow"">http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html</a> </p><p>has an excellent example app for using themes / styles, and it works perfectly. the only difference is that it's an application .. and it's setting the theme on the activity, not the application. </p><p>i've also tried setting the theme at programmatically on the Context object using setTheme(...) in onHandleUpdate() of the appwidget, before the view is accessed. that doesn't work either. </p><p>any ideas? thanks.</p>","337455","","","","","2013-05-27 08:33:04","applying a theme to an appwidget","<android><android-widget><android-styles>","5","0","3","",""
"4005259","1","4005319","","2010-10-23 17:39:24","3","2129","<p>If my application records some audio with MediaRecorder, is it possible to play the recorded audio file into a call that was started with ACTION_CALL or ACTION_DIAL?</p><p>I see that I can start calls from an application but is there a way for my application to know that the call was answered? At this point I would like to play a file of audio into the call. Then, is there a way for me to end the call?</p>","479542","","","","","2010-10-23 17:54:49","Need to play audio into a call","<android>","2","0","","",""
"4005285","1","","","2010-10-23 17:46:26","0","106","<p>I am trying to run the hello world program which is present on developer.android.com.I am using eclipse 3.4.1 version.</p><p>But when i run the program it doesn't give me any errors, but it doesnt display hello world either.All it displays is the emulated device which i can get by running the android sdk also.</p>","317415","","","","","2010-10-24 14:38:25","running hello world program from developer.android.com","<android><eclipse-plugin>","2","0","","",""
"4005728","1","4009104","","2010-10-23 19:41:47","11","16199","<p>i want to hide the soft keyboard when i click out side of editbox in a screen. how can i do this?</p>","307585","","30618","","2010-10-23 20:42:43","2014-02-17 21:25:39","hide default keyboard on click in android","<android>","7","2","9","",""
"4005933","1","4008755","","2010-10-23 20:31:28","10","4189","<p>I have a multi-line TextView that has android:ellipsize=""end"" set. I would like to know, however, if the string I place in there is actually too long (so that I may make sure the full string is shown elsewhere on the page).</p><p>I could use TextView.length() and find about what the approximate length of string will fit, but since it's multiple lines, the TextView handles when to wrap, so this won't always work.</p><p>Any ideas?</p>","348502","","","","","2014-02-21 07:32:05","How do I tell if my textview has been ellipsized?","<android><textview><ellipsis>","4","0","6","",""
"4005936","1","4064599","","2010-10-23 20:32:09","0","214","<p>How to use the setBackgroundDrawable method on tablelayout with an URI?</p>","431652","","","","","2011-11-02 08:19:25","TableLayout background from URI","<android><background><tablelayout>","1","0","","",""
"4006036","1","","","2010-10-23 21:00:34","1","566","<p>As the title suggests, how can i get the coordinates of the cursor in the EditText ? im not trying to get the cursor position here but the screen coordinates of the cursor.</p><p>im trying to show a popup relative to that cursor, therefore i need to determine the cursor coordinates first.</p>","485297","","","","","2011-04-20 21:24:09","EditText's cursor coordinates","<android><edittext>","1","0","","",""
"4006360","1","6233658","","2010-10-23 22:16:39","1","3529","<p>I want to send some data (NOT MULTIMEDIA) through an SMS message in Android. Can this be done? I just want to send a very small amount of data from one phone to another, as XML or something.</p>","413414","","","","","2011-06-03 23:38:24","Android: How to send and receive data through SMS messages","<android><sms>","2","1","3","",""
"4006429","1","4008823","","2010-10-23 22:40:15","2","1775","<p>I'm writing an application where I would like to use a few backgrounds that contain the Android ""green robot, and perhaps even one that says Google underneath the robot.</p><p>Is this against the terms of service or does it violate any copyright laws?</p><p>If it is against any laws, will it matter if the app using the icon is free or charged?</p>","432209","","493939","","2012-10-13 19:52:10","2012-10-13 19:52:10","Using Android robot icon inside applications (copyright laws, terms of service)","<android><smartphone>","2","0","","2012-10-14 00:17:45",""
"4006443","1","","","2010-10-23 22:45:03","1","136","<p>it gives me an error when i try to debug android app with antthe error is:           </p><p>-package-debug-sign:[apkbuilder] WARNING: Using deprecated 'basename' attribute in ApkBuilderTask.Use 'apkfilepath' (path) instead.[apkbuilder] WARNING: Using deprecated inner element in ApkBuilderTask.Use instead.</p>","482320","","437301","","2010-10-24 10:55:32","2010-10-24 10:55:32","Error when debugging Android application with ant","<android>","0","0","","",""
"4006468","1","4006587","","2010-10-23 22:53:10","1","2572","<p>Is there way to add, edit or delete records manually in sqlite database in Android Eclipse emulator?</p><p>Thanks</p>","432848","","","","","2010-10-23 23:37:47","Manual add/delete/edit records in sqlite database in Andorid Eclipse emulator?","<android>","1","0","","",""
"4006519","1","","","2010-10-23 23:09:17","1","159","<p>I'm a beginning Android dev and have made a small working app that displays a web page and then has a menu to switch to about 4 other web pages.</p><p>I've just completed the Tab View tutorial and have that working but I would like to display a web page for each tab that is clicked.</p><p>I'm trying to merge my two successes but am having no luck.  I am Reading a lot but would like a pointer on what or where to go next...</p>","485353","","437301","","2010-10-24 09:54:01","2010-10-24 09:54:01","Tab View for web pages","<android><webclient>","0","1","","",""
"4006529","1","","","2010-10-23 23:12:18","2","366","<ol><li>User click one button on Activity#1 to start Activity#2.</li><li>One button on Activity#2 start system default browser(Intent.ACTION_VIEW) to get Twitter authorized.</li><li>After user allow, Twitter redirect user to Activity#2(Custom intent-filter+data) and it save the tokens. </li></ol><p>Now, if I press back key, the app back to browser, how to prevent this and return to Activity#1? Try several Intent.Flag before start browser with no luck.</p><p>Thanks.</p>","485288","","437301","","2010-10-24 09:52:11","2011-04-08 18:09:29","How to prevent saving browser pages in activity stack history","<android><browser><activity><stack><task>","1","0","1","",""
"4006547","1","4006982","","2010-10-23 23:20:06","2","1985","<p>I know the general problem of ""Can't create handler inside thread that has not called Looper.prepare()"" has been asked before, but I am struggling to understand how it applies in this case.  </p><p>I am trying to construct a new CountDownTimer in a non-UI thread, which I guess is the cause of this error, but I don't really understand why the timer would need to be used in the main thread.  From what I can see, it looks like it has a callback handler that needs to run in a thread that has a looper, which the non-UI thread does not have by default.  It seems my options are: 1) Make this non-UI thread have a Looper or 2) make some strange method on my UI thread that can construct this timer, both which seem goofy to me.  Can someone help me understand the implications?  </p><p>Also, does anyone know of any useful links that shed light on the Looper and MessageQueue?  I don't grasp them well, as I am sure I have shown.  Thank you!</p>","469106","","403455","","2012-07-27 18:34:51","2012-07-27 18:34:51","CountDownTimer: ""Can't create handler inside thread that has not called Looper.prepare()""","<android><multithreading><countdowntimer><looper>","1","0","","",""
"4006583","1","4007716","","2010-10-23 23:33:41","0","590","<p>Is there a way to information on the camera buit into the phone?</p><p>Things like...</p><ul><li>if there is a camera!</li><li>resolution</li><li>if a flash is present</li></ul>","310678","","168868","","2013-10-18 19:33:02","2013-10-18 19:33:02","Android camera information","<android><android-camera>","1","2","","",""
"4006601","1","4006628","","2010-10-23 23:41:46","0","249","<p>Can you find the IP address of a freinds phone using their phone number? </p>","310678","","","","","2010-10-23 23:51:32","Android sending data phone to phone","<android><networking><ip-address>","1","0","","",""
"4006637","1","4147073","","2010-10-23 23:57:06","8","1067","<p>For example, if each row in a list had a background that was a gradient, would it be better to use a image of a gradient or to define that gradient in a shape drawable in xml?  Is there is significant performance difference between the two methods?</p>","445348","","","","","2010-11-10 17:13:19","Performance wise, what is typically better, using an image or a xml created shape as a drawable?","<android><image><drawable><shape>","2","0","2","",""
"4006715","1","4006732","","2010-10-24 00:31:26","0","217","<p>The title is basically all there is too it. I have an array of file objects...</p><pre><code>File[] myFiles = myDirectory.listFiles();</code></pre><p>And I want to convert it to an array of strings. (String[])</p>","478297","","478297","","2010-10-24 00:39:45","2010-10-24 06:30:30","File[] to String[]","<java><android><arrays>","4","5","","",""
"4006737","1","4371922","","2010-10-24 00:47:19","4","808","<p>Ok, this is a really weird one. </p><p>I'm sending Latitude/Longitude to Emulator running my App and its getting the wrong Coordinates !!! Everything I send (either via DDMS using GPX file, DDMS Manual, or telnet and using geo fix command), gets received, but when I print the latitude/longitude points received by the app, there are off by just a little bit (well a few hundred yards to where I was aiming for).</p><p>Discovered this because I've always tested my app on a PC, but recently purchased a Mac. So I'm going through my standard tests, using the GPX file with lat/long points that I always used on the PC, and the app is showing the wrong location. </p><p>Example: I send this: geo fix geo fix -72.74 41.74And in my app, onLocationChanged, location.toString() says this:Location[mProvider=gps,mTime=1287892837000,mLatitude=<strong>41.74016776666667</strong>,mLongitude=<strong>-72.74533443333333</strong>,mHasAltitude=false,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=false,mAccuracy=0.0,mExtras=Bundle[mParcelledData.dataSize=4]]</p><p>I mean what the heck?? Tested with Google Maps also, and if I select myLocation, it goes to the same wacky coordinates instead of the actual ones I sent.</p><p>Looks like some weird math or conversion issue, since the numbers are close, but not exact.</p><p><strong>Again, this all works fine on the PC,</strong> meaning, on the PC it gets the exact coordinates that I send. For the Emulator I created an avd using AVD manager, WVGA854, Google API Level 8.</p><p>Running on new MacBook pro, and new Eclipse Helios install and new install of Android SDK.</p>","483163","","","","","2010-12-07 16:06:35","Wrong Latitude/longitude received in Android Emulator on Mac","<android><osx><ddms>","1","1","","",""
"4006739","1","","","2010-10-24 00:48:15","0","1388","<p>Can I make ImageView in android make some action when I click on that ImageView ?For example, when I click on ImageView imgV that some panel be visible and when I click on other ImageView imgUV that he become unvisible .</p><pre><code>imgV.setOnClickListener( new OnClickListener() {            public void onClick(View v)            {                    int i=tbrSearchNear.VISIBLE;                    tbrSearchNear.setVisibility(1-i);                    tbrSearchCriterium.setVisibility(i);            }            });</code></pre><p>It looks like that doesn't register click at all .</p>","485284","","","","","2010-10-24 07:52:05","ImageView click problem - Android","<android>","2","0","","",""
"4006792","1","","","2010-10-24 01:14:15","0","76","<p>I have the live view working, I was just wondering if it is possible within the constraints of Android to manipulate colors coming in from the phone's hardware in real-time.  For instance, would it be possible to make it so that red's display as green, certain colors are more or less vibrant, etc. within a live view window.  Thanks.</p>","485394","","","","","2010-12-10 17:54:37","Is it possible to manipulate the way colors are displayed coming in from the camera in Android?","<android>","1","0","","",""
"4006959","1","4007793","","2010-10-24 02:46:02","0","508","<p>I obviously new and have been trying to two days to figure out how to save the state of my main activity to no avail. I would appreciate any help. When I launch the ShowDetail activity and return to the main activity I have no data in the list. I have two xml files a main.xml and a item.xml file. main is just a listview and a textview. Item.xml is 3 textviews for the data in the list. Item Here is the code from my main activity:</p><pre><code>public class main extends ListActivity {</code></pre><p>private EventsData events;</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);            setContentView(R.layout.main);    events = new EventsData(this);    try {     Cursor cursor = getEvents();     showEvents(cursor);    } finally {     events.close();    }}@Overridepublic void onSaveInstanceState(Bundle savedInstanceState){ super.onSaveInstanceState(savedInstanceState);}@Overridepublic void onRestoreInstanceState(Bundle savedInstanceState){ super.onRestoreInstanceState(savedInstanceState);}@Overridepublic void onPause(){ super.onPause();}@Overridepublic void onRestart(){ super.onRestart();}private static String[] FROM = { CODE, EXCERPT, _ID, };private static String ORDER_BY = CODE + "" ASC"";private Cursor getEvents() { SQLiteDatabase db = events.getReadableDatabase(); Cursor cursor = db.query(TABLE_NAME, FROM, null, null, null, null, ORDER_BY); startManagingCursor(cursor); return cursor;}private static int[] TO = { R.id.code, R.id.excerpt, };private void showEvents(Cursor cursor) { SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,    R.layout.item, cursor, FROM, TO); setListAdapter(adapter);}private static String[] MIKEY = { _ID, CODE, DEFINITION };protected void onListItemClick(ListView l, View v, int position, long id) { Cursor cursor = ((CursorAdapter)getListAdapter()).getCursor(); cursor.getLong(2); SQLiteDatabase db = events.getReadableDatabase(); Cursor c = db.query(TABLE_NAME, MIKEY, ""_id = ""+cursor.getLong(2)+"""", null, null, null, null); c.moveToFirst(); Intent in1  = new Intent(); Bundle bun = new Bundle(); bun.putLong(""id"", c.getLong(0)); bun.putString(""code"", c.getString(1)); bun.putString(""definition"", c.getString(2)); in1.setClass(this, ShowDetail.class); in1.putExtras(bun); startActivity(in1);}</code></pre><p>}</p>","485419","","485419","","2010-10-24 06:42:00","2010-10-24 10:04:47","How to save the instancestate of my activity","<android><listview><activity><listactivity>","1","0","","",""
"4007282","1","4007293","","2010-10-24 05:12:11","1","805","<p>I want to develop a program using the Java MSN Messenger library (<a href=""http://sourceforge.net/apps/trac/java-jml"" rel=""nofollow"">JML</a>). I can not solve a problem where the following exeception is thrown.</p><pre><code>ERROR/AndroidRuntime(312): FATAL EXCEPTION: Thread-21**ERROR/AndroidRuntime(312):     java.lang.ExceptionInInitializerErrorERROR/AndroidRuntime(312):     at net.sf.jml.protocol.incoming.IncomingUSR$1.getLoginTicket(IncomingUSR.java:198)ERROR/AndroidRuntime(312):     at net.sf.jml.protocol.incoming.IncomingUSR$1.run(IncomingUSR.java:247)ERROR/AndroidRuntime(312):     Caused by: java.lang.NoClassDefFoundError: sun.security.action.GetPropertyActionERROR/AndroidRuntime(312):     at net.sf.jml.util.StringUtils.&lt;clinit&gt;(StringUtils.java:58)ERROR/AndroidRuntime(312):                     ... 2 more**</code></pre><p>How to fix it?</p>","479187","","63550","","2010-10-26 22:43:05","2011-08-26 11:53:35","My program, that uses the Java MSN Messenger library, is in error","<android>","2","0","","",""
"4007486","1","","","2010-10-24 08:01:28","2","2061","<p>I'm developing a mobile Flash application (not an AIR app) running in the browser. According to Adobe:</p><blockquote>  <p>Flash Player 10.1 provides support for  use of native device virtual keyboards  with TextField support if no physical  keyboard is detected. A virtual  keyboard is automatically raised and  lowered in response to focus changes  on text fields when editing text on  mobile devices supporting a virtual  keyboard to enable unobstructed and  intuitive text editing. The focused  text field is centered in the visible  region of the page and appropriately  zoomed/scrolled to ensure it is not  obscured by the virtual keyboard. Upon  screen rotation, incoming calls, or  other system events, any already  existing text input is retained. The  virtual keyboard works with TextField  but does not currently work with the  Text Layout Framework or other Flash  Text Engine text.</p></blockquote><p>I'm listening for a tap event (which works) that sets <code>stage.focus = input;</code> which also is working. However, the virtual keyboard is not triggered.</p><p>I am testing on an HTC Evo.</p>","464847","","","","","2011-01-10 14:14:22","Opening software keyboard on Android Flash 10.1","<android><flash><actionscript-3><player>","1","1","1","",""
"4007591","1","","","2010-10-24 08:50:27","1","99","<p>I am writing an Android app, which is basically a quiz. A it contains pictures of animals and the user must click on the correct picture.The pictures are all png files used as background pictures for button views.</p><p>The problem I have/had is with the onCLick method.THis is the code. </p><pre><code>public void onClick(View view) {    if(view == r1){        if (correct == 0){            tally++;}        total++;        score.setText(""Score: "" + tally + "" out of "" + total );        rg.clearFocus();        rg.clearCheck();        new Thread(new Runnable() {            public void run() {                quest.post(new Runnable() {                    public void run() {                        correct = nextQ();                    }                });            }        }).start();    }    if (view == r2){        if (correct == 1){            tally++;}        total++;        score.setText(""Score: "" + tally + "" out of "" + total );        rg.clearFocus();        rg.clearCheck();        new Thread(new Runnable() {            public void run() {                quest.post(new Runnable() {                    public void run() {                        correct = nextQ();                    }                });            }        }).start();    }    if (view == r3){        if (correct == 2){            tally++;}        total++;        score.setText(""Score: "" + tally + "" out of "" + total );        rg.clearFocus();        rg.clearCheck();        new Thread(new Runnable() {            public void run() {                quest.post(new Runnable() {                    public void run() {                        correct = nextQ();                    }                });            }        }).start();    }}</code></pre><p>r1,r2.r3 are all buttons, and quest is the question TextView. My first attempt at doing this worked fine, except one problem - it crashed a lot. I didn't use the thread you se in the code above. I also had a fourth button r4. After investigating on the internet I found that making Android search and select pictures can cause problems and it is best to put this in another thread. So I did that, and it is shown in the code above. It still crashed, so I took out the fourth button. It now works fine, but I'm not sure why.</p><p>My question is, can anyone tell me how to do this correctly? I mean when a button is clicked, new pictures are randomly generated from a section. All the pictures are stored in the drawable folder, it doesn't grab them online.</p>","485498","","162407","","2010-10-24 09:02:15","2010-10-24 09:02:15","Problem using image files in Android","<android><multithreading><image><crash><onclick>","0","2","","",""
"4007628","1","","","2010-10-24 08:59:31","1","5437","<p>I wish to find out how to get following details in android:</p><p>·           Account name</p><p>·         POP3 address</p><p>·         SMTP address</p><p>·         Username</p><p>·         OWA address if connecting through Exchange</p><p>·         Internet profile through which it is connected.</p>","469853","","","","","2010-10-24 09:22:08","get email account name programmatically android","<android><email><shared>","1","0","","",""
"4007723","1","4009095","","2010-10-24 09:39:49","2","382","<p>I have 2 activities.</p><p>Activity 1 is the 'Homepage' which consists of one spinner.</p><p>Activity 2 will be started once an item from the spinner has been selected in Activity 1. The value of the item will also be passed into Activity 2.</p><p>Actvity 2 also has the same spinner as Actvity 1.</p><p>I would like to make a varible (TABLE_NAME in the code below) whose value will be the selection made in Activity 1 when Activity 2 is initally started but after that the variable value will be the selection made in Activity 2.</p><p>Is there an easy way to identify if an activity has just been started?</p><p>I've tried to show what I want in the code below:</p><p>public class MyOnItemSelectedListener implements OnItemSelectedListener {</p><pre><code>    public void onItemSelected(AdapterView&lt;?&gt; parent,        View view, int pos, long id) {                      if(this activity was just started)            {Intent sender=getIntent();        String TABLE_NAME=sender.getExtras().getString(""TABLE_NAME"");}            else            {TABLE_NAME = parent.getItemAtPosition(pos).toString();}                    Cursor cursor = getStats(TABLE_NAME);                     showStats(cursor);    }    public void onNothingSelected(AdapterView&lt;?&gt; parent) {      // Do nothing.    }}</code></pre>","485508","","485508","","2010-10-24 13:52:59","2010-10-26 18:10:39","Identify if an activity has just been started","<android>","2","4","","",""
"4007774","1","","","2010-10-24 09:57:44","0","381","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/587584/what-is-the-preferred-way-to-declare-a-java-array"">What is the preferred way to declare a Java array?</a><br>  <a href=""http://stackoverflow.com/questions/129178/difference-between-int-array-and-int-array"">Difference between int[] array and int array[]</a>  </p></blockquote><p>Hi!</p><p>Been learning Java for Android by reading some tutorials.  And in lots of the tutorials there are used two different ways of declaring arrays - even in the same project:</p><pre><code>public int integers[] = { ... };public int[] integers = { ... };</code></pre><p>Does it matter or are these two basically the same?</p>","324943","","","","","2010-10-24 11:50:38","Declaring arrays","<java><android>","0","0","0","2010-10-24 13:05:54",""
"4007809","1","","","2010-10-24 10:08:51","1","770","<p>I have an application which using a sync adapter and one of the requirements is to have a notification in the status bar.</p><p>I added a notification but the problem is that there is also a system icon which is displayed but only part of the time during the sync operation.</p><p>I would like to use one (just one) of the icons.</p><p>Does anyone know a way how to use/display the system sync icon or how to disable it completely?</p><p>I've noticed that it's displayed when I insert records to the DB with the URI parameter: CALLER_IS_SYNCADAPTER, BUT it also displayed without that.</p><p>Thanks in advance,</p><p>Erez</p>","481697","","","","","2010-10-24 11:08:51","Using the system sync notification in android 2.1","<android><notifications><sync><adapter>","0","0","","",""
"4007860","1","4389675","","2010-10-24 10:27:12","6","5577","<p>I'm looking for a SIP stack to use on the Android platform. Since it's for a client, to be used for commercial purposes, GPL'ed stacks are not feasible. </p><p>What would you recommend, SO?</p>","359343","","","","","2014-03-21 04:55:42","Looking for a SIP Stack for Android","<android><sip>","5","0","4","2014-02-15 03:55:14",""
"4007963","1","4008974","","2010-10-24 11:08:49","1","1385","<p>I'm learning Java and OpenGL ES for Android by reading tutorials and applying what I already know.  And I have now hit a brick wall when it comes to rotating an object.</p><p>Rotating a cube by touching the screen is no problem.  But if I rotate the cube 180 degrees up or down, then when I now try to rotate the cube left or right it is inverted.  I know why this is happening but I cannot find a solution.</p><p>The code is below if some want to test it:</p><p>File ""Rotating.java"":</p><pre><code>package com.test.opengl;import android.app.Activity;import android.os.Bundle;import android.view.Window;import android.view.WindowManager;public class Rotating extends Activity {    private GLControlView glControlView;    @Override    public void onCreate( Bundle savedInstanceState ) {        super.onCreate( savedInstanceState );        this.requestWindowFeature( Window.FEATURE_NO_TITLE );        getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );        glControlView = new GLControlView( this );        setContentView( glControlView );    }}</code></pre><p>File ""GLControlView.java"":</p><pre><code>package com.test.opengl;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.content.Context;import android.opengl.GLSurfaceView;import android.opengl.GLU;import android.opengl.GLSurfaceView.Renderer;import android.view.MotionEvent;public class GLControlView extends GLSurfaceView implements Renderer {    private Context context;    private float xPrevious, yPrevious;    private float xRotation = 0.0f, yRotation = 0.0f;    private SimpleCubeObject cubeObject;    public GLControlView( Context context ) {        super( context );        this.context = context;        this.setRenderer( this );        this.requestFocus();        this.setFocusableInTouchMode( true );        cubeObject = new SimpleCubeObject();    }    public void onSurfaceCreated( GL10 gl, EGLConfig config ) {        gl.glClearColor( 0.0f, 0.0f, 0.0f, 0.5f );        gl.glShadeModel( GL10.GL_SMOOTH );        gl.glClearDepthf( 1.0f );        gl.glEnable( GL10.GL_DEPTH_TEST );        gl.glDepthFunc( GL10.GL_LEQUAL );        gl.glHint( GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST );    }    public void onDrawFrame( GL10 gl ) {        gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT );        gl.glLoadIdentity();        gl.glTranslatef( 0.0f, 0.0f, -10.0f );        gl.glPushMatrix();        gl.glRotatef( xRotation, 1.0f, 0.0f, 0.0f );        gl.glRotatef( yRotation, 0.0f, 1.0f, 0.0f );        gl.glPushMatrix();        cubeObject.draw( gl );        gl.glPopMatrix();        gl.glPopMatrix();    }    public void onSurfaceChanged( GL10 gl, int width, int height ) {        gl.glViewport( 0, 0, width, height );        gl.glMatrixMode( GL10.GL_PROJECTION );        gl.glLoadIdentity();        GLU.gluPerspective( gl, 45.0f, ( ( float )width / ( float )height ), 0.1f, 100.0f );        gl.glMatrixMode( GL10.GL_MODELVIEW );        gl.glLoadIdentity();    }    @Override    public boolean onTouchEvent( MotionEvent event ) {        float xEvent = event.getX();        float yEvent = event.getY();        switch( event.getAction() ) {            case MotionEvent.ACTION_DOWN: {                xPrevious = xEvent;                yPrevious = yEvent;                return true;            }            case MotionEvent.ACTION_MOVE: {                float xDelta = xEvent - xPrevious;                float yDelta = yEvent - yPrevious;                xRotation += ( yDelta * 0.5f );                yRotation += ( xDelta * 0.5f );                xPrevious = xEvent;                yPrevious = yEvent;                return true;            }            default: return super.onTouchEvent( event );        }    }}</code></pre><p>File ""SimpleCubeObject.java"":</p><pre><code>package com.test.opengl;import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.FloatBuffer;import java.nio.ShortBuffer;import javax.microedition.khronos.opengles.GL10;public class SimpleCubeObject {    private int[] textures = new int[ 1 ];    private float[] colors = {            0.0f, 0.0f, 0.0f, 1.0f,            1.0f, 0.0f, 0.0f, 1.0f,            0.0f, 1.0f, 0.0f, 1.0f,            0.0f, 0.0f, 1.0f, 1.0f,            1.0f, 0.0f, 1.0f, 1.0f,            0.0f, 1.0f, 1.0f, 1.0f,            1.0f, 1.0f, 0.0f, 1.0f,            1.0f, 1.0f, 1.0f, 1.0f    };    private short[] indices = {            0, 1, 2, 0, 2, 3,            1, 5, 6, 1, 6, 2,            2, 6, 7, 2, 7, 3,            3, 7, 4, 3, 4, 0,            0, 4, 5, 0, 5, 1,            7, 6, 5, 7, 5, 4    };    private float[] vertices = {            -1.0f,  1.0f, -1.0f,            -1.0f,  1.0f,  1.0f,             1.0f,  1.0f,  1.0f,             1.0f,  1.0f, -1.0f,            -1.0f, -1.0f, -1.0f,            -1.0f, -1.0f,  1.0f,             1.0f, -1.0f,  1.0f,             1.0f, -1.0f, -1.0f    };    private FloatBuffer colorBuffer;    private ShortBuffer indexBuffer;    private FloatBuffer vertexBuffer;    public SimpleCubeObject() {        ByteBuffer cbb = ByteBuffer.allocateDirect( colors.length * 4 );        cbb.order( ByteOrder.nativeOrder() );        colorBuffer = cbb.asFloatBuffer();        colorBuffer.put( colors );        colorBuffer.position( 0 );        ByteBuffer ibb = ByteBuffer.allocateDirect( indices.length * 2 );        ibb.order( ByteOrder.nativeOrder() );        indexBuffer = ibb.asShortBuffer();        indexBuffer.put( indices );        indexBuffer.position( 0 );        ByteBuffer vbb = ByteBuffer.allocateDirect( vertices.length * 4 );        vbb.order( ByteOrder.nativeOrder() );        vertexBuffer = vbb.asFloatBuffer();        vertexBuffer.put( vertices );        vertexBuffer.position( 0 );    }    public void draw( GL10 gl ) {        gl.glFrontFace( GL10.GL_CCW );        gl.glEnable( GL10.GL_CULL_FACE );        gl.glCullFace( GL10.GL_BACK );        gl.glBindTexture( GL10.GL_TEXTURE_2D, textures[ 0 ] );        gl.glEnableClientState( GL10.GL_COLOR_ARRAY );        gl.glEnableClientState( GL10.GL_TEXTURE_COORD_ARRAY );        gl.glColorPointer( 4, GL10.GL_FLOAT, 0, colorBuffer );        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.glDisableClientState( GL10.GL_COLOR_ARRAY );        gl.glDisable( GL10.GL_CULL_FACE );    }}</code></pre><p>I sure hope someone can help me with this.  I believe, as always, that the solution is simple and easy - it is just me who can't see it right now.</p>","324943","","44729","","2010-10-25 13:43:28","2010-10-25 13:43:28","OpenGL rotating problem","<java><android><opengl-es>","3","0","","",""
"4007976","1","4009144","","2010-10-24 11:15:51","4","2017","<p>I am teaching myself Android using Eclipse, the Android plug-in, and Sams ""Teach Yourself Android Development"" book.  I have this weird little problem.  I've been able to create xml files in the res/values directory that hold strings and color values (colors.xml and strings.xml).  I have been able to reference these values in the properties of my Android screens (the xml in res/layout), for example setting the ""Text"" and ""Text color"" properties with references like ""@string/topTitle"" and ""@color/titleColor,""  where topTitle and titleColor are defined in the xml files.  </p><p>BUT: when I create a file called ""dimens.xml"" and have font sizes in it, Eclipse correctly puts this file in res/values, but when I try to reference these values, e.g. ""@dimension/titleFont"" I get an error ""No resource found that matches the given name.""  I've tried lots of different names, I've tried ""@dimens"" instead of the type, still nothing.  If I go into the layout xml file and set it explicitly to a font size, e.g. 22pt, it works.  </p><p>So Eclipse recognized my ""dimens.xml"" file when I made it well enough to put it in res/values, and lets me edit it, and shows it full of (dimension) values.  It just doesn't recognize my referring to it in other xml files.</p><p>The book I'm using doesn't actually show a dimension example so I must be doing something wrong.  I checked the Android docs but couldn't see any problem.</p><p>Any help appreciated. Thanks.</p>","485548","","485548","","2010-10-24 11:34:38","2010-10-24 16:31:24","Eclipse + Android not recognizing my (dimension) values","<android><eclipse-plugin>","1","0","2","",""
"4007985","1","4007993","","2010-10-24 11:18:17","1","546","<p>how do i disable the back button function to do nothing ?</p>","434885","","","","","2010-10-24 11:22:54","android key disable","<android>","1","1","","",""
"4008015","1","","","2010-10-24 11:33:15","15","8931","<p>I need to sync my Android SQLite DB with my cloud-server DB, and doing it in a bi-directional way in a multiuser environment.</p><p>I have found and introduction to the solution <a href=""http://blog.deeje.tv/musings/2009/06/notes-on-writing-a-history-driven-client-server-synchronization-engine.html"" rel=""nofollow"">here</a> but I would like to read about a better solution/algorithm.</p>","406222","","1077789","","2012-07-07 15:51:04","2014-01-22 01:02:12","android sqlite bidirectional synchronization sqlite","<android><database><sqlite><data-synchronization>","2","0","6","",""
"4008081","1","","","2010-10-24 11:51:28","15","8858","<p>I have written a service with a remote interface and installed it on my PC's Eclipse AVD. I have a client test harness which starts and invokes methods in the service. Initially I had the service installed by a control class and activity, which I have now removed, so that the manifest for the service looks like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifestxmlns:android=""http://schemas.android.com/apk/res/android""package=""com.myname.gridservice""android:versionCode=""1""android:versionName=""1.0""&gt;&lt;application    android:icon=""@drawable/icon""    android:label=""@string/app_name""    android:debuggable=""true""&gt;    &lt;service        android:enabled=""true""        android:debuggable=""true""        android:name=""OverlayService""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.myname.OverlayService.SERVICE""/&gt;            &lt;action android:name=""com.myname.gridservice.IRemoteInterface"" /&gt;        &lt;/intent-filter&gt;    &lt;/service&gt; &lt;/application&gt;  &lt;/manifest&gt;   </code></pre><p>so there's no activity tag.  </p><p>When I launch it from the debug icon  in Eclipse, the console tells me it's installing the apk (which it is), but it does not appear as a debug thread and breakpoints aren't triggered, although the service's behaviour is OK as far as the client sees it. If I wrap the service tag in an activity tag which has an associated class and launch that, then I can debug it</p><p>Is it possible to debug the service without wrapping it in an activity?</p>","440010","","","","","2013-06-10 17:01:05","Debugging a service","<android><android-manifest>","3","2","1","",""
"4008089","1","","","2010-10-24 11:54:09","1","1776","<p>I want to write an app to send an sms from a shortcut on a home screen. That is all.</p><p>I just can't understand within the framework how I can write such an app. Here's what I've tried so far and what my ideas are:</p><ol><li>I wrote an activity that sends an sms using SmsManager within the onCreate() however, this just keeps on sending messages even though the code is not in a loop. I realise I must be not be using an activity the way it's designed to be used. The android application fundamentals article says an activity is for displaying a screen or gui, but I don't need a gui. I just don't know what component I need to to use.</li></ol><p>A service? no, because I don't need something running forever in the background.An activity? I guess no because I don't need a gui.</p><p>I had an idea to create a broadcast receiver which would respond to a broadcast, so my sens smsm code would be in there ready to send when it receives the signal. But how do i send the signal from an app shortcut on the home screen? What would be the entry point of the app.</p><p>I'm just really confused, I've read the tutorials and the app fundamentals and searched forums and not found the answer. There's is just a big gap in my knowledge of the android framework that needs filling I guess, once it clicks I'll be fine but I'm just stuck right now.</p><p>Thanks people.</p>","485570","","407438","","2010-10-24 11:55:34","2010-10-25 08:03:13","simple app which sends one sms without gui required","<android><sms>","1","0","1","",""
"4008108","1","","","2010-10-24 12:01:49","-1","5005","<p>i want to override the method onWindowFocusChanged, but everytimei write it elcipse gives me a error message saying @override annotation is wrong, which means that i am not overriding the method but creating a new one.</p><p>maybe i havnt included the package necessary ??? </p>","434885","","","","","2012-04-20 05:56:48","android onWindowFocusChanged","<android>","3","1","","2013-01-11 01:43:15",""
"4008141","1","","","2010-10-24 12:11:54","3","286","<p>I'm using a ListView with an ArrayAdapter, and code executing after <code>ListView.setAdapter(ArrayAdapter,...)</code> is seeing <code>ListView.getChildCount()==0</code>.</p><p>Is there a way t wait for the UI thread to finish filling the ListView before continuing?</p><p>Thanks in advance,Lenny</p>","485576","","684803","","2012-05-08 01:46:08","2012-05-08 01:46:08","ListView: how do I wait until it's loaded up?","<android><listview>","2","0","","",""
"4008273","1","4010542","","2010-10-24 12:52:27","0","3372","<p>I am facing a weird behavior regarding the subject.</p><p>I have a very simple layout containing only an empty <em>RelativeLayout</em>.</p><p>Once I have input form the user this relative layout is filled with square tiles to achieve a mosaic-like effect. Each tile is made by a FrameLayout containing two images (only one is drawn at any given time). It is not possible for me to put the tiles in the XML layout because I do not know in advance how many of them I will need.</p><p>In the <em>onSizeChanged</em> of my relative layout, I force a resize on all the tiles to fit the new size.</p><p>The code is something like this:</p><pre><code>public void resizeTiles(int w, int h) {    int l1 = w / X; int l2 = h / Y;    int tileS = (l1 &lt;= l2 ? l1 : l2);    android.view.ViewGroup.LayoutParams lp;    for (Tile t : myTiles) {        lp = t.getLayoutParams();        lp.width = tileS;        lp.height = tileS;    }}</code></pre><p>In my manifest file I have the following:</p><pre><code>&lt;uses-sdk     android:minSdkVersion=""4""    android:targetSdkVersion=""4""/&gt;</code></pre><p>Thus, target system is 1.6.</p><p>So far so good, this is working like a charm ... but only on 2.2.</p><p>The same binary placed on emulator 2.1-update1 or previous is giving me back an empty layout (I also tried a couple of physical devices, same result).</p><p>Debugging, I tracked down the problem is in the resize; commenting out width and height assignments I see the tiles but with distorted proportions.</p><p>Any suggestion on how to make this working ?</p><p>Thanks in advance.</p>","485587","","","","","2010-10-24 21:27:06","Programmatically resize of view depends on android version?","<android><layout>","1","0","2","",""
"4008290","1","4732658","","2010-10-24 12:57:12","2","108","<p>I was looking at my application (designed for 1.6) that uses the DatePicker controls on a HTC Desire the other day, and the owner of the phone showed me the native calendar program which uses much much nicer controls, i.e. the datepicker you can touch and scroll rather than having to repeatedly press the buttons to adjust days/months/year.</p><p>So my question is does anyone know if these sense controls can be automatically used in place of the stock datepicker controls?  I would ideally like my app to run on older devices i.e. 1.6 but show the nicer UI elements if running on a device that has the sense UI.</p><p>Thanks </p>","333276","","","","","2011-01-19 07:14:38","How to utilise Sense UI widgets?","<android>","1","0","","",""
"4008446","1","","","2010-10-24 13:34:45","0","1403","<p>Greetings  I am creating a service client and the following lines give meerror.  I was wondering how to fix these...</p><pre><code>//  I have put in the service client stuff below...private  CheckZone mBoundService;private ServiceConnection mConnection = new ServiceConnection() {public void onServiceConnected(ComponentName CheckZone, IBinder service) {    // This is called when the connection with the service has been    // established, giving us the service object we can use to    // interact with the service.  Because we have bound to a explicit    // service that we know is running in our own process, we can    // cast its IBinder to a concrete class and directly access it.    mBoundService = ((CheckZone.LocalBinder)service).getService();    //This line complians about binding, and states that it can not be resolved.  How do I fix this please?    Toast.makeText(binding.this, ""Connected to CheckZone"", Toast.LENGTH_SHORT).show();}</code></pre>","383760","","592182","","2011-05-08 23:05:17","2011-05-08 23:05:17","Android service client code","<android><service>","3","1","","",""
"4008461","1","","","2010-10-24 13:37:04","0","1098","<p>HiIn my android app I can make calls to Twitter api immediately after I login. I am using same instance of OAuthConsumer. But when I create  OAuthconsumer for subsequent call and use setTokenWithSecret I get Incorrect signature error. </p><p>I spent few hours trying to debug but no luck... any help is appreciated.</p><p>Following is code ...in onnewIntent if statement 1== 1 works but I get Incorrect signature error If I call verify method on Twitter adapter </p><pre><code>private static String TAG = ""OAuthForTwitter"";private CommonsHttpOAuthConsumer httpOauthConsumer;private OAuthProvider httpOauthprovider;public final static String consumerKey = """";public final static String consumerSecret = """";private final String CALLBACKURL = ""myapp://mainactivity"";@Overrideprotected void onNewIntent(Intent intent) {    super.onNewIntent(intent);    Log.d(TAG, ""onNewIntent"");    Uri uri = intent.getData();    if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACKURL)) {        String verifier = uri                .getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);        Log.d(TAG, ""onNewIntent  "" + "" verifier "" + verifier);        try {            httpOauthprovider.retrieveAccessToken(httpOauthConsumer,                    verifier);            String userKey = httpOauthConsumer.getToken();            String userSecret = httpOauthConsumer.getConsumerSecret();            if (1 == 1) {                String surl = ""http://api.twitter.com/1/account/verify_credentials.xml"";                HttpGet request = null;                HttpClient httpClient = null;                HttpResponse response = null;                request = new HttpGet(surl);                httpOauthConsumer.sign(request);                System.out.println(""Sending request to Twitter..."");                httpClient = new DefaultHttpClient();                response = httpClient.execute(request);                String sresponse = parseResponseToString(response);                Log.d(TAG, sresponse);            } else {                TwitterAdapter adapter = new TwitterAdapter(null,                        consumerKey, consumerSecret, userKey, userSecret);                String s = adapter.VerifyUser();                Log.d(TAG, s);            }        } catch (Exception e) {            Log.d(TAG, ""onNewIntent error "" + e.getMessage());        }    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    doOauth();}private void doOauth() {    try {        httpOauthConsumer = new CommonsHttpOAuthConsumer(consumerKey,                consumerSecret);        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);        this.startActivity(new Intent(Intent.ACTION_VIEW, Uri                .parse(authUrl)));        Log.d(TAG, ""sent doOauth"");    } catch (Exception e) {        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();    }    Log.d(TAG, "" doOauth Complete"");}public class TwitterAdapter {    oauth.signpost.commonshttp.CommonsHttpOAuthConsumer httpOauthConsumer;    public TwitterAdapter(String username, String consumerkey,String consumersecret, String accesstoken, String accesssecret) {        httpOauthConsumer = new CommonsHttpOAuthConsumer(consumerkey, consumersecret);        httpOauthConsumer.setTokenWithSecret(accesstoken, consumersecret);    }    public String VerifyUser() throws ClientProtocolException, IOException,            OAuthMessageSignerException, OAuthExpectationFailedException,            OAuthCommunicationException {        String surl = ""http://api.twitter.com/1/account/verify_credentials.xml"";        HttpGet request = null;        HttpClient httpClient = null;        HttpResponse response = null;        request = new HttpGet(surl);        httpOauthConsumer.sign(request);        System.out.println(""Sending request to Twitter..."");        httpClient = new DefaultHttpClient();        response = httpClient.execute(request);        return parseResponseToString(response);    }}</code></pre><p>}</p>","485604","","485604","","2010-10-24 13:44:09","2011-02-27 00:10:08","Incorrect signature while accessing Twitter api on android","<android><twitter><oauth>","3","0","","",""
"4008495","1","","","2010-10-24 13:47:41","1","1816","<p>I'm using a raw resource by creating a folder res/raw/myfile and then using the code InputStream is = Resources.getSystem().openRawResource(R.raw.myfile);</p><p>This code throws a resource not found exception and in the logs it says ""resources don't contain package for resource number 0x7f04000""</p><p>The code I used above is by my guess the correct one. All the other examples I've seen are not possible (2.1 sdk) as they may be old examples.</p><p>I've cleaned and built and used a fresh avd.My R.java looks like thispublic static final class raw {        public static final int myfile=0x7f040000;    }</p>","485621","","","","","2010-10-25 04:52:04","Android raw resource can't be found","<android><resources>","1","0","","",""
"4008520","1","","","2010-10-24 13:54:03","3","1328","<p>I have made an Application in Java that transmits video  (JMF= ""JAVA MEDIA FRAMEWORK""). Now I want an Android client for receiving video.  What steps do i follow to make such client.  I have seen that JMF doesnt work on Android.  I want to know best way of doing it in Android platform .</p>","485623","","2961","","2011-10-21 08:54:46","2011-10-21 08:54:46","Video Streaming in Android","<android><streaming><video-streaming><jmf>","1","0","2","",""
"4008571","1","4019350","","2010-10-24 14:06:55","4","5325","<p>I'm working on a ListActivity which will display a bunch of numbers (weights). I would like to change the background of a specific row in the ListView. To do this I have created a custom implementation of the ArrayAdapter class and have overridden the getView method. The adapter accepts a list of numbers and sets the background of the row with the number 20 to yellow (for simplicity reasons).</p><pre><code>    public class WeightListAdapter extends ArrayAdapter&lt;Integer&gt; {    private List&lt;Integer&gt; mWeights;    public WeightListAdapter(Context context, List&lt;Integer&gt; objects) {        super(context, android.R.layout.simple_list_item_1, objects);        mWeights = objects;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View v = super.getView(position, convertView, parent);        int itemWeight = mWeights.get(position);        if (itemWeight == 20) {            v.setBackgroundColor(Color.YELLOW);        }        return v;    }}</code></pre><p>The problem is that not only the row with the number 20 gets the yellow background but also the row with the number 0 (the first row that is) and I'm not sure why this is so.</p><p>Am I doing something wrong in the getView method (like calling the super method)? My reasoning for the implementation is: All the returned views should be the same (that's why I'm calling the super method) only the view fitting the if criteria should be changed.</p><p>Thanks for your help!</p>","404200","","948041","","2013-05-09 09:15:48","2013-05-09 09:15:48","Custom ArrayAdapter setBackground in getView","<android><listview><android-arrayadapter>","3","0","1","",""
"4008627","1","4729529","","2010-10-24 14:18:25","11","6868","<p>I would like to test the behavior of my application when the user is in a no-signal zone or when his phone is in flight mode.</p><p>-> <strong>How do I put an Android Virtual Device into offline mode</strong> (where no connection to the internet is possible) ?</p><p>I have tried the following:</p><ul><li><p>Activating flight mode via the AVD settings: surprisingly, this does NOT work (browsing  the internet is still possible in flight mode!)</p></li><li><p>Disabling the network connection on my PC: this obviously works, but is not satisfactory as I need Internet when I am testing my app</p></li></ul>","479851","","213269","","2011-03-22 08:29:15","2013-01-04 14:46:53","How to put an AVD (emulator) into OFFLINE mode?","<android><avd>","9","2","1","",""
"4008631","1","","","2010-10-24 14:20:11","1","1202","<p>I have installed eclipse 5.2 in ubuntu 10.10. In the 'Install New Software', it show Android Developments Installed. And when i goto preferences window, Android is not listed in the left panel. Already i was running Android SDK in ubuntu 10.04, after i upgraded ubuntu OS, eclipse is not showing the Android.</p>","205504","","205504","","2010-10-24 14:54:12","2012-12-25 19:27:22","Can't Configure Android SDK in Eclipse in Ubuntu After Upgraded to 10.10","<android><eclipse><ubuntu><sdk>","2","1","","",""
"4008875","1","4348389","","2010-10-24 15:29:05","5","2523","<p>I have some 4500 entries in my database. What is the best way to show them in a ListView. Should I load them all in one stretch when the application initializes or should I use lazy loading? The list will also be searchable and filterable. Could you also point me to some nice articles that would gimme a better idea. Please do give me suggestions.</p>","421372","","166749","","2010-10-24 15:55:07","2010-12-03 17:57:38","Lazy loading from SQLite","<android><design><sqlite><listview><lazy-loading>","1","5","2","",""
"4008958","1","4008985","","2010-10-24 15:50:48","2","961","<p>i wnat to make an andoir app in which i want to use the camera ... only to view what is in front of the camera and not to click an image ...what is the code for it..?</p>","470892","","","","","2010-10-24 22:07:01","how to use the camera class in android to view what is in front of the camera ..and not click photos","<android><camera>","2","0","1","",""
"4008990","1","4011910","","2010-10-24 16:02:22","1","1325","<p>I have a radiobuttongroup in a game app in Android. Before the user can go on to the actual game he has to choose a level, which are three radiobuttons. Now, if the user clicks ""play"" the app crashes. How can I use a validation to see if a button was chosen?</p><p>I have an edittext also, which I simply use a: if ((editText.getText().toString().equals("""")))to see if the user has written a name, but this doesn't work on radiobuttons, or at least my game crashes even when I try to use this type of check. </p><p>Any help appreciated!</p>","455479","","","","","2010-10-25 04:31:00","How can I validate a radiobuttongroup in Android?","<android><validation><radio-button>","1","0","","",""
"4009109","1","4010412","","2010-10-24 16:24:04","1","797","<p>I'm very new to Android delelopment, searching and reading various tutorials and using different parts of code from around the internet, trying to make sense of it as I go. Forgive me if my explanation isn't too great.</p><p>Currently I have a list created with 4 list items, what I'd like to do is assign a different icon to each of these list items, however, I've no idea how to do it, nor do I know what to search for.</p><p>Here's the code:</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;ListView android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:id=""@+id/mainListView""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>row.xml</p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/rowTextView""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dp""    android:textSize=""16sp"" &gt; &lt;/TextView&gt;</code></pre><p>FirstList.java</p><pre><code>import java.util.ArrayList;import java.util.Arrays;import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;public class FirstList extends Activity {private ListView mainListView;private ArrayAdapter&lt;String&gt; myListAdapter;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mainListView = (ListView) findViewById( R.id.mainListView);    String[] myList = new String[] {""List 1"", ""List 2"", ""List 3"", ""List 4""};    ArrayList&lt;String&gt; listObjects = new ArrayList&lt;String&gt;();    listObjects.addAll( Arrays.asList(myList));    myListAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.row, listObjects);    mainListView.setAdapter(myListAdapter);    }}</code></pre><p>I'd appreciate any input you have, including any resources that you may recommend or critique of my code, as a newbie I'd rather not pick up bad habits from the start!</p><p>Thanks.</p>","485702","","485702","","2010-10-24 16:35:26","2010-10-24 20:53:02","Android: How do I assign each of my ListView list items an individual icon?","<java><android><xml><listview>","2","0","","",""
"4009200","1","4026392","","2010-10-24 16:40:56","0","2454","<p>I'm getting a weird problem when refreshing my <code>ListView</code>, it works fine until the device is rotated and then when refreshing it again it goes completely blank. This can only be fixed by rotating the device again(as it is also refreshed in <code>onCreate()</code>) but then whenever its refreshed again it goes blank. Problem persists until app is restarted.</p><p><strong>EDIT:</strong> </p><p>Some code:</p><pre><code>private ListView contactlist = null;private static MatrixCursor matrixcursor = null;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    contactlist = (ListView) findViewById(R.id.contactlist);    if (savedInstanceState == null) {        matrixcursor = new MatrixCursor(new String[] {""_id"",""name"",""one"",""two"",""three"",""four""});    } else {        contactlist.setAdapter(new listCursorAdapter(this,matrixcursor));    }}</code></pre><p>this works fine but whenever:</p><pre><code>contactlist.setAdapter(new listCursorAdapter(this,matrixcursor));</code></pre><p>is called after <code>onCreate()</code> and after the device has been rotated the <code>ListView</code> goes blank.</p>","364727","","493939","","2012-04-16 12:16:44","2012-04-16 12:17:45","Android ListView refresh issue","<android><android-listview><refresh>","2","6","2","",""
"4009297","1","4009555","","2010-10-24 17:00:47","1","1053","<p>I have for example a Play/Pause button and would like its size not to change when I change the text from 'play' to 'pause' and back. Due to internationalization I don't know if 'play' or 'pause' will be the longer string..</p><p>I imagine I need to set the string to the longest string and then create the button allowing the UI to size it properly then get its height/width and set the height/width such that it doesn't resize when the button text is changed to the shorter string. But I'm not sure how/where in the code to do this or if there is an easier way to handle this automatically.</p>","317033","","","","","2010-10-24 17:56:20","Android: Preserve button size when changing text","<android><layout><button>","1","0","","",""
"4009309","1","4029458","","2010-10-24 17:02:48","0","7188","<p>I'm rather new to both Java programming and to Android development, so my learning curve is rather steep at the moment. I seem to be stuck on something that I can't find decent examples for how to work past it.</p><p>I wrote a function that gets all my phone's contacts based on examples and docs I found here &amp; there online. The problem I cannot seem to work through is this. The following code works just fine;</p><pre><code>    private void fillData() {    // This goes and gets all the contacts    // TODO: Find a way to filter this only on contacts that have mobile numbers    cursor = getContentResolver().query(Contacts.CONTENT_URI, null, null, null, null);    final ArrayList&lt;String&gt; contacts = new ArrayList&lt;String&gt;();    // Let's set our local variable to a reference to our listview control    // in the view.    lvContacts = (ListView) findViewById(R.id.lvContacts);    while(cursor.moveToNext()) {        contacts.add(cursor.getString(cursor.getColumnIndex(Contacts.DISPLAY_NAME)));    }    // Make the array adapter for the listview.    final ArrayAdapter&lt;String&gt; aa;    aa = new ArrayAdapter&lt;String&gt;(this,                                  android.R.layout.simple_list_item_multiple_choice,                                  contacts);    // Let's sort our resulting data alphabetically.    aa.sort(new Comparator&lt;String&gt;() {        public int compare(String object1, String object2) {            return object1.compareTo(object2);        };    });    // Give the list of contacts over to the list view now.    lvContacts.setAdapter(aa);}</code></pre><p>I want to alter the query statement by filtering out all contacts that do not have a mobile phone number entry.I attempted something like this;</p><pre><code>        cursor = getContentResolver().query(Contacts.CONTENT_URI,        new String[] {Data._ID, Phone.TYPE, Phone.LABEL},        null, null, null);</code></pre><p>But when I do that it throws a NullPointer exception error. What's wrong with this?I got that from an example on android's site, but they had a where clause that didn't apply to my needs, so I change the where stuff to null. Is that what's screwing this up?</p><p>Thanks.</p>","485710","","","","","2010-10-27 02:03:55","Android getContentResolver().query error","<android><contacts>","2","1","","",""
"4009392","1","4009692","","2010-10-24 17:19:46","2","7645","<p>I'm developing a question game and I want to change the answer button pressed background color to green if the answer is correct or to red if the answer is wrong just in the moment the user press the button.</p><p>Actually I have a custom_button.xml which I assign to the buttons in the layout:</p><pre><code>        &lt;Button         android:id=""@+id/la""        android:width=""63dp""        android:height=""65dp""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/la""        android:tag=""@string/la""        android:layout_toRightOf=""@+id/fa""        **android:background=""@drawable/custom_button""**        android:layout_margin=""3dp""    /&gt;  </code></pre><p>Is there a way to change the pressed background of a button just in the moment the user is pressing the button?</p><p>I tried using setBackgroundDrawable() inside the button OnClickListener but this change the button behaviour for the next time the user click the button, not the actual.</p><pre><code>bt.setBackgroundDrawable(getResources().getDrawable(R.drawable.custom_button_fail));</code></pre><p>thanks in advance!</p>","470914","","1011724","","2013-04-09 09:50:40","2013-04-09 09:50:40","How to dynamically change a pressed button background color?","<android>","1","0","0","",""
"4009468","1","","","2010-10-24 17:31:53","0","686","<p>Is it possible to use a Google Apps account as a test account with the Android License Verification Library?</p><p>I've done some testing and even though I have my Google Apps account listed, I always get back an unlicensed response.  The only account I've ever had success testing with is one ending in @gmail.com</p><p>Thanks-</p>","233202","","","","","2011-02-17 00:34:36","Android LVL and Google Apps account","<android>","2","0","","",""
"4009513","1","4009717","","2010-10-24 17:43:49","0","1204","<p>I would like to ask if there is any methods to get a View from another View.</p><p>My case is that:I have a custom ImageView call MyImageView.and my layout is that:</p><pre><code>FrameLayout:  MyImageView   LiearLayout:      LiearLayout:           TextView       LiearLayout:          TextView</code></pre><p>I have some code in MyImageView and I would like to edit the text in TextView under the LinearLayout.</p><p>my code in MyImageView for select the TextView is:</p><pre><code>TextView textView = (TextView) findViewById(id.TextView01);</code></pre><p>However textView is always null and I can't set the text that I prefered.</p><p>More, if I code this:</p><pre><code>TextView textView = (TextView) findViewById(R.id.TextView01);</code></pre><p>Eclipse will give me a error and said can;t resolve the id.</p><p>So Is there any methods to edit TextView from a ImageView?</p>","485758","","244296","","2010-10-25 16:36:01","2010-10-25 16:36:01","How to get TextView reference from a custom ImageView?","<android><imageview>","2","0","","",""
"4009540","1","4010105","","2010-10-24 17:50:16","1","877","<p>I write android application.How can I use Certificate in <code>https</code> connection when I initialize certificate from directory file and not from packages?</p><p>When I have packages file with password, this code works:    <pre>    KeyStore keyStore = KeyStore.getInstance(""PKCS12"");    keyStore.load(certificateIs, pass.toCharArray());    KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());    kmf.init(keyStore, pass.toCharArray());    SSLContext sc = SSLContext.getInstance(""TLS"");    sc.init(kmf.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());</pre></p><p>But I have certificate initialized from der file:</p><pre>    CertificateFactory cf = CertificateFactory.getInstance(""X.509"");    X509Certificate certificate = (X509Certificate) cf.generateCertificate(certBytes);</pre><p>I do not know how use this certificate over <code>https</code> connection.</p>","412894","","1139398","","2012-10-22 09:38:21","2012-10-22 09:38:21","using Certificate in https","<java><android><https><certificate><x509certificate>","1","0","1","",""
"4009810","1","","","2010-10-24 18:51:51","3","1157","<p>I am trying to delete received SMS in ContentObserver (on ""content://sms/"") onChange() method using  contentResolver.delete, but after deleting ContentObserver is invoked one more time.</p><p>Could you explaing my, whe ContentObserver invokes itself despite deliverSelfNotifications() returns false?</p><p>I foud soultion to uregister ContentObserver before deleting the sms and register again after, but is inelegant.</p><p>My code:</p><pre><code>  private class SmsMmsContentObserver extends ContentObserver {    public SmsMmsContentObserver(Handler handler)    {      super(handler);    }    @Override public boolean deliverSelfNotifications() {         return false;         }    @Override    public void onChange(boolean selfChange) {      super.onChange(selfChange);      Uri uriSMSURI = Uri.parse(""content://sms/"");      Cursor cur = getContentResolver().query(uriSMSURI, null, null,                   null, null);      if (cur.moveToNext())      {             int threadIdIn = cur.getInt(cur.getColumnIndex(""thread_id""));           getContentResolver().delete(Uri.parse(""content://sms/conversations/"" + threadIdIn), null, null);      }    }  }</code></pre><p>Methods to register observer in on of services.</p><pre><code>private void registerSmsMmsObserver()  {   if (observer == null)   {       observer = new SmsMmsContentObserver(new Handler());       contentResolver = getContentResolver();       contentResolver.registerContentObserver(uriSmsMms, true, observer);   }  }  private void unregisterSmsMmsObserver()   {   if (contentResolver != null)     contentResolver.unregisterContentObserver(observer);   observer = null;  }</code></pre>","465030","","","","","2011-08-10 15:42:39","Android - why ContentObserver invokes itself?","<android><delete><sms><observer-pattern>","1","0","1","",""
"4009904","1","4014737","","2010-10-24 19:08:53","1","571","<p>Is there a way to inject keystrokes into the JVM on the Android platform?  </p><p>I'm looking for something like java.awt.Robot but I don't think that's available on Android</p><p>thanks</p>","232416","","","","","2010-10-25 12:58:17","Inject Keystrokes","<android><keyboard><robot><automated-testing>","3","0","","",""
"4009959","1","4010022","","2010-10-24 19:18:24","0","1643","<p>Looking at Google Calendar on my android web browser I noticed the time selector looks like a native Android selector as opposed to looking like an HTML selector drop-down. To see it:</p><ul><li>go to <a href=""http://calendar.google.com/"" rel=""nofollow"">http://calendar.google.com/</a></li><li>Touch the plus button at the top right</li><li>Touch the time drop-down</li></ul><p>You should see the native-looking selector. </p><p>What HTML incantation are they using to get that look? </p><p>Are there other android specific or HTML5 specific tags to get native (or improved) look on Android/iPhone webkit (and WebView)?</p>","13055","","","","","2011-02-22 12:02:40","Native looking HTML selector with Android/iPhone Webkit?","<iphone><android><html5>","2","0","","",""
"4010005","1","4010034","","2010-10-24 19:27:36","6","3082","<p>Here's the scenario conceptually (excluding linearlayouts)</p><pre><code>ScrollView  Button  Checkboxes  Spinner  ListView (full-size, non-scrolling)AdMob advert</code></pre><p>i.e. a scrolling pane, which has a filtering UI at the top, followed by results, but the advert must always remain visible, and when scrolling down the filter UI must scroll away, leaving maximum space for results.</p><p>I'm aware there are issues with a ListView inside a ScrollView, though for me it is working well in many ways (I'm fixing the length of the ListView to stop it collapsing). So the screen scrolls nicely, the ad stays put at the bottom, and it looks good.</p><p>But the problem I'm seeing is, inexplicably, when the activity opens, the ScrollView is scrolled down a bit, so the ListView is at the top of the screen. I assume this is a default behaviour, so I set about trying to force the scroll position of the ScrollView to the top, but I've tried various methods, and see no effect:</p><pre><code>scrollview.scrollTo(0, 1000/-1000);scrollview.smoothScrollBy(0, 1000/-1000);scrollview.fullScroll(View.FOCUS_UP);</code></pre><p>Is there any way to force the ScrollView to start with the scroll position at the top?</p><p>If not, how can I have an ad that doesn't scroll off the bottom, but a filter UI that always scrolls off the top? Using ListView seems overkill as I don't need scrolling but it does provide many benefits so would be nice to avoid starting from scratch and rendering everything myself.</p>","477415","","","","","2013-06-24 11:59:49","Scrolling issues with a ListView inside a ScrollView","<android>","6","2","","",""
"4010186","1","","","2010-10-24 20:06:46","1","805","<p>The application works fine in the emulator. This issue manifests on the Sprint HTC Android phone.</p><p>The program uses a TabActivity which contains a MapHandler / ItemizedOverlay. When a marker on the map is touched, the overlay onTap method is called. In this method, an alert dialog is displayed then, after a button is pressed, the view is switched to the view containing the details of the location. The view is switched by sending a message to the MapHandler which in turn uses a viewswitcher to swap them out.Again, there are no issues in the emulator, only on the phone.</p><p>Here is the stack trace that results:</p><pre><code>10-24 15:49:33.055: ERROR/AndroidRuntime(10930): Uncaught handler: thread main exiting due to uncaught exception10-24 15:49:33.360: ERROR/AndroidRuntime(10930): java.lang.StackOverflowError10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.text.BoringLayout.draw(BoringLayout.java:356)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.widget.TextView.onDraw(TextView.java:3934)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.View.draw(View.java:5838)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.View.draw(View.java:5944)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.widget.FrameLayout.draw(FrameLayout.java:352)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.View.draw(View.java:5841)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.widget.FrameLayout.draw(FrameLayout.java:352)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.View.draw(View.java:5841)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.widget.FrameLayout.draw(FrameLayout.java:352)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.View.draw(View.java:5841)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.widget.FrameLayout.draw(FrameLayout.java:352)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1896)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewRoot.draw(ViewRoot.java:1237)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1504)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.os.Handler.dispatchMessage(Handler.java:99)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.os.Looper.loop(Looper.java:123)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at android.app.ActivityThread.main(ActivityThread.java:4077)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at java.lang.reflect.Method.invokeNative(Native Method)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at java.lang.reflect.Method.invoke(Method.java:521)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)10-24 15:49:33.360: ERROR/AndroidRuntime(10930):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I'm a little suspicious of the sendmessage/viewswitcher method.</p><p>Anyone have any ideas?</p>","62710","","1407672","","2013-01-25 08:34:00","2013-01-25 08:34:00","StackOverflowError when switching views in Android (testing on Sprint HTC)","<java><android><mobile-phones>","1","2","1","",""
"4010238","1","4013466","","2010-10-24 20:18:10","3","672","<p>I'm working on an Android application that will come with lots of data. I'd have expected to just distribute the SQLite database, but it's clear from researching this that the database can be included, but must be copied from raw to data, which if there's a good few MB of data will take up space needlessly. For my app the data is all text/numeric/date, and in a relational database would normally take up four tables. So pretty simple, but having two copies of it seems v wasteful.</p><p>The options I see are:</p><ol><li>Tolerate the data being duplicated (it pains me)</li><li>On installation the app downloads the data over HTTP (I'd then have a potential challenge with the load), probably Google App Engine.</li></ol><p>Any other solutions worth considering?</p>","477415","","477415","","2010-10-25 12:15:09","2010-10-25 12:15:09","Best way to deploy an application that comes with lots of data","<android><sqlite>","3","5","3","",""
"4010428","1","4012266","","2010-10-24 20:58:00","1","1408","<p>StateListDrawables and <code>&lt;selector&gt;</code> are great for setting different drawables for each state of a view, but is there a way to tie in what text style that view should use for each of those states?</p><p>For example, if you had a button that was white with black text, and when clicked, the button color became black, you would want your text color to change to white.  I can imagine how I would do this with code, but is there a way to do it with xml similar to the <code>&lt;selector&gt;</code> used for drawables?</p>","445348","","","","","2010-10-25 06:29:38","How to change text style based on state with xml?","<android><coding-style>","1","0","1","",""
"4010551","1","4010994","","2010-10-24 21:28:44","0","414","<p>I use the following code with the intention to create an image that's half white and half black and put it on a button.What's wrong with my code? (latter we want to use a more complicated logic about what pixels are white and what are black but it should still be black and white)</p><pre><code>int height = 100;int width = 100;quadratImage = Bitmap.createBitmap(        width,         height,         Bitmap.Config.ALPHA_8);for (int x = 0; x &lt; width; x++){    for (int y = 0; y &lt; height; y++){        int color;        if (x&lt; 50){            color = R.color.black;        }        else{            color = R.color.white;        }        quadratImage.setPixel(                x, y, color);    }}quadratImage.prepareToDraw();imageButton.setImageBitmap(quadratImage);</code></pre><p>My colors are defined as:</p><pre><code>&lt;color name=""black""&gt;#000000&lt;/color&gt;&lt;color name=""white""&gt;#ffffff&lt;/color&gt;</code></pre>","25282","","25282","","2010-10-24 21:46:29","2010-10-24 23:23:47","Creating an image and rending into a ImageButton in android","<android><android-ui>","2","1","","",""
"4010588","1","4713008","","2010-10-24 21:37:59","7","1351","<p>They have states for things like pressed, focused, disabled, but is it possible to create custom states so it could reflect some of my own custom criteria?</p><p>For example, say you have a list of names. Some people fall into a certain category that should be visually represented differently.  These people's rows would then have a different state and background drawable.</p>","445348","","","","","2011-01-17 12:13:55","Is it possible to create a custom state for use in a StateListDrawable?","<android><state><drawable>","1","1","2","",""
"4010623","1","4011052","","2010-10-24 21:46:24","6","4822","<p>I've created a custom ListView by extending SimpleCursorAdapter.The result is IMAGE + CheckedTextView (Text + Checkbox).</p><p>When I long click an Item, everything works fine - I get the right ID and details of the clicked Item.</p><p>The problem occurs when I try to mark an Item as checked but it checks the wrong checkbox.</p><p><strong>For example:</strong> I have 9 items on my list, sorted 1-9. if I click on listItem 1, the checkbox on line 9 is being checked. if I click on item 4, the checkbox on line 6 is being checked and if I click on the middle line, it is being checked.</p><p>Clearly I'm missing something here :)Do remember when I long click the line (contextMenu opens), everything works great.</p><p><strong>This is the listener:</strong></p><pre><code>lv.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {                CheckedTextView markedItem = (CheckedTextView) view.findViewById(R.id.btitle);                if (!markedItem.isChecked()) {                    markedItem.setChecked(true);                } else {                    markedItem.setChecked(false);                }            }        });</code></pre><p>Appreciate any help!</p><p>Let me know If you need me to post more code.</p><p>Thank you!</p><p>btw, If I click on more than one... the PARTY continues... no obvious order...</p><p>EDIT: the Adapter code</p><pre><code>public class ImageCursorAdapter extends SimpleCursorAdapter {    private Cursor c;    private Context context;    private String url;    private TextView bUrl;    public ImageCursorAdapter(Context context, int layout, Cursor c,            String[] from, int[] to) {        super(context, layout, c, from, to);        this.c = c;        this.context = context;    }    public View getView(int pos, View inView, ViewGroup parent) {        View v = inView;        if (v == null) {            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = inflater.inflate(R.layout.image_list, null);        }        this.c.moveToPosition(pos);        final TextView bTitle = (TextView) v.findViewById(R.id.btitle);        String bookmark = this.c.getString(this.c.getColumnIndex(Browser.BookmarkColumns.TITLE));        byte[] favicon = this.c.getBlob(this.c.getColumnIndex(Browser.BookmarkColumns.FAVICON));        if (favicon != null) {            ImageView iv = (ImageView) v.findViewById(R.id.bimage);            iv.setImageBitmap(BitmapFactory.decodeByteArray(favicon, 0, favicon.length));        }        bTitle.setText(bookmark);        return (v);    }}</code></pre>","444324","","444324","","2010-10-24 22:12:23","2011-12-20 14:03:04","Android Click on listItem checks wrong checkbox","<android><listview><checkedtextview>","1","8","4","",""
"4010844","1","","","2010-10-24 22:40:23","0","276","<p>Using the Android 2.0 ContactsContract API, is it possible to build a list of objects representing contacts in a Contact Group like this:</p><pre><code>public class GroupContact {      public String displayName;    public List&lt;String&gt; phoneNumbers;}</code></pre><p>While making fewer than O(n) SQL queries?</p>","485897","","","","","2011-07-17 08:23:49","How many queries are required to get the names and numbers of everyone in an Android contact group?","<android><contacts><group><contactscontract>","1","1","","",""
"4010854","1","","","2010-10-24 22:43:54","1","2646","<p>I am trying to use the chooser so I don't have to create a selector-dialog.  Maybe it is the wrong construct or widget to be using.  What is happening is that the list of intents that I supply are inserted into a chooser dialog, but so are all the other applications on my device.  Then if I use the back-button, the application ""finishes.""</p><p>The invocation is:</p><pre><code>Intent intentChooser = Intent.createChooser(intentDocumentView, ""Choose A Chapter"");Parcelable [] parcelable = new Parcelable [2]; parcelable[0] = new LabeledIntent(intentDoc0, ""com.mobibob.myapp"", ""Title 0"", 0);parcelable[1] = new LabeledIntent(intentDoc1, ""com.mobibob.myapp"", ""Title 1"", 0);intentChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, parcelable);int whichDocument = RESULT_FIRST_USER;startActivityForResult(intentChooser, whichDocument);</code></pre><p>Do I need to specify more in the intentChooser??  category? flags? extras?</p>","157804","","","","","2012-04-05 20:20:49","How to use the Android Intent.createChooser()?","<android><dialog><selection>","1","0","0","",""
"4011100","1","","","2010-10-25 00:04:25","9","6112","<p>Below is a bit of code that I managed to get to work to hide the soft keyboard on android. It works by the user clicking anywhere on the screen (outside of a <code>EditText</code> input/s) to hide the IME soft keyboard. It registers a <code>OnTouchListener</code> to the <code>ScrollView (id=""@+id/sv_background)</code> which when the screen is touched it hides the IME soft keyboard via the <code>InputMethodManager</code> code. I have set the scroll view as the parent layout in this case but it also works with any other layout view. </p><p>I hope this is useful to someone out there in Android land.</p><p>XML</p><pre><code>&lt;ScrollView android:id=""@+id/sv_background"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;other views and EditTexts/&gt;&lt;/ScrollView&gt;</code></pre><p>Java</p><pre><code>private ScrollView svBackground;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.newentry);    svBackground = (ScrollView)findViewById(R.id.sv_background);    svBackground.setOnTouchListener(new OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);            imm.hideSoftInputFromWindow(svBackground.getWindowToken(), 0);            return false;        }    });}</code></pre>","485936","","573032","","2013-05-08 13:32:01","2013-05-08 13:32:01","Android hide soft keyboard IME","<java><android>","0","2","","2011-07-14 11:13:28",""
"4011152","1","4011170","","2010-10-25 00:21:15","1","6694","<p>I have an Activity in which user can update a specific information clicking in a button near a label. This buttons than triggers a Dialog where I have some fields to get user input and a button to finish editing. </p><p>My problem is that I am not able to get a reference to the button declare in the dialog specific xml layout. The button reference returns null. Follow some code snippet to ilustrate.</p><p>Button which fires the event to build the dialog is declared as a instance variable in the activity as follows: </p><pre><code>private Button bConfigurarCarro;</code></pre><p>than onCreate method:</p><pre><code>bConfigurarCarro = (Button)findViewById(R.id.bConfigurarCarro); bConfigurarCarro.setOnClickListener(configuraCarroListener);</code></pre><p>this correctly fires the event to create the dialog: </p><pre><code>protected OnClickListener configuraCarroListener = new OnClickListener(){public void onClick(View v) {showDialog(CARRO_DIALOG_ID);Log.d(TAG, ""Executando evento do botão de configuração de carro no abastecimento."");            }        };</code></pre><p>than to create the dialog Overrides onCreateDialog method like this: </p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {  switch (id) {    case TIME_DIALOG_ID:        return new TimePickerDialog(this, mTimeSetListener, hora, minuto, false);    case DATE_DIALOG_ID:        return new DatePickerDialog(this, mDateSetListener, ano, mes, dia);    case CARRO_DIALOG_ID:        Log.d(TAG, ""Criando dialog de cadastro de carro."");        dialogCarro = new Dialog(this);        dialogCarro.setContentView(R.layout.novo_carro_dialog);        bSalvarCarro = (Button)findViewById(R.id.botaoSalvarCarro);        bSalvarCarro.setOnClickListener(salvarCarroListener);        dialogCarro.setTitle(""Carro"");        dialogCarro.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);        Log.d(TAG, ""Dialog de cadastro de carro criado retornando..."");        return dialogCarro;    }        return null;}</code></pre><p>The specific line where the NullPointer triggers is the one where after trying to get Button reference above, I than try to setOnClickListener..</p><pre><code>bSalvarCarro = (Button)findViewById(R.id.botaoSalvarCarro);bSalvarCarro.setOnClickListener(salvarCarroListener);</code></pre><p>the bSalvarCarro is null.</p><p>The xml layout for the Dialog which I try to set above using the line of code: </p><pre><code>dialogCarro.setContentView(R.layout.novo_carro_dialog);</code></pre><p>Is this one(novo_carro_dialog.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:id=""@+id/marcaCarro""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                     android:text=""@string/marcaCarro""/&gt;                &lt;EditText android:id=""@+id/tMarcaCarro"" android:singleLine=""true"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:width=""130px""/&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView android:id=""@+id/nomeCarro""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                     android:text=""@string/nomeCarro""/&gt;                &lt;EditText android:id=""@+id/tNomeCarro"" android:singleLine=""true"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content""/&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView android:id=""@+id/anoCarro""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                     android:text=""@string/anoCarro""/&gt;                &lt;EditText android:id=""@+id/tAnoCarro"" android:singleLine=""true"" android:layout_width=""fill_parent""                android:numeric=""integer"" android:maxLength=""4"" android:layout_height=""wrap_content"" /&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;TextView android:id=""@+id/modeloCarro""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                     android:text=""@string/modeloCarro""/&gt;                &lt;EditText android:id=""@+id/tModeloCarro"" android:singleLine=""true"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" /&gt;            &lt;/TableRow&gt;            &lt;Button android:id=""@+id/botaoSalvarCarro"" android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" android:text=""@string/bSalvarCarro"" /&gt;&lt;/TableLayout&gt;</code></pre><p>As you can see the Button is declared with the id botaoSalvarCarro, but trying to get a reference to it returns null. I am a bit confused by this as if I take out the line which sets the listener the dialog is correctly showed, so. How do I get the reference to this button correctly?</p>","442041","","","","","2010-10-25 00:25:59","How to get reference to a Button created in a custom Dialog, using a xml layout?","<android><button><reference><dialog>","1","0","0","",""
"4011178","1","4011431","","2010-10-25 00:27:48","9","10457","<p>I have a WidgetProvider and an Configure Activity</p><p>When the Widget is started it starts with the configure activity and I set it up by making a custom call to the widgetprovider</p><p>(which you will notice is from the sdk tutorial examples)</p><pre><code> // Push widget update to surface with newly set prefix              AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);              AwarenessWidget.updateAppWidget(context, appWidgetManager,                      mAppWidgetId, position);            // Make sure we pass back the original appWidgetId            Intent resultValue = new Intent();            resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);            setResult(RESULT_OK, resultValue);            finish();</code></pre><p>I pass the Widget ID to the function.... inside the widget I create a Intent like this:</p><pre><code>  Intent configIntent = new Intent(context, Configure.class);    configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);    PendingIntent pendingIntent = PendingIntent.getActivity    (context, 0, configIntent,    PendingIntent.FLAG_UPDATE_CURRENT);    views.setOnClickPendingIntent(R.id.MainImage,pendingIntent);    views.setImageViewResource(R.id.MainImage, lv_images[version]);    appWidgetManager.updateAppWidget(appWidgetId, views);</code></pre><p>I am always referencing the widget ID and even add it as a extra on the intentbut when I get two of these widgets on the home screen the widget ID is always referencing the last placed widget ID</p>","478183","","","","","2013-03-07 18:43:48","Multiple Instances Of Widget Only Updating Last widget","<android><android-widget>","3","0","9","",""
"4011277","1","4011299","","2010-10-25 01:04:22","0","68","<p>I would like the main layout file (main.xml) respond to the main activity. I would like a TextView inside the layout file only to show if a variable, located in the main activity, equals a certain number, like 0. If the variable is 1 or 2, I want it to show something else.</p><p>What's the easiest way to perform this? I'm not really sure if this is even possible!</p>","478297","","","","","2010-10-25 01:20:50","Android: Layout Responds to Activity","<java><android><xml>","2","0","","",""
"4011327","1","4011356","","2010-10-25 01:23:07","2","2313","<p>I remember a while ago reading about an alternative (aka faster) way to perform a <code>getPixel()</code>-ish method. </p><p>Problem is, I don't remember where I read that, and I've searched thoroughly.. I think.</p><p>The answer had something to do with locking the Bitmap in memory, or something like that. </p><p>I need to run <code>getPixel()</code> multiple times ""per-tick,"" which is very costly it seems.</p><p>Does anyone know what I'm talking about?</p>","408178","","638994","","2012-10-12 15:09:17","2012-10-12 15:09:17","Alternative to Bitmap.getPixel()","<android><bitmap><getpixel>","1","1","","",""
"4011335","1","","","2010-10-25 01:25:52","4","1342","<p>I'm trying to write some apps using wikitude, and I'm having some problems running even the example.I've put the sample ( BasicOpenARDemo ) that comes with the SDK inside eclipse and tried to run it, where I encountered the next error: ""wikitude was not found on the system. Please press the ok-button to access the Android market and download wikitude.""First question- I don't understand- Why am I approached to download the utility when I have a standalone sample inside my eclipse? Doesn't the core files behind Wikitude come with the SDK or the sample itself?</p><p>The next question will be - after some googling, I've found that in order to install this ""Android market"" I need to follow the manual that comes in the 9th message in the next thread (the message that was written by ronni.rasmussen) -<a href=""http://forum.xda-developers.com/archive/index.php/t-529170.html"" rel=""nofollow"">http://forum.xda-developers.com/archive/index.php/t-529170.html</a></p><p>Well, I've followed it, and now when I try to press the OK button that comes after the ""wikitude was not found on the system..."" message, I get redirected to the Android market, where I find Wikitude, but when I try to download it- I get a ""Download was unsuccessful. Please try again"" error message. How do I fix that?One more thing that I don't understand- How come it's written in this offline Android market that the available wikitude version is for android 1.5 and no longer maintained?</p><p>As you can see- I'm quite baffled here. Hope someone could clear this up for me.</p>","485962","","2153784","","2011-08-28 17:10:51","2011-08-28 17:10:51","Android: Installing Wikitude on Android Emulator","<java><android><android-emulator>","1","0","1","",""
"4011482","1","4012181","","2010-10-25 02:16:59","0","966","<p>Hey, Im trying something in android, that has to get the words sent in sms and print on the emulator screen. But the app doesnt update in time.</p><p>I send a message. Ok. But when I open the app it doesnt print the words that I've sent. So i have to close the emulator and then open it again, and run the app, and the word is there.</p><p>Id like that when I sent the message and then I access the app, the word is printed without I have to close the emulator.</p><p>How do I do this?</p><p>So here is my code. Remember that I want to, send a new SMS and when I go to my app again, (without close and open the emulator), it updates the words in the screen, the new words shall be printed in the screen. Thx.</p><p>I have this class <strong>SMS.java</strong>, which is my activity, and another class, that is below this one here, called <strong>DataHelper.java</strong>, which manipulate my database, and has the methods to insert, query, update, etc.:</p><p><strong>SMS.java</strong></p><pre><code>package com.sys;import java.util.List;import java.util.StringTokenizer;import com.sys.DataHelper;import android.app.Activity;import android.content.ContentValues;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.net.Uri;import android.os.Bundle;import android.provider.BaseColumns;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;import com.sys.ratedSmsContacts;public class SMS extends Activity { private DataHelper dh;  private static TextView txtView;                private static Button btnChkCntts;private static Button btnChkTag;final Uri CONTENT_URI = Uri.parse(""content://sms/sent"");    @Override    public void onCreate(Bundle savedInstanceState) {    this.dh = new DataHelper(this);     super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final Button button = (Button) findViewById(R.id.btnChkCntts);    button.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        Intent myIntent = new Intent(v.getContext(), ratedSmsContacts.class);        startActivityForResult(myIntent, 0);    }    });    txtView =    (TextView)findViewById(R.id.txtView);              Cursor cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);                                            String body;          String atual;        if(cursor.moveToFirst()){            body = cursor.getString(cursor.getColumnIndexOrThrow(""body"")).toString();            if(body == "" ""){                Toast.makeText(getBaseContext(), ""There is no words to save!"", Toast.LENGTH_LONG).show();            }                else{                                                   StringTokenizer st = new StringTokenizer(body);                                       while(st.hasMoreTokens()){                        atual = st.nextToken();                            while(this.dh.select(atual) == true){                                this.dh.atualiza(atual);                                Toast.makeText(getBaseContext(), ""Word updated!"", Toast.LENGTH_LONG).show();                            }                            while(this.dh.select(atual) == false){                                this.dh.insert(atual);                                Toast.makeText(getBaseContext(), ""Word added!"", Toast.LENGTH_LONG).show();                            }                        }                    }                    List&lt;String&gt; words = this.dh.selectAll();                    StringBuilder sb = new StringBuilder();                    sb.append(""Set of words:\n\n"");                    for (String w : words) {                        sb.append(w);                        sb.append("" "");                                             }                       txtView.setText(sb.toString());                }                           }                }</code></pre><p><strong>DataHelper.java</strong></p><pre><code>package com.sys;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 android.widget.Toast;import java.util.ArrayList;import java.util.List;public class DataHelper {private static final String DATABASE_NAME = ""sms.db"";private static final int DATABASE_VERSION = 1;private static final String TABLE_NAME = ""words"";private Context context;private SQLiteDatabase db;private SQLiteStatement insertStmt;private SQLiteStatement updateStmt;private static final String INSERT = ""insert into ""   + TABLE_NAME + ""(word, cont) values (?, 1)"";public DataHelper(Context context) {  this.context = context;  OpenHelper openHelper = new OpenHelper(this.context);  this.db = openHelper.getWritableDatabase();           //openHelper.onUpgrade(db, 1, 2);  this.insertStmt = this.db.compileStatement(INSERT); }public long insert(String word) {   this.insertStmt.bindString(1, word);               return this.insertStmt.executeInsert(); }public void atualiza(String word){   this.db.execSQL(""UPDATE words SET cont = cont + 1 WHERE (word= ?)"", new String[] {word} );       }public void deleteAll() {  this.db.delete(TABLE_NAME, null, null); }public boolean select(String wrd) {  String word;  Cursor cursor = this.db.query(TABLE_NAME, new String[] {""word""}, ""word like ?"", new String[] {wrd} , null, null, null);  if (cursor.moveToFirst()) {     do {        word = cursor.getString(0);      } while (cursor.moveToNext());   }  if (cursor != null &amp;&amp; !cursor.isClosed()) {     cursor.close();              return true;           }else{      return false;  }}public List&lt;String&gt; selectMaxCont(){          List&lt;String&gt; list = new ArrayList&lt;String&gt;();   Cursor cursor = this.db.query(TABLE_NAME, new String[]{""word""}, null, null, null, null, ""cont desc"");   if(cursor.moveToFirst()){       do{   list.add(cursor.getString(0));       }while(cursor.moveToNext());   }   if(cursor != null &amp;&amp; !cursor.isClosed()){       cursor.close();   }   return list;}public List&lt;String&gt; selectAll() {      List&lt;String&gt; list = new ArrayList&lt;String&gt;();      Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word"" }, null, null, null, null, ""cont desc"");      if (cursor.moveToFirst()) {         do {            list.add(cursor.getString(0).toUpperCase());          } 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, word TEXT, cont INTEGER)"");           }  @Override  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {     Log.w(""SMS Words Database"", ""Upgrading database, this will drop tables and recreate."");     db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);     onCreate(db);  } }}</code></pre>","399459","","","","","2010-10-25 06:10:12","How to make Android app update in execution time","<android><database><sms><android-emulator>","1","0","1","",""
"4011605","1","4011623","","2010-10-25 02:48:26","1","1399","<p>I created a widget that works great until I restart the phone, then the widget doesn't display it is invisible but if i hold and click i can throw it in the garbage</p><p>I have a function that is called from my configure activity in my widgetprovider that does the following:</p><pre><code>static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,            int appWidgetId, int version)  {        if(savedType == -1)            savedType = version;//   android.os.Debug.waitForDebugger();    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);    Intent configIntent = new Intent(context, Configure.class);    configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);    Uri data = Uri.withAppendedPath(            Uri.parse(appWidgetId + ""://widget/id/"")            ,String.valueOf(appWidgetId));    configIntent.setData(data);    PendingIntent pendingIntent = PendingIntent.getActivity    (context, 0, configIntent,    PendingIntent.FLAG_UPDATE_CURRENT);    views.setOnClickPendingIntent(R.id.MainImage,pendingIntent);    views.setImageViewResource(R.id.MainImage, lv_images[version]);    appWidgetManager.updateAppWidget(appWidgetId, views);}</code></pre><p>I had my onUpdate not doing anything because there is never anything to update but thinking this would be called after a phone restart i copied the code i had in the function </p><pre><code>for(int i = 0; i &lt; appWidgetIds.length; ++i){     updateAppWidget(context, appWidgetManager, appWidgetIds[i], savedType);}</code></pre><p>but this didn't seem to do much either.... suggestions?</p>","478183","","","","","2010-10-25 03:39:08","Widget Not showing up after phone restart","<android><android-widget>","1","0","","",""
"4011643","1","4149621","","2010-10-25 03:02:31","0","141","<p>Hey everybody, I was wondering where, or what is the methods used in the batch uninstaller programs? I know how to pull up lists of the applications, and the icons in a listview.. getting them into the right lists and whatever, but how do I actually uninstall the application? Thanksa</p>","481082","","","","","2010-11-10 22:10:45","Uninstall methods in Android","<android><list><batch-file><uninstaller>","1","0","","",""
"4011647","1","","","2010-10-25 03:03:14","3","1721","<p>Hi all:   I'm writing a class that inherit from TextView, and override its <code>onDraw()</code> method, but in the method, my invoke of <code>canvas.drawText()</code> doesn't seems to work, the code just like below:</p><pre><code>protected void onDraw(Canvas canvas) {    // super.onDraw(canvas);    Paint paint = new Paint();    paint.setColor(android.graphics.Color.WHITE);    paint.setTextSize(20);    String text = ""hello"";    canvas.drawText(text, 0, 0, paint);}</code></pre>","486005","","641020","","2011-09-22 10:06:18","2012-11-27 11:12:51","why my invoke of Canvas.drawText() just doesn't work","<android><textview><android-canvas><ondraw><drawtext>","2","2","","",""
"4011657","1","4011761","","2010-10-25 03:06:42","-1","2224","<p>I need to accept values (username and password) from the user, when he clicks menu button and one of the button that says login. When the login button is clicked, a pop up should show up that accepts the values and should have an ok button.Expecting a pop something like when we try to download an app from apple store (iphone)Could some one please guide me how to do this. Also... this menu is to be visible for a MapActivity class which implements LocationListener</p><p>thanks</p>","377337","","377337","","2010-10-25 03:24:18","2010-10-25 03:38:23","android username password input","<android>","1","3","1","",""
"4011662","1","4011767","","2010-10-25 03:07:53","1","2361","<p>I want to implement a Home button in my Android App which will terminate the all the Activities but the first one. Instead of user pressing the Back button again and again, I want to give user a single button which will take him/her on the first (Home) Activity.Please help how to implement it.</p>","476747","","","","","2010-10-25 03:40:51","Implementing the ""Go to Home"" functionality in Android?","<android><activity>","2","0","","",""
"4011738","1","","","2010-10-25 03:31:32","2","2310","<p>I want to have a transparent view, above my application.<br>I want to do this just knowing the current activity.<br>I found a way of doing this by adding a new framelayout via the windowManagerI m doing this :</p><pre><code>public static void AddViewAbove(Activity activity) {    FrameLayout newLayout = new FrameLayout(activity);    WindowManager.LayoutParams lp = new WindowManager.LayoutParams(    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT,    WindowManager.LayoutParams.TYPE_APPLICATION,    // if I let WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE       // then touchevent are passed to the application behind, but I cant handle touch in    // my new frameLayout    WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,    PixelFormat.TRANSLUCENT);    activity.getWindowManager().addView(newLayout , lp);}</code></pre><p>My main problem now is that i can't receive touchevent correctly in my new FrameLayout and in the same time in application behind my view.</p>","468488","","578215","","2012-02-08 12:52:53","2012-02-08 12:52:53","Android : transparent view does not manage touchevent correctly","<android><view><transparent>","1","0","2","",""
"4011779","1","4029163","","2010-10-25 03:42:58","3","2251","<p>the document <a href=""http://developer.android.com/guide/topics/data/data-storage.html"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html</a></p><p>shows that there are multiple ways to save data, I need to do this in a widget and everytime I try to save i get errors...</p><p>for instance</p><pre><code>      SharedPreferences settings = getSharedPreferences(""NAME"", 0);      SharedPreferences.Editor editor = settings.edit();      editor.putBoolean(""silentMode"", false);      // Commit the edits!      editor.commit();</code></pre><p>Error</p><pre><code>Description Resource    Path    Location    TypeThe method getSharedPreferences(String, int) is undefined for the type AWidget</code></pre><p>another attempt:</p><pre><code>     String FILENAME = ""hello_file"";     String string = ""hello world!"";     FileOutputStream fos = openFileOutput(""Test.txt"", Context.MODE_PRIVATE);     fos.write(string.getBytes());     fos.close();</code></pre><p>with error</p><pre><code>Description Resource    Path    Location    TypeThe method openFileOutput(String, int) is undefined for the type AWidget</code></pre><p>whats the deal? I see no mention this does not work in a widget so why is it that these examples don't work for me?</p><p>What is the preferred way to save this data?</p>","478183","","","","","2010-10-27 00:48:58","Save Widget State","<android><android-widget>","2","2","3","",""
"4011867","1","","","2010-10-25 04:14:14","6","3181","<p>Does anybody knows how to set android search dialog hint dynamically?T have try to do something like:</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/search_label"" android:hint=""@string/search_hint"" android:id=""@+id/search_dialog_text""&gt;&lt;/searchable&gt;</code></pre><p>Somewhere:</p><pre><code>@Overridepublic boolean onSearchRequested() {  Bundle appSearchData = new Bundle();  appSearchData.putString(""SomeSpecificParam"", SomeClass.class.getName());  startSearch("""", false, appSearchData, false);  EditText  text = (EditText )findViewById(R.id.search_dialog_text);  text.setHint(""Search something else"");  return true;}</code></pre><p>but text is equal null.</p><p>So looking forward you suggestions. Thanks.</p>","486039","","244296","","2010-10-25 04:15:45","2014-02-06 23:31:11","Set search hint dynamically","<android><android-searchmanager>","6","0","4","",""
"4011908","1","","","2010-10-25 04:30:07","2","2060","<p>I am wondering if my codes here can view a specific pdf file using existing PDF viewer in Android Phone (HTC Desire).. If i would like to open pdf files from local folder.. What should i do?</p><pre><code>public class ghcm_Submenu1 extends Activity {private ListView lv1;private String lv_arr[]= {""item1"", ""item2""};    @Override    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.submenu);        lv1=(ListView)findViewById(R.id.ListView01);        // 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 AdapterView.OnItemClickListener() {                 public void onItemClick(AdapterView parentView, View childView, int position, long id) {                                if ((position)== 0){                         Intent intent = new Intent();                         File file = new File(""/sdcard/item1.pdf"");                         if (file.exists()) {                             Uri path = Uri.fromFile(file);                             intent.setAction(Intent.ACTION_VIEW);                             intent.setDataAndType(path, ""application/pdf"");                             intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                             try {                                 startActivity(intent);                             }                              catch (ActivityNotFoundException e) {                                 Toast.makeText(ghcm_Submenu1.this,                                      ""No Application Available to View PDF"",                                      Toast.LENGTH_SHORT).show();                             }                         }                    }                    else if ((position)== 1){                         Intent intent = new Intent();                         File file = new File(""/sdcard/item2.pdf"");                         if (file.exists()) {                             Uri path = Uri.fromFile(file);                             intent.setAction(Intent.ACTION_VIEW);                             intent.setDataAndType(path, ""application/pdf"");                             intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                             try {                                 startActivity(intent);                             }                              catch (ActivityNotFoundException e) {                                 Toast.makeText(ghcm_Submenu1.this,                                      ""No Application Available to View PDF"",                                      Toast.LENGTH_SHORT).show();                             }                         }                    }                      }                    public void onNothingSelected(AdapterView parentView) {                      }                    });       }</code></pre><p>}</p>","486043","","486043","","2010-10-25 04:54:39","2010-10-25 04:54:39","android : how to make my apps open specific PDF file on click","<android><pdf>","0","0","","",""
"4011985","1","4033227","","2010-10-25 04:50:44","1","1670","<p>This is my first time using SAXParser, (I'm using it in Android, but I don't think that makes a difference for this particular issue) and I'm trying to read in data from an RSS feed. So far, it's working great for me for the most part, but I'm having trouble when it gets to a tag that contains HTML encoded text (e.g. <code>&amp;lt;a href=""http://...</code>). The <code>characters()</code> method only reads in the <code>&amp;lt;</code> as a <code>&lt;</code>, then treats the next set of characters as a separate entity, rather than taking the entire contents at once. I would rather it just read it in as it is, without actually translating the HTML. The code I'm using for my document handler (shortened) is posted below:</p><pre><code>@Override    public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {        if (localName.equalsIgnoreCase(""channel"")) {            inChannel = true;        }        if (inChannel) {            if (newFeed == null) newFeed = new Feed();            if (localName.equalsIgnoreCase(""image"")) {                if (feedImage == null) feedImage = new Image();                inImage = true;            }            if (localName.equalsIgnoreCase(""item"")) {                if (newItem == null) newItem = new Item();                if (itemList == null) itemList = new ArrayList&lt;Item&gt;();                inItem = true;            }        }       }    @Override    public void endElement(String uri, String localName, String qName) throws SAXException {        if(!inItem) {            if(!inImage) {                if(inChannel) {                    //Reached end of feed                    if(localName.equalsIgnoreCase(""channel"")) {                        newFeed.setItems((ArrayList&lt;Item&gt;)itemList);                        finalFeed = newFeed;                        newFeed = null;                                             inChannel = false;                        return;                    } else if(localName.equalsIgnoreCase(""title"")) {                        newFeed.setTitle(currentValue); return;                    } else if(localName.equalsIgnoreCase(""link"")) {                        newFeed.setLink(currentValue); return;                    } else if(localName.equalsIgnoreCase(""description"")) {                        newFeed.setDescription(currentValue); return;                    } else if(localName.equalsIgnoreCase(""language"")) {                        newFeed.setLanguage(currentValue); return;                    } else if(localName.equalsIgnoreCase(""copyright"")) {                        newFeed.setCopyright(currentValue); return;                    } else if(localName.equalsIgnoreCase(""category"")) {                        newFeed.addCategory(currentValue); return;                    }                                       }            }            else { //is inImage                //finished with feed image                if(localName.equalsIgnoreCase(""image"")) {                    newFeed.setImage(feedImage);                    feedImage = null;                    inImage = false;                    return;                } else if (localName.equalsIgnoreCase(""url"")) {                    feedImage.setUrl(currentValue); return;                } else if (localName.equalsIgnoreCase(""title"")) {                    feedImage.setTitle(currentValue); return;                } else if (localName.equalsIgnoreCase(""link"")) {                    feedImage.setLink(currentValue); return;                }            }        }        else { //is inItem            //finished with news item            if (localName.equalsIgnoreCase(""item"")) {                itemList.add(newItem);                newItem = null;                inItem = false;                return;            } else if (localName.equalsIgnoreCase(""title"")) {                newItem.setTitle(currentValue); return;            } else if (localName.equalsIgnoreCase(""link"")) {                newItem.setLink(currentValue); return;            } else if (localName.equalsIgnoreCase(""description"")) {                newItem.setDescription(currentValue); return;            } else if (localName.equalsIgnoreCase(""author"")) {                newItem.setAuthor(currentValue); return;            } else if (localName.equalsIgnoreCase(""category"")) {                newItem.addCategory(currentValue); return;            } else if (localName.equalsIgnoreCase(""comments"")) {                newItem.setComments(currentValue); return;            } /*else if (localName.equalsIgnoreCase(""enclosure"")) {                 To be implemented later            }*/ else if (localName.equalsIgnoreCase(""guid"")) {                newItem.setGuid(currentValue); return;            } else if (localName.equalsIgnoreCase(""pubDate"")) {                newItem.setPubDate(currentValue); return;            }                   }    }    @Override    public void characters(char[] ch, int start, int length) {        currentValue = new String(ch, start, length);    }</code></pre><p>And an example of the RSS feed I'm trying to parse is <a href=""http://feeds.arstechnica.com/arstechnica/index.xml"" rel=""nofollow"">this one</a>.</p><p>Any ideas?</p>","321697","","321697","","2010-10-25 05:08:31","2011-04-20 07:31:10","Retrieving HTML encoded text from XML using SAXParser","<java><android><xml><rss><saxparser>","3","0","2","",""
"4012056","1","4012097","","2010-10-25 05:12:22","0","705","<p>For those of you who have used the Facebook app, it has an interesting way of showing more information on the home activity by having a draggable view at the bottom of the screen that, when dragged up, shows Facebook notifications.  Dragging the same view back down hides the notifications.  Note that this will work either by holding and dragging it to the top of the screen or simply flinging it in that direction.</p><p>I would like to do something similar for my app.  I have a LinearLayout at the bottom of my activity and want to be able to drag it up to see more information.  How can I go about doing this?  Are there any tutorials available?</p>","164312","","","","","2010-10-25 05:50:50","Android: Draggable view to show another view (similar to Facebook)","<android><facebook><draggable><android-linearlayout>","1","0","","",""
"4012069","1","","","2010-10-25 05:39:16","2","704","<p>I've downloaded the source code from code.google from android. Because they dont come with the eclipse project. I've import them into eclipse.Assuming i've downloaded ABC source code with package named com.example.abc1. I can't import via ""Existing Projects into Workspace"".2. I tried create a android project named ABC with package com.sample.abci tried import via ""achive file"" or ""file system"" into created folder abc.But, all imported files will go into folder abc\abc\src, abc\abc\res,....3. how to auto change package name accordingly current project package name?or i've to create project following package name from the downloaded code?</p>","486015","","","","","2010-10-25 05:39:16","how to import downloaded code from code.google into Eclipse and auto change package name?","<android>","0","3","","",""
"4012118","1","","","2010-10-25 05:55:56","1","2098","<p>HelloIn my android application,on exit of application by using movetasktoback(true) on back of Homescreen,if the user reloads the application again ,the user is redirected directly to Homepage other that to loading screen.Is there any solution that i could exit the application on Home and wherein should clear all the stack created in this app.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2012-02-13 08:01:46","Exit application completely in android","<android>","4","1","1","",""
"4012184","1","","","2010-10-25 06:10:46","0","212","<p>Sorry that I'm asking such a question, but I'm tryin to make this one run for hours, and I'm not finding the mistake...</p><pre><code>public class Main extends ListActivity {/** Called when the activity is first created. */ProgressDialog dialog;@Overridepublic synchronized void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);         new WebLoader().doInBackground(""http://sample.sample.com/sample.xml"");}public class WebLoader extends AsyncTask&lt;String, Void, String&gt; {    @Override    protected String doInBackground(String... params) {        String result = """";        try{            URL url = new URL(params[0]);            URLConnection conn = url.openConnection();            InputStream is = conn.getInputStream();            BufferedInputStream bis = new BufferedInputStream(is);            ByteArrayBuffer baf = new ByteArrayBuffer(2048);            int current = 0;            while((current = bis.read()) != -1)            {                baf.append((byte)current);            }            result = new String(baf.toByteArray());        }        catch(Exception e)        {            Log.e(""gullinews"", e.getMessage());        }        return result;    }    @Override    protected void onPostExecute(String result) {        dialog.dismiss();    }    @Override    protected void onPreExecute() {        dialog = ProgressDialog.show(getApplicationContext(), """",                 ""Loading. Please wait..."", true);    }       }</code></pre><p>}</p><p>Running with a debugger shows, that the xml data is downloaded, but there's just black screen. When I tried ""setContenView(R.layout.main);"" with 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;ListView android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:id=""@android:id/list"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>//Edit: okay, I solved one error, didn't solve the rest. Source updated.</p><p>My Main problem now is, that I ain't got an Idea why the ProgressDialog doesnt show up. rest should be black, that's right.</p>","486084","","486084","","2010-10-25 11:24:17","2010-10-29 06:12:56","What is wrong with this code?","<java><android><listview><android-asynctask><android-sdk-1.6>","1","4","","",""
"4012189","1","","","2010-10-25 06:11:42","0","231","<p>I developed apps with google map.I got map key i got google map in my application two days before .I did nt change anything but now i did not get the google map only show boxes .The logcat show <strong>couldn't get connection factory client error</strong>.I searched this error but i can't get clear ans as well as map .So plz anyone help me to solve this problem.</p><p>Thanks ,Lakshmanan</p>","450596","","","","","2011-04-21 11:51:10","Google map not displayed in my android application now it displayed before two days","<android>","1","0","","",""
"4012232","1","4012423","","2010-10-25 06:23:02","3","1746","<p>I need to draw text to a canvas (of a custom view), and need to first trim it to a maximum width, adding an ellipsis at the end if necessary.  I see you can do it for a TextView, but I want to do it inside a custom view's onDraw() without having to add a child view.  </p><p>Is this possible?  I know I could measure the string, chop off a character, measure again, etc until it is the right size....and I'm sure there are more efficient ways as well...but I'd like to avoid reinventing that wheel if I can.</p>","226507","","","","","2013-11-05 09:16:49","draw text ""ellipsized"" to a canvas","<android>","1","0","","",""
"4012240","1","","","2010-10-25 06:24:23","0","1472","<p>I am trying to Download a Video as explained in:</p><p><a href=""http://stackoverflow.com/questions/2678051/cant-download-youtube-video"">http://stackoverflow.com/questions/2678051/cant-download-youtube-video</a>and<a href=""http://stackoverflow.com/questions/3172962/how-does-a-youtube-movie-downloader-work-youtube"">http://stackoverflow.com/questions/3172962/how-does-a-youtube-movie-downloader-work-youtube</a></p><p>but it seems this method does not work anymore.</p><p>How can I download the .flv from Youtube today? Is there a method to save the movie after I watched it, without downloading again?Does anybody have a working exmaple? (Is the best way to learn)</p><p>Thanks in advance, Adrian.</p>","356097","","","","","2013-07-05 09:47:55","[Android]Downloading a youtube video","<android><download><youtube>","1","1","","",""
"4012403","1","","","2010-10-25 06:54:37","2","1086","<p>I have been reading up on some free engines to use for a game I would like to develop. However I can't seem to make out which one is best. I have focused on AndEngine and TyphonRT however sadly the latter seems to be not realesed yet, a shame as it apears to be a beetter choise. What would you reccomend?</p><p>Thanks </p><p>Ps does anyone have links to typhonrt tutorials? Or will they only be realesed as soon as the engine is?</p>","407133","","","","","2010-10-25 06:54:37","Best free 2D engine for android games?","<android>","0","0","","2011-08-03 16:34:00",""
"4012409","1","4012495","","2010-10-25 06:55:20","0","953","<p>can anybody tell how to add web view in list view in android give example</p><p>Thanks</p>","426344","","302328","","2010-10-25 07:11:20","2010-10-25 07:11:20","how to add web view in list view with example","<android><listview>","1","0","","",""
"4012490","1","4131541","","2010-10-25 07:09:57","0","1976","<p>I am new to android. I am using a database to store my data. I also store date as TEXT in database. format of date is as follow...""Mon, 20 Oct 2010 12:30:00""So i stored them in TEXT datatype not in DateTime. Now i want to display them in following format""Mon, 20 Oct 2010""   The main thing is that i want to ORDER them in DESC. I write a query for this but it dose not work. It there is some alternative for this???? i also read about ""strftime()"" function of SQLITE but i did not know how to use it for this.</p><p>My Query is:</p><p>""Cursor c = myDB.rawQuery(""Select * from List ORDER BY to_date(substr(date,6,20), 'DD-MM-YYYYTHH24:MI:SS') DESC"",null);""</p><p>Please Help me... Thanks in advance!</p>","486139","","135152","","2011-05-25 03:09:13","2011-05-25 03:09:13","How to convert TEXT data to DATE TIME in SQLITE in Android?","<android><sqlite><datetime>","2","0","","",""
"4012703","1","4012777","","2010-10-25 07:49:49","19","22240","<p>How do I test a mobile website for Android or BlackBerry without having the actual device? </p>","193133","","75204","","2010-10-25 15:34:45","2012-04-11 06:32:59","Test a mobile website for Android or BlackBerry","<android><testing><blackberry>","5","0","5","",""
"4012715","1","4015914","","2010-10-25 07:53:02","0","692","<p>I'm trying to use inflate while using ViewFlipper to access to the data inside my view. I've done sample project that crashes.</p><p><code>main.xml</code><br>        &lt; ?xml version=""1.0"" encoding=""utf-8""?><br>        &lt; ViewFlipper<br>    xmlns:android=""http://schemas.android.com/apk/res/android""<br>    android:id=""@+id/RelativeLayout""<br>    android:layout_width=""wrap_content""<br>    android:layout_height=""wrap_content"" /></p><p><code>FlipViewBug.java</code>  </p><pre><code>package android.FlipViewBug;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.LayoutInflater;public class FlipViewBug extends Activity {    private static LayoutInflater inflater = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);    }}</code></pre><p>When I rotate emulator from horizontal to vertical orientation (CTRL+F11) app crashes with ""stopped unexpectedly"". If I remove line<br>inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);<br>app works 'fine'. Am I trying to do something wrong? In my app I have more complex LinnarView that ViewFlipper is nested and the results are the same.<br>I was checking this on android 1.5, 2.2 and galaxy tab. There is no problem while rotating form vertical view to horizontal.</p>","475837","","","","","2010-10-25 15:06:18","ViewFlipper crashes after orientation change","<android>","1","0","","",""
"4012831","1","4012983","","2010-10-25 08:14:47","1","1442","<p>I'm trying to create calendar for android. There is a month switcher (previous/next month). How can I call the same activity (which displays the calendar) with other parameters...</p><p>e.g. <strong>previous</strong> month will have <code>CalendarMonth(java.util.Calendar.MONTH - 1)</code> </p><p>and <strong>next</strong> month will have <code>CalendarMonth(java.util.Calendar.MONTH + 1)</code> </p><p>current month will have nothing in costructor</p><p>Hope it's clear :)</p><p>Thanks for help in advance</p>","295141","","","","","2010-10-25 10:39:32","Call the same activity but with new parameters","<android>","3","2","1","",""
"4012949","1","4013904","","2010-10-25 08:35:47","2","848","<p>Ok, I have 1 custom toast (xml layout) and it works great:</p><pre><code>    LayoutInflater inflater = getLayoutInflater();    View layout = inflater.inflate(R.layout.custom_toast, (ViewGroup) findViewById(R.id.toast_layout));    ImageView image = (ImageView) layout.findViewById(R.id.logo);            image.setImageResource(R.drawable.logo);    title = (TextView) layout.findViewById(R.id.title);            txt = (TextView) layout.findViewById(R.id.text);    toast = new Toast(appContext);    toast.setGravity(Gravity.FILL_HORIZONTAL|Gravity.BOTTOM, 0, 0);    toast.setDuration(Toast.LENGTH_LONG);    toast.setView(layout);        </code></pre><p>But when I try to make 2nd one same way I get error ""Source not found"" which doesn't really tell me anything about what's wrong.</p><pre><code>    LayoutInflater infl = getLayoutInflater();    View lay = infl.inflate(R.layout.toast_arrows, (ViewGroup) findViewById(R.id.toast_lay));                            toastarrows = new Toast(appContext);    toastarrows.setGravity(Gravity.FILL_HORIZONTAL|Gravity.CENTER, 0, 0);    toastarrows.setDuration(Toast.LENGTH_SHORT);    toastarrows.setView(lay);                    toastarrows.show();</code></pre><p>I'd like those 2 toasts to appear almost same time in different places of the screen.Anyone can tell me please what's wrong with this code?</p>","475861","","","","","2010-10-25 11:03:28","Android: 2 toasts same time","<android><toast>","2","3","","",""
"4012966","1","","","2010-10-25 08:38:10","0","277","<p>I have a colored texture work as a menu button. Sometimes I want to gray it out when it's disabled. How to do it without creating a new grayscaled texture? Can glBlendFunc do this for me? Thanks in advance. </p>","372859","","44729","","2010-10-25 13:41:13","2012-04-22 16:48:07","How to render a grayscaled texture on Android?","<android><opengl-es>","2","0","","",""
"4013028","1","4013110","","2010-10-25 08:45:13","1","488","<p>Hi allI'm having an problem with my JNI library.The execution time of the same code changes from one phone to the other.I thought it was just because we were testing on an old phone but recently I run on htc legend and all the jni code was slow...</p><p>I run the profiler and its really a night and day difference:on some phone the jni functions take 15% to 20% as on the other phones it takes 40% and 50% for the same conditions...</p><p>anybody has an explanantion?</p>","440336","","","","","2010-10-25 09:10:08","Android: Performances of Native/JNI code change from one phone to another","<android><jni><android-ndk-r4>","2","3","","",""
"4013113","1","","","2010-10-25 09:00:23","2","233","<p>I want to make an application to add personal details to the contacts in Android. I am able to add the name, phone number, etc. using the following code:</p><pre><code>intent addContactIntent = new Intent(Contacts.Intents.Insert.ACTION, Contacts.People.CONTENT_URI);addContactIntent.putExtra(Contacts.Intents.Insert.NAME, ""myname""); addContactIntent.putExtra(Contacts.Intents.Insert.PHONE, ""232323222""); addContactIntent.putExtra(Contacts.Intents.Insert.PHONE_TYPE, Contacts.Phones.TYPE_MOBILE); </code></pre><p>But the problem is that in address field there is city, street, etc. and here I'm not able to add data.</p>","436663","","1128737","","2012-01-15 17:29:09","2012-02-28 11:04:36","Add city and street to personal details in Android","<android>","1","0","","",""
"4013162","1","4013214","","2010-10-25 09:09:37","1","1354","<p>I am usin location service for getting latitude and longitude of my location.While running my program it will give me wrong latitude and longitude.How can i get my current location details accurately? Is there any settings in mobile /device ?</p><pre><code>String locationProvider = LocationManager.GPS_PROVIDER;        if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER )) {            locationProvider = LocationManager.NETWORK_PROVIDER;        }        Log.w(TAG,""CurrentLocProvider :""+locationProvider);        location=locationManager.getLastKnownLocation(locationProvider);        Log.i(TAG,""Location :""+location);        if(location!=null){            Log.i(TAG,""Location Lat :""+location.getLatitude());            latitude = Double.toString(location.getLatitude());            longitude = Double.toString(location.getLongitude());            txtView.append(""\nLatitude : ""+latitude+""\n Longitude : ""+longitude);        }</code></pre><p>After some time </p><pre><code>public void onLocationChanged(Location location) {Log.i(TAG,""Lat :""+location.getLatitude();Log.i(TAG,""Long :""+location.getLongitude();}</code></pre><p>Also giving me wrong location.Some times USA,In another device china.In Different device it is giving different results?How can i get the currect result?</p><p>Thanks,aare.</p>","486216","","68262","","2010-10-25 09:12:33","2010-10-25 09:22:33","gps doesn't provide my longitude and latitude accurately Android?","<android><gps>","2","0","1","",""
"4013176","1","","","2010-10-25 09:11:28","0","543","<p>When I am tring to save a java file, an error occured and and I can not save the file.</p><p>Error is :</p><p>""Some characters can not be mapped using Cp1252 character encoding.""</p><p>My Code is :</p><pre><code>package org.anddev.android.HelloWorld;    import android.app.Activity;import android.content.SharedPreferences;     import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.View.OnClickListener; import android.widget.*; public class LifeCycleDemo extends Activity { LinearLayout myScreen; TextView txtColorSelect; int actMode = 0; @Override public void onCreate(Bundle savedInstanceState){         super.onCreate(savedInstanceState);         setContentView(R.layout.lifecycledemo);         myScreen = (LinearLayout) findViewById(R.id.myScreen);         TextView txtToDo = (TextView) findViewById(R.id.txtToDo);         String msg =         ""Instructions: \n"" + ""0. New instance (onCreate, onStart, onResume) \n"" +         ""1. Back Arrow (onPause, onStop, onDestroy) \n"" + ""2. Finish (onPause, onStop, onDestroy) \n"" + ""3. Home (onPause, onStop) \n"" + ""4. After 3 &gt; App Tab &gt; re-execute current app \n""         + "" (onRestart, onStart, onResume) \n"" + ""5. Run DDMS &gt; Receive a phone call or SMS \n""         + "" (onRestart, onStart, onResume) \n"" + ""6. Enter some data - repeat steps 1-5 \n"";         txtToDo.setText(msg);}    @Override protected void onPause() {      super.onPause();     //saveDataFromCurrentState();         Toast.makeText(this, ""onPause"", 1).show(); }@Override protected void onRestart() {         super.onRestart();         Toast.makeText(        this, ""onRestart"", 1).show(); }@Override protected void onResume(){         super.onResume();         Toast.makeText(        this, ""onResume"", 1).show(); }@Override protected void onStart(){         // TODO Auto-generated method stub         super.onStart();         //updateFromSavedState();         Toast.makeText(this, ""onStart"", 1).show(); }@Override protected void onDestroy(){         // TODO Auto-generated method stub         super.onDestroy();        Toast.makeText(this, ""onDestroy"", 1).show(); }@Override protected void onStop() {         // TODO Auto-generated method stub         super.onStop();         Toast.makeText(this, ""onStop"", 1).show(); }</code></pre><p>Please help me,... </p>","453607","","1122476","","2012-10-04 12:07:38","2012-10-04 12:07:38","error when saving a java file ( Some characters can not be mapped using Cp1252 character encoding)","<android>","1","0","","",""
"4013273","1","","","2010-10-25 09:28:02","3","676","<p>I want to use Sharepoint webservice in android.i don't know how to start.Anyone help me..</p>","405388","","","","","2011-03-04 12:04:39","How to use sharepoint webservice in android?","<android>","1","3","1","",""
"4013287","1","","","2010-10-25 09:29:54","0","1119","<p>How do I obtain the X &amp; Y resolution of a Bitmap in DPI on the android platform?I'm expecting some api like 'GetXResInDPI()' like below :</p><p><code>double getXResolution(Bitmap bmp) {    double lXRes = Bmp.GetXResInDPI();    return lXRes;}</code></p><p>I'm unable to obtain any such method for the android platform in spite of scourging through the java doc.</p><p>Any help would be appreciated.</p>","461269","","","","","2011-05-19 16:55:39","How to get X & Y resolution in DPI for the android platform?","<android><graphics><bitmap><resolution>","1","0","","",""
"4013396","1","4427115","","2010-10-25 09:46:06","1","417","<p>I want to show a ListView with two Buttons belows (outside of list) it. But as my Activity extends ListActivity, I am facing problems on setContentView. Can anybody please help me?</p><p>Updates: Solution</p><p>I got the solution. No matter which and how many elements we use on a ListActivity, the id (android:id) of ListView in XML file must be @android:id/list. :-)</p>","476747","","476747","","2010-11-08 03:37:38","2010-12-13 08:49:51","ListView with other elements","<android><listview>","2","0","","",""
"4013460","1","","","2010-10-25 09:55:35","1","629","<p>I have an app that have more than one gallery. It is a travel app and it have a separate gallery for each trip. When I'm taking pictures with the camera I'm saving them in the default MediaStore of the system.</p><p>To view an Image I'm using <code>new Intent(Intent.ACTION_VIEW)</code> and it launches the default image viewer. When scrolling with the left and right arrows it displays all the pictures in the folder where the pictures from the camera are saved.</p><p>Is there any way to put an extra in the intent when calling VIEW action which images to scroll trough? I have the IDs of the images for a certain trip in a database.</p><p>Or putting them in  a separate folder is the only solution?</p>","475564","","","","","2011-01-30 14:03:20","ACTION_VIEW for images but only a subset of images","<android><image><android-intent><actionview>","1","0","","",""
"4013508","1","4013554","","2010-10-25 10:02:45","0","2762","<p>How can I compare dates using where statement in sqlite?I don't know how to write date in timestamp format in DB.I guess only timestamp format (integer or string in database) I can compare?!</p><p>Can someone help me with code for writing date in db (using ContentValues )</p><p>I want to use this code for comparison:</p><pre><code> Cursor mCursor =             db.query(true,               tableName,               null,                KEY_DATETIME + "" &gt;= '""+ fromDate +""' and "" +                 KEY_DATETIME + "" &lt;= '""+ toDate +""'"" ,                null,               null,                null,                null,                null);</code></pre>","432848","","2153784","","2011-09-24 23:05:49","2011-09-24 23:05:49","Android sqlite date comparison?","<android>","1","0","","",""
"4013558","1","","","2010-10-25 10:10:25","3","522","<p>Is it possible to detect <code>key-presses</code> in Android when the screen is locked? I want to be able to detect when the center D-Pad button is pressed while the screen is off.</p>","486288","","437301","","2010-10-25 12:43:22","2010-10-25 12:43:22","Android: Detect key-presses in Android when the screen is locked","<android><lockscreen>","0","0","","",""
"4013586","1","4013706","","2010-10-25 10:13:47","1","8032","<p>i have a main Activity called Main which has onActivityResult Method.</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data, Bundle extras){           Log.i(""in OnActivityResult"", ""in OnActivityResult"");    super.onActivityResult(requestCode, resultCode, data);    Log.i(""in OnActivityResult"", ""in OnActivityResult"");    ObjectInputStream ois = null;    if(requestCode == SUB_ACTIVITY_REQUEST_CODE)    {        Log.i(""in OnActivityResult IFFFF"", ""in OnActivityResult IFFFF"");        extras = getIntent().getExtras();        byte gpBytes[] = extras.getByteArray(""gpBytes"");        ByteArrayInputStream bis = new ByteArrayInputStream(gpBytes);        try        {            ois = new ObjectInputStream(bis);            gpObject = (GP) ois.readObject();        }        catch (StreamCorruptedException e)        {                                           e.printStackTrace();        }         catch (IOException e)         {                       e.printStackTrace();        } catch (ClassNotFoundException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    Log.i(""GP object Values"", ""GP object Values&lt;&lt;&gt;&gt;""+ this.gpObject.xValue + ""and &lt;&lt;&gt;&gt;"" + this.gpObject.yValue); }</code></pre><p>and in my second activity i wrote that code on button Action.</p><pre><code>public void onClick(View v) {        Log.i(""button"", ""button"");        goToGrifReferenceAction();        GridReferenceActivity.this.setResult(RESULT_OK, getIntent().putExtra(""gpObject"", GridReferenceActivity.this.gpBytes));        GridReferenceActivity.this.finish();    }</code></pre><p>so now problem is when the second activity finishes. onActivityResult does not call in main activity... can anybody tell me where i am going wrong.</p><p>and i am calling the second activity like this.</p><pre><code>@Override        public void onClick(View v)        {                                       Intent i = new Intent(Main.this, GridReferenceActivity.class);            startActivityForResult(i, SUB_ACTIVITY_REQUEST_CODE);        }</code></pre><p>and here is my menifest 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.anquetMap""  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="".Main""              android:label=""@string/app_name""  android:configChanges=""keyboardHidden|orientation"" 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;         &lt;activity android:name="".GridReferenceActivity""  android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.GridReferenceActivity""/&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=""7"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;</code></pre><p> </p><p>I'll be very thankful to him.Thanks a lot.</p>","397901","","437301","","2010-10-25 12:31:30","2010-10-25 13:05:31","onActivityResult Does not works in android","<android><activity>","3","2","2","",""
"4013677","1","4013691","","2010-10-25 10:31:08","0","2084","<p>Hai Friends,           I want to display a toast message to the user, when there is poor or no internet connection, so i have written the following code in my activity.</p><blockquote>  <p>ConnectivityManager conMgr = ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);</p><pre><code>  if (</code></pre>    <p>conMgr.getNetworkInfo(0).getState() ==  NetworkInfo.State.CONNECTED             ||  conMgr.getNetworkInfo(1).getState() ==  NetworkInfo.State.CONNECTING  ) {</p><pre><code>      //notify user you are online  }       else if (</code></pre>    <p>conMgr.getNetworkInfo(0).getState() ==  NetworkInfo.State.DISCONNECTED             ||  conMgr.getNetworkInfo(1).getState() ==  NetworkInfo.State.DISCONNECTED) {            //notify user you are not online</p><pre><code>      Toast.makeText(getBaseContext(),""Please</code></pre>    <p>Check Your Internet Connection and Try  Again"",Toast.LENGTH_SHORT).show();</p><pre><code>  }</code></pre></blockquote><p>The error message in Log is </p><pre><code>10-25 15:52:03.412: ERROR/AndroidRuntime(19084): Caused by: java.lang.SecurityException: ConnectivityService: Neither user 10031 nor current process has android.permission.ACCESS_NETWORK_STATE.10-25 15:52:03.412: ERROR/AndroidRuntime(19084):     at android.os.Parcel.readException(Parcel.java:1218)10-25 15:52:03.412: ERROR/AndroidRuntime(19084):     at android.os.Parcel.readException(Parcel.java:1206)10-25 15:52:03.412: ERROR/AndroidRuntime(19084):     at android.net.IConnectivityManager$Stub$Proxy.getNetworkInfo(IConnectivityManager.java:266)10-25 15:52:03.412: ERROR/AndroidRuntime(19084):     at android.net.ConnectivityManager.getNetworkInfo(ConnectivityManager.java:153)</code></pre>","424413","","","","","2010-10-25 10:33:02","Need Help in Checking Internet Connection in Android?","<android>","1","0","","",""
"4013712","1","","","2010-10-25 10:35:53","1","737","<p>I have two activities A,B .When i Click a particular button in Activity A,Acivity B has to appear with Flip animation.And when i press particular button in Activity B activity a has to appear with Fllip Animation please let me know.</p>","446010","","446010","","2010-10-26 06:31:48","2012-05-07 13:57:58","How to Implement flip effect to new activity","<android>","1","2","","",""
"4013725","1","4013780","","2010-10-25 10:37:08","16","28883","<p>I am trying to develope an app on canvas ,i am drawing on canvas with bitmap .After drawing,i am trying to convert into bitmap image .</p><p>can anyone give me suggession</p><p>thanking you in advance</p>","486301","","881229","","2013-12-12 06:02:40","2014-02-19 09:07:02","converting a canvas into bitmap image in android","<android><bitmap><android-canvas>","3","1","7","",""
"4013846","1","","","2010-10-25 10:52:17","0","538","<p>Add a type of contact (RawContact), sometimes they are combined with telephone contacts LOOKUP_KEY. It turns out that some contacts entries contain two RawContact'a one integrated phone, one of mine. The question is how to find out whether there is a Contacts RawContract my type? Or learn to RawContacts to which he refers Contacts?</p>","486312","","940096","","2011-11-16 14:34:32","2011-11-16 14:34:32","RawContacts and Contacts","<android><android-contacts>","1","0","","",""
"4013862","1","4013911","","2010-10-25 10:54:46","5","6656","<p>I'm developing an Android application.</p><p>I have several objects loaded on a <code>ListActivity</code>. I want to know the item clicked on event <code>onListItemClick</code>.</p><p>I see method <code>onListItemClick</code> has a parameter called id. How can I setup this id?</p><p>My objects are identified by an ID, how can I add this ID to listItem?</p><p>Thanks.</p>","68571","","","","","2013-06-05 14:01:56","Identify the item clicked on ListActivity method onListItemClick","<android><listactivity><listitem>","4","0","1","",""
"4013984","1","4031803","","2010-10-25 11:12:11","0","253","<p>I'm developing an Android application.</p><p>How can I setup the row id for every item on a ListView? I don't want to use SimpleCursorAdapter. I have my owns objects, and I want to use them.</p><p>These objects have and ID and a NAME. The name will be displayed and the ID will be stored to retrieve it on <code>onListItemClick(ListView parent, View v, int position, long id)</code>.</p><p>Any advice?</p><p>Thanks.</p>","68571","","","","","2010-10-27 09:42:35","How can I setup the row id on every row for a ListView?","<android><listview><rowid>","1","0","","",""
"4014002","1","","","2010-10-25 11:14:25","1","402","<p>I have been struggling with this problem for many days. please help me..</p><p>In my android application i am trying to download images from remote server dynamically ( no of images dynamically come ).  for downloading all images it is taking 30 to 40 seconds mean time user has to wait to see the activity . But it is the worst case that loading activity after loading all images. I want to load activity first then load images one by one.</p><p>Is there anything to do it?</p><p>Thanks and Regards,</p><p>Kiran  </p>","416143","","379693","","2010-10-30 08:42:42","2010-10-30 08:42:42","How to load activity before loading all images?","<android><android-layout><android-sdk-2.1><android-sdk-2.2>","1","0","2","",""
"4014031","1","4014107","","2010-10-25 11:19:05","1","198","<p>In geocoder class document i read below lines</p><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. </p><p>How can I know if my framwork(1.6) providing background service for Geocoder.Currently it gives me null result.</p><p>Thanks,aare.</p>","486216","","","","","2010-10-25 11:30:27","how can i know Geocoder is provided or not android?","<android><gps>","1","1","","",""
"4014033","1","4058722","","2010-10-25 11:19:20","8","1549","<p>It seams that Dalvik's garbage collector doesn't respect SoftReferences and removes them as soon as possible, just like WeakReferences. I'm not 100% sure yet, but despite the fact that there is still ~3MB of free memory my SoftReferences get cleared after I see ""GC freed bla-bla-bla bytes"" in LogCat.</p><p>Also, I saw a comment by Mark Murphy <a href=""http://groups.google.com/group/cw-android/browse_thread/thread/f93a60181d5ee336"">here</a>:</p><blockquote>  <p>Except that it doesn't work on  Android, at least in the 1.5  timeframe. I have no idea if the GC  SoftReference bugs have been fixed.  SoftReferences get GC'd too soon with  this bug.</p></blockquote><p>Is it true? Are SoftReferences not respected?</p><p>How to workaround this?</p>","457086","","","","","2013-08-09 13:42:02","Android: the GC doesn't respect SoftReferences?","<android><garbage-collection><weak-references><soft-references>","3","2","4","",""
"4014047","1","4014093","","2010-10-25 11:20:52","6","5446","<p>I am trying to compile the following for the android ndk</p><pre><code>#include &lt;jni.h&gt;#include &lt;string.h&gt;extern ""C"" {    JNIEXPORT jstring JNICALL Java_com_knucklegames_helloCpp_testFunction(JNIEnv * env, jobject obj);};JNIEXPORT jstring JNICALL Java_com_knucklegames_helloCpp_testFunction(JNIEnv *env, jobject obj) { return env-&gt;NewStringUTF(env, ""Hello from native code!"");}</code></pre><p>but it is giving the following error</p><pre><code>Compile++ thumb: helloCpp &lt;= /cygdrive/c/workspace/helloCpp/jni/main.cpp/cygdrive/c/workspace/helloCpp/jni/main.cpp: In function '_jstring* Java_com_knucklegames_helloCpp_testFunction(JNIEnv*, _jobject*)':/cygdrive/c/workspace/helloCpp/jni/main.cpp:10: error: no matching function for call to '_JNIEnv::NewStringUTF(JNIEnv*&amp;, const char [24])'/cygdrive/d/android/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/jni.h:839: note: candidates are: _jstring* _JNIEnv::NewStringUTF(const char*)make: *** [/cygdrive/c/workspace/helloCpp/obj/local/armeabi/objs/helloCpp/main.o] Error 1</code></pre>","471196","","160206","","2010-10-25 11:22:38","2010-10-25 11:28:56","Android C++ NDK","<c++><android><android-ndk>","1","0","1","",""
"4014053","1","5642369","","2010-10-25 11:21:47","3","109","<p>I am currently pondering the feasability of implementing part of the Android APIs on a desktop JVM and I was wondering whether you had already heard of such a project.</p><p>If there aren't, and you know good reasons why (beyond ""no one has begun that yet""), I would be glad to read them.</p>","113158","","55452","","2010-11-15 16:15:59","2011-04-13 12:16:15","Is there a project that aims to implement (part of) the Android APIs on a desktop JVM?","<android><jvm>","2","2","3","",""
"4014142","1","","","2010-10-25 11:35:47","5","884","<p>Is there any procedure/API provided in Android SDK/NDK to check if ""JPEG HW Decoder"" exists in the underlying android phone handset?</p><p>If yes, then</p><p>Is there any procedure/API provided in Android SDK/NDK to access ""JPEG HW Decoder"" for decompressing JPEG image? </p><p>( I guess PV Media framework provides access for the same, but I am not sure)</p><p>I plan to use JPEG hardware decoder to decompress jpeg image for achieving peformance. Please comment!</p><p>Thanks,Rodney </p>","486359","","446591","","2011-03-12 06:03:33","2012-02-14 09:29:11","JPEG HW Decoder access API","<android><jpeg><decoder>","1","0","1","",""
"4014213","1","","","2010-10-25 11:46:25","5","2829","<p>I would like to write an App, that picks up sound from the mic, adds effects to it and plays it back in realtime.</p><p>If found <a href=""http://developer.android.com/reference/android/media/AudioRecord.html"">AudioRecord</a> to pick up sound from the mic and <a href=""http://developer.android.com/reference/android/media/AudioTrack.html"">AudioTrack</a> to play it back. In between, I need some library to manipulate the sound, add effects or use some equalizer on it. This maybe achieved with the Java Sound API, but that seems to be missing as I read <a href=""http://code.google.com/p/android/issues/detail?id=60"">in this issue report</a> pointed to from <a href=""http://stackoverflow.com/questions/1971463/sound-effects-manipulation"">this SO question</a>.</p><p>My question is: How can I do this on Android? Can you recommand any libraries?</p>","60518","","","","","2013-09-03 16:16:08","How to add sound effects on Android?","<java><android><audio>","2","0","2","",""
"4014287","1","4629976","","2010-10-25 11:58:33","1","710","<p>I've created an app that uses MediaPlayer to play a random (short) sound when a button is clicked. The sounds are played correctly on android devices &lt; 2.2. This is the code responsible for playing sounds.</p><pre><code>r = new Random();sounds = new ArrayList&lt;MediaPlayer&gt;();sounds.add(MediaPlayer.create(this, R.raw.sound1));sounds.add(MediaPlayer.create(this, R.raw.sound2));sounds.add(MediaPlayer.create(this, R.raw.sound3));sounds.add(MediaPlayer.create(this, R.raw.sound4));sounds.add(MediaPlayer.create(this, R.raw.sound5));theButton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        playSound();    }});private void playSound() {    Thread thread = new Thread() {        public void run() {            MediaPlayer soundPlayer = sounds.get(r.nextInt(sounds.size()));            while (soundPlayer.isPlaying())            {                soundPlayer = sounds.get(r.nextInt(sounds.size()));            }            soundPlayer.seekTo(0);            soundPlayer.start();        }    };    thread.start();}</code></pre><p>The sounds are all .wav files. I tried converting them to .mp3, but then they wouldn't play at all. Am I doing something extremely wrong, or is the MediaPlayer in 2.2 buggy? Anyone else had this problem and know of a fix? Keep in mind that the sounds are played normally on all other devices with an android version below 2.2.</p>","397060","","","","","2011-01-07 20:27:06","Mediaplayer plays weird sounds on Android 2.2","<android><media-player><android-2.2-froyo>","2","1","","",""
"4014298","1","","","2010-10-25 11:59:57","0","668","<p>I'm trying to use RelativeLayout to display a map tile, surrounded by directional buttons, in a simple dialog.</p><p>I've tried a few variations, but inevitably, some of my buttons are missing.</p><p>In this version of the example, the <code>up</code> and <code>left</code> buttons are missing. If I declare the <code>up</code> button first and place the <code>tile</code> button relative to it, then <code>up</code> shows. Do RelativeLayouts require the topmost widget to be declared first? Guess not, there would be no use for <code>layout_above</code> then...</p><p>I can't post images (low rep), but you can view the result <a href=""http://emberapp.com/paour/images/emulator"" rel=""nofollow"" title=""here"">here</a>.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""    &gt;&lt;ImageView        android:id=""@+id/tile""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_margin=""5px""        android:layout_centerInParent=""true""        android:src=""@drawable/loading""        /&gt;&lt;Button        android:id=""@+id/up""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_above=""@id/tile""        android:layout_centerHorizontal=""true""        android:drawableLeft=""@drawable/up""        /&gt;&lt;Button        android:id=""@+id/left""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@id/tile""        android:layout_centerVertical=""true""        android:drawableLeft=""@drawable/left""        /&gt;&lt;Button        android:id=""@+id/right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/tile""        android:layout_centerVertical=""true""        android:drawableLeft=""@drawable/right""        /&gt;&lt;Button        android:id=""@+id/down""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/tile""        android:layout_centerHorizontal=""true""        android:drawableLeft=""@drawable/down""        /&gt;&lt;Button        android:id=""@+id/in""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/tile""        android:layout_alignParentLeft=""true""        android:text=""@string/test_in""        /&gt;&lt;Button        android:id=""@+id/out""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/tile""        android:layout_alignParentRight=""true""        android:text=""@string/test_out""        /&gt;&lt;/RelativeLayout&gt;</code></pre>","304876","","","","","2010-10-25 14:28:54","RelativeLayout doesn't display all my widgets","<android><gui><layout>","1","0","","",""
"4014317","1","","","2010-10-25 12:02:18","5","3458","<p>whenever I click on the EditText, the screen readjusts and the edittext-view moves up. But this is not enough and the soft-keyboard still covers the view to not show what a user typing.</p><p>My layout is as follows:</p><p>A listview occupying 65% of screen height, followed by an editetxt view and a button</p><pre><code>LISTVIEW______________________________EDITTEXT              |BUTTON ______________________________</code></pre><p>My activity has the following flag set  <code>android:windowSoftInputMode=""stateAlwaysHidden|adjustPan""</code></p>","266272","","21234","","2010-10-25 12:10:48","2014-03-12 13:53:00","How to avoid the on-screen keyboard from covering the EditText in android","<android><android-softkeyboard>","2","4","2","",""
"4014331","1","4014924","","2010-10-25 12:04:13","2","1883","<p>I've taken some animation xml straight from the android docs, and as far as I can see, doesn't work on either my 2.1 update 1 emulator or my 2.1 update 1 Galaxy S device. </p><p>Specifically, I'm trying to create an animation to pulsate a view (i.e. make it smaller then larger in one animation) This is the very simple markup: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;set         xmlns:android=""http://schemas.android.com/apk/res/android""&gt;         &lt;scale                 android:fromXScale=""1.0""                 android:toXScale=""0.5""                 android:fromYScale=""1.0""                 android:toYScale=""0.5""                 android:pivotX=""50%""                 android:pivotY=""50%""                 android:duration=""1000"" /&gt;                 &lt;set android:startOffset=""1000""&gt;                         &lt;scale                         android:fromXScale=""0.5""                         android:toXScale=""1.0""                         android:fromYScale=""0.5""                         android:toYScale=""1.0""                         android:pivotX=""50%""                         android:pivotY=""50%""                         android:duration=""1000"" /&gt;                 &lt;/set&gt; &lt;/set&gt; </code></pre><p>So what I'm trying to achieve is to reduce the view from its size to half of it over a second, then to increase it back to its original size over a second. So to re-iterate, over two seconds it should go from original -> half size -> original.</p><p>What actually happens is it snaps instantly to half of the views size (even though fromX/YScale is at 1.0) and then performs the animation over two seconds and snaps back to original size afterwards. </p><p>Can anyone else try this out quickly? If others see this behaviour I'll submit it as a bug. I just can't believe something so basic could be broken!? </p><p>Also, copying this animation under the ""Tween Animation"" heading on this page <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html"" rel=""nofollow"">http://developer.android.com/guide/topics/graphics/2d-graphics.html</a> word for word also doesn't animate as per the page says. Seems to be broken in exactly the same way!</p><p>Anyone got any ideas? </p><p>Thanks! </p><p>Andy.</p>","187100","","187100","","2010-10-25 13:21:03","2012-11-16 17:27:12","Android animation startOffset broken or buggy?","<java><android><animation>","3","0","3","",""
"4014391","1","","","2010-10-25 12:12:15","10","15097","<p>I need to implement c2dm in my app. Is there anyone who is also doing this? Please help..some tutorials will be very helpful OR if you have completed your c2dm implementation then a tutorial is more than appreciated.</p><p>Please help.</p>","152867","","","","","2012-04-11 10:46:29","Anyone doing C2DM on Android","<android><android-c2dm>","2","5","11","",""
"4014392","1","4017330","","2010-10-25 12:12:20","2","322","<p>I am watching a YouTube Video on a Browser, how would i continue to watch the same video using YouTube Apk on an Android Phone? Assuming that i already have the parameters of where to continue from and pass those parameters to the phone using C2DM ?</p><p>RegardsV. Ramkumar.</p>","486391","","","","","2010-10-26 11:51:04","Using YouTube apk?","<android><youtube>","1","1","","",""
"4014426","1","4014799","","2010-10-25 12:17:47","5","6099","<p>I wounder if the source code for Twitter android app is released??</p>","486396","","","","","2013-12-27 08:29:00","Twitter Android App - Source code","<android><twitter>","5","2","1","",""
"4014517","1","4014677","","2010-10-25 12:29:31","0","3232","<p>I am new to android.I need to create a Transparent Panel .Can any one help me with same code..</p><p>Thanks in advance....</p>","366916","","437301","","2010-10-25 16:25:06","2012-01-28 05:40:46","Android-Transparent Panel","<android>","4","2","","",""
"4014709","1","4015072","","2010-10-25 12:53:58","0","818","<p>I have a very odd problem, hopefully easily solved.</p><p>I am drawing a quad as a triangle strip. It simply has 2 triangles in the strip and I apply a texture containing an alpha channel to it. </p><p>For one of the triangles it seems the alpha is fine and exactly as I want it however for the first triangle it looks as though the alpha is either 1.0 or 0.0, rather than the correct in-between values.</p><p>What could be causing this? Have I assumed correctly that that's the problem? I shall attach an image so people can see what I mean:</p><p><img src=""http://i.stack.imgur.com/xzJWm.png"" alt=""Alpha problem""></p><p>The weird thing is this is drawn as a triangle array and from 1 texture so I am unsure how I can change settings or affect the texture in some way. I thought maybe the triangle was being drawn in a different rotation but they are both anti-clockwise.</p><p>Code wise drawn like so:</p><pre><code>    gl.glBindTexture(GL10.GL_TEXTURE_2D, texturePointer);    //Enable the vertices buffer for writing and to be used during our rendering    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    //Specify the location and data format of an array of vertex coordinates to use when rendering    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);    //Enable the texture buffer    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);    gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer);</code></pre><p>So I am a little stumped if I'm honest.</p><p>Edit: Looking at this a bit more it's as though one of the triangles is being textured twice so the alpha obviously adds up and it gets a bit more applied. This probably means I'm doing something wrong with my triangle strip. I make the strip like so (started hand writing it out to check..):</p><pre><code>//Top left    vertices[vertPlace++] = 0.0f;    vertices[vertPlace++] = height;    vertices[vertPlace++] = 0.0f;    //Bottom left    vertices[vertPlace++] = 0.0f;    vertices[vertPlace++] = 0.0f;    vertices[vertPlace++] = 0.0f;    //top right    vertices[vertPlace++] = width;    vertices[vertPlace++] = height;    vertices[vertPlace++] = 0.0f;    //Bottom right    vertices[vertPlace++] = width;    vertices[vertPlace++] = 0.0f;    vertices[vertPlace++] = 0.0f;    //Now set the indices    indices[indiPlace++] = (short)0;    indices[indiPlace++] = (short)1;    indices[indiPlace++] = (short)2;    indices[indiPlace++] = (short)3;    //Top Left    textureCoords[textPlace++] = 0.0f;    textureCoords[textPlace++] = 1.0f;    ///Bottom left    textureCoords[textPlace++] = 0.0f;    textureCoords[textPlace++] = 0.0f;    //Top right    textureCoords[textPlace++] = 1.0f;    textureCoords[textPlace++] = 1.0f;    //Bottom right    textureCoords[textPlace++] = 1.0f;    textureCoords[textPlace++] = 0.0f;</code></pre><p>Somehow I'm doing something wrong there, I just can't see it.</p>","432272","","432272","","2010-10-25 13:29:06","2011-01-30 15:03:22","Android OpenGL - ES alpha transparency different for triangles in triangle strip?","<android><opengl-es><textures><alphablending>","1","0","","",""
"4014789","1","","","2010-10-25 13:05:28","1","865","<p>hi i have create a simple activity but does not work any one help me that how could it does not work here is the code</p><pre><code>public class CountriesActivity extends Activity {     protected void onCreate(Bundle icicle) {         super.onCreate(icicle);         setContentView(R.layout.countries);         ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,                 android.R.layout.simple_dropdown_item_1line, COUNTRIES);         AutoCompleteTextView textView = (AutoCompleteTextView)                 findViewById(R.id.countries_list);         textView.setAdapter(adapter);     }     private static final String[] COUNTRIES = new String[] {         ""Belgium"", ""France"", ""Italy"", ""Germany"", ""Spain""     };</code></pre>","467591","","3171","","2010-10-25 13:06:14","2011-01-04 07:34:36","countries List in an array","<android>","1","1","1","",""
"4014807","1","5877559","","2010-10-25 13:06:41","0","546","<p>I'm currently trying to create a gallery of pictures loaded from Internet.</p><p>I'm using a standard Gallery object, with a custom adapter and a custom ImageView. Everything is working quite fine, expect for the pictures downloading.</p><p>I'm using an asynchronous task to do this (I have thumbnails displaying while loading).</p><p>It's working really well to load thumbnails, but not really for the ""big"" images (about 50k each).</p><p>I'm using this for loading pictures :</p><pre><code>private class DownloadImageTask extends AsyncTask&lt;String,Void,Drawable&gt;{    @Override    protected Drawable doInBackground(String... arg0) {        URL url;        InputStream is;        Drawable d=null;        try {            url = new URL(arg0[0]);            is = (InputStream) url.getContent();            d = Drawable.createFromStream(is, ""src"");            return d;        } catch (MalformedURLException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }        return null;    }    protected void onPostExecute(Drawable result) {        setImage(result);    }</code></pre><p>}</p><p>Problem is, quite randomly but about 8 times out of 10, I got the following message in my log ""10-25 14:58:18.764: DEBUG/skia(11294): --- decoder->decode returned false"", and then my drawable is null.</p><p>I'd say there is a problem with my code, but why is it working sometimes? or not? </p><p>I tried to put WebViews in my gallery, loading only the image URL, and it's working really nicely and awsomly fast to download the pictures, but then the display is quite messed up (slower and not responsive, and images are not centered in the screen...).</p><p>What should I do?</p><p>I don't understand why sometimes my inputstream is not working. Only sometimes. If tried hard enough (like with a loop), it always works after a few attemps, but it's really an ugly solution. </p><p>Is there a way to download the pictures with webviews and get them after? I tried something like that (with getCache() or capturePicture() from the webview) but it wasn't showing anything...</p><p>Any thoughts? Any ideas?</p><p>Thanks a lot! </p><p>EDIT:Well.. it's working everytime when I realize a copy of the inputStream... but why?</p>","483291","","483291","","2010-10-25 13:39:37","2011-05-04 01:36:50","Android - Dynamic Picture loading troubles","<android><download><internet><inputstream><image>","1","0","","",""
"4014845","1","","","2010-10-25 13:12:42","1","1870","<p>Hi I am new to android.I just create the Grid view by using java code(not using xml design)I need to reduce the font size of the Grid view .How to do this ? </p>","486458","","","","","2010-10-25 19:16:35","how to reduce the font size in Grid view in Android?","<android>","1","0","","",""
"4014895","1","","","2010-10-25 13:17:15","1","148","<p>I have downloaded the image from given url,and displayed in the imageview,which works fine in the emulator .but not works in real device... whats the problem?</p><p>Here my code</p><pre><code>final String url = urlStr;            InputStream inputStream = null;            try {                inputStream = httpRequest.openHttpConnection(url);                if(inputStream!=null)                {                bitmap = BitmapFactory.decodeStream(inputStream);               if(bitmap!=null)                {                width=bitmap.getWidth();                height=bitmap.getHeight();                int newWidth = 50;                int newHeight = 50;             // calculate the scale - in this case = 0.4f                float scaleWidth = ((float) newWidth) / width;                float scaleHeight = ((float) newHeight) / height;                // create matrix for the manipulation                Matrix matrix = new Matrix();                // resize the bit map                matrix.postScale(scaleWidth, scaleHeight);               // recreate the new Bitmap               resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0,width, height, matrix, true);                }               inputStream.close();            }             }            catch (IOException e1)            {                e1.printStackTrace();            }            return  resizedBitmap;</code></pre>","461972","","461972","","2010-10-25 16:06:49","2011-05-07 17:51:01","image issue on android","<android>","1","2","","",""
"4014928","1","4014966","","2010-10-25 13:21:26","0","170","<p>I read recently in a magazine that it's now possible to write / use Adobe-Air applications on android devices.</p><p>I've been developing android applications for 3 months and find that it's sometimes tricky to get the desired results using android sdk.</p><p>On the other hand I read that you can use html and javascript stuff in AIR applications.</p><p>So the question: Who here has developed with both AIR and the Android SDK: which way is more elegant, better for performance or easier?!</p><p>Thank you,</p><p>Mur</p>","408780","","319618","","2010-10-25 13:26:47","2010-10-25 13:26:47","Android application development","<android><air>","1","0","","",""
"4014991","1","4022059","","2010-10-25 13:28:33","0","762","<p>I have an handler in one activity, and I would like to use sendBroadcast in order to start receiver of another application(different APK).</p><p>I cant do this since i am into an Handler and i`am losing the scope of my activity.</p><p>Any idea how I could achieve this idea?</p><p>some code:</p><pre><code>private Handler mHandler = new Handler() {    public void handleMessage(Message msg) {        switch (msg.what) {            case INSTALL_COMPLETE:                 // here I wanna start my extern application via broadcasting!!                startApplication();                break;            default:                break;        }    }</code></pre><p>if broadcasting wont work through handler, any other ideas would be welcome,</p><p>thanks.</p>","260511","","","","","2010-10-26 08:55:00","Broadcast Intent inside an Handler","<android>","1","0","","",""
"4015015","1","","","2010-10-25 13:30:35","2","915","<p>I was wondering if there is a way for using one set of images for all the resolutions. I have an application, and I want to port it on all the android resolutions but I don't want to store 3 sets of images, for every resolution category. What would be the best practice to use as less images as possible.</p><p>Thank you!</p>","460611","","","","","2013-05-02 11:33:50","Using images for multiple resolutions","<android>","2","1","2","",""
"4015026","1","4086745","","2010-10-25 13:31:26","7","5118","<p>We have about 7-8 tables in our Android application each having about 8 columns on an average. Both read and write operations are performed on the database and I am experimenting and trying to find ways to enhance the performance of the DataAccess layer. So, far I have tried the following:  </p><ol><li>Use positional arguments in where clauses (Reason: so that sqlite makes use of the same execution plan)</li><li>Enclose inserts and update with transactions(Reason: every db operation is enclosed within a transaction by default. Doing this will remove that overhead)</li><li>Indexing: I have not created any explicit index other than those created by default on the primary key and unique keys columns.(Reason: indexing will improve seek time)</li></ol><p>I have mentioned my assumptions in paranthesis; please correct me if I am wrong.</p><p><strong>Questions:</strong>  </p><ol><li><p>Can I add anything else to this list? I read somewhere that avoiding the use of db-journal can improve performance of updates? Is this a myth or fact? How can this be done, if recomended?   </p></li><li><p>Are nested transactions allowed in SQLite3? How do they affect performance?The thing is I have a function which runs an update in a loop, so, i have enclosed the loop within a transaction block. Sometimes this function is called from another loop inside some other function. The calling function also encloses the loop within a transaction block. How does such a nesting of transactions affect performance?  </p></li><li><p>The where clauses on my queries use more than one columns to build the predicate. These columns might not necessarily by a primary key or unique columns. Should I create indices on these columns too? Is it a good idea to create multiple indices for such a table?</p></li></ol>","236128","","","","","2013-07-02 10:38:17","SQLite Optimization for Android application","<android><optimization><sqlite3>","4","0","9","",""
"4015036","1","4078136","","2010-10-25 13:32:15","18","2209","<p>I want to start a project for Android but i really like to build it using Maven. Does Google provide support for Maven or plan to support it? It would be great if anybody know at least an archetype for Maven that I can use meanwhile. Thanks in advance.</p>","354063","","","","","2012-09-10 15:32:32","maven support for android projects?","<java><android><maven>","4","0","3","",""
"4015088","1","4015793","","2010-10-25 13:36:39","3","2410","<p>I'd like to show a ContextMenu for a custom View which is not part of an AdapterView.</p><p>I called</p><pre><code>myActivity.registerForContextMenu(myView);</code></pre><p>and the ContextMenu already shows up.</p><p>But I don't know how to access the data of myView in </p><pre><code>@OverrideonContextItemSelected(MenuItem item) //...</code></pre><p>I thought I could create a custom menuInfo in</p><pre><code>@OverrideonCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) //...</code></pre><p>This is from the docs: ""menuInfo - Extra information about the item for which the context menu should be shown. This information will vary depending on the class of v.""</p><p>Can anyone give me a hint?</p>","474326","","","","","2010-10-25 14:54:32","Android: How to create a ContextMenu for a custom View","<android><menu><contextmenu>","1","0","3","",""
"4015094","1","","","2010-10-25 13:37:47","5","23812","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker"">Enable GPS programatically like Tasker</a>  </p></blockquote><p>I'm a beginner android developer.</p><p>I want enable and disable GPS with a click of a button, without running this intent:</p><pre><code>intente in = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);   startActivity(in);</code></pre><p>that brings me in the setting menu.</p><p>Is there a method to enable or disable GPS as in the android ""Power Control"" widget?</p><p>Thanks</p><p>EDIT:</p><p>The widget that I said is in the android system (version 1.6 on forward). There is an application (siriusapplications.com/powercontrolplus) that make want I want do, and extend the android power control.. my question is: how this persor can manage this?? –</p>","486488","","507519","","2011-12-11 15:57:32","2011-12-11 15:57:41","Android Enable and Disable GPS","<android><gps>","2","0","1","2011-08-25 18:25:52",""
"4015123","1","4015149","","2010-10-25 13:41:00","3","3702","<p>I have created a very small android app. I don't want to publish it to public. I just want my other friend to run my app on his phone. I don't have android phone but my friend has one. I have developed the app using eclipse IDE. How do I bundle it to apk and give it to him. I am a beginner (even less than a beginner) - please tell me what should I do ?</p>","104450","","","","","2010-10-25 14:17:56","How to distribute apk files to my friends?","<android>","2","0","","",""
"4015249","1","4016859","","2010-10-25 13:57:01","1","446","<p>i want to install a non market app on android device by using given steps:</p><p>1)Copy the APK file you want to install to your phone's memory card and insert the card into your Android phone.2)Go to Android Market and search for the Apps Installer application.3)Open it and click on the Install button.4)After it is installed, just open it. It will show you all the APK files stored directly in     the root directory of your memory card.5)Just click on the application you want to install and it will be installed.</p><p>but When trying to install the APK file, I tried a couple of programs.</p><p>""App Installer"" and ""Apps Installer"" both see the APK file on the root directory but give me this message ""There is a problem trying to parse the package.""</p><p>please help me</p><p>Thanks in advance </p>","361288","","","","","2010-10-25 16:57:18","Problem on insatlling apk on android device","<android>","2","2","","",""
"4015296","1","4016760","","2010-10-25 14:02:48","1","3375","<p>My select_screen_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/home_menu""      android:icon=""@drawable/home_tab""      android:title=""Home"" /&gt; &lt;item android:id=""@+id/submit_report""      android:icon=""@drawable/submit_tab""      android:title=""Submit a Report"" /&gt;  &lt;item android:id=""@+id/search_list""      android:icon=""@drawable/search_icon""      android:title=""Search the List"" /&gt;&lt;/menu&gt;</code></pre><p>and my activity class used it as</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.select_screen_menu, menu);         return true;}public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.home_menu: {      Static.backwardTo(User.viewflipper,ConstandsUsed.USER_SELECT_SCREEN);      return true;    }    case R.id.submit_report:      Static.backwardTo(User.viewflipper, User.sumitAReport_PAGE);      return true;    case R.id.search_list:      Static.backwardTo(User.viewflipper, User.searchTheList_PAGE);      return true;    default:      return super.onOptionsItemSelected(item);        }}</code></pre><p>i have used the following code to identify the back button</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {------}</code></pre><p>this two are not working together. The menu will work only when this onkeydown function is removed.Is there any way to use this togetherDo I need to do any other things?</p><p>Please help me, thanks</p>","477754","","477754","","2010-10-25 14:32:19","2010-10-25 16:30:58","Android menu not displaying","<android><menu>","2","4","","",""
"4015458","1","","","2010-10-25 14:19:59","1","867","<p>I'm trying to <em>have fun</em> with android animations. This is the crime scene:I've a relative layout with the following components:</p><ol><li><p>On the background we placed a ListView 200dip wide.</p></li><li><p>Hover the ListView we added: one Button 40dip wide, 2nd ListView 80dip wide and a 3rd ListView 80dip wide.</p><p>As first thing I would like to show the ListView behind the other components. Once the user selects an item I want to show the other components hover the first listView coming from right with a TranslateAnimation.</p></li></ol><p>I hope you can understand my poor english.</p><p>Have fun and have a good week!</p><p>Any help is really appreciated.</p>","259072","","","","","2010-12-03 01:23:32","Android TranslateAnimation with Button View problem","<android><animation><sdk>","1","0","","",""
"4015498","1","","","2010-10-25 14:24:52","13","557","<p>I am contacting a web service multiple times to get a JSON String via <code>HttpGet</code> and <code>DefaultHttpClient</code>.</p><pre><code>...DefaultHttpClient defaultHttpClient = new DefaultHttpClient();HttpGet httpGet = new HttpGet(url);HttpResponse httpResponse = (HttpResponse)defaultHttpClient.execute(httpGet);HttpEntity httpEntity = httpResponse.getEntity();...</code></pre><p>I find that LogCat is printing <strong>interface name: null</strong> with tag <strong>System.out</strong> for each time <code>HttpResponse httpResponse = (HttpResponse)defaultHttpClient.execute(httpGet);</code> is executed.</p><p>Am i establishing this http connection properly with <code>HttpGet</code>? Is there a different way?</p><p>How can i create this connection and not get <strong>interface name: null</strong> LogCat messages from the <strong>System.out</strong> tag?</p>","416412","","2416510","","2013-09-27 12:33:05","2014-02-07 15:33:49","Logcat printing ""interface name: null"" during each DefaultHttpClient execution method call","<android><httpclient><httpresponse><logcat><http-get>","2","6","2","",""
"4015537","1","","","2010-10-25 14:29:02","0","180","<p>HI all,</p><p>actually i m new in android development.</p><p>i have one activity class and one simple class(Without Activity). in Simple class i m calling some web service and storing the response in array. after that this array i want to access in my activity class. m not able to make the object. how can i do that? i don't want to use bundle. as this array i want to access in more than one class. </p><p>please help me.</p><p>thanks in advance.</p>","383597","","","","","2010-10-25 14:42:23","Android Class Object problem","<android>","2","0","","",""
"4015618","1","4015941","","2010-10-25 14:37:42","0","388","<p>I have a RelativeLayout in wich i have two images. The problem is: the scale up. They are displayed way bigger than the are supposed to. Here is my layout:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/gallery_batch""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:background=""@drawable/batch_background""&gt;&lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/icon_success""    android:id=""@+id/view_batch_icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:layout_centerVertical=""true""    android:padding=""5dp""    android:layout_gravity=""center_vertical""/&gt;&lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/text_bereits_geladen""    android:layout_toRightOf=""@id/view_batch_icon""    android:layout_centerVertical=""true""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:padding=""5dp""/&gt;</code></pre><p></p><p>Can anybody tell me what i am doing wrong here?Thanks!</p>","457378","","","","","2010-10-25 15:10:25","Images in my Layout scale up but the should not. How can i prevent the Images to be scaled?","<android><image><scaling>","1","0","","",""
"4015653","1","4015699","","2010-10-25 14:41:33","0","169","<p>Friend's         I'm working upon searching in maps, here i have string in my array,when i enter characters for searching in Edit text box,i need the string have started with similar character in my result.<br>for example in my array i have String[] name ={""A"",""B"",""BB"",""Boys"",""Box""}</p><p>Initially i have all the array string in my result,if i suppose enter an character like b in editbox i need filter and show the charcters matches with b that is ""B"",""BB"",""""Boys"",""Box"",if suppose i enter two characters like ""bo""in editbox ,i need result strings ""Boys"",""Box""in another array.Help me.</p><p>thanks in advance.</p>","393953","","","","","2010-10-25 14:45:56","Filtering Array of Strings","<android>","1","0","","",""
"4015680","1","6202502","","2010-10-25 14:44:05","26","21017","<p>I'm working on an application that displays someone else's database of images.  The images they have are all vector graphics and can be converted to any format, however keeping them in a vector format is good because users will probably want to zoom in closely.</p><p>The question is, is there a built-in way to display a vector graphic in Android?  The format doesn't matter - we can convert.  The current format we're considering is PDF, but given that there's no native PDF support, I'd have to do something pretty complex just to get it working (for example, integrating <a href=""http://poppler.freedesktop.org/"">poppler</a> into my app via the NDK).  The alternative is to just convert the vector graphics into a simpler format (JPG, GIF) but I'd rather avoid that.</p>","60261","","","","","2012-11-19 07:09:00","Vector graphics in Android","<android><vector-graphics>","2","2","8","",""
"4015744","1","4019870","","2010-10-25 14:49:12","0","328","<p>Hai friends I am trying to display thumbnail videos in my media player and it's not working. Log cat error is </p><pre>10-25 19:50:35.577: ERROR/MediaPlayerService(33):   error: -210-25 19:50:35.577: ERROR/MediaPlayer(65): Unable to to create media player10-25 19:50:35.916: ERROR/AndroidRuntime(1175): FATAL EXCEPTION: main10-25 19:50:35.916: ERROR/AndroidRuntime(1175): java.lang.RuntimeException: Unable to start activity ComponentInfo{media.media/media.media.VideoViewDemo}: java.lang.NullPointerException10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.os.Handler.dispatchMessage(Handler.java:99)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.os.Looper.loop(Looper.java:123)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at java.lang.reflect.Method.invokeNative(Native Method)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at java.lang.reflect.Method.invoke(Method.java:521)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at dalvik.system.NativeStart.main(Native Method)10-25 19:50:35.916: ERROR/AndroidRuntime(1175): Caused by: java.lang.NullPointerException10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at media.media.VideoViewDemo.onCreate(VideoViewDemo.java:72)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     ... 11 more</pre> ","486554","","199122","","2010-10-25 14:53:09","2010-10-26 00:31:01","video thumbnails not working","<java><android><video>","1","0","","",""
"4015773","1","4015886","","2010-10-25 14:52:11","6","15613","<p>firstly, I coded some methods in Main Activity, But I decided they should be a class.</p><p>this is my code... openFileOutput and openFileInput are undefined. Any idea?? maybe it should be service or activity...??</p><pre><code>    package spexco.hus.system;    import java.io.FileInputStream;    import java.io.FileNotFoundException;    import java.io.FileOutputStream;    import java.io.IOException;    import java.util.Date;    import spexco.hus.cepvizyon.CepVizyon;    import android.content.Context;    public class LicenseIDB {    private String PHONECODEFILE = ""CepVizyonCode"";    private static String PhoneCode = null;    public LicenseIDB() {    if (readLocal(PHONECODEFILE, 8) == null)        createSystemCode();}public static long getDate() {    Date currentTime = new Date();    return currentTime.getTime();}public void createSystemCode() {    long date = getDate();    String str = Integer.toHexString(Integer.MAX_VALUE - (int) date);    for (int i = str.length(); i &lt; 8; i++) {        str += """" + i;    }    PhoneCode = str.substring(0, 8);    saveLocal(PhoneCode, PHONECODEFILE);}public static String getPhoneCode() {    return PhoneCode;}public void saveLocal(String fileString, String Adress) {    try {        FileOutputStream fos = openFileOutput(Adress, Context.MODE_PRIVATE);        fos.write(fileString.getBytes());        fos.close();    } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}public String readLocal(String Adress, int lenght) {    byte[] buffer = new byte[lenght];    String str = new String();    try {        FileInputStream fis = openFileInput(Adress);        fis.read(buffer);        fis.close();        str = new String(buffer);    } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    return str;}</code></pre><p>}</p>","483988","","","","","2014-01-04 12:30:34","The method OpenFileOutput() is undefined !","<android><local-storage>","2","0","1","",""
"4015832","1","4015965","","2010-10-25 14:57:49","1","236","<p>Currently I'm mixing explicit attributes (layout_width, height, alignment) on my various XML layouts with coded styles in styles.xml, plus outsourcing colors from colors.xml.</p><p>From your experience, what's the recommended way to organize an android app's layouts?</p>","169786","","","","","2010-10-25 15:12:46","Preferred method for XML layouts: explicit attributes or styles.xml?","<android><xml><layout>","1","0","","",""
"4015866","1","","","2010-10-25 15:01:09","10","4362","<p>Im wondering what is the point of using a android service to do background work when you need to do a lot of things just to access any public methods or get a large chunk of data from a service such as a larger List object.</p><p>why not just use a simple POJO that does stuff in the background for you in a seperate thread if you like and gain access to its public methods without creating interfaces using AIDL, binding to a service etc etc?</p><p>seems soo much work needs to be done to access a method from a service class or is that really not the point of a service class in android?</p><p>i have developed a android service class that gets 100's of items in a xml structure from a web service who i then parse it into a POJO that is then stored in a List but i am having difficulty finding a way to send this List back to the activity that called this service.</p><p>i've read about using parcebales objects but that along with all the intent.putExtra have a size limitations so i may run into problems in the future.</p><p>i am thinking of ditching Android services and i have quickly found out why i dont like using them in the first place :(</p><p>a simple <code>SomeBackgroundPojo backroundTask = new SomeBackgroundPojo();  backgroundTask.getData();</code></p><p>Seems soooo much easier than dealing with parcelables, serealizable objects, AIDL, binding etcc etc all just to achieve the two lines of code i just typed above :(</p>","444668","","964741","","2012-11-09 09:18:11","2012-11-09 09:18:11","Why use a android service?","<android><service>","1","0","4","",""
"4016100","1","4017948","","2010-10-25 15:27:20","1","2016","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2923265/android-how-do-i-open-another-app-from-my-app"">android: how do i open another app from my app?</a>  </p></blockquote><p>Is there an Intent to view files such as word document (.doc), excel sheet, powerpoint (.ppt), pdf, etc. in Android?</p>","435025","","29995","","2011-11-10 21:48:40","2011-11-10 21:48:40","Is there an Intent for viewing documents (Word, Excel, Powerpoint, PDF, etc.) in Android?","<android><ms-office><android-intent>","2","0","0","2011-12-20 15:08:45",""
"4016139","1","4016414","","2010-10-25 15:30:46","2","1040","<p>please, is this the correct syntax for copying a particular row from one table to another?</p><pre><code>db.execSQL(""insert into Route select * from "" + DATABASE_TABLE + "" WHERE _id = rowId"");</code></pre><p>because for some reason, when i call the method that executes this statement, all the items from the first table are copied into the second table and not the specific row i want. thanks.</p><p>this is the method call for copy:</p><pre><code>public void copyData(long rowId){db.execSQL(""insert into Route select * from "" + DATABASE_TABLE + "" WHERE _id = rowId""); }</code></pre><p>if not, could you please show me how?..</p>","479908","","","","","2010-10-25 15:57:27","correct syntax to copy from one table row to another (sqlite android)","<android>","1","0","","",""
"4016149","1","4016352","","2010-10-25 15:31:18","0","166","<p><strong>Elegant Solution</strong></p><p>Hey People.I'm currently working on a Project and I am thinking of an elegant solution for the implementation, I'm tired of improvised solutions. </p><p>Let me try to explain my ""Problem"" to you:</p><p>The task of this part of my app is pretty simple:</p><p>I want my app to download some stuff and process that downloaded file in the background, displaying a ProgressDialog in the meantime. After that, the contents should be returned in a List of Strings which are displayed in some ListActivity. So far, not a big deal:</p><p>Downloader and the processing stuff is a subclassed AsyncTask and called in a class different from the main Activity. But now my Problem:</p><p>Where to call the Progressdialog? And how can the GUI-Thread ""react"" with a ProgressDialog? Should I call the ProgressDialog from the processing class or is it better to kind of ""block"" the main class, waiting for a notification?</p><p>Greetings</p><p>EnflamedSoul</p>","486084","","1140748","","2012-04-30 20:13:04","2012-04-30 20:13:04","Elegant Solution?","<java><android><parallel-processing>","2","1","","",""
"4016229","1","","","2010-10-25 15:39:07","0","4301","<p>In my Android applications I would like to check if the APN settings set is the preferred APN.</p><p>Can I have a list of APN in android?</p>","420261","","238978","","2012-06-23 11:08:51","2012-06-23 11:08:51","APN settings in android","<android><apn>","4","0","","",""
"4016313","1","4016574","","2010-10-25 15:48:14","14","11019","<p>The subject kinda says it all.. I'm requesting a PIN code from the user, if they enter it, click the OK Positive Button and the PIN is incorrect I want to display a Toast but keep the dialog open. At the moment it closes automatically..  Sure this is very trivial thing to correct but can't find the answer yet.</p><p>Thanks..</p>","333276","","","","","2011-10-02 12:34:45","How to keep an alertdialog open after button onclick is fired?","<android>","4","2","5","",""
"4016516","1","","","2010-10-25 16:07:29","2","2459","<p>I had read about localization here: <a href=""http://developer.android.com/guide/topics/resources/localization.html"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/localization.html</a>But I need to switch language in my android applicartion in run time, e.g. via Spinner.</p><p>I attempted to do subj in this way</p><pre><code>DisplayMetrics dm = res.getDisplayMetrics();Configuration conf = res.getConfiguration();conf.locale = new Locale(language_code.toLowerCase(),coutry_code.toUpperCase());res.updateConfiguration(conf, dm);</code></pre><p>but all changes apply only after restarting appCould anyone help me?</p>","486647","","","","","2012-09-16 06:32:25","How to change language in runtime","<android>","1","0","2","",""
"4016779","1","4017202","","2010-10-25 16:33:02","1","245","<p>I have 2 AttributeSet objects- how can I combine them into 1?</p>","440093","","","","","2010-10-25 17:27:20","Android: How to merge 2 AttributeSet objects?","<android>","1","0","","",""
"4016850","1","4017003","","2010-10-25 16:44:11","9","6614","<p>I have a View to that I need to add some text.The used View is: </p><pre><code>&lt;TextView   android:layout_marginLeft=""10dp""   android:layout_width=""wrap_content""  android:gravity=""center_vertical""  android:layout_gravity=""center""   android:maxLines=""3""  android:layout_height=""70dp""   android:textColor=""#000000""  android:textSize=""12dp"" /&gt;</code></pre><p>The problem i have is, if this text contains more than 3 line it just shows three line but no indication  that it cut some line.<br>I want to append '...' at end of third line if it cut some data.</p>","477754","","114066","","2011-01-04 13:32:34","2011-01-04 13:38:05","android append '...' at the end textview","<android><append><textview>","3","1","4","",""
"4016900","1","","","2010-10-25 16:49:44","0","157","<p>I built a gallery. The centered image is scaled up. I did this by extending from gallery and overwriting getChildStaticTransformation. There I  modified the camera. It zooms in when the image is close to the center point.</p><p>Problem: the centering item (from <em>getSelectedItem()</em>) changes a bit too late. sometimes the side elements that are smaller than the next coming get re-centered.</p><p>Is there any way to tell the gallery when it has tochanng to its neighbor?</p><p>Thank you so far.</p>","472355","","","","","2010-11-04 09:30:08","How to change the centering-changing-point of the gallery?","<android>","1","0","","",""
"4017012","1","4017132","","2010-10-25 17:03:00","1","220","<p>I'm obviously pretty new to Android. Does better documentation exist for the set of android.R.* classes somewhere? The API reference is pretty bare bones, many times only containing the resource literal IDs and not explaining how/where they are used. Similarly, it would be nice if additional information (or pictorial examples) existed for the various platform defined layouts and styles. </p><p>Or am approaching this the wrong way? Perhaps there's a better method to determine their usage than going straight to the documentation. I'm finding this portion (I'm not even sure what to call it) to be the most confusing aspect of Android programming by far and am open to any suggestions that will better my understanding.</p><p>Thanks!</p>","263823","","","","","2010-10-25 17:22:12","Better documentation for android.R.*?","<android>","2","0","","",""
"4017020","1","4018439","","2010-10-25 17:04:04","1","142","<p>I have streamed audio from url,but when the call or sms comes i need to pause the song and when the call ends again i am gonna resume the song...</p><p>How to do this?...</p>","461972","","","","","2010-10-25 20:11:55","Streaming issue in android","<android>","1","4","","",""
"4017264","1","4017466","","2010-10-25 17:36:32","3","3682","<p>I'm creating a simple dialog with a ListView on it. I want to be able to access a context menu on it.Here's the basic code I've:</p><pre><code>&lt;On CreateDialog&gt;listViewSongs=(ListView) layout.findViewById(R.id.ListView_Songs);listViewSongs.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, drawingPanel.metronome.getSongNames()));registerForContextMenu(listViewSongs);  </code></pre><p>Then I just add a simple item:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){    super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle(""Sample Context Menu"");    menu.add(0, MENU_EDIT_SONG, 0, ""Edit"");}</code></pre><p>And finally I override the onContextItemSelected:</p><pre><code>@Overridepublic boolean onContextItemSelected(MenuItem item) { super.onContextItemSelected(item);    editSong();    return true; }</code></pre><p>So my problem is that when I longpress the listview I got the context menu, but after clicking the only option on it, it never calls onContextItemSelected :(Any help?</p><p>PS: I've tried also to override onMenuItemSelected, onOptionsItemSelected, but I got the same result :\ never got called.</p>","474684","","474684","","2010-10-25 17:49:36","2012-07-04 17:58:46","onContextItemSelected never called using a Dialog with a ListView","<android>","2","4","","",""
"4017323","1","","","2010-10-25 17:43:35","1","894","<p>while I'm able to set ""highlight color"" for <code>ListView</code> items using <code>android:listSelector</code> attribute and appropriate selector, I'm unable to do the same, or something similar, for <code>Menu</code> items - they just keep using default system color scheme. I've read <a href=""http://developer.android.com/guide/topics/ui/menus.html"" rel=""nofollow"">Creating Menus</a> article and found nothing there. Any clues?</p><p>Btw: I'm referring to <code>Menu</code> accessible via 'Menu' button. </p>","344036","","344036","","2010-10-25 20:23:54","2010-10-25 20:23:54","Android: selector for highlighting menu items?","<android><user-interface><menu><selector>","0","2","","",""
"4017485","1","4107866","","2010-10-25 18:05:37","1","516","<p>I have a ListActivity; and for each item in the ListView there is a checkbox.</p><p>When you touch a list item, another Activity launches.</p><p>When you use the trackpad/trackball to highlight (read: select) an item and click the trackpad, it essentially simulates touching the item.  This causes my other Activity to launch.</p><p>I would like clicking the trackpad to check the checkbox of the highlighted item.  Is there a handler I can override to do this?</p>","406790","","319618","","2010-11-04 10:41:10","2010-11-05 16:25:08","Overriding trackpad click","<android><listview><touchpad><trackpad>","2","4","","",""
"4017488","1","4017569","","2010-10-25 18:05:57","0","743","<p>I can't find my test.db in the file manager in DDMS. Does someone know when we create a database, where it's installed ?</p>","439058","","128165","","2010-10-25 18:14:49","2010-10-25 23:07:03","i created a database in my app, but i don't find it in the DDMS","<sql><android><database><ddms>","2","0","","",""
"4017584","1","","","2010-10-25 18:21:27","0","294","<p>I am writing unit tests (AndroidTestCase).  The application under test uses some background services to communicate over the web the get information.  </p><p>To receive notification of events I am interested in, (like when content has been delivered etc), I register a listener that exposes various methods.  In these listener interface methods, I assert certain things to help me validate i am getting appropriate responses.</p><p>My problem is that the test methods are finishing prior to the callback occurring and I do not know how to tell the method to ""wait"" for the callback to happen.</p>","479573","","789593","","2012-03-17 11:12:58","2012-03-17 11:12:58","AndroidTestCase - Asynch calls","<android>","1","0","1","",""
"4017644","1","4021990","","2010-10-25 18:31:22","2","658","<p>I have implemented an <code>AutoCompleteTextView</code> for searching. Is <code>AutoCompleteTextView</code> supported in all SDK versions and targets, because when I tried this <a href=""http://developer.android.com/resources/tutorials/views/hello-autocomplete.html"" rel=""nofollow"">sample</a>it shows an empty dropdown list. When I used the same in my application for parsed content placed inside a string array, I'm getting an Exception.</p><pre><code>Log.v(""Length of a"",Integer.toString(a.length));try{    wv.setVisibility(View.GONE);    place_list.setVisibility(View.VISIBLE);    Log.v(""Length of a222222"",Integer.toString(a.length));    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(Bru_Maps.this, android.R.layout.simple_dropdown_item_1line, a);    textView.setAdapter(adapter);} catch(Exception e) {                      Log.v(""Error"",""search_name""+e);     }</code></pre><p>The above given code prints the log well but it returns a <code>NullPointerException</code>.</p><pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(Bru_Maps.this, android.R.layout.simple_dropdown_item_1line, a);</code></pre>","393953","","421372","","2013-01-14 23:44:01","2013-01-14 23:44:01","Need help on AutoCompleteTextView for Searching","<android>","2","0","1","",""
"4017903","1","6273358","","2010-10-25 19:03:06","14","27445","<p>I am trying to get the last inserted rowid from a sqlite database in Android. I have read a lot of posts about it, but can't get one to work. This is my method: </p><pre><code> public Cursor getLastId() {        return mDb.query(DATABASE_TABLE, new String[] {KEY_WID}, KEY_WID + ""="" + MAX(_id), null, null, null, null, null);}</code></pre><p>I have tried with MAX, but I must be using it wrong. Is there another way?</p>","455479","","67566","","2011-04-11 00:27:57","2012-06-29 15:50:45","Get last inserted value from sqlite database Android","<android><sqlite><lastinsertid>","6","1","6","",""
"4018130","1","4622102","","2010-10-25 19:31:34","1","1477","<p>When I run KitchenSink example project on iPhone emulator everything is OK, but trying to launch for Android emulator produces errors:</p><pre><code>[ERROR] /Users/lukasz/Android/android-sdk-mac_x86/tools/apkbuilder[ERROR] Failed installing com.appcelerator.kitchensink: pkg: /data/local/tmp/app.apk</code></pre><p>It happens whatever Androig API I choose (from 1.5 to 2.2 or from APIs 1.5 to APIs 2.2).I am using Titanium Developer 1.2.1, titanium SDK 1.4.1.11</p><p>Where is the problem? </p><p>As far as I can see Android SDKs and platforms work correctly because I can successfully compile Android projects from diffrent IDE (Netbeans).</p>","229229","","","","","2013-08-03 00:16:19","KitchenSink tools/apkbuilder error when trying to run for Android","<android><titanium>","3","0","1","",""
"4018309","1","","","2010-10-25 19:54:10","3","3222","<p>I currently have a list and would like to display a large amount of text once a list item has been clicked. The amount of text will vary depending on the list item that's been clicked, ranging anything from a paragraph to a number of paragraphs.</p><p>I'm still very much an Android noob, so any tutorials that you know of that relate to your answer would be most appreciated.</p><p>Thank you.</p>","485702","","","","","2010-10-25 20:56:50","Best way to display a large amount of text?","<android>","2","0","","",""
"4018367","1","","","2010-10-25 20:00:36","0","218","<p>I am having a problem with rest and android, the problem is I have a transport object in example a class Human, which is extended by Male and Female, I want to use  json as transport for the human object.if I use standard serialized objects, i would usually do </p><pre><code>if(human instanceof Male.class){}else if(human instance of Female.class){}else{ throw new RuntimeException(""incorrect class"")}</code></pre><p>how do I implement this in android with rest?I've seen that Gson and Jaskson  which do not support polymorphism,on the server side we're using Apache CXF for rest, with jax-rs annotations Ideas/previous experiences??</p>","240864","","12707","","2010-10-25 20:01:56","2011-05-06 19:19:26","Json to pojo unmarshaler with polymorph classes for android","<android><json><polymorphism>","1","0","","",""
"4018507","1","4018602","","2010-10-25 20:19:56","1","150","<p>I have an app in Android Market which is a standalone app that's essentially a full conduit to an SQLite Database(add, change, delete, inquiry). Some of my potential clients have asked to see a sample of my work, but they don't have an Android device.</p><p>Other than just showing them screenshots etc., is there a way I could have them go to a website where they can actually run it &amp; check it out. </p><p>I'm thinking there would be a programming element involved (convert app to a mobile website essentially?), hence posted this question here. </p><p>Not quite sure where to get started. Any help would be appreciated.</p>","289918","","1288","","2012-06-04 01:26:55","2012-06-04 01:26:55","Showcasing Android app on a website","<android>","2","2","","",""
"4018556","1","4323543","","2010-10-25 20:25:06","1","697","<p>I have a problem with a filter on my listview.In fact that work pretty well with an IndexAdapter, but not with a SimpleCursorAdapter.</p><p>In the following example, if isCursor==false, the filter work pretty wellbut if it is == true, the filter does not work!</p><p>By the way, the adapter work pretty well.</p><pre><code>if(isCursor){    mCursorAdapter = new SimpleCursorAdapter(this,android.R.layout.simple_list_item_1, stationsCursor, columns, to);    FilterTextWatcherCursor filterTextWatcher = new FilterTextWatcherCursor(mCursorAdapter);    filterText.addTextChangedListener(filterTextWatcher);    this.setListAdapter(mCursorAdapter); }else{    mIndexAdapter = new MyIndexAdapter&lt;String&gt;(getApplicationContext(), R.layout.row_station_picker, elements);    FilterTextWatcher filterTextWatcher = new FilterTextWatcher(mIndexAdapter);    filterText.addTextChangedListener(filterTextWatcher);    this.setListAdapter(mIndexAdapter);    }ListView lv = getListView();lv.setTextFilterEnabled(true);lv.setFastScrollEnabled(true);</code></pre><p>I really do not understand where the problem might come.For information, my FilterTextWatcher is:</p><pre><code>public class FilterTextWatcherCursor implements TextWatcher { private SimpleCursorAdapter adapter;  public FilterTextWatcherCursor(SimpleCursorAdapter adapter) {    this.adapter = adapter; } 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) {  adapter.getFilter().filter(s); }}</code></pre><p>FilterTextWatcher is quite the same, but I replaced SimpleCursorAdapter with IndexAdapter</p><p>Thank a lot for any help...</p>","327402","","327402","","2011-04-13 08:51:16","2011-04-14 10:41:56","Text Filter: strange behavior with SimpleCursorAdapter","<android><listview><text><filter>","1","1","","",""
"4018711","1","","","2010-10-25 20:46:21","0","786","<p>I am working on developing a HID Bluetooth Driver, that would allow an user to connect a bluetooth keyboard or mouse. So far I was able to achieve this using JNI, and a C BlueZ interface, but there were compatibility problems: the software only worked on a few devices.</p><p>As Bluetooth support was introduced from Android 2.0, I was thinking to give it a try. I am able to manage the L2CAP connections using the Android SDK, but I have a few problems so far:1)- how to read the STANDARD (!!) Bluetooth Device class. Android offers some custom Bluetooth Class values that are useless2)- how to read a Service record (I am interested in the  Report Descriptor, attribute ID 0x206). Basically I need to do exactly what getRemoteServiceRecord does.</p><p>Is it possible in the current form of the Bluetooth SDK? Should I consider using reflection on the bluetooth service running on the device?</p><p>Please note that I would prefer to go as Standard as possible, to avoid any other compatibility issues. </p><p>Thank you.</p>","486907","","21234","","2010-10-25 20:58:58","2010-10-25 20:58:58","Android Bluetooth : read service records","<android><bluetooth><hid><sdp>","0","2","","",""
"4018772","1","4938835","","2010-10-25 20:53:53","4","14738","<p>Is there a way to call setContentView(id) multiple times with different id during one Activity to render different views or do I absolutely have to start a new Activity?</p>","25282","","","","","2014-01-23 19:53:21","Calling setContentView() multiple times","<android><android-ui>","2","0","3","",""
"4019007","1","","","2010-10-25 21:26:54","1","166","<p>I need to create a new screen and I don’t know from where and how to start.</p><p>These are the requirements':</p><p>The screen will be separate in the middle while each side will hold few components (TextView) and will have different color. (two layouts or custom view ??)</p><p>The borders of the new screen should be rounded and padding.</p><p>Unfortunately I don’t have (yet) permission to upload an image for example so I hope my description was ok.</p><p>Can someone please give me few tips how to start this screen? </p><p>Thanks</p>","452118","","","","","2010-10-27 08:10:21","Need help with screen design","<android>","1","0","","",""
"4019100","1","4019193","","2010-10-25 21:37:33","0","3089","<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:text=""Title""     android:id=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:textSize=""30px""     android:textStyle=""bold""     &gt;&lt;/TextView&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""60px""&gt;&lt;Button     android:text=""Choose a Story""     android:id=""@+id/choose""     android:layout_width=""150px""     android:layout_height=""wrap_content""      android:layout_gravity=""bottom""     android:layout_marginBottom=""1px""&gt;&lt;/Button&gt;&lt;Button     android:text=""Info""     android:id=""@+id/info""     android:layout_width=""150px""     android:layout_height=""wrap_content""      android:layout_gravity=""bottom""     android:layout_marginBottom=""1px""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>In this code, as you can see, there is a title, 2 linear layouts, and 2 buttons that are inside a linear layout. What I'm trying to do is center the 2 buttons. No matter what I do, I can never get the 2 buttons to be centered at the bottom with a height of 60px. </p><p>In the end I'm trying to make the text centered both vertically and horizontally, and have the 2 buttons on the bottom centered horizontally. What do I need to change?</p><p>Heres a picture of what it looks like in the Layout Editor.<img src=""http://i.stack.imgur.com/ynjJ5.png"" alt=""alt text""></p>","478297","","478297","","2010-10-25 21:52:22","2010-10-25 22:09:20","Android XML: Centering Horizontally On Bottom","<android><xml>","1","7","","",""
"4019170","1","4019311","","2010-10-25 21:48:57","0","1137","<p>I have created a simple listview and added a few items in it. I am trying to add really long text in each item. I want this text to be displayed in single line only. the text that does not fit should fade in the corners. I have seen this kind of list in samsung galaxy s but somehow I am not able to achieve this. Can anyone help me? </p>","","PrincessP","","","","2012-09-04 10:39:43","Item in listview to be displayed in single line each","<android><listview><text><line>","1","0","","",""
"4019174","1","4019258","","2010-10-25 21:49:21","1","576","<p>I need to download a zip file and unpack it, in the background (in an AsyncTask I'd imagine).</p><p>As it is now, I've got a DefaultHTTPClient set up, and a ZipInputStream ready to go, but here's where I am stuck - I have no idea how to use these two together. Here's the relevant code in the AsyncTask:</p><pre><code>DefaultHttpClient http = new DefaultHttpClient();        HttpGet method = new HttpGet(""http://tf2b.com/downloads/imgshugo.zip"");        //method.addHeader(""Accept-Encoding"", ""gzip"");        HttpResponse res = http.execute(method);        InputStream is = res.getEntity().getContent();        ZipInputStream zip = new ZipInputStream(is);</code></pre><p>The last line there I'm not sure about at all, even. Any help would be appreciated!</p>","486968","","","","","2010-10-25 22:01:45","Downloading and decompress a zip-file in the background?","<java><android>","1","0","1","",""
"4019200","1","","","2010-10-25 21:52:40","5","1518","<p>Just looking for an easy answer that I can't find on Google. Simply put. Is there a way to tell when ScrollView has stopped scrolling after a fling?</p>","469219","","","","","2011-08-15 12:36:14","Android ScrollView isFinished?","<android><scrollview>","1","2","","",""
"4019308","1","4019492","","2010-10-25 22:13:32","0","3285","<p>I've created a custom ListView by extending SimpleCursorAdapter. The result is IMAGE + CheckedTextView (Text + Checkbox).</p><p>After I had issues with the wrong checkboxes getting checked (<a href=""http://stackoverflow.com/questions/4010623/android-click-on-listitem-checks-wrong-checkbox"">see here</a>) I had to remove <strong>lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);</strong> from onCreate.</p><p>Now I click on a ListItem line and it checks the right checkbox.</p><p>What I'm trying to do is make a LinearLayout.VISIBLE when 1 or more checkboxes are checked AND make LinearLayout.GONE when no checkbox is checked.</p><p>Here is the code:</p><pre><code>lv.setOnItemClickListener(new OnItemClickListener() {   @Override   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {CheckedTextView markedItem = (CheckedTextView) view.findViewById(R.id.btitle);if (!markedItem.isChecked()) { markedItem.setChecked(true); //show bottom control panel findViewById(R.id.bottom_control_bar).setVisibility(LinearLayout.VISIBLE);} else { markedItem.setChecked(false); SparseBooleanArray lala = ((ListView) parent).getCheckedItemPositions(); //if no checkbox is checked, hide bottom control panel if (lala == null) {  findViewById(R.id.bottom_control_bar).setVisibility(LinearLayout.INVISIBLE); }}view.refreshDrawableState();//showSortBtn(markedItem);</code></pre><p>}  });</p><p>This is how I bind the listView to the custom adapter:</p><pre><code>projection = new String[] { Browser.BookmarkColumns._ID,                Browser.BookmarkColumns.FAVICON, Browser.BookmarkColumns.TITLE,                Browser.BookmarkColumns.URL };        displayFields = new String[] { Browser.BookmarkColumns.TITLE,                Browser.BookmarkColumns.FAVICON, Browser.BookmarkColumns.URL };        int[] displayViews = new int[] { android.R.id.icon, android.R.id.text1 };        cur = managedQuery(BOOKMARKS_URI, projection,                Browser.BookmarkColumns.BOOKMARK + "" == 1"", null, Browser.BookmarkColumns.VISITS + "" DESC"");        setListAdapter(new ImageCursorAdapter(this,                android.R.layout.simple_list_item_single_choice, cur,                displayFields, displayViews));</code></pre><p>I have two issues with this:</p><ol><li><p>if I check 2 or more checkboxes and then uncheck only one, the LinearLayout disappears which means <code>SparseBooleanArray lala = ((ListView) parent).getCheckedItemPositions();</code> is null. why is it null if there are still other checkboxes checked?</p></li><li><p>if I switch <code>findViewById(R.id.bottom_control_bar).setVisibility(LinearLayout.INVISIBLE);</code> to <code>findViewById(R.id.bottom_control_bar).setVisibility(LinearLayout.GONE);</code> (like I want to do) the first checkbox is being checked correctly and after the LinearLayout is GONE, everything is a mess again, just like on <a href=""http://stackoverflow.com/questions/4010623/android-click-on-listitem-checks-wrong-checkbox"">my previous question</a>.</p></li></ol><p>Appreciate any help!</p>","444324","","444324","","2010-10-26 09:15:20","2010-10-26 18:09:01","Android: list.getCheckedItemPositions() always returns null","<android><android-listview>","1","0","","",""
"4019321","1","","","2010-10-25 22:16:47","0","1204","<p>I am building a Calendar Application for Android OS. I have previously made some Android applications with built-in android widgets such as buttons and spinners etc. Now I want to create an Android Application that displays 4 'tabbed' views of a Calendar (month, week, day &amp; list). I have already built the backend stuff for the application, I just need to display the events in an interactive UI. I have a few questions regarding this:</p><ol><li>Any suggestions on how to go about doing this? Should I have a xml file with gridview that can update in real-time according to user interactions + current time. If so then do you have any open-source example of this?</li><li>Are there any open source calendar applications I can check for Calendar UI information?</li><li>I have to update the Calendar UI according to the current day and time. How can I do this?</li></ol><p>Any other suggestions are also welcome.</p><p>Thank you.</p>","484881","","","","","2010-10-25 22:23:34","Need help building a Calendar UI for Android 2.2. Any suggestions on how to start?","<java><android><user-interface><calendar><interactive>","1","0","0","",""
"4019337","1","4019444","","2010-10-25 22:20:28","1","5090","<p>I am having a lot of trouble understanding how the Android context menu works.  I am writing a simple program which will display a list of different types of ice cream in a list view. When the user to ""taps and holds over each type, a context menu should appear with 4 options asking what information they want to be displayed about that ice cream (picture, ingredients, order, other).</p><p>I don't understand how to make it so that each list item's context menu gives the appropriate info (the info associated with whichever list item the user tapped and held).</p><p>I am working from an example given by my teacher, which has some of the functionality I am after, but does not deal with the issue of displaying different info for each list item. I see that in the given code, my prof even gave a hint in the comments within the parameters of onCreateContextMenu():</p><pre><code>public void onCreateContextMenu( //called each time the context menu is requested        ContextMenu menu,   //the ContextMenu itself        View v, //The view for which the context menu is being built        ContextMenu.ContextMenuInfo menuInfo) { //tells you which item in the list the user did the tap-and-hold over </code></pre><p>But I am still unsure of what I am able to do with this parameter, and I've been spinning my wheels for a long time now.  There is at least one other thread on stackoverflow that addresses this question, but it did not help me get any closer to understanding what's going on here.</p><p>I really appreciate the help, as I am new to Android (and OOP generally) and a little hesitant to ask questions for fear of public techie ridicule or being seen as taking advantage of the community. I just hope that at some point I'll be able to pay it forward to someone else.</p><p>Thanks!</p><p>Here's my code:</p><pre><code>package CS285.Assignment2;import android.app.Activity;import android.os.Bundle;import android.app.ListActivity;import android.util.Log;import android.view.ContextMenu;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class IceCreamMenu extends ListActivity {    TextView selection;    ImageView imgView;    String[] items={""Butter Pecan"", ""Chocolate"",             ""Coffee"", ""Mango"",             ""Rocky Road"",""Strawberry"",             ""Vanilla""};    int[] images={R.drawable.butterpecan,            R.drawable.choclate,            R.drawable.coffee,            R.drawable.mango,            R.drawable.rockyroad,            R.drawable.strawberry,            R.drawable.vanilla};    public static final int IMG_ID = 0;    public static final int INGR_ID = 1;    public static final int ORDER_ID = 2;    public static final int OTHER_ID = 3;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        selection=(TextView)findViewById(R.id.selection);        imgView = (ImageView)findViewById(R.id.Image);        setListAdapter(new ArrayAdapter&lt;String&gt;(this,                                                android.R.layout.simple_list_item_1,                                                 items));        registerForContextMenu(getListView()); //indicate that the ListView has a context menu.    }    //event handling for ListItemClick events    public void onListItemClick(ListView parent, View v,                        int position, long id) {        selection.setText(items[position]);    }    @Override    public void onCreateContextMenu( //called each time the context menu is requested            ContextMenu menu,   //the ContextMenu itself            View v, //The view for which the context menu is being built            ContextMenu.ContextMenuInfo menuInfo) { //tells you which item in the list the user did the tap-and-hold over             populateMenu(menu);    }    private void populateMenu(Menu menu) {        menu.add(Menu.NONE, IMG_ID, Menu.NONE, ""Picture"");        menu.add(Menu.NONE, INGR_ID, Menu.NONE, ""Ingredients"");        menu.add(Menu.NONE, ORDER_ID, Menu.NONE, ""Order"");        menu.add(Menu.NONE, OTHER_ID, Menu.NONE, ""Other"");    }    private boolean applyMenuChoice(MenuItem item) {        switch (item.getItemId()) {        case IMG_ID:            imgView.setImageResource(images[0]);            return(true);        case INGR_ID:            return(true);        case ORDER_ID:            return(true);        case OTHER_ID:            return(true);        }        return(false);    }    //called whenever an item in a ContextMenu is selected.    @Override    public boolean onContextItemSelected(MenuItem item) { //item is the menu item chosen        return(applyMenuChoice(item) ||          super.onContextItemSelected(item));    }}</code></pre>","471791","","1465910","","2012-09-29 09:17:16","2012-09-29 09:17:16","How to use the Android Context Menu (on tap and hold)","<android><listview><contextmenu><listadapter>","2","0","","",""
"4019397","1","4020544","","2010-10-25 22:30:55","0","275","<p>I am developing a website that will play sound files for all smartphone users -- BlackBerry, Android, and iPhone.  I've already figured this out for the iPhone, but how do I do this for BlackBerry and Android?</p>","107763","","75204","","2010-10-26 14:29:36","2010-10-26 14:29:36","Using sound on a website for iPhone, BlackBerry and Android","<android><blackberry><html5><audio>","1","1","","",""
"4019481","1","4025741","","2010-10-25 22:47:55","1","367","<p><br>This question is a follow up to a previous question I had<br><a href=""http://stackoverflow.com/questions/2822885/im-trying-to-implement-2-factor-authentication-on-the-cheap-how-would-i-do-that"">http://stackoverflow.com/questions/2822885/im-trying-to-implement-2-factor-authentication-on-the-cheap-how-would-i-do-that</a>  </p><p>I'm exploring the idea of using an android phone to SMS or robot talk a pin/token code to a user's home phone or mobile device. I'm looking at using android because the hardware would be cheap and I'll be able to install the application I'd make with no issues. </p><p>User's should be logging onto the system about once a day. The application currently has 75 users. User's are not guaranteed to have a cell phone.</p><p>I have a few questions:<br>Is this a viable 2nd form of authentication?<br>Is there a cheaper way of accomplishing this?</p><p>The workflow is as follows.</p><p>User goes to webapp enters user name, selects type of notification they want, SMS or Speech and submits.  </p><p>The webapp (in my case C# .net) verifies the user exists and looks up the phone number we have on record.  </p><p>The web app creates a token that will expire in a set amount of time and somehow communicates this and the phone number to the android device. (XML, files or anything really)</p><p>The android phone has an application that checks the XML file or folder containing files with the information on a set interval and performs a SMS or phones the person and tells them the token with the robot voice.</p><p>The phone then notifies the webapp that the message was sent or failed and the webapp notifies the user.</p><p>Here is a picture of what I'm thinking.<img src=""http://i.stack.imgur.com/y8dtU.jpg"" alt=""alt text""></p><p>Thanks for any feedback. Security is not my strong suit.</p>","102526","","","","","2010-10-26 16:28:55","Using SMS as an authentication factor for a website","<android><authentication><mobile-phones>","2","2","","",""
"4019534","1","8255745","","2010-10-25 22:57:57","6","4925","<p>I'm using following code to open a gallery inside of my app</p><pre><code>Intent intent = new Intent(Intent.ACTION_GET_CONTENT);intent.setType(""image/*"");startActivityForResult(intent, FIND_RESULT);</code></pre><p>Is it possible to limit a list of images to only show images taken by camera? Viewing Gallery on my 2.1 system, images are grouped so there has to be a parameter that defines to which folder it belongs.</p><p>Checking the <a href=""http://developer.android.com/reference/android/provider/MediaStore.Images.ImageColumns.html"">MediaStore.Images.ImageColumns</a> I did not a find any column that would define such thing.</p><p>Could I be wrong? Because if I could create a query to filter by folder and create my own gallery view, then my problem would be solved.</p>","73010","","73010","","2010-10-26 11:52:43","2013-10-27 23:11:57","Gallery with folder filter","<android><android-gallery>","2","2","6","",""
"4019641","1","","","2010-10-25 23:17:39","0","462","<p>Can anyone point me toward the source code for KeyEvent? </p><p>I am trying to select text in a webview and would like to understand how the code i am using is working.  Specifically, i would like to re-write it so that the select text implements a scroll when the user gets to the end of the view that is currently visible.</p><pre><code>    public void selectAndCopyText() {       try {        KeyEvent shiftPressEvent = new KeyEvent(0,0,          KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_SHIFT_LEFT,0,0);        shiftPressEvent.dispatch(portal);       } catch (Exception e) {        throw new AssertionError(e);      }   } </code></pre><p>In other words: using the code above or emulateshiftheld() makes it so that the user cant scroll.  If the text that needs to be selected is not completely visible in the window, then the user has no way to copy and select all of the text.  </p><p>What i would really like to know is how the KeyEvent is manipulating the text cursor and allowing the selection action to take place. </p>","481022","","","","","2010-10-25 23:17:39","Override KeyEvent","<android>","0","2","","",""
"4019829","1","4029184","","2010-10-26 00:19:57","1","82","<p>I have a issue that I have been struggling with for some time and its becoming quite frustrating...</p><p>I have an app that a user can modify the background image of a widget in a configure activity.  Once they select what image they want I save a SharedPreferences file with the widgetsID and the value for the image... however in the onEnabled of the WidgetProvider I do not know the widget ID, so I can not do a look up of which image to use... Since there can be multiple instances of this widget I do not know which id goes with which onEnabled...</p><p>any suggestions?</p>","478183","","","","","2010-10-27 00:52:51","Saving Simplistic Android Widget Across Restarts","<android><android-widget>","1","0","","",""
"4019873","1","4997243","","2010-10-26 00:31:31","1","810","<p>I am trying to import from a file. I am getting error message like the following. The error occurred at getColumnIndex. How can I prevent this from happening. </p><pre><code>Cursor c = activity.getContentResolver().query(android.provider.Browser.BOOKMARKS_URI,                 null,                 Browser.BookmarkColumns.TITLE+""=?"",                new String[]{title},                 null);int idIndx = c.getColumnIndex(Browser.BookmarkColumns._ID);//error found here</code></pre><h2>Error in stacktrace</h2><pre><code>cannot dup fd=1023, size=1048576, err=0 (Too many open files)cannot map BpMemoryHeap (binder=0x682e50), size=1048576, fd=-1 (Bad file number)E/JavaBinder( 5561): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)E/JavaBinder( 5561): java.lang.RuntimeException: No memory in memObjE/JavaBinder( 5561):    at android.database.CursorWindow.native_init(Native Method)E/JavaBinder( 5561):    at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:518)E/JavaBinder( 5561):    at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:27)E/JavaBinder( 5561):    at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:493)E/JavaBinder( 5561):    at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:496)E/JavaBinder( 5561):    at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:103)E/JavaBinder( 5561):    at android.os.Binder.execTransact(Binder.java:288)E/JavaBinder( 5561):    at dalvik.system.NativeStart.run(Native Method)</code></pre>","349161","","","","","2011-07-01 13:35:31","How can I prevent database access error message of ""too many open files"" in android?","<android><database>","2","0","","",""
"4019965","1","","","2010-10-26 00:58:03","1","183","<p>How can I get it back again so I can put the right path into it? I think this is the reason that app inventor wont connect to my phone.</p>","487080","","450106","","2010-10-26 01:01:00","2011-03-10 19:27:17","I accidentally exited out of the popup where app inventor asked for the path to adb","<android><adb><app-inventor>","3","2","","",""
"4020013","1","","","2010-10-26 01:13:54","1","378","<p>I am trying to get this hello world android application working.<br />I go through this installation process and read about how easy this thing is to get up and running with a ""Hello World"" application. I run the simple hello world application (following every step exactly as it says) and POOF... nothing. I get an error java.lang.IllegalArgumentException: Bad version: standalone at com.android.sdkstats.sdkStatsService.normalizeVersion(sdkStatsService.java:467)</p><p>Any idea how to fix this? I have double checked my namespaces (all 3 of them) and also tried this using the XML editor...  </p>","487092","","","","","2010-10-26 14:53:41","Android Hello World Exception","<java><android><exception>","1","4","","",""
"4020026","1","","","2010-10-26 01:16:58","1","177","<p>I have two identical <em>Moto Droids</em>. Both are up to date (2.2). I have been using one of the phones for development for some time. I now want to install my app to the other phone but cannot get adb to recognize it.</p><p><strong>Platform</strong>: WinSvr2008R2</p><ul><li>Eclipse with android pluig ins.</li><li><strong>USB debugging</strong>: <strong>on</strong>.</li><li>Have verified both phones have the same options and settings.</li><li>The phone that is not recognized shows up in Windows Devices.</li></ul><p><em>Is there some kind of hidden binding that prevents adb from working with mulitple devices?</em></p>","487101","","1697109","","2013-04-03 21:23:13","2013-04-03 21:23:13","ADB recognizes one phone but not another","<android>","0","2","","",""
"4020091","1","","","2010-10-26 01:37:34","5","1603","<p>I am trying to develop an android application (targeting versions 2.1/2.2) which requires the tracking of Path x,y coordinate points and am having a hard time.  The basics of the app are similar to FingerPaint, except first a separate thread draws some lines using a Path drawable onto a canvas, then the user tries to draw over those lines, covering them completely with a different Paint and Path object.  The user will have a larger Paint brush than the computer.  The first auto drawn lines use a separate thread similar to LunarLander example app.  Since the lines are not just straight lines I'm struggling finding an approach to do the following:1.  Track the auto points draw.  I realize I'm providing the basic points but using <code>path.lineTo</code> and <code>path.arcTo</code> and <code>path.quadTo</code> to really figure out all the points.  </p><ol><li>Once I know all the points the auto path drew, monitor and detect when user has drawn over all those points and ""wins"" that round.</li></ol><p>My ideal method which obviously doesn't exist would be something like<code>autoPath.getDrawnPoints().coveredBy(userPath.getDrawnPoints()) == true</code> ?Any help with this would be greatly appreciated, thank you.-Ben</p>","487112","","641020","thyrgle","2011-09-22 10:10:36","2013-03-07 13:36:28","Android tracking x,y coordinates draw from Path","<android><android-canvas>","1","1","","",""
"4020129","1","4029211","","2010-10-26 01:51:09","0","33","<p>I have a widget that I have an intent that starts an activity when I click, but I need to get saved Data into the widget, so onEnabled can I start an Activity that will look up the saved data for the activity?</p><p>Also an intent I need to set up for the click events... how do I set these up with out first having the config show up?</p>","478183","","","","","2010-10-27 01:00:25","Can an Activity be started from within a WidgetAppProvider?","<android><android-widget>","1","0","","",""
"4020200","1","","","2010-10-26 02:13:41","0","460","<pre><code>  public class SimpleOptionMenu extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        case R.id.icon:     Toast.makeText(this, ""You pressed the icon!"", Toast.LENGTH_LONG).show();                            break;        case R.id.text:     Toast.makeText(this, ""You pressed the text!"", Toast.LENGTH_LONG).show();                            break;        case R.id.icontext: Toast.makeText(this, ""You pressed the icon and text!"", Toast.LENGTH_LONG).show();                            break;    }    return true;}}</code></pre><p>I have res/menu/menu.xml file created and filled. When this class extends just Activity, it works fine, but when i used ListActivity, it keeps crashing. I noticed this when i was working with another app that uses list activity. [after searching long and hard. :|]</p>","408412","","408412","","2010-10-26 02:39:54","2011-07-28 13:04:03","App crashes when using menus in ListActivity. How to fix this?","<android><listactivity><android-menu>","2","1","","",""
"4020260","1","","","2010-10-26 02:29:31","8","3231","<p>There are a number of posts all over the internet on this topic, however none of them have been able to isolate and solve the problem.</p><p>I am trying to show some special UTF-8 encoded symbols stored in a SQLite database using a TextView, however all it shows is boxes. I understand what this means is that right font is not installed. But when I print those symbols using Arial font on Mac it works.</p><p>I am trying to use an Arial typeface on the device and the emulator.</p><p>Any advise.</p>","210504","","","","","2011-02-09 20:59:56","Display unicode characters in TextView Android","<android>","2","0","2","",""
"4020269","1","","","2010-10-26 02:31:53","0","479","<p>Hey there- I'm trying to set my own icons for Air for Android using Flash CS5. I see the icon tab within the Air Android Settings panel, but it won't let me navigate to my icons.  Also, I would add the path to my manifest.xml file, but it gets overwritten while publishing.  Thanks, any advice is appreciated!</p>","487135","","","","","2011-02-17 02:06:52","How do I set icons for Air for Android Settings within Flash CS5?","<android><flash><air><icons><cs5>","1","1","","",""
"4020291","1","4750312","","2010-10-26 02:39:24","4","3999","<p>I have some questions on installing Pocketsphinx on and Android phone, and I haven't been able to find answers on CMUSphinx's support forum, IRC, existing StackOverflow posts, or intensive Googling. If anyone here has a minute and would be willing to help, I'd greatly appreciate it. </p><p>First off, I'm confused as to whether I can even install Pocketsphinx on Android. I believe I need Java bins in order to run on Android, so I attempted to install Sphinx 4. To test the program, I made an empty activity and moved the HelloWorld demo file into the onCreate method. </p><p>Then, I added the following libraries to the build path: </p><ul><li>js.jar</li><li>jsapi-1.0-base.jar</li><li>junit-4.8.1.jar</li><li>sphinx4.jar</li><li>tags.jar</li><li>WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar</li></ul><p>The code deploys on a Droid 2 running Android 2.2, but I get the following error at runtime: </p><pre><code>ERROR/AndroidRuntime(11567): Caused by: Property exception component:'wsjLoader' property:'location' - Can't locate resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz</code></pre><p>I am including that jar file in the build path, so I'm not sure why that's causing an exception to be thrown. But then again, I'm not even sure I should be trying to install Sphinx 4 on Android. Does anyone know what I should do? Thanks in advance for your help.</p><p>5/2011 Update: The attempt I made to get pocketsphinx to run on Android is now listed on the CMU Sphinx wiki at <a href=""http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/"" rel=""nofollow"">http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/</a></p>","371408","","407651","","2011-08-08 19:17:02","2012-12-06 09:57:38","Installing Pocketsphinx on Android","<java><android><speech-recognition><cmusphinx>","4","0","4","",""
"4020294","1","4020302","","2010-10-26 02:39:32","3","1554","<p>I'm messing around with the Notepad exercise 1. When I create the fillData method, I get an error that ""Cursor cannot be resolved to a type""</p><p>Here's my code:</p><pre><code>private void fillData() {    //get notes from DB and create item list    Cursor c = mDbHelper.fetchAllNotes();    startManagingCursor(c);    String[] from = new String [] { NotesDbAdapter.KEY_TITLE };    int[] to = new int[] { R.id.text1 };    SimpleCursorAdapter notes =         new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);    setListAdapter(notes);}</code></pre><p>Do I need to import the cursor class at the top of my java file? If so, how?</p>","479180","","65977","","2010-10-26 03:31:28","2010-10-26 03:31:28","compiler error: ""Cursor cannot be resolved to a type""","<java><android>","1","4","","",""
"4020348","1","","","2010-10-26 02:51:58","1","1050","<p>When non-focused EditText clicked, it becomes focused, but cursor does not move to new location. I should click it again to move cursor to a new position. </p><p><strong>Q:</strong> How can I focus and move cursor with only one click?</p>","62192","","","","","2011-05-30 10:45:18","Cursor location not updated when non-focused EditText clicked","<android><focus><edittext><cursor-position>","1","0","","",""
"4020390","1","","","2010-10-26 03:03:18","0","1613","<p>I am a PHP programmer who is having to do some work in the android development environment. I have 2 books on this and have tried 30 search engine topics and still have not found just a simple example of everything that you need to do to place a working hyperlink in a Java android application. I just need a very simple but complete ingredient for doing so. I have the 2.2 android development environment with Eclipse and an emulator. I have tried the WebView control which just simply loads a web site into the window when I run the application. I need a basic hyperlink to a web site example. I don't want anything else thrown in with it (just an application with a working hyperlink and nothing else), because I am trying to learn the different controls bit by bit along with the Java and XML code that controls them. This is so different from PHP, ASP, etc. that it has me totally fishing for answers. Thanks;</p><p>Cullan</p>","487144","","","","","2012-01-22 17:24:57","I need exact simple instructions for placing a simple hyperlink to a web site in a java android application","<android>","3","1","2","",""
"4020476","1","","","2010-10-26 03:29:14","4","2044","<p>So, I have found a bug in a specific sdk that causes it to fail on some Android phones after re-installing a new version of an app which uses the sdk (via adb install -r, and presumably when a user gets an update that has been pushed to the Android market). Is there any way to force an application's data to automatically be cleared upon update of the app? I realize there are different ways that data could be stored, but I just need to essentially simulate an invocation of the ""Clear Data"" button that'd you find when browsing to the application in the ""Manage Applications"" section of the Settings (i.e. I just want all data gone). </p><p>I am an Android noob and am doing minimal Java coding on this project, so I am basically looking for the simplest solution here. I suppose I could settle on storing a ""currentVersion"" to disk and then checking it upon launch every time to see if the <em>real</em> current version matches the version that was written to disk on the last launch. Is that the only real way to do this?  If so, what's the simplest way to do so?</p><p>Thanks!</p>","284071","","","","","2010-10-26 06:28:42","How do I most easily delete Android application data upon upgrade/update?","<android>","1","0","","",""
"4020501","1","4020533","","2010-10-26 03:35:19","0","3667","<p>any pointer would be helpful. I need a font with symbol character set</p>","210504","","210504","","2010-10-26 03:47:32","2010-10-26 03:47:32","Any open source unicode ttf or otf font that I can use for my application?","<android>","1","2","1","",""
"4020503","1","4029945","","2010-10-26 03:36:04","1","1702","<p>I'm using shape attribute like this:</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:padding=""10dp""&gt;&lt;solid    android:color=""#FFFFFF"" /&gt;&lt;corners    android:bottomRightRadius=""15dp""    android:bottomLeftRadius=""15dp""    android:topLeftRadius=""15dp""    android:topRightRadius=""15dp"" /&gt;&lt;/shape&gt;</code></pre><p>and</p><pre><code>        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""@drawable/rounded_textview""&gt;        &lt;/TextView&gt;</code></pre><p>If I change the color at runtime with the following method:</p><pre><code>TextView.setBackgroundColor();</code></pre><p>The shape I used is disappear. What should I do to change it with the proper way?Or should I must have to generate lots of shape for just different colors?</p><p>Thanks.</p>","428022","","428022","","2010-10-26 05:16:05","2011-06-15 10:57:15","How to change the color of TextView at runtime with shape attribute on Android?","<android><textview><shape>","3","2","1","",""
"4020515","1","4020776","","2010-10-26 03:38:43","1","1338","<p>HI,</p><p>I need to use http post method for web-service in android application .But in android shows error when use this method .How to use this method in application or any other equal method for replacing this http post method. </p><p>thanks,Lakshmanan.</p>","450596","","","","","2010-10-26 04:49:11","can't use Http Post method in android application","<android>","1","0","1","",""
"4020538","1","4020655","","2010-10-26 03:43:43","0","442","<p>Currently I have a cartoon character that takes up almost the full screen of a surfaceview, and my little app is only to animate this 2D character during ontouch event at different coordinates. </p><p>What I am doing now is to redraw the whole character every single time, and this way I need to have a specific graphic for every single frame.</p><p>I am just wondering if its better to split the character into different parts, e.g. heads, hands, legs, and whenever a ontouch event happens, I only need to re-draw the specific part?</p><p>What do you think the pros and cons would be? Is it less CPU intensive?</p>","389615","","","","","2010-10-26 04:14:27","Whats the easiest way to animate 2D graphics on a surfaceview?","<android>","1","0","","",""
"4020618","1","","","2010-10-26 04:05:46","5","11210","<p>At Android application, it always extends Activity and the entry is onCreate. So it seems that user has to select application and click to luanch it.(if it is wrong,please advise me. sorry)</p><p>So, how to implent a service running on background without user clicking to start application? </p>","424854","","","","","2010-10-26 07:41:45","How to auto start service in android?","<android>","2","4","2","",""
"4020626","1","","","2010-10-26 04:07:42","0","2330","<p>I am trying to develope an app on canvas ,i am drawing a bitmap on canvas with the help of canvas.drawBitmap().After that i want to convert that canvas into bitmap.</p><p>can anyone give me suggession</p><p>thanking you in advance</p>","486301","","390989","","2010-10-26 04:13:35","2011-06-30 09:41:50","converting canvas into bitmap in android","<android><canvas><matrix><bitmap><rect>","3","2","","",""
"4020700","1","4021692","","2010-10-26 04:27:41","0","589","<p>I have ArrayList of custom objects that is the data underlying an ArrayAdapter for a ListView.</p><p>Sometimes this data is modified in a batch, such as fetching a set of new items from the web.  When the data is modified in a batch, should notifyDataSetChanged() be called after every add() to the ArrayList</p><p><em>Some over simplified code:</em></p><pre><code>for(Object object : newObjects){   list.add(object);   adapter.notifyDataSetChanged();}</code></pre><p>or should it be called once after all of the items in the batch have been added?</p><pre><code>for(Object object : newObjects){    list.add(object);}adapter.notifyDataSetChanged()</code></pre><p>Say there is a batch of 50 new objects.  If 50 notifyDataSetChanged() calls are made right after another, like in the first example, will the views redraw themselves 50 times in a row (I imagine a major performance hit) or will it only perform the latest call and in a sense only redraw them once?</p><p>I'm basically wondering if I can use the first method or will it have a major performance impact?</p><p>Thanks</p>","445348","","445348","","2010-10-26 04:51:54","2010-10-26 07:55:19","notifyDataSetChanged() performance question and when/how to call in relation to a batch of data changes","<android><listview><android-arrayadapter>","1","0","1","",""
"4020707","1","","","2010-10-26 04:30:20","0","3039","<p>I can not create a new project.</p><p>When I try to create a new project, I put the name and then I get </p><blockquote>  <p>An SDK Target must be specified.</p></blockquote>","487183","","2063910","","2013-05-08 09:11:19","2013-05-08 09:11:19","An SDK Target must be specified. in eplipce and SDK android","<android><sdk><target>","2","2","","",""
"4020771","1","","","2010-10-26 04:46:45","0","2798","<p>I'm doing animation of spinning with different images (like horizontal roulette) one image at a time from left to right over the screen.</p><p>At every animation cycle I need to change image to random from the list, so I found if I use repeating animation then setting new ImageResource on onAnimationRepeat of AnimationListener doesn't update my ImageView. I've decided to use custom triggering of next animation from onAnimationEnd. Here a pice of code:</p><pre><code>    ImageView image = (ImageView)(ImageView)findViewById(R.id.imageId);    Animation aMid = AnimationUtils.loadAnimation(this, R.anim.plant_middle);      aMid.setFillEnabled(true);    aMid.setFillAfter(true);    aMid.setAnimationListener(new AnimationListener() {        @Override        public void onAnimationStart(Animation animation) {             setRandomImageResource();        }        @Override        public void onAnimationRepeat(Animation animation) { }        @Override        public void onAnimationEnd(Animation animation) {            if(customCounter &lt; SPIN_COUNT){                customCounter++;                image.startAnimation(aMid);            }        }   });</code></pre><p>And Animation ixm is pretty simple, it's about ImageView comes from left of the screen to it's right:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""    android:shareInterpolator=""true""&gt;    &lt;translate         android:interpolator=""@android:anim/linear_interpolator""         android:fromXDelta=""-100%""         android:toXDelta=""100%""         android:fromYDelta=""0%""         android:toYDelta=""0%""         android:duration=""4000"" /&gt; &lt;/set&gt;</code></pre><p>The <strong>problem is</strong> in that between every animation cycle ImageView appears in the center of the screen for a very short moment, like it is flying from right back to left to start next animation cycle, or like it flickers in the middle where it's initially positioned in layout xml. </p><p>Setting it's visibility to GONE on onAnimationEnd and VISIBLE on onAnimationEnd doesn't work our the problem.</p><p><strong>What do?</strong> </p>","366101","","","","","2013-02-12 20:14:09","custom repeating of translation animation in android","<android><animation><repeat>","3","0","","",""
"4020854","1","4703932","","2010-10-26 05:08:25","0","414","<p>I am implementing a saxxml parser , i have successfully parsed it. But i need a feature to be implemented, there shpould be section heading which is a date say oct 26 and the rows in the section should be the feeds of that date. I have successfully implemented it in iphone, but i am very new to android and need help how to add section heading and group the rows. I am now using listview to show the feeds. Anyone has an idea abt this?I have no idea about how to group the rows also. </p><p>Please help.</p><pre><code>&lt;day&gt;&lt;date&gt;October 19&lt;/date&gt;    &lt;job&gt;        &lt;value&gt;xyz&lt;/value&gt;        &lt;time&gt;5:30&lt;/time&gt;    &lt;/job&gt;    &lt;job&gt;        &lt;value&gt;abc&lt;/value&gt;        &lt;time&gt;6:30&lt;/time&gt;    &lt;/job&gt;</code></pre><p></p><p>    October 20                    xyz            5:30                            abc            6:30        </p>","450487","","","","","2011-01-16 05:11:44","how to set section heading for tables in android (ie. grouping of rows is there)","<android><tablelayout>","1","1","","",""
"4020881","1","4615146","","2010-10-26 05:15:26","3","1899","<p>I used the following seek bar for displacing the progress of my audio. <pre><code>android:padding=""7dp""android:id=""@+id/SeekBar01""android:layout_width=""245dip""android:thumb=""@drawable/seekthumb2""android:progressDrawable=""@drawable/seekbar1""android:layout_height=""fill_parent""android:clickable=""false""android:focusable=""false""android:longClickable=""false""/&gt;</code></pre><p>I want to disable the manual motion of this seek bar. i mean the seek can only move by my code and it cannot be accessed by any other means (Touch).Thank you</p>","477754","","","","","2011-01-06 13:00:59","android disable seek bar for audio controler","<android><seekbar>","2","0","1","",""
"4020909","1","","","2010-10-26 05:20:51","14","8989","<p>There appears to be a bug in <code>startActivity</code>.</p><p>By setting activities to be <code>singleTop</code> with different <code>taskAffinity</code> in AndroidManifest.xml and using the <code>Intent.FLAG_ACTIVITY_NEW_TASK</code> when calling <code>startActivity</code>, two activities can be created in two tasks (one activity per task).</p><p>Calling <code>startActivity</code> again will return to the first activity/task and <code>onNewIntent</code> is called. However, calling <code>startActivity</code> a forth time will return to the second activity/task, but <code>onNewIntent</code> is not called.</p><p>The only difference between the two tasks is their <code>taskAffinity</code>. Somehow, asymmetrical behaviour is observed.</p><p>However, if the <code>Intent.FLAG_ACTIVITY_SINGLE_TOP</code> is also used, then <code>onNewIntent</code> is called as expected.</p><p>It would appear that <code>singleTop</code> in AndroidManifest.xml is not the same as <code>Intent.FLAG_ACTIVITY_SINGLE_TOP</code> in the <code>Intent</code>.</p><pre>public class ActivityA extends Activity implements OnClickListener {    private String tag;    @Override    public void onCreate(final Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        tag = getClass().getName();        Log.v(tag, ""onCreate()"");        setContentView(R.layout.main);        Button button = (Button)findViewById(R.id.button);        button.setText(tag.endsWith(""ActivityA"") ? ""Activity B""                : ""Activity A"");        button.setOnClickListener(this);    }    @Override    public void onClick(View v) {        Intent intent;        int flags = Intent.FLAG_ACTIVITY_NEW_TASK        // | Intent.FLAG_ACTIVITY_SINGLE_TOP        ;        Log.v(tag, ""onClick()"");        intent = new Intent(this,                tag.endsWith(""ActivityA"") ? ActivityB.class                        : ActivityA.class);        intent.setFlags(flags);        startActivity(intent);    }    @Override    protected void onNewIntent(Intent intent) {        Log.v(tag, ""onNewIntent()"");    }}</pre><pre>public class ActivityB extends ActivityA {}</pre><pre>&lt;?xml version=""1.0"" encoding=""utf-8""?>&lt;manifest    xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.test""    android:versionCode=""1""    android:versionName=""1.0"">    &lt;application        android:icon=""@drawable/icon""        android:label=""@string/app_name"">        &lt;activity            android:name="".ActivityA""            android:launchMode=""singleTop""            android:label=""Activity A"">            &lt;intent-filter>                &lt;action                    android:name=""android.intent.action.MAIN"" />                &lt;category                    android:name=""android.intent.category.LAUNCHER"" />            &lt;/intent-filter>        &lt;/activity>        &lt;activity            android:name="".ActivityB""            android:launchMode=""singleTop""            android:label=""Activity B""            android:taskAffinity=""activity.B"">        &lt;/activity>    &lt;/application>&lt;/manifest> </pre>","481207","","","","","2012-12-28 05:30:10","Bug: onNewIntent not called for singleTop activity with Intent.FLAG_ACTIVITY_NEW_TASK","<android>","1","1","7","2013-05-14 17:55:27",""
"4021003","1","4021345","","2010-10-26 05:41:23","1","2478","<p>I'm currently using the following seekbar for showing my audio palying progress, i want to disable thumb movement by user.</p><pre><code>&lt;Seekbar    android:padding=""7dp""    android:id=""@+id/SeekBar01""    android:layout_width=""245dip""    android:thumb=""@drawable/seekthumb2""    android:progressDrawable=""@drawable/seekbar1""    android:layout_height=""fill_parent""    android:clickable=""false""    android:focusable=""false""    android:longClickable=""false"" /&gt;</code></pre><p>But it's not working.</p>","487219","","1765573","","2013-07-24 08:21:48","2013-07-24 08:21:48","How can I disable the seek bar for audio controller","<android><movement><seekbar><disabling>","4","1","","",""
"4021136","1","","","2010-10-26 06:16:47","0","179","<p>i have a textview at the bottom of my screen but when menu clicked, i need to move the textview just above the menu, so that every one can see the textview,now when i clicked menu ,it cover the textview ,any solution for this problem</p>","487219","","487219","","2010-11-02 05:32:47","2011-05-24 11:04:59","Android TextView show just above the Menu","<android><menu>","1","2","","",""
"4021138","1","","","2010-10-26 06:16:56","2","743","<p>Hi Please any one Help me out of this..i am using listview adapter for displaying image list with check box, that allows to select multiple image form list.. code works good for images list not more than screen but if image is more than screen (for scrolling) it throws null pointer exception.. following is my code.</p><p>(apterMultiChoice.java)</p><pre><code>  public class PhotoAdapterMultiChoice extends BaseAdapter   {public ViewHolder holder;private Activity activity;private ArrayList&lt;String&gt; data;private ArrayList&lt;String&gt; text;private ArrayList&lt;CheckBox&gt; chkBox;private static LayoutInflater inflater=null;public ImageLoader imageLoader;     public PhotoAdapterMultiChoice(Activity a, ArrayList&lt;String&gt; title,ArrayList&lt;String&gt;           URL,ArrayList&lt;CheckBox&gt; chkBoxPass) {    activity = (Activity) a;    data=URL;    text=title;    this.chkBox = chkBoxPass;    inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    imageLoader=new ImageLoader(activity.getApplicationContext());}public int getCount() {    return data.size();}public boolean getSelect(int position){    return this.chkBox.get(position).isChecked();}public int getCountSelect(){    return chkBox.size();}public Object getItem(int position) {    return this.chkBox.get(position).isChecked();}public long getItemId(int position) {    return position;}public static class ViewHolder{    public TextView text;    public ImageView image;    public CheckBox checkBox;}public View getView(int position, View convertView, ViewGroup parent) {    System.out.println(this.chkBox.size() +"" ---- ""+data.size());    if(this.chkBox.size() &lt; data.size())    {        View vi=convertView;        if(convertView==null)        {            System.out.println(""convertView is null"");            vi = inflater.inflate(R.layout.photoitemlistmultichoice, null);            holder=new ViewHolder();            holder.text=(TextView)vi.findViewById(R.id.text);            holder.image=(ImageView)vi.findViewById(R.id.image);            holder.checkBox=(CheckBox) vi.findViewById(R.id.check);            //this.chkBox.add((CheckBox) vi.findViewById(R.id.check));            vi.setTag(holder);        }        else         {            System.out.println(""convertView is Not null"");            this.chkBox.add((CheckBox) vi.findViewById(R.id.check));            holder=(ViewHolder)vi.getTag();        }        System.out.println(""Position : ""+position);        holder.text.setText(text.get(position));        holder.image.setTag(data.get(position));        //holder.checkBox.setTag(chkBox.get(position));        //this.chkBox.set(position, chkBox.get(position));        //this.chkBox.add(holder.checkBox);        imageLoader.DisplayImage(data.get(position), activity, holder.image,""Photo"");        return vi;    }    return null;}}</code></pre><p>How i call adapter</p><pre><code>PhotoAdapter adapter = new PhotoAdapter(this, imageNameList, thumbURLList);listPhoto.setAdapter(adapter); //listPhoto is my listView</code></pre><p>(photolist.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/lblAlbumName""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     /&gt;&lt;ListView    android:id=""@+id/listPhoto""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""     android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;</code></pre><p>(photoitemlist.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;ImageView      android:id=""@+id/image""      android:layout_width=""50dip""      android:layout_height=""50dip"" android:src=""@drawable/default_photo_icon""  android:scaleType=""centerCrop""/&gt;  &lt;TextView      android:id=""@+id/text""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_weight=""1""       android:layout_gravity=""left|center_vertical""       android:textSize=""20dip""       android:layout_marginLeft=""10dip""      /&gt;&lt;/LinearLayout&gt;</code></pre><p>please help..</p><p>thanks...</p>","392924","","501859","","2011-04-08 10:17:18","2012-02-28 10:59:39","listview with imagelist not work proper for multiple selection in custome adapter","<android><listview>","1","1","","",""
"4021160","1","4021205","","2010-10-26 06:20:18","1","2663","<p>The text on my buttons are set in resource files. E.g.</p><pre><code>            &lt;Button android:id=""@+id/up_button"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:text=""@string/up_label"" /&gt;</code></pre><p>The above code defines a button with text <code>@string/up_label</code>. How can I change this text in my program during the application is running. </p><p>Thanks. </p>","183828","","302328","","2010-10-26 06:27:40","2014-04-05 20:23:53","Change the text on a button in the program","<android><button>","3","0","","",""
"4021234","1","","","2010-10-26 06:32:07","0","478","<p>I have written code to add a number in contact book when the application is used.</p><pre><code>    ContentResolver cr = getContentResolver();    Uri phoneUri = null;    ContentValues values = new ContentValues();    values.put(People.NAME, ""stack"");    Uri uri = getContentResolver().insert(People.CONTENT_URI, values);    phoneUri = Uri.withAppendedPath(uri, People.Phones.CONTENT_DIRECTORY);    values.clear();    values.put(People.Phones.TYPE, People.Phones.TYPE_MOBILE);    values.put(People.Phones.NUMBER, ""9879958170"");    getContentResolver().insert(phoneUri, values);</code></pre><p>and even added the permission in .manifest file.</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""    android:enabled=""true"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS""    android:enabled=""true"" /&gt;</code></pre><p>this is working on emulator the contact gets added but..when i put this application into device....there is no contact with name stack...</p><p>Can anyone help me and let me know if i have done any mistake.</p><p>Thanks in advance:)</p>","452331","","11238","","2010-10-26 06:53:40","2010-10-26 07:22:01","Adding a number into Contacts works on emulator but not on device","<android><android-contacts>","2","0","","",""
"4021293","1","4124864","","2010-10-26 06:44:20","1","1537","<p>I have a lsit view and i that i need to add some text.in the adapter, I need to append ... at the end and i used the followingwhen i give  </p><pre><code>android:ellipsize=""end""</code></pre><p>in the only shows 2 lineeg:<br>asdnfsdfdsf asdfsdfasdf<br>sdfsd sdfsdf sdfsd ad...  </p><p>And when i give </p><pre><code>android:ellipsize=""start""</code></pre><p>it is as :<br>asdnfsdfdsf asdfsdfasdfd<br>...sdfsd sdfsdf sdfsd ad  </p><p>The complete code i used:  </p><pre><code>&lt;TextView  android:layout_width=""wrap_content"" android:background=""#016A7D""   android:layout_height=""80dp"" android:textColor=""#000000""    android:maxLines=""4""              android:id=""@+id/list_report_desciption""     android:ellipsize=""end""</code></pre><p>/>And the output i got is:  </p><p>What exactly will a smarter planet<br>  look like? How's IT changing? A...</p><p>actually it contains more than 6 lines<br>Is there any thing i need to set so that i need to get 3 lines<br>Thanks  </p>","477754","","","","","2013-05-29 11:32:49","android append '…' at the end textview _EDIT","<android><listview><append>","4","2","","",""
"4021445","1","","","2010-10-26 07:15:31","0","1092","<p>couldn't get connection factory client running the MapsDemo sample application on emulator. I'm getting the error: couldn't get connection factory client. </p><p>How to resolve this error?</p>","2355649","","","","","2011-03-25 09:10:30","How to resolve couldn't get connection factory client error on android","<android>","1","1","1","",""
"4021511","1","4110850","","2010-10-26 07:25:07","1","769","<p>I want to save my downloaded <code>ListView</code> items so that for example next time the app starts, it should not start my download dialog, instead my previous <code>ListView</code> items should turn up.</p><p>Some useful code snippets would be appreciated.</p><p>Thanks in advance and please tell me if I need to clarify!</p>","386562","","","","","2010-11-05 23:03:55","Save ListView items","<java><android>","5","0","","",""
"4021556","1","","","2010-10-26 07:32:47","0","595","<p>I have inflated a View into a PopupWindow. This View includes a TextView where I want to place text at runtime. I need to count the number of lines the TextView uses in order to adjust the size of the pop-up. For this purpose I use TextView's getLineCount() and draw the TextView before counting the number of lines ( myTextView.draw(canvas) ).</p><p>However, the first time I call the PopupWindow the getLineCount() returns the number of characters and not the number of lines (e.g 42 instead of 2) Debug prits suggest this is because the TextView is not properly initiated:</p><p>DEBUG/View(207): frame={0, 0, 0, 0} scroll={0, 0}  DEBUG/View(207): mMeasureWidth=0 mMeasureHeight=0 DEBUG/View(207): privateFlags={} DEBUG/View(207): frame={0, 0, 0, 0} scroll={0, 0} mText=""text to display.."" </p><p>The rest of the times a pop-up is triggered (by user press on map icons) the view has non-zero parameters, and then line count works fine:</p><p>DEBUG/View(207): frame={7, 13, 209, 79} scroll={0, 0}  DEBUG/View(207): mMeasureWidth=202 mMeasureHeight=66 DEBUG/View(207): privateFlags={HAS_BOUNDS} DEBUG/View(207): frame={7, 13, 209, 79} scroll={0, 0} mText=""text to display.."" </p><p>As a work-around I tried to draw an invisible PopupWindow before drawing the first pop-up, i.e trying to use it ""twice the first time"". This didn't help.. I also tried to invalidate the MapView which didn't work either.</p><p>Can anyone please suggest how to initiate the views properly so that I can use getLineCount() the way it is supposed to? </p><p>Thank you!Vanja</p>","419305","","","","","2010-10-26 07:47:21","Initiation of Android TextView will not work first time, dimensions are zero. What is the secret trick?","<android><textview><line-count>","1","0","","",""
"4021602","1","4022316","","2010-10-26 07:41:05","0","736","<p>I am trying to use KSOAp on android to connect to salesforce. Right now I am able to connect and authenticate on the server. I can also get the contacts from salesforce. What I am trying now is to create a contact through my client application on Android.But unfortunately I am new to Webservices and Ksoap and I do not understand how to. The salesforce API talks of creating a contacts Sobject. But this i believe is when one uses the wsdl to generate the necessary objects on client side platform. Since KSoAP doesnt support wsdl. How can i form these Contact objects and pass them on to the webservice?   </p><p>Here is the Api reference.<a href=""http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_calls_search.htm|StartTopic=Content%2Fsforce_api_calls_search.htm|SkinName=webhelp"" rel=""nofollow"">http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_calls_search.htm|StartTopic=Content%2Fsforce_api_calls_search.htm|SkinName=webhelp</a></p>","452307","","","","","2010-10-26 09:28:31","Create a contact on salesforce through Android","<android><web-services><soap><salesforce><ksoap2>","1","0","1","",""
"4021612","1","","","2010-10-26 07:42:22","1","698","<p>I have a problem with the Android Emulator and its SD card. I am developing an application that writes files to /sdcard. Everything works fine, until I exit the emulator by clicking its close button. After restart the files are empty (size 0), but still in the directory. Of course, they have not been empty as long as the emulator runs.</p><p>This looks like a failed sdcard unplug, like with usb stick. But I am not sure, how the emulator treats the card exactly. I am starting the emulator from Eclipse, and get an error at exit, when I close the emulator.</p><p>The problem did not exist before I updated my Android plugin. I could use all my files after restarting the emulator. Moreover, the problem does not occur on the real thing. I am using the most recent Android stuff, and Eclipse 3.5. </p><p>I already tried deleting my emulators and creating a new one. I also tried shutting the emulator down with the red telephone button, but that did never complete. Of course, my app is not a service and has no threads pending at shutdown.</p><p>Any ideas, you friendly people out there?</p>","447111","","447111","","2010-10-26 10:17:41","2012-04-18 06:38:39","Android Emulator SD Card Problem","<android>","2","0","","",""
"4021672","1","4021741","","2010-10-26 07:50:44","1","11469","<p>I have loaded a progressBar from:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ProgressBar xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+android:id/progress_small"" style=""?android:attr/progressBarStyleLarge"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;</code></pre><p>On different devices I get different visualization. I want the progressbar on every device and every android version look rounded and not being built by some short liney only.</p><p>Is there a way to force this?Thanks so far</p>","472355","","","","","2014-01-18 19:44:02","Changing the style of a progressbar","<android>","2","0","0","",""
"4021709","1","4043998","","2010-10-26 07:59:59","1","458","<p>I am trying to run my service as soon as boot is completed.I know how to do it, but this is the prob:</p><p>the service is running as soon as it get the boot completed intent,but my service cant open any HttpUrlConnections</p><p>I get that error:</p><pre><code>    10-26 09:53:50.400: ERROR/HttpHandler(1165) Host is unresolved: my.host:8080</code></pre><p>assume the this hosts works fine as soon as i launch my service manually after boot up with a launcher.</p><p>Is there a problem with connections when the device is booting up? maybe it's not ready for opening connections while it's booting up? </p><p>any ideas? or how should I fix that??</p><p>thanks,</p><p>ray.</p>","260511","","","","","2010-10-28 14:46:13","Connection problem on Boot Completed issue","<android>","2","0","","",""
"4021751","1","","","2010-10-26 08:07:03","1","646","<p>I am writing app, that should authorize on twitter. I load to WebView Link to my app's server, which redirects me to twitter authorization page. Before this, user is logged in on my app server with DefaultHttpClient.</p><p>If i just writing <em>webView.loadUrl(link);</em> everythig works correctly, but if i'm adding  <em>webView.setWebViewClient(new WebViewClient(){});</em> before loading link - it redirects me to authorization on my app's server.</p><p>What should i do to remove this redirection?</p>","564272","","","","","2010-10-26 08:07:03","[android]Setting WebViewClient to WebView doesn't work correctly","<android><webview><webviewclient>","0","0","","",""
"4021765","1","4080066","","2010-10-26 08:08:59","0","4014","<p>I have updated my  android sdk  with samsung galax tab addon , it installed successfully . problem is that when i open galaxy tab emulator, it displayed portion of emulator ,i.e; bottom of emulator is not visible. i thnk it is problem with desktop resolution , but resolution of desktop is 1280 X 1024 .  Can any one tell me how to get the display of galaxy tab emulator </p>","414777","","","","","2010-12-21 01:06:40","Android samasung galaxy tab emulator resolut?","<android><emulator><tablet>","4","0","1","",""
"4021841","1","4029645","","2010-10-26 08:22:20","4","1195","<p>To what extend do color depth and compression level of the original jpg and/or png images used as drawables have an effect on the app's UI performance, given the fact that all images are converted to bitmaps internally anyway. Especially considering i.e. images in list views for example.</p><p>Same question goes for png vs. xml shapes as drawables.</p><p><strong>Edit</strong>: I found a similar question which addresses memory usage, but my focus is more on UI performance (i.e. scrolling long list views, etc.). <a href=""http://stackoverflow.com/questions/2602282/android-is-decreasing-size-of-png-files-have-some-effect-to-resulted-bitmap-in"">http://stackoverflow.com/questions/2602282/android-is-decreasing-size-of-png-files-have-some-effect-to-resulted-bitmap-in</a></p><p>Larger images probably take longer for decompressing, but when they're cached properly (and i.e. asynchronous lazy loading), after initial loading, it shouldn't matter anymore.</p>","241475","","21234","","2010-12-08 11:00:43","2010-12-08 11:00:43","How does color depth and/or compression level of images affect UI performance?","<android><performance><graphics>","1","0","1","",""
"4021881","1","","","2010-10-26 08:28:38","4","674","<p>I am trying to use  <code>android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS</code> from <a href=""http://developer.android.com/reference/android/provider/Settings.html#ACTION_NETWORK_OPERATOR_SETTINGS"" rel=""nofollow"">This API</a>but it is giving an error. </p><p>I think its matching Activity may not exist.</p><p>How can I use it. I want to make an application which can directly give me list of available network operators.</p><pre><code>    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         closeButton = (Button)findViewById(R.id.widget29);         txt=(TextView)findViewById(R.id.widget28);         closeButton.setOnClickListener(new OnClickListener() {             //@Override public void onClick(View v) {</code></pre>","487350","","766024","","2014-01-11 10:10:03","2014-01-11 10:10:03","Deal with Intent Action (ACTION_NETWORK_OPERATOR_SETTINGS) not being found","<android><networking><settings>","1","3","","",""
"4021956","1","4034394","","2010-10-26 08:39:59","6","2666","<p>I have a <code>RelativeLayout</code> filling the screen and a couple of <code>ImageView</code> positioned on it using <code>LayoutParams</code> margins. These <code>ImageView</code> are animated in different ways, and in one case I want an image to ""fly in"" to the screen from the right.</p><p>Unfortunately, if I set <code>leftMargin</code> for that ImageView greater than the width of the screen, it does not appear (or appears cropped if it partially visible at the start of animation).</p><p>I tried setting width and height of <code>RelativeLayout</code> to be bigger than screen size - it works, but only partially: if the image is positioned completely off-screen, it does not work, and if the image is partially visible, it is <strong>not</strong> cropped, but that works only for right and bottom sides.</p><p>So, my question is this: how to position several <code>ImageViews</code> on and <strong>off</strong> the screen so that I can animate them using <code>Animation</code>?</p>","6533","","","","","2013-05-07 00:35:26","How to position a view off-screen so that it can be Animated to move on-screen?","<android><animation>","2","3","2","",""
"4021966","1","4022148","","2010-10-26 08:40:46","12","3923","<pre><code>PackageManager pm = this.getPackageManager();ActivityManager am = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);List&lt;RunningAppProcessInfo&gt; runningAppProcesses = am.getRunningAppProcesses();for(RunningAppProcessInfo process : runningAppProcesses) {    try {        ApplicationInfo ai = pm.getApplicationInfo(process.processName, PackageManager.GET_META_DATA);        Log.d(TAG, applicationInfo.name + """");    } catch (NameNotFoundException e) {        e.printStackTrace();    }}</code></pre><p><code>process.processName</code> returns a valid package name but <code>applicationInfo.name</code> is always null.</p>","421372","","421372","","2013-12-12 06:26:58","2013-12-12 19:23:06","PackageManager's applicationInfo.name is always null","<android><process>","3","0","4","",""
"4022051","1","","","2010-10-26 08:54:00","1","4189","<p>I am trying to integrate Admob to android, i end up with no success. The Document says Need to Provide DeviceID to get Ads for Real Devices.Could you please Help me about this. But I m getting ads in the Emulator by setting AdManager.TestEmulator.</p>","487376","","","","","2013-02-18 22:39:28","Integrate Admob to Android Problem","<android><admob><ads>","3","0","2","",""
"4022072","1","","","2010-10-26 08:56:12","1","1832","<p>I am new to android and trying to streaming video from my server.When i run the application it gives Error ""sorry,this video is not valid for streaming to this Device.."" than i download and push to sdcard of my device(samsung Galaxy 5)this time video is playing.... i convert this video by SOTHINK VIDEO CONVERTER..Any Help??</p><p>Thanks..</p>","487379","","302328","","2010-10-26 11:58:16","2011-06-28 08:37:18","Android Video Streaming Problem","<android><videoview>","3","0","","",""
"4022088","1","4022786","","2010-10-26 08:58:13","12","12263","<p>I want to read all the messages and their respective details from my phone.For this I am using the Uri like this:</p><pre><code>Uri sms = Uri.parse(""content://sms/"");</code></pre><p>But I don't know how many columns in database which are associated with this uri.</p><p>I want to display the following information:</p><ol><li>Message Type</li><li>Sender Number</li><li>Message Body</li><li>Timestamp</li></ol><p>Please can anybody enumerate the total column names?</p>","457982","","251122","","2010-10-26 09:03:37","2010-10-26 12:42:36","How many database columns associated with a SMS in android?","<android><sms><messages>","3","0","8","",""
"4022237","1","4022899","","2010-10-26 09:19:05","0","1702","<p>I am trying to make a application where a dialog will come from where user will be able to choose an option...I want the alert dialog like this,,,An image with the corresponding text</p><p>Here is the sample image I am looking ..<a href=""http://garr.me/wp-content/uploads/2009/12/sharevia.jpg"" rel=""nofollow"">http://garr.me/wp-content/uploads/2009/12/sharevia.jpg</a></p><p>I also want to change the ""share picture via"" text.</p><p>Thanks in advanceTanmay</p>","463721","","","","","2010-10-26 10:44:40","Android AlertDialog Builder Issue with image","<android><builder><alertdialog>","1","0","","",""
"4022397","1","4022533","","2010-10-26 09:38:43","4","4608","<p>I need to use geocoder to get lang and lat from address for google map.am working in android sdk 2.2 .wen using geocoder is not working it throw exception. How to use geocoder  in my application.or any other methods available to get long and lat?</p><p>I have android 2.1 device .is there any possible to gecoder work in android 2.1 actual deevice.I saw one thread in web page in that they mentioned geocoder work fine in actual device 2.2.But i dont know it ll work on device 2.1 or not i checked but in device also geocoder not working.any one help me to solve my issues.</p><p>Thanks,</p><p>Lakshmanan</p>","450596","","","","","2010-10-26 09:54:12","how to use geocoder in android 2.2 emulator or android 2.1 device","<android><android-emulator>","1","0","3","",""
"4022437","1","","","2010-10-26 09:43:27","11","1592","<p>I'm guessing everybody who does Android programming has on their own created multiple AVDs for various devices for testing purposes.  I didn't really want to add to the ""reinvent the wheel"" club, and was hoping someone could point me to an article that lists out various AVD configurations, or a site/link to download already created AVDs to copy into my Eclipse environment, or scripts to create the AVDs via the command line, etc.?</p><p>The only thing I've been able to find so far via Googling is this blog article...</p><p><a href=""http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/"">http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/</a></p><p>Be nice if a bunch of already-created AVD configurations shipped with the Android SDK, for the various popular Android devices.</p><p>Thanks in advance for any advice/info.</p>","435519","","","","","2011-08-24 12:59:10","Do common AVD configurations already exist somewhere that can be downloaded/viewed?","<android><android-emulator>","1","1","4","",""
"4022566","1","","","2010-10-26 09:58:52","12","4907","<p>I am aware of Creating a new values directory for the language with the suffix of the language code. For german: values-de or french: values-fr then copy our string.xml into that and translate each entry. And this works based on the Phone Localization settings</p><p>I wanted to know if we can bypass the phone setting and and make the user select his required language inside the app?</p><p>My requirement is, i want to give a language selection option inside my app, and make the user select the language he wants for the app.. how to dynamically switch between the string.xml (for different languages) ???</p><p>thanks in advance</p>","367016","","166749","","2010-10-26 10:03:55","2012-09-18 07:16:40","Custom Multi Language support","<android>","3","1","8","",""
"4022628","1","4022696","","2010-10-26 10:07:32","1","1570","<p>I need to hide a TextView after 10 seconds. I thought I could implement a Chronometer and when elapsed time is bigger than 10000 millis I hide the TextView. My problem is that the chronometer only ticks once and then stops. Any idea what I've missed ?</p><pre><code>Activity ctx = this;...private void ShowText(String message)    {        txtProceed.setText(message);        txtProceed.setVisibility(View.VISIBLE);        chronoHideText = new Chronometer(ctx);        chronoHideText.setOnChronometerTickListener(new OnChronometerTickListener()        {               public void onChronometerTick(Chronometer arg0) {                  long elapsed = SystemClock.elapsedRealtime() - chronoHideText.getBase();                  Log.i(""Chrono"",String.valueOf(elapsed));                   if (elapsedTime&gt;10000)                   {                       txtProceed.setVisibility(View.INVISIBLE);                       chronoHideText.stop();                   }               }        }        );        chronoHideText.setBase(SystemClock.elapsedRealtime());        chronoHideText.start();    }</code></pre><p>Thank you Janusz for  your help. The solution that works great now is:</p><pre><code>Handler splashHandler = new Handler() {            @Override            public void handleMessage(Message msg) {                    switch (msg.what) {                    case 0:                            //remove SplashScreen from view                            txtProceed.setVisibility(View.INVISIBLE);                            break;                    }                    super.handleMessage(msg);            }    };    Message msg = new Message();    msg.what = 0;    splashHandler.sendMessageDelayed(msg, 10000);</code></pre>","379865","","379865","","2010-10-26 10:35:17","2010-10-26 10:41:38","Android chronometer ticks once and stops","<android><timer><chronometer>","2","2","","",""
"4022711","1","","","2010-10-26 10:18:01","1","4050","<p>I'm making an app on android, using webview to load google map (using this url for my webview: <a href=""http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html"" rel=""nofollow"">http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html</a>).but i can't put a marker on that webview, can't somebody tell me how?</p>","487481","","250259","","2011-12-02 12:28:09","2012-04-16 21:10:05","using WebView to view map and set marker (pin) on android","<android><google-maps><webview><marker>","3","2","","",""
"4022727","1","4023974","","2010-10-26 10:19:58","2","801","<p>Is it possible in Android, to disable standard features of the phone such as Mail, browser, phone etc?</p><p>What I'm asking is, is it possible to create an application that, when launched on startup provides some features to the user, but sits ""on top"" of android so they only have access to your application and not the underlying features of android itself? </p><p>Effectively, the phone still runs android, but the user never gets to <em>see</em> this as they are limited to the functionality that your app provides.</p>","155695","","","","","2010-10-26 13:11:04","Is Android ""open"" enough to let you disable built-in features such as Phone book etc?","<android><android-2.2-froyo>","1","3","0","",""
"4022742","1","","","2010-10-26 10:22:36","3","652","<p>in my android application i have to download xml files from the server. i used the code that shown below. sometimes it shows null pointer exception for getResponseCode() method. the httpConn is not null. </p><pre><code>                    public static byte[] getGprsConnData(String urlStr){                    URL url = new URL(urlStr);        URLConnection urlConn = url.openConnection();        if(!(urlConn instanceof HttpURLConnection)){        Log.e(""Error"", ""connection is not an instance of HTTP connection"");            throw new IOException (""URL is not an Http URL"");        }        httpConn = (HttpURLConnection)urlConn;        if(httpConn == null){            System.out.println(""httpconnection is null"");        }else{            System.out.println(""httpconnection isn't null"");        }        httpConn.setAllowUserInteraction(false);        httpConn.setInstanceFollowRedirects(true);        httpConn.setRequestMethod(""GET"");        System.out.println(""getting http Connection "");        httpConn.connect();         System.out.println(""http Connection established"");        int code = -1;        try{        code = httpConn.getResponseCode();        }catch(Exception e){            e.printStackTrace();            Log.e(""Exception"", ""while getting http response code"");        }        System.out.println(""http Connection response code"" + code);        if(httpConn != null &amp;&amp; httpConn.getResponseCode()!= HttpURLConnection.HTTP_OK){            return null;        }        System.out.println(""getting inputStream"");        InputStream fromServer = httpConn.getInputStream();}</code></pre><p>What will be the reason for that exception?? anybody please help</p>","462695","","462695","","2010-10-27 10:20:47","2010-10-27 10:20:47","android httpurlconnection shows null pointer exception","<android>","0","1","1","",""
"4022773","1","","","2010-10-26 10:27:55","1","136","<p>I need one information regarding , one android app XML resources for different versions of build. That means, i have a string XML files related to one android app. i have to use same string resource file for two different builds(in second build i need to change some strings of xml file instead of create new string.xml. this is like MACRO concept of C- programing).</p><p>Please tell me how to solve this issue. </p>","388269","","","","","2010-10-26 10:27:55","one android app XML resources for different versions of build","<android>","0","1","","",""
"4022815","1","4039883","","2010-10-26 10:33:25","1","4039","<p>I have a game running on android.</p><p>basically, it's structure is like lunarlander</p><p>I started my activity , using the layout to start the class running.</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;my.darling.gameView    android:layout_width=""match_parent""     android:layout_height=""match_parent""/&gt;&lt;/FrameLayout&gt;</code></pre><p>When I pressed home, i can return to my game everytime. I always shut down the thread and create a new one.</p><p>The problem occurs when I pressed BACK botton.</p><p>I think my game finished. but after 4 times of ""click the game"" -> ""click BACK""</p><p>There comes an error -> ""stopped unexpectedly""</p><p>I've override the function : <code>onPause()</code> and called <code>finish()</code>. But it still happens.</p><p>can anyone help me?</p>","408278","","408278","","2010-10-28 09:18:43","2010-10-28 09:18:43","killing activity on Android doesn't clear memory?","<android><memory><activity><bitmap>","1","3","1","",""
"4022830","1","","","2010-10-26 10:35:23","2","2078","<p>I have 2 activities named firstActivity.java,secondActivity.java.When I click a button in firstActivity, I am calling secondActivity .But when I return back from secondActivity ,based on the result I need to skip some steps in firstactivity which are performed in its onCreate() method. While coming back from secondActivity I used Bundle to put data which I gave as input to Intent, I accessed that data in onCreate() of first activity .But while I started activity application was crashing showing as NullPointerException in the line where I am accessing data of 2nd activity. the reason I think is when the application is launched for the first time there will not be any values in Bundle so I am getting nullpointer exception.so, can anyone help me in sorting out this issue?</p><p>Thanks in Advance,</p>","429501","","","","","2010-10-26 14:48:13","Saving state between activities","<android>","1","3","2","",""
"4022860","1","","","2010-10-26 10:39:37","4","1762","<p>I'm having memory problems and think it might have to do with creating large bitmaps. </p><p>The task at hand is to get a fairly small tile image and create a larger tiled image and set this as the phone wallpaper. The way I'm doing this is:</p><blockquote>  <p>1) Create a view that is 2 * screen width, 1 * screen height</p>    <p>2) Set the view background to a BitmapDrawable with the tile mode set to repeat</p>    <p>3) Create a bitmap with the views dimensions</p>    <p>4) draw the view to the bitmap by: view.draw(new Canvas(bitmap))</p>    <p>5) set wallpper: getApplicationContext().setWallpaper(bitmap)</p></blockquote><p>This works fine on my phone (HTC Magic) and other phones that I have tried. But I am getting bug reports relating to this issue. I tried to recreate the problem by doubling the required dimensions and the problem seems to be happening in the 4th step when the view is being drawn to the bitmap:</p><blockquote>  <p>ERROR/dalvikvm-heap(124): Heap Massage needed (7372800-byte external allocation too big)</p></blockquote><p>I'm not sure how to go about solving this. Please help!Thanks</p>","362476","","362476","","2010-10-26 13:17:21","2010-12-14 21:55:18","Dealing with Large Bitmaps (tiling a small bitmap to create wallpaper)","<android><memory><views><bitmap>","4","1","2","",""
"4022866","1","4022917","","2010-10-26 10:40:20","3","5150","<p>I have prebuild database of mostly string objects. I want to know how to put in my apk file so the database will be already created when the user installs the database.</p>","371539","","","","","2012-05-11 20:16:50","How to put existing database in the .apk file?","<android><database>","2","0","3","",""
"4022975","1","4023734","","2010-10-26 10:55:45","4","2049","<p>I want to store some data that should remain also after application uninstall and to be accessible by a new version of this application.Share preferences/files are not a solution as they are removed when program is uninstalled, also writing to internal memory is not a solution (also removed with uninstall).Writing to external public folders I see that is not removed but this would require an external SD Card and don't want to be constrained by this.I don't know about using the SQLite database, how it works? It could be a solution for what I want ?Or any other solutions would be appreciated. Thanks.</p>","467780","","","","","2012-01-06 04:13:35","How to store data that remains after uninstall","<android><file><data><uninstall><store>","3","3","1","",""
"4022998","1","","","2010-10-26 10:59:45","0","1496","<p>I have a ListView and a button in my view. Button is placed just below the listview. My listview contains 10 items. When I am running the application. I can't see the button inside the view. Because of 10 items i have to scroll the listview to see all items. If i use 4 items, I can see the button. Why it is happened? Please help me.Thank you..</p>","483861","","","","","2012-01-07 06:57:05","Problem when using more elements in the ListView","<android><listview>","4","0","","",""
"4023058","1","4027230","","2010-10-26 11:10:31","3","5360","<p>I'm attempting to get data from <a href=""http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured?&amp;start-index=1&amp;max-results=15&amp;v=2"" rel=""nofollow"">http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured?&amp;start-index=1&amp;max-results=15&amp;v=2</a>and print the titles of the videos, but I get an exception in the line</p><pre><code>            int responseCode = httpConnection.getResponseCode(); </code></pre><p>what's the problem? Any other way to get this data?</p><p>My code: </p><pre><code>URL url;    try {                String featuredFeed = ""http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured?&amp;start-index=1&amp;max-results=15&amp;v=2"";                url = new URL(featuredFeed);                URLConnection connection;                connection = url.openConnection();                HttpURLConnection httpConnection = (HttpURLConnection)connection;                 int responseCode = httpConnection.getResponseCode();                 if (responseCode == HttpURLConnection.HTTP_OK) {                   InputStream in = httpConnection.getInputStream();                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                  DocumentBuilder db = dbf.newDocumentBuilder();                  // Parse the earthquake feed.                  Document dom = db.parse(in);                        Element docEle = dom.getDocumentElement();                  // Get a list of each earthquake entry.                  NodeList nl = docEle.getElementsByTagName(""entry"");                  if (nl != null &amp;&amp; nl.getLength() &gt; 0) {                    for (int i = 0 ; i &lt; nl.getLength(); i++) {                      Element entry = (Element)nl.item(i);                      Element title = (Element)entry.getElementsByTagName(""title"").item(0);                      String titleStr = title.getFirstChild().getNodeValue();                      VideoCell cell = new VideoCell(titleStr);                      // Process a newly found earthquake                      addVideoCellToArray(cell);                    }                  }                }              } catch (MalformedURLException e) {                e.printStackTrace();              } catch (IOException e) {                e.printStackTrace();              } catch (ParserConfigurationException e) {                e.printStackTrace();              } catch (SAXException e) {                e.printStackTrace();              }              finally {              }</code></pre><hr><p>EDIT: Problem solved. Forgot to add internet permissions!</p>","171911","","171911","","2010-10-26 19:22:37","2012-01-04 09:37:41","Android: Trying to get data from youtube api","<android><youtube-api><httpurlconnection><urlconnection>","1","0","5","",""
"4023068","1","4023103","","2010-10-26 11:12:17","9","7304","<p>How can i enable my app to be moved to the sdcard?</p><p>-edited the title in order to make question more relevant to the answers given.</p>","97688","","705198","","2011-08-14 19:03:42","2013-12-24 21:36:30","How to enable app being moved to sdcard (and support android < 2.2 still)?","<android><app2sd>","4","0","4","",""
"4023232","1","","","2010-10-26 11:37:58","0","4320","<p>I was wondering if there is a simple way to style a ListView along with it's items like the conversation in android's text message app. There are rounded corners and stuff like that, where I'm not sure how I could implement this myself.</p><p>I know that I could look for the source code of it, and try to copy from there, but it's a huge app with a lot of files and that's why I decided to ask first. </p><p>Thanks in advance,Jan Oliver</p>","169748","","","","","2010-10-26 12:56:42","Android: ListView style like text messages conversations","<android><listview>","2","0","1","",""
"4023273","1","4027138","","2010-10-26 11:43:31","21","26531","<p>Im trying to create my own url scheme so my android app can get called via an URL but for now I dont have a success.</p><p>Im trying to have this url to work : cedemo://com.cedemo.scan?X=toto</p><p>Here is part of my manifest file :</p><pre><code>&lt;activity android:name="".Gallery1"" android:label=""@string/app_name"" android:launchMode=""singleTask"" android:screenOrientation=""portrait""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.GALLERY"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;            &lt;data android:scheme=""cedemo"" android:host=""com.cedemo.scan"" /&gt;        &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>Does anyone can help telling me what is wrong ?Also, if someone find what is wrong, can someone tell me how I read the ""X"" variable from inside the android code from my app ?</p><hr><p><strong>Update:</strong></p><p>Update: I did the modification of the action (as advised in one of the answers) and it's worked fine. The thing is that I still cannot get the url variable value. Here is the code I tried.</p><pre><code>final Intent intent = getIntent();final String myScheme=intent.getScheme();final Bundle myBundle=intent.getExtras();final boolean inContestKey;if (myBundle != null) {    inContestKey=myBundle.containsKey(""inContest"");}final Uri myURI=intent.getData();final String value;if (myURI != null) {    value = myURI.getQueryParameter(""inContest"");}</code></pre><p>But I receiving <code>null</code> from all the functions… what else can i do?</p><p>May be I should explain better the context of my software:</p><ol><li>My software is started</li><li>My software launch then the browser</li><li>the user click a link in the browser and the browser go to the url scheme, back to the software with a variable  ""X"" (for example)</li><li>the software should read the variable ""X""</li></ol><p>But in my case : <code>myScheme</code>, <code>myBundle</code>, <code>myURI</code> are set to <code>null</code>.</p><p>Any ideas ?</p><hr><p><strong>Update:</strong></p><p>I found the answer is that you have to be in the main activity to do that.</p>","429222","","760489","","2013-10-08 05:11:10","2013-10-08 05:11:10","android custom url scheme..?","<android><url>","2","0","13","",""
"4023357","1","4267666","","2010-10-26 11:53:35","1","2106","<p>Friend's       I need help on setting the data content showing from DropDownlist of auto complete text box to another string,when i click the particular content from dropdown list.Help me.</p><p>thanks in advance.</p>","393953","","","","","2010-11-24 14:06:43","How to assign the value of AutoCompleteTextView from Dropdown selected value to another String","<android>","1","0","1","",""
"4023599","1","4023645","","2010-10-26 12:23:29","0","97","<p>I am writing a small game for the android platform (HTC Desire) and i am trying to implement a simple scripting language, mostly to set variables and check if conditions are met.</p><p>So I thought maybe there was a runtime parser in the android library, that way I can put some of the logic in scripts, instead of in the engine.</p><p>It's quite basic stuff, like setting variables; ""skill_accuracy = 5"", IF conditions ""if (skill_accuracy > nme.accuracy) { hit = true}"" and maybe call a function like ""call level_won();"" but Im guessing that can be done using method invokation.</p><p>Any ideas?</p>","432869","","","","","2010-10-26 12:29:45","Runtime parsing in Android","<android><parsing><invoke>","1","0","0","",""
"4023615","1","","","2010-10-26 12:25:38","0","264","<p>hiii..i m developing an app in which as user click on a link it should prompt the user to open link in myAppbrowser (which i will create) or default browser(like activity chooser do).as user click on default browser app prompt again that, 'this page cant open in default browser'.after that the browser which i make should run...</p><p>how to implement this....plz help me</p>","450601","","450601","","2011-01-20 10:06:05","2011-01-20 10:06:05","open another browser in spite of default browser","<android>","1","3","","",""
"4023638","1","","","2010-10-26 12:28:53","0","1807","<p>below is a sample structure of the XML I'm trying to parse using the Android SAX parsing approach in this <a href=""http://www.ibm.com/developerworks/opensource/library/x-android/index.html#list8"" rel=""nofollow"">tutorial</a>. </p><pre><code>&lt;root&gt;    &lt;parent&gt;        &lt;id&gt;&lt;/id&gt;        &lt;name&gt;&lt;/name&gt;        &lt;child&gt;            &lt;id&gt;&lt;/id&gt;            &lt;name&gt;&lt;/name&gt;        &lt;/child&gt;        &lt;child&gt;            &lt;id&gt;&lt;/id&gt;            &lt;name&gt; &lt;/name&gt;        &lt;/child&gt;    &lt;/parent&gt;    &lt;parent&gt;        &lt;id&gt;&lt;/id&gt;        &lt;name&gt;&lt;/name&gt;        &lt;child&gt;            &lt;id&gt;&lt;/id&gt;            &lt;name&gt;&lt;/name&gt;        &lt;/child&gt;    &lt;/parent&gt;    ...&lt;/root&gt;</code></pre><p>I have two classes named <code>Parent</code> and <code>Child</code>. Parent has a field which is a list of Child objects, such as this.</p><p>Parent</p><pre><code>public class Parent {    private String id;    private String name;    private List&lt;Child&gt; childList;    //constructor, getters and setters    // more code}</code></pre><p>Child</p><pre><code>public class Child {    private String id;    private String name;    //constructor, getters and setters    // more code}</code></pre><p>So I created a Parent object to store the parsed data. In the code below I can get the <code>name</code> and <code>id</code> element of <code>parent</code> but I cant figure out how to parse the <code>child</code> elements and their own child elements. I dont know if this is the right way to accomplish what I'm trying to do.</p><p>Can someone show me a way?</p><pre><code>public class AndroidSaxFeedParser extends BaseFeedParser {    public AndroidSaxFeedParser(String feedUrl) {        super(feedUrl);    }    public List&lt;Parent&gt; parse() {        final Parent current = new Parent();        RootElement root = new RootElement(""root"");        final List&lt;Parent&gt; parents = new ArrayList&lt;Parent&gt;();        Element parent = root.getChild(""parent"");        parent.setEndElementListener(new EndElementListener() {            public void end() {                parents.add(current.copy());            }        });        parent .getChild(""id"").setEndTextElementListener(                new EndTextElementListener() {            public void end(String body) {                current.setId(body);            }        });        parent .getChild(""name"").setEndTextElementListener(                new EndTextElementListener() {            public void end(String body) {                current.setName(body);            }        });        try {            Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8,                    root.getContentHandler());        } catch (Exception e) {            throw new RuntimeException(e);        }        return parents ;    }}</code></pre>","487601","","418183","","2011-01-28 19:17:06","2012-09-20 15:43:22","Parsing XML using android sax parser","<android><xml><sax><xml-parsing>","1","0","0","",""
"4023688","1","","","2010-10-26 12:35:41","0","150","<p>HI, </p><p>I want to create a table in android, should contains a lot of rows. Each row has 4 columns, and if i click any view, i want to integrate onClick event for the view.I have developed something similar to the requirement,But didn't got the click view, Here is my code :</p><p>LinearLayout lLayout1= null;    LinearLayout main_lLayout= null;    LinearLayout lLayout2= null;    TextView myText[] = new TextView[12];</p><pre><code>LinearLayout myLayout[] = new LinearLayout[12];@Overridepublic void onCreate(Bundle icici) {    super.onCreate(icici);    main_lLayout = new LinearLayout(this);    main_lLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,                                           LayoutParams.WRAP_CONTENT));    main_lLayout.setOrientation(LinearLayout.VERTICAL);    int k = 0;    for(int i=0;i&lt;4;i++) {        myLayout[i] = new LinearLayout(this);        for(int j=0;j&lt;4;j++) {            myText[j] = new TextView(this);            myText[j].setText(""asdf""+i+j);            myText[j].setPadding(0, 0, 20, 10);            myText[j].setClickable(true);            myText[j].setId(k);            myText[j].setOnClickListener(this);            k++;            System.out.println(k);            myLayout[i].addView(myText[j]);        }               main_lLayout.addView(myLayout[i]);    }           setContentView(main_lLayout);}@Overridepublic void onClick(View v) {    System.out.println(myText[0].getText());    System.out.println(myText[10].getText());}</code></pre>","487604","","","","","2010-10-26 13:13:13","Problem with displaying Table in Android, Please help","<android><onclick><tablelayout>","1","0","","",""
"4023717","1","","","2010-10-26 12:39:00","0","529","<p>HelloIn my android application i am using a webview to display apage of contents .What i require is like if the user longpress on a word then that particular word should be highlighted and should be highlighted even if the user reloads the app again.</p><p>Is there any way that i can get this done in android.</p><p>Please forward your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-10-26 12:44:54","highlight the word on longpress android","<android>","1","0","","",""
"4023749","1","4427066","","2010-10-26 12:44:25","1","425","<p>When a user presses the Search hard key on the device, Android shows the Quick Search Bar. How do I disable the Quick Search Bar?</p>","476747","","246246","","2013-09-28 15:28:47","2013-09-28 15:28:47","How to disable QSB..?","<android><searchbar>","2","0","","",""
"4023758","1","","","2010-10-26 12:45:25","0","646","<p>Im trying to determine if data was successfully sent to the server through a TCP socket using the OutputStream object. for testing purposes i disable network communications in the phone and OutputStream.write(); doesn't throw an exception, all the methods in the socket class return as though the socket is active and working. Is there anything i'm doing wrong here?</p><p>is there any socket implementation or stream implementation i can use to get an exception or error when the stream / socket doesn't actually send the data in the buffer?</p><p>also setting SetSoTimeout() on the socket doesn't seem to do anything.</p><p>Thanks,  Totem</p>","274180","","","","","2011-06-11 22:26:03","Android TCP socket and Streaming. No Errors or exceptions when sending data after conectivty loss","<android><sockets>","1","0","","",""
"4023837","1","4024441","","2010-10-26 12:54:12","-1","697","<p>javax.activation cannot be resolved, why? </p>","472537","","","","","2010-10-26 14:00:53","Android javax.activation cannot be resolved after including java mail 1.4.3 lib","<android><email>","1","0","","2012-08-20 02:03:06",""
"4023855","1","4023981","","2010-10-26 12:56:28","0","147","<pre><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1200000, 200, ll);</code></pre><p>My assumption is that it gets the location every 120000ms if it has changed more then 200 meters.</p><p>At least this is what I am experiencing anyway....which is what I want. But what happens if the phone ends up in a metal building where there is NO GPS reception..??</p><p>Does it just keep trying every 1200000ms for a GPS fix forever..?? Or does this eventually die off and not work again..??</p><p>If I put the phone on my dash and drive around...every 120000ms I send a SMS message with the latest coordinates. Everything works just fine. But if the phones ends up in a building for 3-4-5 hours and comes back out side 3-4-5 hours later....my hope is that it will pick back up where it left off and send me a new location (if it has changed more than 200 meters). But this does not appear to be the case. It just stops working and I never get a new location even if I do have a clear view of the sky. Just wondering if this stops searching for a GPS fix or something after so many attempts to obtain a GPS fix...?</p>","393913","","","","","2010-10-26 13:17:43","What does this line of code do..?","<android>","2","0","","",""
"4023953","1","","","2010-10-26 13:09:01","4","209","<p>I have created an android app with a dynamic scrolling interface.  When a user scrolls the first tap is not registered.</p><p>Just a guess, but it seems like the first tap is considering the tap to stop the scrolling, even if the user already reached the bottom of the scrollview.</p><p>Any help is greatly appreciated.</p>","422967","","","","","2010-10-26 13:09:01","Android ScrollView - 1st tap is not registered","<android>","0","1","","2013-02-06 13:51:07",""
"4023972","1","4024782","","2010-10-26 13:10:56","2","3411","<p>Basically I have created a Blackjack app that uses several methods that get called and pass a long the information that is needed (about cards and actions).  I have 2 buttons displayed on screen that are click able (hit and stand).  Now I have a method called player turn... and this is when I (through static ints) have if a button is selected, things will happen.  However I did this with an infinite while loop thinking it will just keep checking to see if a button is pressed and then only do action when a button is pressed.  This isn't working as  my screen is not refreshing after each textview or imageview change thus as soon as I hit start game the game appears to ""freeze"" (being due to the method never ending) and I am therefore unable to click said buttons.  Is there a way to call something similar to keyboard listener in java (Which pauses activity and waits for user input), in android?  If not, what would you suggest the workaround be?  Lastly (though not as currently important) how would I properly refresh everything after each change (I believe I need to use invalidate.. though I'm not sure what to have before invalidate so it refreshes the whole thing)?  Thanks a bunch in advance.</p>","487645","","87197","","2011-05-20 21:00:46","2012-01-07 22:18:47","How to have a method pause and wait for input with Android?","<java><android><onclick><buttonclick><blackjack>","5","1","","",""
"4023975","1","","","2010-10-26 13:11:10","3","4937","<p><a href=""http://stackoverflow.com/questions/2403632/android-show-soft-keyboard-automatically-when-focus-is-on-an-edittext/2403977#2403977"">http://stackoverflow.com/questions/2403632/android-show-soft-keyboard-automatically-when-focus-is-on-an-edittext/2403977#2403977</a></p><p>I've read this post that automatically shows the virtual keyboard when a dialog box is shown. however, it's not working for me. any ideas why? eventhough the edit text is automatically on focus when the dialogbox appear, the event doesn't trigger. I've also read the onpostresume answer but I don't know how to apply it. any help is appreciated.</p><pre><code>final Dialog dialog = new Dialog(ThesisI.this);        dialog.setContentView(R.layout.budget_dialog);        final EditText et = (EditText) dialog.findViewById(R.id.textComments);        final Button enter = (Button) dialog.findViewById(R.id.buttonEnter);        final Button cancel = (Button) dialog.findViewById(R.id.buttonCancel);        enter.setOnClickListener(new View.OnClickListener() {      @Override   public void onClick(View v) {      }        });        /**cancel */        cancel.setOnClickListener(new View.OnClickListener() {      @Override   public void onClick(View v) {   }        });               dialog.show();         et.setOnFocusChangeListener(new View.OnFocusChangeListener() {            @Override            public void onFocusChange(View v, boolean hasFocus) {                if (hasFocus) {                  dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);                }            }        });</code></pre><p>however, i noticed that if I change focus to the button then focus again to the edit text. this event works, using this code below.</p><pre><code>et.setOnFocusChangeListener(new View.OnFocusChangeListener() {            @Override            public void onFocusChange(View v, boolean hasFocus) {                if (hasFocus) {                   InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);                      inputMgr.toggleSoftInput(0, 0);                }            }        });</code></pre><p>any idea on how to apply it?</p>","470153","","1765573","","2013-07-27 07:32:36","2013-07-27 07:32:36","Android: Dialog box show soft keyboard automatically when focus is on an EditText not working","<android><android-softkeyboard>","2","0","","",""
"4024015","1","","","2010-10-26 13:15:40","0","866","<p>How can I pass a multidimensional array from one activity to another?</p>","483861","","","","","2010-10-26 13:21:02","passing a multidimensional array from one activity to another","<android><multidimensional-array>","1","0","","",""
"4024141","1","","","2010-10-26 13:29:31","0","39","<p>I have two activities A &amp; b.</p><p>in A i have one button which takes me to the activity B. in Activity B i have one edit text. when user enter some values in edittext i m getting the value in some variable. and i want to pass this value back to activity A. i applied the Bundle concept bt it is force closing my app.</p><p>pls anybody can help me?</p><p>thanks in advance.</p>","383597","","","","","2011-02-22 14:39:21","Android Actvities problem for getting result","<android>","2","1","","",""
"4024297","1","4027022","","2010-10-26 13:48:38","0","271","<p>I have a couple activities in my app that I would like to utilize shared preferences.  Initially, I created a method in each activity to utilize SharedPreferences, which worked fine.  However, since there are multiple activities that use the same data, I’m basically tucking similar methods in multiple places.  So it seemed like it made more sense to create a class specifically for the purpose of handling all these methods.</p><p>Unfortunately, I don’t understand how to do it properly.</p><p>This won’t compile, because it says “getSharedPreferences is undefined for the type AppPrefs.”</p><pre><code>public class AppPrefs { public void foo() {  SharedPreferences settings = getSharedPreferences(""MyAppPrefs"", 0); } }</code></pre><p>Finally, I thought, maybe since SharedPreferences is an interface I could do this, but then I’d have to implement the inherited methods.  I have no reason to Override any of those methods, so there is no reason to do this either.</p><pre><code>public class AppPrefs implements SharedPreferences { public void foo() {  SharedPreferences settings = getSharedPreferences(""MyAppPrefs"", 0); } }</code></pre><p>What makes sense to do here?  Is there a concept am I missing?  Could anyone elaborate and explain?  Thanks.</p>","432209","","","","","2010-10-26 18:57:38","How do I create a class specifically for the purpose of using SharedPreferences?","<java><android><interface><sharedpreferences>","2","0","","",""
"4024302","1","","","2010-10-26 13:48:52","1","1854","<p>I have the next xml layout file:</p><p></p><p></p><pre><code>&lt;ViewFlipper android:id=""@+id/details""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;!-- ListView que define la lista de noticias --&gt;    &lt;ListView        android:id=""@+id/list""        android:cacheColorHint=""@android:color/transparent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""/&gt;    &lt;!-- Layout del detalle de una noticia --&gt;    &lt;ScrollView      android:id=""@+id/scroll""        android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:background=""#FFFFFFFF""&gt;        &lt;LinearLayout          android:id=""@+id/widget""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:orientation=""vertical""&gt;            &lt;RelativeLayout android:id=""@+id/top""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:padding=""2dip""                android:background=""@drawable/header""&gt;                &lt;Button android:id=""@+id/back""                     android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                     android:layout_marginTop=""5.0dip""                    android:layout_marginLeft=""5.0dip""                    android:padding=""5.0dip""                    android:background=""@drawable/custom_buttom""                    android:text=""Atrás""                     android:textStyle=""bold""                    android:textSize=""11.0dip""                    android:textColor=""#FFFFFF""/&gt;                &lt;Button android:id=""@+id/share""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginTop=""5.0dip""                    android:layout_marginRight=""5.0dip""                    android:padding=""5.0dip""                    android:background=""@drawable/custom_buttom""                    android:text=""Compartir""                     android:textStyle=""bold""                    android:textColor=""#FFFFFF""                    android:textSize=""11.0dip""                    android:layout_alignParentRight=""true""&gt;                &lt;/Button&gt;            &lt;/RelativeLayout&gt;            &lt;TextView              android:id=""@+id/title""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:layout_marginTop=""12dip""              android:padding=""10dip""              android:gravity=""fill_horizontal""              android:textStyle=""bold""              android:textSize=""22dip""              android:textColor=""#000000""/&gt;            &lt;TextView              android:id=""@+id/date""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:paddingLeft=""10dip""              android:gravity=""left""              android:textSize=""11dip""              android:textColor=""#000000""/&gt;            &lt;WebView             android:id=""@+id/message""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             android:layout_marginTop=""12dip""             android:padding=""10dip""             android:gravity=""fill_horizontal""             android:textSize=""14dip""             android:layout_centerInParent=""true""/&gt;            &lt;TextView              android:id=""@+id/source""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:paddingLeft=""10dip""              android:gravity=""center""              android:textSize=""11dip""              android:textColor=""#000000""/&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/ViewFlipper&gt;</code></pre><p></p><p>where the content in the WebView is dinamically changed depending the item selected in a previous ListView (the first view in the ViewFlipper).</p><p>The problem is when I set a new content in the WebView after the view has been filled with text. If the first text set is longer than the next one, the second time I have a large blank space between the finish of the WebView text and the footer I have in the screen. Do anyone know what is the problem ?</p><p>Another problem I have is with de focus. The first time I load this view it is focused in the top, but the second one is focused directlly in the WebView.</p>","487687","","","","","2012-01-21 11:30:59","problem with height in WebView","<android><height><webview>","2","0","","",""
"4024349","1","","","2010-10-26 13:53:58","0","538","<p>I'm using a listview with an adapter extending CursorAdapter.The listitems contains a few TextViews which can contain arbitrary lengths of text.The problem is now as the views (in the listview) are recycled, items might get alot higher than needed since a previous item in the view needed bigger space.</p><p>I guess that the solution is to somehow to not allow recycling, or just force set the size of the view upon it being bound. I've been trying a number of different solutions but I haven't found a way. Could someone please help me? ;)</p><pre><code>    @Overridepublic View newView(Context context, Cursor c, ViewGroup parent) {    settings = ctx.getSharedPreferences(""myprefs"", 0);    View v = inflater.inflate(R.layout.convoview_list_item, parent,false);    ctx2 = context;    parentGroup = parent;           return v;}@Overridepublic void bindView(View v, Context context, Cursor c){    //Adding text etc to my views from the cursor here.    }</code></pre>","487693","","487693","","2010-10-26 14:39:30","2012-08-16 17:19:20","Force custom cursoradapter to not recycle views","<android>","2","1","","",""
"4024462","1","4024626","","2010-10-26 14:03:50","0","2328","<p>I have to place selected particular set of string from String Array into another array, here I need to combine both <code>equalsIgnorecase</code> with String <code>startsWith</code> method.</p><p>If I have comparator:</p><pre><code>String a= ""j"";if(a.startswith(""j""))</code></pre><p>it returns true only ""j"", but here i need  ""J"" and ""j"" has case sensitive, how can I get this.</p><p>Thanks in advance.</p>","393953","","390989","","2010-10-26 14:12:40","2010-10-26 14:19:40","How to make Use of String startswith and equalsIgnoreCase for string array object","<android>","2","2","","",""
"4024505","1","4024582","","2010-10-26 14:08:33","7","3816","<p>I need it specifically for image distortion (filters, blurring, etc also welcomed ;) ). Do you know some libraries with appropriate license (Apache, MIT, LGPL also), that I can use? Propriety libraries with reasonable prices - open to them also. Can be in C also.</p><p>thanks in advance,danail</p>","232798","","","","","2010-10-26 14:15:35","Image processing on Android - what libraries can I use?","<android><image-processing><image-manipulation>","1","0","2","",""
"4024556","1","4359092","","2010-10-26 14:12:44","1","618","<p>I want to create an app which would monitor changes to data in a folder on SD card. For example if a file is put in a folder, as soon as file is copied, my app would send this file to server and delete this file.Is it possible to do this?</p><p>Thanks.</p>","337214","","","","","2012-03-16 04:17:00","Android : Monitoring folder activity","<android><folder>","2","0","","",""
"4024620","1","4024715","","2010-10-26 14:19:09","0","1400","<p>Imagine I have the following code that runs as a background processor for an android application:</p><pre><code>public class Background extends Service {    public void popup (String message, int duration)    {        Toast.makeText(this, message, duration).show();    }    class BackgroundChecker extends TimerTask     {        public void run()        {            popup(""Message!"", Toast.LENGTH_LONG); // here        }    }}</code></pre><p>When it reaches the popup message i.e. // here, Android tells me to force quit. I know that the problem is with context i.e. <code>this</code>, but I don't know why because I have extended Service in that class which Android API told me to. Can you help me figure out why this is happening and how to fix it? By the way, instead of <code>this</code> I used <code>getApplicationContext()</code> as well but it still crashes =(.</p><p>Thank you.</p>","484881","","","","","2010-10-26 14:59:37","Why doesn't the 'toast' message work, in Android? Cannot fix bug, please help!","<java><android><class><crash><toast>","1","0","","",""
"4024683","1","","","2010-10-26 14:25:44","3","742","<p>Does anyone have any suggestions for doing this?  At the moment, a new row gets added to the database and I call requery().  I'd like any new rows to animate when they show up for the first time.  Many row additions will happen in the middle of the list, and not at the top or bottom.  I'd like these to animate somehow so the user can see them immediately.</p><p>I was thinking of perhaps having a hashmap (or some data structure) in my Adapter that holds the id of a particular row and a boolean stating whether or not it has been viewed.  In bindView, the boolean for the id of that row is checked and, if true, animates some flashing of some sort, and then updates the data structure.  Does this sound plausible?</p><p>Also, when the Cursor is requeried, I'd like to scroll the list to where the new row is.  Unfortunately, I don't think I can know its position without brute forcing through the list until I find it.  Any suggestions?</p>","406790","","","","","2011-10-11 04:20:55","Animate new rows in ListView with a CursorAdapter","<android><listview><animation><cursor>","1","0","","",""
"4024726","1","","","2010-10-26 14:30:03","0","3741","<p>To put it simply. From a context menu on a TabActivity how can I initiate executing the intent for the current tab? I am trying to force a refresh.</p><p>The tabs all initiate activities displaying a subset of people names.  While in one list you call up an edit activity which allows you to associate the name to one of the other lists in the TabHost.  Using the back button to get back to the tabhost (onResume fires) and the list has not updated.  I would like to have a context menu item to refresh the current tab.</p><p>I know about using one activity for all the views in a tabhost but for many reasons I have not chosen that method.</p>","465199","","","","","2011-10-21 22:33:52","Force Tabhost to initiate Activity (refresh)","<android><android-tabhost>","2","0","2","",""
"4024822","1","4199775","","2010-10-26 14:40:42","4","659","<p>I want do an app,i want it look the same as this one:</p><p><img src=""http://i.stack.imgur.com/pUF7P.jpg"" alt=""alt text""></p><p>I don't know how to write the word ""writing"" as the red mark ,and how to add the app icon onthe screen.</p>","233618","","40347","","2010-10-26 14:55:21","2010-11-16 22:38:39","how to write word for app on screen","<android><android-widget>","2","6","4","",""
"4024895","1","4025123","","2010-10-26 14:48:52","1","3226","<p>I am trying to create a simple button example, but when I add this code:</p><p>mButton = (Button) findViewById(R.id.button1);</p><p>it wont update my R.id file. I've tried everything including making sure automatic build is on, cleaning the project, and updating the SDK. This happens in both 1.6 and 2.2 projects.</p><p>Here's what full code is looking like:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;public class NewTest extends Activity { Button myButton;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        myButton = (Button) findViewById(R.id.button1);    }}</code></pre>","487733","","","","","2014-01-25 21:26:14","r.id not regenerated","<android><button>","6","1","","",""
"4024935","1","4028901","","2010-10-26 14:54:08","0","227","<p>first:</p><pre><code>10-26 17:43:07.454: WARN/dalvikvm(6371): threadid=3: unable to interrupt threadid=1910-26 17:43:07.487: DEBUG/dalvikvm(6371): GC freed 279 objects / 259776 bytes in 208ms10-26 17:43:07.487: WARN/WindowManager(2215): Attempted to add application window with unknown token HistoryRecord{46366130 spexco.hus.cepvizyon/.ViewCam}.  Aborting.</code></pre><p>I cant see  other errors now, But in second, I want to learn how to stop Handler.?My handler code is: I call with ""handler.sendMessage(new Message());""</p><pre><code>private Handler handler = new Handler() {    public void handleMessage(Message msg) {        try {            bmp = CameraManagerScreen.ActiveCam.getCurrentImage();            bmpl = CameraManagerScreen.ActiveCam.getCurrentLenght();            if (bmpl != bmpltmp) {                if (speed.getVisibility() == 4) {                    speed.setVisibility(0);                    counter++;                } else {                    speed.setVisibility(4);                    counter++;                }            }            bmpltmp = bmpl;            if (bmp != null) {                if (CameraManagerScreen.ActiveCam.isConnected())                    m_ProgressDialog.dismiss();                imageView.setImageBitmap(bmp);            }            if (isDemo &amp;&amp; counter == 10) {                counter++;                CameraManagerScreen.ActiveCam.cancel();                CameraManagerScreen.ActiveCam.setConnected(false);                m2_ProgressDialog.show();            }        } catch (Exception e) {        } finally {            if (isDemo &amp;&amp; counter == 10)                sleep(999999999);            sleep(50);        }    };    public void sleep(long delay) {        this.removeMessages(0);        sendMessageDelayed(obtainMessage(0), delay);    };};</code></pre>","483988","","","","","2010-10-26 23:42:44","I have some questions about my debug time errors","<android><thread-safety><handler>","1","0","","",""
"4025038","1","","","2010-10-26 15:07:38","1","1261","<p>I'm developing an android app that creates a calendar on the phone the first time the application is installed. When I create an event, either programmatically or using the device itself, the event will show up in the calendar but its title is missing. I'm testing my code on HTC nexus one. </p><p>Since I'm getting the same behavior when creating the event through my code or through the device, I'm suspecting there is a problem in the code I wrote to create a new calendar account. I am doing so by adding a new field in the <strong>calendars</strong> table of the <strong>calendar.db</strong> database, whose URI is: ""content://com.android.calendar/calendars""</p><pre><code> private Uri addNewCalendar() {   if (!calendarExists()) {       ContentResolver contentResolver = mContext.getContentResolver();       ContentValues cv = new ContentValues();       cv.put(Calendar.Calendars._SYNC_ACCOUNT, mAccount.name);       cv.put(Calendar.Calendars._SYNC_ACCOUNT_TYPE, mAccount.type);       cv.put(Calendar.Calendars._SYNC_TIME, new Date().getTime());       cv.put(Calendar.Calendars.URL, ""http://www.example.com"");       cv.put(Calendar.Calendars.NAME, mAccount.name);       cv.put(Calendar.Calendars.DISPLAY_NAME, mAccount.name);       cv.put(Calendar.Calendars.HIDDEN, 0);       cv.put(Calendar.Calendars.COLOR, 14417920);       cv.put(Calendar.Calendars.ACCESS_LEVEL, 700);       cv.put(Calendar.Calendars.SELECTED, 1);       cv.put(Calendar.Calendars.SYNC_EVENTS, 1);       cv.put(Calendar.Calendars.TIMEZONE, ""GMT"");       cv.put(Calendar.Calendars.OWNER_ACCOUNT, mAccount.name);       Uri uri = contentResolver.insert(Calendar.Calendars.CONTENT_URI.buildUpon().build(), cv);       return uri;      }      return null;    }</code></pre><p>Also, when checking whether the title field of the event is actually written in the database, I found it is saved correctly. I can see the event title when I try to edit the event on the phone.</p><p>Anyone has an idea why I'm having this problem? If you need more information, please let me know.</p>","487750","","","","","2010-10-26 15:07:38","After adding an event to a user-created calendar in android,the event title doesn't show up","<java><android><events><sdk><calendar>","0","2","1","",""
"4025082","1","4026240","","2010-10-26 15:12:19","5","9169","<p>I have a service that monitors a socket connection.  When the connection is lost it needs to display a Toast informing the user that it is reconnecting.  This works fine the first time.  After that I see the enqueueToast in the log but the toast is not displayed.  Any ideas are appreciated.  I thought this was going to be an easy thing to add, but I must be missing something.</p><p>Log entry</p><blockquote>  <p>INFO/NotificationService(118): enqueueToast pkg=com.abc  callback=android.app.ITransientNotification$Stub$Proxy@43f7b100  duration=1</p></blockquote><p>Code that calls the Toast</p><pre><code>public class ConnectionService extends Service { .....public void restartConnection(){  try  {     Log.i(this.toString(), ""Attempting to reconnect..."");     // increase the wait between each retry until the max is reached     int sleepTime = reconnectCounter * MIN_RECON_WAIT;     if (sleepTime &gt; MAX_RECON_WAIT)     {        sleepTime = MAX_RECON_WAIT;     }     String msg = ""The connection has been lost.  Restart attempt will start in: "" + sleepTime/1000 + "" seconds"";     Log.i(this.toString(), msg);     Toast.makeText(getApplicationContext(), msg , Toast.LENGTH_LONG).show();     Thread.sleep(sleepTime);     // increment the counter     reconnectCounter++;     this.startConnectionThread();  }  catch (Exception e)  {      Log.e(this.toString(), ""Exception: "" + e.toString());      e.printStackTrace();  }}// end retartConnection</code></pre>","418714","","95313","","2013-04-06 06:24:11","2013-04-06 06:24:11","Android Toast started from Service only displays once","<android>","2","2","2","",""
"4025104","1","4025160","","2010-10-26 15:15:27","4","5665","<p>Is there an easy way to share a link from an android program to facebook, and twitter? How to?</p>","472537","","","","","2010-10-26 15:20:16","Android facebook/twitter share button","<android><facebook><twitter>","1","0","1","",""
"4025258","1","","","2010-10-26 15:31:14","0","68","<p>HI All,</p><p>i have multiple activities in my activityGroup under tabactvity.</p><ol><li><p>I want to start the child actvity for result.</p><p>Intent i = new Intent(this, addstocks.class);  </p><p>View view = stocksgroup.group.getLocalActivityManager()<br>.startActivity(""show_city"", i<br>.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))<br>.getDecorView();  </p><p>// Again, replace the view<br>stocksgroup.group.replaceView(view); </p></li></ol><p>this code basically taking me to the next activity. here i want to implement the actvity for result. hw can i do that?</p>","383597","","","","","2011-06-15 10:19:48","Android Actvity Group","<android>","1","0","","",""
"4025311","1","","","2010-10-26 15:37:43","1","2601","<p>This must be something I’m just overlooking or possibly my ADT install is out of date.</p><p>When I attempt to add a new drawable resource to my project I don’t see a type of Drawable in the “New Android XML file dialog.”</p><p>Here’s what I see when adding a resource:</p><p><a href=""http://img221.imageshack.us/img221/2977/drawable.jpg"" rel=""nofollow"">http://img221.imageshack.us/img221/2977/drawable.jpg</a></p><p>What am I missing here?</p>","487791","","487791","","2010-10-26 19:48:04","2010-12-31 18:27:25","Adding a drawable resource","<android><resources><eclipse-plugin><adt>","1","2","","",""
"4025331","1","4055270","","2010-10-26 15:40:04","0","1776","<p>Ok, I'm not great at explaining this as I'm new to Android so work with me.I have tried everything I can find and I dont know how to make everything work together.I have a Spinner to select an age group, a Radio group with Radio buttons to allow you to select Gender (male or female), I have an EditText that I will allow for numerical input and a Textview out to the side that is currently blank.</p><p>Depending on which age group is selected from the spinner and which one of the Radio buttons are selected - setText of the TextView to a certain number based on what number is entered in the EditText box.</p><p>Ive tried using OnItemSelectedListener for the spinner but havent been able to find how it knows what is selected from the array.I tried getItemSelected with an if statement with the item from the array</p><p>for the radio buttonIve tried using an if statement - if (radiobutton.isChecked()) but I didnt know if I needed an ifCheckedRadio before this and how to make it work after the spinner</p><p>and if all of this worked I hadif (EditText.getText().equals(""#""))TextView.setText(""#"");</p><p>This will be copied for each possible # entered</p><p>now would the text change like this without a button and OnClickListener or is there a way to do this without a button becuase there will more than one EditText that will be added at the end using a button but I wanted this displayed immediately after it is entered</p><p>Sorry if this isnt clear, please let me know if you need more information. If I've overlooked a previous question that uses spinners and radiobuttons please let me know and I'll keep looking but I've been stuck on this.</p>","478121","","","","","2011-04-09 12:17:46","Help! I need a Spinner, Radio Group with Radio buttons, EditText, and setText","<android><radio-button><spinner>","4","0","","",""
"4025369","1","4025422","","2010-10-26 15:44:41","55","61971","<p>My keystore is corrupt, therefore the Android Market is requiring me to rename the app and resubmit it. However, whenever I go to edit the package names in Manifest and throughout the files, it gives me tons of errors.</p><p>What's the proper way to change the application name?</p><p>Thanks!</p>","312390","","","","","2014-02-26 04:58:56","How to change package name of an Android Application","<java><android>","13","1","25","",""
"4025590","1","4028610","","2010-10-26 16:10:10","3","4855","<p>In light of the <a href=""http://codebutler.com/firesheep"" rel=""nofollow"">Firesheep</a> exploit, does anyone know what protocol the Facebook for Android app is using?</p>","76365","","","","","2013-08-03 01:00:29","Does facebook for android use https?","<android><security><facebook>","2","4","","",""
"4025605","1","5590243","","2010-10-26 16:11:26","20","20947","<p>I'm developing an Android application.</p><p>How can I center the title for a custom dialog that I'm using?</p><p>Thanks.</p>","68571","","","","","2012-11-13 11:00:39","Custom dialog on Android: How can I center its title?","<android><modal-dialog>","5","0","8","",""
"4025625","1","4058239","","2010-10-26 16:14:34","3","292","<p>It appears as though everyone using my application on an LG Ally is having to redownload the application every time they turn off their phone.</p><p>I've received the folling market comments relating to the issue:</p><pre><code>""Is great when it works. But if i shut my phone off i have to reinstall it. Lg ally.""""Great quick ref. I do have to redownload it every time my cell updates. Lg Ally""</code></pre><p>And the following report in an email:</p><pre><code>""The one problem that I have with it is should I turn my pohone off or the battery dies completly I have to redownload and install again. I was wondering if there was a way to fix this. I am using an LG Ally with the latest android sofware what ever that may be. Thank you for the app and your time.""</code></pre><p>Based on a quick google, the LG Ally currently has Android 2.1.</p><p>My application requests the following permissions:</p><pre><code>android.permission.INTERNETandroid.permission.CALL_PHONE</code></pre><p>and is using copy protection.</p><p>What could be causing this issue?</p>","192549","","","","","2010-10-30 10:24:09","Android app being deleted from LG Allys when phone turns off","<android><google-play>","1","0","1","",""
"4025707","1","4026090","","2010-10-26 16:24:54","1","2275","<p>I was given an assignment to develop a very simple weather app in Android using the data given from </p><p><a href=""http://forecast.weather.gov/zipcity.php"" rel=""nofollow"">http://forecast.weather.gov/zipcity.php</a></p><p>This would be my first actual android app, my only other experience is watching/reading many tutorials on getting started.</p><p>To give some background information of the app, it simply needs to have one activity that is atext field for the user to enter a city, state combination, or just a zip code.  This then needs to be submitted to the website's (listed above) form.</p><p>After this has been submitted, my app needs to retrieve page sent in response and display it in a simple layout (possibly a listView of the days of the week).</p><p>My first question is, how would I go about submitting a text input to the above website's form?  Would I have to know the name of the form's field to submit to it precisely?  </p><p>In general, how should I start this process?</p><hr><p>Edited version:</p><p>Using this code: </p><pre><code>HttpClient httpClient = new DefaultHttpClient();HttpPost post = new HttpPost(""http://forecast.weather.gov/zipcity.php?inputstring=04419"");    HttpResponse httpResp;    try {        httpResp = httpClient.execute(post);        StatusLine status = httpResp.getStatusLine();        Toast.makeText(getApplicationContext(), status.getStatusCode(), Toast.LENGTH_SHORT).show();    } catch (ClientProtocolException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }</code></pre><p>I'm getting a:</p><p>10-26 15:29:56.686: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol</p><p>error in the debug view. Is this error related?  Is my use of toast reasonable for testing if this http interaction is successful?</p>","487840","","487840","","2010-10-26 19:45:59","2010-10-26 19:45:59","Submitting an HTML form in Android without WebView","<html><android><http><forms><post>","3","0","1","",""
"4025770","1","4026303","","2010-10-26 16:32:02","10","8132","<p>Is there any way I can launch an activity from a portion of a string.  </p><p>egI have this in my strings.xml file:</p><pre><code>&lt;string name=""clickable_string""&gt;This is a &lt;u&gt;clickable string&lt;/u&gt;&lt;/string&gt;</code></pre><p>I would like the text between the <code>u</code> tags to be underlined and launch an activity when clicked when inserted in to a <code>TextView</code></p>","264276","","","","","2012-03-28 22:38:33","Android: Launch activity from clickable text","<android><text><hyperlink><launch>","2","0","11","",""
"4025978","1","","","2010-10-26 16:56:35","1","206","<p><img src=""http://i.stack.imgur.com/FEQC9.png"" alt=""alt text""></p><p>In hierarchy viewer there are several IDs as shown above, for example ""id/timepicker_input"".But I can't find a respective timepicker_input - ID when typing</p><pre><code>myNumberPicker.findViewById(android.R.id. ...? );</code></pre><p>So how to access these Views by their ID?</p>","474326","","474326","","2010-10-26 17:00:06","2010-10-26 20:07:35","How to access a View by an ID of the android namespace","<android><namespaces><views><hierarchy>","1","0","","",""
"4026002","1","","","2010-10-26 16:59:38","10","9456","<p>I am writing an android app for storing and managing voice memos with some basic metadata and tagging. When recording sound I use: </p><pre><code>recorder = new MediaRecorder();         recorder.setAudioSource(MediaRecorder.AudioSource.MIC);recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);recorder.setOutputFile(currentRecordingFileName);// and so on</code></pre><p>This works well when using the phone in a normal fashion. However, it does not detect the presence of a bluetooth headset and still uses the phone's own microphone even when the headset is plugged in.</p><p>I also tried using MediaRecorder.AudioSource.DEFAULT, hoping it would automatically choose the correct source, but then no sound was recorded at all.</p><p>How can I a) detect if a bluetooth headset is plugged in and/or b) use a bluetooth headset as audio source for the media recorder?</p>","472779","","","","","2014-02-20 10:20:29","How to record sound using bluetooth headset","<android>","3","0","9","",""
"4026068","1","4026181","","2010-10-26 17:08:20","0","312","<p>Just something I have been thinking about. It is possible to create an android layout with just a TextView widget and no Layout code (e.g: inearLayout, ScrollLayout), but if I try to add anything else to the XML file all sorts of errors start popping up. Is it possible to create a Layout with just widgets?</p><p>Also, if it is, how?</p>","348261","","16434","","2010-10-26 17:35:54","2010-10-26 17:35:54","Is it possible to make an Android Layout, without just widgets?","<android><xml><layout><widget>","2","2","","",""
"4026088","1","4026210","","2010-10-26 17:10:10","3","1339","<p>I made a library that I use across my app. I want it to access some settings that are stored in the shared preferences.</p><p>This is a shortened version of my library:</p><pre><code>package com.android.foobar;import android.content.SharedPreferences;import android.preference.PreferenceManager;public class Lib {    int now;    public Lib() {        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);        now = settings.getInt(""now"", 435);    }    public int foo(){        return now;    }}</code></pre><p>I've been looking for an answer and experimenting, but I can't find a valid context to pass to getDefaultSharedPreferences(). Any ideas?</p>","487897","","","","","2010-10-26 17:36:40","Android: using SharedPreferences in a library","<java><android><class><sharedpreferences>","1","0","1","",""
"4026215","1","","","2010-10-26 17:26:29","3","4154","<p>Lets say I have an xml file called test1.xml in String xmlFile = ""test1.xml"" format.  How can I get the R.id.test1 value of it?</p>","375566","","","","","2011-01-25 14:33:04","Android SDK - get R.id (int) of a string value","<android>","1","0","","",""
"4026227","1","4027496","","2010-10-26 17:27:55","0","1488","<p>I have quite a common problem, I guess. </p><p>I have an <code>Activity</code> and inside it I need three screens. The problem is, they can/should be scrolled in both ways (horizontally and vertically). Since embedding a <code>HorizontalScrollView</code> with a normal ScrollView is usually discouraged and typically causes more problems than it solves, are there any other ways to implement this without having to write your own <code>SurfaceView</code> class and handle the scrolling by hand? </p><p>What I've tried so far is: Have <code>HorizontalScrollView</code> and <code>ScrollView</code> embeded in each other. It didn't worked well. While horizontal scrolling was working almost perfectly (almost because I could still see a part of the second screen before even starting to scroll), vertical didn't work at all (as expected) and was partly covering the screen. </p><p>I can't split it into three different activities, as the code requires to change/update views in all 3 pages.</p><pre><code>&lt;com.tseng.widget.TalentLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/TalentLayout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""&gt;    ... many dozen of other views here ...&lt;/com.tseng.widget.TaletLayout&gt;</code></pre><p>That's basically the layout of every single of the three horizontal pages. </p><p>What's the best way to implement this? If there is no other solution than writing my own scrolling features, is there any good tutorial or code I could look at?</p>","455493","","840520","","2012-07-17 07:13:41","2012-07-17 07:13:41","Scrolling vertically and horizontally","<android><scrolling>","1","1","","",""
"4026251","1","","","2010-10-26 17:31:29","0","539","<p>I have a website embedded in my Android application. It has a 478px wide div with some content in it. My phone is in landscape mode. Why is there a horizontal scrollbar? I can hide it, but i can still scroll to the right (which is empty space). I can see the entire 478px wide div without scrolling. </p><p>There should not be any way to scroll. I see a min_width attribute for WebView but no max_width. Any ideas?</p>","","user286355","","","","2010-10-26 17:31:29","Android Webkit WebView extends Viewport","<java><android><webview>","0","2","","",""
"4026279","1","4053006","","2010-10-26 17:34:55","0","153","<p>How can i use tabs to switch between activities? For example i have some tabs, one of them includes google map and i want each tab to have its own activity with its own .xml file. How can i do it?</p>","485572","","","","","2010-10-29 14:55:00","Using tabs and MapActivitys (Android)","<java><android><google-maps>","3","0","","",""
"4026327","1","","","2010-10-26 17:39:17","0","453","<p>After I successfully <a href=""http://stackoverflow.com/questions/3086057/how-to-setup-an-alarm-that-would-go-off-even-if-i-restart-my-android-phone"">configured alarms to go of after I start or restart my phone</a> (thanks for that answer Macarese), I must have made something wrong, because stored alarms are not fired after 2 or even 3 hours after the phone has been turned on.</p><p>I tested alarms that supposed to be sending notifications every 5 minutes...  Nothing happens!</p><p>I've been following up with the logcat and I've noticed that even the providers, for databases are being published late (like really, really late).</p><p>The following is what I have in terms of my application <strong>Manifest</strong>:</p><pre><code>  &lt;service android:name=""Service_A"" android:enabled=""true""&gt;      &lt;intent-filter&gt;          &lt;action android:name=""com.magoco.main.Service_A""&gt;&lt;/action&gt;      &lt;/intent-filter&gt;  &lt;/service&gt;    &lt;receiver android:name=""AlarmReceiver"" android:enabled=""true""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.BOOT_COMPLETED""&gt;&lt;/action&gt;            &lt;category android:name=""android.intent.category.HOME""&gt;&lt;/category&gt;            &lt;action android:name=""android.intent.action.PACKAGE_REPLACED""&gt;&lt;/action&gt;            &lt;action android:name=""android.intent.action.PACKAGE_RESTARTED""&gt;&lt;/action&gt;            &lt;data android:scheme=""package"" android:path=""com.magoco.main""&gt;&lt;/data&gt;        &lt;/intent-filter&gt;</code></pre><h2>        </h2><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-permission android:name=""android.permission.VIBRATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_BOOT_COMPLETED""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt;</code></pre><p>The receiver suppose to start after boot is complete and the receiver call the service.</p><p>Here is the <strong>AlarmReceiver</strong> Code:</p><pre><code>public class AlarmReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    try {        Intent serviceIntent = new Intent();        serviceIntent.setAction(""com.magoco.main.Service_A"");        context.startService(serviceIntent);    } 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>And finally here is the code for the <strong>Service_A</strong>, btw, most of this code has been stripped because is confidential:</p><pre><code>public class Service_A extends Service {public Service_A() {    // TODO Auto-generated constructor stub}@Overridepublic void onCreate() {    super.onCreate();    this.searchForRNotifications();    this.searchForAlarmsNotifications();}@Overridepublic void onDestroy() {    super.onDestroy();}private void showNotification() {}private void serviceShowNotification(String _msg, int _notificationId) {}private void serviceShowAlarmsNotification(String _msg,}public void searchForRNotifications() {}private void incrementCounter() {}private void shutdownCounter() {}@Overridepublic IBinder onBind(Intent arg0) {    // TODO Auto-generated method stub    return null;}</code></pre><p>Any help in this regard, would be very much appreciated.</p><p>Thanks in advance, </p><p>monnet</p>","372475","","372475","","2010-10-26 20:13:41","2010-10-26 20:13:41","Why isn't my application service launching inmediately after the phone is turned on?","<android><service><providers><alarms>","0","3","1","",""
"4026347","1","4026398","","2010-10-26 17:41:30","1","4857","<p>I have</p><pre><code>ArrayList&lt;String&gt; ids = ArrayList&lt;String&gt;();</code></pre><p>What would be the cleanest way to make it Parceleable? Apparently String itself is not parcelable, so <code>Parcel.writeList(ids)</code> is not working.</p><p>I was thinking to either parcelize <code>ArrayList&lt;Uri&gt;</code>  or put array contents into a <code>Bundle</code>.</p>","450741","","","","","2010-10-26 17:51:13","android parcelable string array","<android><string><arraylist><bundle><parcel>","2","0","","",""
"4026373","1","16037697","","2010-10-26 17:45:25","0","511","<p>I have <code>class Maingamepannel</code>  extending <code>surfaceview</code> for my games first level everything works fine. Now i Want to redraw my <code>surfaceview</code> for my next level so that I can reinitialize mybitmap objects at their initial position and start the game again with bit diffrent conditionswhich i have handeled in switch case.</p><p>To achieve this after finishing my annimations in first loop I have called my activity showing view again like this--- </p><pre><code>Intent backIntent = new Intent(getContext(),mygame.pkg.StartGame.class);    sg.level++;     backIntent.putExtra(""levelkey"",""""+sg.level);getContext().startActivity(backIntent);</code></pre><p>By doing this I am able to redraw my bitmaps at initial position and starting annimations again, But the problem is this is drawing a another surface while my requirement is to use the same surfaceor delete the first surface and then drawing a another one.</p>","472336","","331473","","2011-11-23 05:59:31","2013-04-16 12:57:22","To redraw the surfaceview to move to the next level","<android>","1","3","1","",""
"4026426","1","4026472","","2010-10-26 17:50:51","1","5259","<p>How to setup the attribute to achieve the rounded corner for each item in the <code>ListView</code>?Please kindly give an example if you can, thanks!</p><p>for example:<a href=""http://www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/"" rel=""nofollow"">http://www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/</a></p><p>EDIT:That's my code here for the answer.</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;gradient    android:startColor=""#ffff""    android:endColor=""#fddd""    android:angle=""270"" /&gt;&lt;corners    android:radius=""13dp"" /&gt;&lt;stroke    android:width=""1dp""    android:color=""#feee"" /&gt;&lt;/shape&gt;</code></pre>","428022","","1198729","","2012-07-15 14:48:55","2012-07-15 14:48:55","Rounded corner of list item on Android?","<android><listview><rounded-corners>","1","0","2","",""
"4026462","1","","","2010-10-26 17:54:02","4","4989","<p>I have an activity. It does not have a title bar. The content view is just a linear layout. It looks like android draws a drop shadow at the top of my content view, directly below the status bar. Is there a way to stop that from being drawn?</p><p>My layout is just:</p><pre><code>&lt;LinearLayout ... /&gt;</code></pre><p>I have no titlebar:</p><pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE);</code></pre><p>Thanks.</p>","291701","","22904","","2012-07-05 14:55:12","2012-07-05 14:55:12","Remove default drop shadow at top of activity layout?","<android>","2","1","4","",""
"4026484","1","4027002","","2010-10-26 17:56:52","2","3928","<p>When I run the app in Eclipse, Android emulator starts but says ""Bluetooth is not available"". Need urgent help with this.</p><p>Also need help with running/installing an app on real phone. I connected my HTC Desire (Android 2.2), enabled USB debugging and run the app from Eclipse. Emulator starts as usual instead of the app running on my phone. </p><p>Appreciate your time and help.</p><p>Cheers,Madhu</p>","487851","","390989","","2010-10-26 18:03:51","2011-11-14 08:06:22","Cannot run (in Eclipse) Bluetooth Chat sample app from Android website","<android><bluetooth><chat>","2","1","1","",""
"4026563","1","4027085","","2010-10-26 18:05:47","1","2077","<p>Can anyone kindly guide me as to how to implement a dynamic auto complete widget in android. My requirement is, as I type a letter, a thread will work and will return an array with 5 suggestions maximum. I need to display these 5 suggestions in an auto complete list view.</p><p>Experts please guide as to how to implement the same.</p><p>Looking forward,Regards,Rony</p>","264953","","","","","2011-05-05 13:18:17","Dynamic autocomplete widget in android","<android>","1","0","3","",""
"4026625","1","","","2010-10-26 18:12:42","1","3075","<p>Hi Guys:I am new to android. I am developing an application in android 2.2 to identify location of user by means of any available resources (GPS , Networks etc). I have done finding location through GPS and using SIM network along with internet. Now problem is want to locate device when no GPS and no internet is available. In this case I have to implement Triangulation.I know theory of concept of <strong>triangulation</strong> but to implement is realy a biggggggg deal to me.Will any body kindly guide me to sort out the problem? I have searched the web but could not find any solution.</p>","569375","","","","","2013-06-13 23:18:13","Implementing Triangulation in android","<java><android><networking><geolocation><triangulation>","3","7","2","",""
"4026631","1","6225311","","2010-10-26 18:13:13","1","1453","<p>I'm trying to provide a modified view for a custom Android keyboard in fullscreen mode. Therefor I'm trying to replace the extract view. In the documentation I found the following method: <a href=""http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html#setExtractView%28android.view.View%29"" rel=""nofollow"">setExtractView(View view)</a> - so I assume it's a public API call.</p><p>However, as you can see from the Android OS source code (snipped pasted below) it lets me only access a view that has view items with id's within the com.android.internal.* space. Otherwise I will, of course, get a NullPointerException.</p><pre><code>public void setExtractView(View view) {    mExtractFrame.removeAllViews();    mExtractFrame.addView(view, new FrameLayout.LayoutParams(            ViewGroup.LayoutParams.MATCH_PARENT,            ViewGroup.LayoutParams.MATCH_PARENT));    mExtractView = view;    if (view != null) {        mExtractEditText = (ExtractEditText)view.findViewById(                com.android.internal.R.id.inputExtractEditText);        mExtractEditText.setIME(this);        mExtractAction = (Button)view.findViewById(                com.android.internal.R.id.inputExtractAction);        if (mExtractAction != null) {            mExtractAccessories = (ViewGroup)view.findViewById(                    com.android.internal.R.id.inputExtractAccessories);        }        startExtractingText(false);    } else {        mExtractEditText = null;        mExtractAccessories = null;        mExtractAction = null;    }}</code></pre><p>So, I'm wondering, is it a bug, that this method is within the public API or if not, how can I create a custom view with IDs in the com.android.internal.* space?</p><hr><p><strong>Update</strong>: Nevermind, just found <a href=""http://developer.android.com/reference/android/R.id.html#inputExtractEditText"" rel=""nofollow"">this</a>. Will check later and report back if it worked.</p>","184367","","497356","","2011-09-11 03:34:51","2011-09-11 03:34:51","Android: InputMethodService how to set a view with setExtractView(View view)?","<android><view><input><keyboard>","1","2","1","",""
"4026632","1","4026743","","2010-10-26 18:13:14","1","538","<p>I am trying to develop a native application for iPhone or Android or Symbian on Windows.  I have looked online and came across <a href=""http://rhomobile.com/"" rel=""nofollow"">http://rhomobile.com/</a>, which let you develop native applications for almost all devices, but I am inexperienced in Ruby.  I can code in HTML, ASP.Net, Javascript, and PHP.</p><p>The only thing that made my search hard is that this application should be available via Apple AppStore(iPhone) or OviStore (Symbian) or Android Store (Android).  And I needed local database access, like SQLite, or MySQL.</p><p>I've searched a lot online, but couldn't find much.</p><p>If you are aware of any similar product, or any suggestion, please let me know.</p><p>Thank you very much for you help!</p>","487940","","","","","2010-10-27 06:33:27","Native Mobile Applications with HTML","<iphone><html><android><symbian><native>","5","0","","",""
"4026712","1","4026789","","2010-10-26 18:23:06","1","587","<p>There what I am trying to do :</p><p>I am calling a WebService that send me back an image.I get it from the <code>entity.getContent()</code> method.</p><p>Further in my code I try to use de <code>BitmapFactory.decodeByteArray(myImage, 0, myImage.lenght)</code> but the Bitmap that it returns me is always <code>null</code></p><p>Does someone have an idea ?</p>","290613","","","","","2010-10-26 18:31:26","DecodeByteArray with WebService image always null","<android><bitmap><android-image>","1","0","","",""
"4026825","1","","","2010-10-26 18:34:29","0","2045","<p>I am looking for an RTP lirbary for Android. So far I could not find any. Is there any such library?</p><p>Alternatively, I think I can use any RTP library for JSE for which I can get the source code. I can compile the code in Android. I will be writing a proprietary application so the license has to permit that. Can anyone suggest a library meeting my criteria?</p><p>Thanks.</p>","154680","","","","","2012-09-11 08:44:51","RTP library for Android","<java><android><rtp>","2","0","","",""
"4026933","1","","","2010-10-26 18:46:38","2","895","<p>I have an imageswitcher as the only component on the screen. I want to capture the swipe gesture and click event separately for it. But it is not able to get the events separately. If I set the onclicklistener method for imageswitcher object then it always fires onclick method even if I have swiped.</p><p>Can someone let me know the workaround to this?</p>","445541","","","","","2012-07-09 12:52:14","Get click event and swipe gesture in imageswitcher in android?","<android><events><click>","1","1","2","",""
"4026934","1","","","2010-10-26 18:46:49","0","1784","<p>I have implemented location identification using GPS in android in my application but now if GPS is not available or disabed then how to identify location when internet is enabled in device. Whether using google API or triangulation or some thing else. Thank You.</p>","569375","","","","","2010-10-26 18:53:09","Finding your location when using Internet in android","<android><mobile><internet><location><triangulation>","2","1","","",""
"4027020","1","4027070","","2010-10-26 18:57:17","0","1720","<p>Let's say I want to perform a quick HTTP post to a website within my android app.</p><p>If I were to set up the http client and send the post all in the onCreate method of the main screen (inside the UI thread) just for testing purposes, what would I use to quickly see what the response is to the post?</p><p>I tried something quick and dirty below inside the onCreate method when the app first opens and nothing really happens, is there something more I need to do/obviously my toast idea is just bad...</p><pre><code>  HttpClient httpClient = new DefaultHttpClient();  HttpPost post = new HttpPost(""http://forecast.weather.gov/zipcity.php?inputstring=04419"");  HttpResponse httpResp;  try {   httpResp = httpClient.execute(post);   StatusLine status = httpResp.getStatusLine();      Toast.makeText(getApplicationContext(), (CharSequence) status, Toast.LENGTH_SHORT).show();  } catch (ClientProtocolException e) {   e.printStackTrace();  } catch (IOException e) {   e.printStackTrace();  }</code></pre>","487840","","203766","","2010-10-26 18:59:56","2010-10-26 19:03:35","How to quickly test an HTTP post response in an Android emulator","<android><http><post>","1","1","","",""
"4027345","1","","","2010-10-26 19:37:29","0","878","<p>When I touch a control outside of the PopupWindow, the popup dismissed, but the touched control does not get focus. </p><p><strong>Q:</strong> What can be done, to make sure the clicked control get focus?</p><p>I tried setOutsideTouchable with no luck, it looks like this method is for some thing else.</p>","62192","","","","","2011-01-11 22:16:22","The touched control does not gain focus, when I touch outside of the PopupWindow","<android><focus><popupwindow>","1","0","","",""
"4027367","1","","","2010-10-26 19:41:38","0","556","<p>I am trying to create a file ,if it doesnot exist and tried to write some data to it. The same program I did in java, it was running fine.But when I try to do the same thing in Android I am getting NullPointerException at the place where I am trying to write data to file. And also, I did not find any new file in the current directory .I will share the code here: <br></p><h1>xmlpoc.java       <br></h1><p><br></p><pre><code>   public class xmlPoc extends Activity { String s=""&lt;employee&gt;""+               ""&lt;details&gt;""+               ""&lt;pictag id=""+                ""\""@drawable/icon\""""  +               ""mystr""+                ""=""+              ""\""Picture 1\"""" +              ""myint"" +               "" ="" +              ""\""33\"""" +               ""/&gt;""+                "" &lt;name&gt;SandeepKumarSuman&lt;/name&gt;""+               ""&lt;designation&gt;J2ME Programmer&lt;/designation&gt;""+               ""&lt;city&gt;Gorakhpur&lt;/city&gt;""+                ""&lt;state&gt;UP&lt;/state&gt;""+             ""&lt;name&gt;mohan&lt;/name&gt;""+             ""&lt;designation&gt;J2ME GAMEProgrammer&lt;/designation&gt;""+              ""&lt;city&gt;HYD&lt;/city&gt;""+              ""&lt;state&gt;AP&lt;/state&gt;""+              ""&lt;name&gt;hari&lt;/name&gt;""+              ""&lt;designation&gt;Fresher&lt;/designation&gt;""+             ""&lt;city&gt;GNT&lt;/city&gt;""+              ""&lt;state&gt;AP&lt;/state&gt;""+               ""&lt;/details&gt;""+               ""&lt;/employee&gt;"";          File f;             FileOutputStream fop;@Override     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);       f=new File(""./myfile1.txt"");           try {                fop=new FileOutputStream(f);         } catch (FileNotFoundException e) {        // TODO Auto-generated catch block            e.printStackTrace();    }    if(!f.exists()){     try {            f.createNewFile();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }   System.out.println(""New file myfile.txt has been created to the current directory"");    }    try {        fop.write(s.getBytes());     fop.flush();     fop.close();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}</code></pre><p><br>Can anyone help me in sorting out this issue.<br>Thanks in Advance,}</p>","429501","","","","","2012-11-13 00:42:47","NullPointerException Occurs when trying to create a file and write data to it in Android","<android>","2","2","","",""
"4027388","1","","","2010-10-26 19:45:21","5","1114","<p>I'm totally new to android programming (just did some tutorials/read the dev guides etc.) and as every newbie I want to do a useless game :-).</p><p>Currently I'm struggling with the layout of different views. Similar to the example I've made a class which extends a <code>SurfaceView</code> and put that into a <code>FrameLayout</code>. Around this <code>SurfaceView</code> I want to have other View's like <code>Buttons</code> &amp; <code>TextViews</code>.Something like this:</p><pre><code>-----------------------------------------------| TextView | SurfaceView           | TextView ||          |                       |          |------------                       ------------|          |                       | TextView ||          |                       |          ||          |                       ------------|          |                       | TextView ||          |                       |          ||          |                       ------------|          |                       |          ||          |                       |          |-----------------------------------------------| Button                             Button   |-----------------------------------------------</code></pre><p>I've managed to do something like this with a <code>FrameLayout</code> and <code>RelativeLayouts</code> (sticking the <code>TextViews</code> at the edges of the screen) but I'd like to better control the size of the <code>SurfaceView</code> as it should be a multiple in width and height of the object(s) I'll be drawing in it. I've tried setting <code>layout_width</code> and <code>layout_height</code> to some dp values but when I start painting at 0,0 it's still at the very top-left corner (where the <code>TextView</code> is..).</p><p>So, what's the best practice to achieve a layout as above? Using what layout? Or should I better draw my text inside the <code>draw()</code> function of my <code>SurfaceView</code> instead?</p>","488049","","810368","","2012-10-03 14:59:09","2012-10-18 15:24:28","Combining SurfaceView with other Views such as TextView and Buttons","<android><android-layout><layout><opengl-es><surfaceview>","1","1","0","",""
"4027415","1","4027535","","2010-10-26 19:48:34","0","2248","<p>I am currently working on an android app that is causing me some trouble. My app is heavily dependent on images that are fitted correctly to the screen they are being displayed on. Unfortunately things like the FWVGA/WVGA resolution difference 854 vs 800 is causing me some real problems, and that's aside from the other sizes/densieites and resolutions.</p><p>I don't know if I'm just missing the point here but how do I go about having my app display correctly on both the resolutions without either ""squashing"" my images or cutting bits off of giving me black bars etc?</p><p>There doesn't seem an immediately present solution where I can just have it display a different image automatically from the drawable folder for the right screen.</p><p>I have tried using displaymetrics but unless i have my manifest claim that it supports all screen sizes, the android OS will in fact ""lie"" to my app about hte current resolution.</p><p>Someone please tell me there is an easy solution.</p>","353674","","","","","2010-10-26 20:46:56","android screen resolutions and sizes","<android><screen><resolution>","3","0","","",""
"4027463","1","","","2010-10-26 19:56:40","1","831","<p>If a user does a ""pinch zoom"" on the map, my overlays don't properly size until the end.  This has been noted in other posts, so i assume it is a known issue.</p><p>Problem is, my client finds it totally unacceptable, as I am tasked with making the android app look as good as the iphone version.  </p><p>Is there any way to correct this, even if it is a horrible hack?  For instance, can I subclass the mapview and handle drawing or override some other method?</p>","226507","","","","","2011-04-13 04:58:46","workaround for mapview overlays not pinch-zooming correctly","<android>","1","2","","",""
"4027553","1","4028540","","2010-10-26 20:08:00","0","4161","<p>I have to GestureDetectors in my program. One works beautifully, the other doesn't. As far as I can tell they're both implemented the same way.</p><p>Here's the code for implementing the one that isn't working:</p><pre><code>myExcuseGestureDetector = new GestureDetector(new excuseGestureDetector());excuseView.setOnTouchListener(new View.OnTouchListener() {    public boolean onTouch(View v, MotionEvent event) {       if(myExcuseGestureDetector.onTouchEvent(event)){         Log.d(""Excuse Gesture Return"",""true"");         return true;       }       Log.d(""Excuse Gesture Return"",""false"");       return false;    }});</code></pre><p>Then I have this block later which defines excuseGestureDetector</p><pre><code>private class excuseGestureDetector extends SimpleOnGestureListener{  @Override     public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {   Log.d(""MotionEvent"",""onFling"");         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(currExcuseNumber&lt;currExcuseSet.size()){               currExcuseNumber++;               loadNextExcuse(currExcuseNumber,1);                excuseView.setInAnimation(slideLeftExcuseIn);                  excuseView.setOutAnimation(slideLeftExcuseOut);                excuseView.showNext();                return true;              }             }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {              if(currExcuseNumber &gt; 1){               loadNextExcuse(currExcuseNumber,0);                excuseView.setInAnimation(slideRightExcuseIn);                  excuseView.setOutAnimation(slideRightExcuseOut);                excuseView.showPrevious();               return true;              }             }         } catch (Exception e) {             // nothing         }         return false;     }}</code></pre><p>For whatever reason, it doesn't register the fling at all. Regardless of whether the animation happens or not, the program should print out the Log.d(""MotionEvent"",""onFling"") that I'm trying to trace and it doesn't. All I know is that it does register that a touchevent of some sort has occured because it does trace out ""Excuse Gesture Return"" ""false"" from the first block I showed. Any thoughts on why it won't register the fling?</p>","469219","","","","","2012-12-05 23:21:43","Android: GestureDetector won't catch Gestures","<android><gestures>","2","0","","",""
"4027636","1","","","2010-10-26 20:19:12","0","399","<p>I have a file stored in /data/data/com.sai.myproj/files/a.txt .This is the file I created and wrote data, it was stored in data/data/com.sai.myproj/files/a.txt  which can be viewed using FileExplorer of DDMS. How to copy this file from there to res folder as I need to parse this file . <br><br>Can anyone help me in sorting out this issue. <br></p><p>Thanks in Advance,</p>","429501","","","","","2011-01-14 08:21:41","how to copy a file stored in /data/data/com.sai.myproj/files/a.txt to res folder in Android","<android>","2","0","","",""
"4027752","1","","","2010-10-26 20:33:46","0","965","<p>Hi I've a widget which i would like to delete programmatically if the user gives the command by clicking on some button or so.. But as per my knowledge the app programme and the widget programme will be running in different processes. So how is it possible to get the controll of another process remote view and delete the same clearing all the db contents related to the widget?</p>","488094","","","","","2011-04-26 19:02:11","programmatically delete a widget on home screen by click listener in android","<android><database><delete><android-widget><homescreen>","1","0","","",""
"4027796","1","4027955","","2010-10-26 20:40:18","0","3408","<p>I am trying to implement an app that will only listen for a certain header in the SMS.(Parse the sms message and look for some header)That's not hard to do.</p><p>The problem is once the app finds the header and knows this SMS is for me,I don't want other app(that has broadcast listener on SMS) to receive SMS.(for example, 'messages' to pop-up with sms message)</p><p>Is there a way to listen SMS before any other apps and decide to pass on to other appor don't pass to other apps?</p>","432056","","","","","2010-10-26 21:07:27","Android: SMS filter - Can you have priority listener for SMS messages?","<android><filter><sms><priority>","2","1","2","",""
"4027997","1","","","2010-10-26 21:01:04","3","1487","<p>I've just added a header to my ListView and I have to change a bunch of code because the header essentially becomes position 0 (Meaning the Cursor indices of my CursorAdapter do not line up with the indicies of the list.  They are off by 1 now).  Why?  This seems a bit silly to me.</p><p>The only reason I can come up with is that a developer may want to access the header.  Fine.  Provide something like getListView().getHeader().</p>","406790","","","","","2012-07-15 13:54:18","Is there a good reason for a ListView header taking up a position?","<android><listview><header><cursor>","2","3","","",""
"4027998","1","","","2010-10-26 21:01:32","-1","429","<p>i have written the code for geocoding..but unfortunately it does not work ie nothing is displayed on screen...i am attaching the code...can someone please tell me what is the fault in the code..thanks</p><pre><code>public class geocoder extends Activity { // private TextView output; private LocationManager mgr;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mgr = (LocationManager) getSystemService(LOCATION_SERVICE);        Geocoder geocoder = new Geocoder(this, Locale.US);        // output = (TextView) findViewById(R.id.output);        String staddress = ""Georgia Tech, Atlanta, GA"";       //  List&lt;Address&gt; loc = null;        try{         List&lt;Address&gt; loc = geocoder.getFromLocationName(staddress, 5);        }        catch(IOException e) {         Log.e(""IOException"", e.getMessage());         }        // output = (TextView) findViewById(R.id.output);    }}</code></pre>","488123","","390989","","2010-10-26 21:08:46","2010-10-26 21:18:02","android geocoder---nothing is displayed on screen whenn the i run the application","<android><eclipse>","1","0","","",""
"4028270","1","","","2010-10-26 21:42:01","5","1960","<p>I'm porting an app written in a graphics environment that allows drawing to happen outside the bounds of the clipping rectangle. Any way to do this in Android?</p>","267257","","","","","2013-11-21 10:38:10","Can I draw outside the bounds of an Android Canvas","<android><drawing><image-clipping>","3","1","1","",""
"4028364","1","4028673","","2010-10-26 21:55:52","3","1462","<p>The iPhone gives the app the ability to change the notification bar's color so you can have it match your app's design without having to hide it completely.</p><p>Is there a way to change the notification bar color in Android?</p><p>I'm looking to have it force black with white text to be less visually present while using the app, but still there.</p><p>I don't want to hide it.</p>","445348","","445348","","2010-10-26 23:03:41","2010-10-26 23:03:41","Is it possible to change the color of the notification bar?","<android><design><colors><notification-bar>","1","1","","",""
"4028384","1","4028412","","2010-10-26 21:58:33","1","1094","<p>I would like a cell phone app to be able to determine how many cell phones around it are running the same app.</p><p>I'm not sure what direction to start researching (API's,concepts) to understand how my phone would figure out what other phones are running the same app in a specific distance.  </p>","488162","","","","","2010-10-26 22:02:47","Can phone apps detect what phones around them are running the same app?","<iphone><android><windows-mobile>","2","0","1","",""
"4028549","1","","","2010-10-26 22:21:17","0","1296","<p>I have a database with coordinates in Degrees Minutes Seconds format, is there any way to change them to decimal coordinates using Android built in function or is there any simpler way to show such coordinates in a mapview ?</p>","487015","","","","","2010-10-26 22:36:23","Convert Degrees Minutes Seconds coordinates to decimal in Android","<android><gps><android-mapview>","1","0","","",""
"4028609","1","4028677","","2010-10-26 22:33:49","1","2131","<p>I am new at android development and java programming, but I have decided to program a drinking game app in android. This app basically simulates a deck a cards, a player clicks a button to draw a card then based on the card thats drawn the player plays a drinking game (ie takes 1 drink, takes 2 drinks...ect). </p><p>I have the main program in one java file, and the code that shuffles the card deck and puts the card sequence in an array in other java file. My problem is that whenever a class from the other java file (classicMode.java) is called from the main program (fubar.java), my android program crashes and gives the error : </p><p>""The application Drinking Game - FUBAR (process com.games.dg) has stopped unexpectedly. Please try again"".</p><p><strong>Heres the code for the main program:</strong></p><pre><code>package com.games.dg;import java.util.Arrays;import java.util.Collections;import android.app.Activity;import android.os.Bundle;import android.widget.Button;import android.widget.TextView;import android.view.View;import android.view.View.OnClickListener;import com.games.dg.classicMode;public class fubar extends Activity {    private Button classic;    private Button custom;    private Button help;    private Button back;    private Button showCard;    private TextView txtbox;    private int showCardClick = 0;    private classicMode newGame;    String[] cardDeck;    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        initControls();    }    public void initControls()    {     classic = (Button)findViewById(R.id.classicGame);     custom = (Button)findViewById(R.id.customGame);     help = (Button)findViewById(R.id.gameHelp);     // Classic Game is Selected     classic.setOnClickListener(new OnClickListener()     {      public void onClick (View v)      {       setContentView(R.layout.gamegui);    cardDeck = newGame.getCards();       // Back Button Clicked       back = (Button)findViewById(R.id.backButton);       back.setOnClickListener(new OnClickListener()       {        public void onClick (View v)        {         setContentView(R.layout.main);         initControls();         showCardClick = 0;        }       });       //start the game method here       showCard = (Button)findViewById(R.id.showCard);       txtbox = (TextView)findViewById(R.id.textBox);       showCard.setOnClickListener(new OnClickListener()       {        public void onClick (View v)        {         if (showCardClick &lt;=51)         {          txtbox.setText(cardDeck[showCardClick]);             showCardClick++;         }         else          txtbox.setText(""End of Game"");        }       });            }}</code></pre><p><strong>and heres the code from my other class that shuffles the deck:</strong></p><pre><code>package com.games.dg;import java.util.ArrayList;import java.util.Arrays;import java.util.Collections;import java.util.List;class classicMode{ // Variables that describe number of cards and array cards will be placed in public int cardCount = 52; public static int[][] cards; // Variables that describe the rules when a certain card is drawn public String ace = ""Take 1 Drink!""; public String two = ""Take 2 Drinks!!""; public String three = ""Take 3 Drinks!!!""; public String four = ""Questions: The Dealer must ask the group a question, everyone else must answer his question with a question of their own...""; public String five = ""Take 5 Drinks!!!!!""; public String six = ""I Never....: The person who draws this card must tell the group something he or she has never done, anyone in the group who did what the dealer has'nt takes a drink""; public String seven = ""Thumbmaster: The person who draws this card is the Thumbmaster for the entire game. Everytime he or she puts his thumb on the table, everyone else must follow. The last person to do so takes  a drink.""; public String eight = ""The Categories!: The Dealer must give a category to the group, the group must then mention brands within that category. (Ex. Dealer says: Cars, brands would be honda, toyota, mazda...)""; public String nine = ""Its Rhyme Time: The Dealer says a word, everyone else in the group must come up with a rhyme for that word, the loser takes a drink""; public String ten = ""Everyone Drinks!""; public String jack = ""Dude's Night Out: All the guys take a drink""; public String queen = ""Ladies Drink for Free: All the girls take a drink""; public String king = ""The Waterfall: The Dealer starts drinking, then another person, then a 3rd person and so on. The second person can not stop drinking until the first person stops, the third person cant stop until the second one stops, and so on. Pray that a heavy drinker doesnt go first!""; // Shuffles the 2D card matrix, in the matrix each number represents a cardpublic static void mixup() {  int[] values = {1,2,3,4,5,6,7,8,9,10,11,12,13};  for(int i=0;i&lt;=3;i++)  {   Collections.shuffle(Arrays.asList(values));   for(int j=0;j&lt;=12;j++)    cards[j][i]=values[j];  } } //Outputs the card order as a 1D array of stringspublic String[] getCards() {  String[] card_deck = new String[52];  int k = 0;  mixup();  for(int i=0;i&lt;=12;i++)  {   for(int j=0;j&lt;=3;j++)   {    if(j==0)    {     card_deck[k] = Integer.toString(cards[i][j]) + ""of Hearts"";     k++;    }    if (j==1)    {     card_deck[k] = Integer.toString(cards[i][j]) + ""of Spades"";     k++;    }    if (j==2)    {     card_deck[k] = Integer.toString(cards[i][j]) + ""of Clubs"";     k++;    }    if (j==3)    {     card_deck[k] = Integer.toString(cards[i][j]) + ""of Diamonds"";     k++;    }   }  }  return card_deck; }}</code></pre><p>So for instance when the call ""cardDeck = newGame.getCards();"" or  ""txtbox.setText(cardDeck[showCardClick]);""  is made, the program crashes/Can anyone help me out?</p><p>Thanks in advance!</p><p><strong>update, heres my log of what occured when the program started:</strong></p><pre><code>D/HomeLoaders(   93):   ----&gt; cleared application listI/ActivityManager(   50): Displayed activity com.games.dg/.fubar: 1360 ms (total 1360 ms)D/KeyguardViewMediator(   50): pokeWakelock(5000)I/ARMAssembler(   50): generated scanline__00000077:03545404_00000A04_00000000 [ 29 ipp] (51 ins) at [0x2d1320:0x2d13ec] in 4688047 nsI/ActivityManager(   50): Start proc com.android.inputmethod.latin for service com.android.inputmethod.latin/.LatinIME: pid=235 uid=10001 gids={3003, 1015}D/ddm-heap(  235): Got feature list requestD/dalvikvm(  235): Trying to load lib /system/lib/libjni_latinime.so 0x43758040D/dalvikvm(  235): Added shared lib /system/lib/libjni_latinime.so 0x43758040D/AndroidRuntime(  221): Shutting down VMW/dalvikvm(  221): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)E/AndroidRuntime(  221): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  221): java.lang.NullPointerExceptionE/AndroidRuntime(  221):    at com.games.dg.classicMode.mixup(classicMode.java:42)E/AndroidRuntime(  221):    at com.games.dg.classicMode.getCards(classicMode.java:52)E/AndroidRuntime(  221):    at com.games.dg.fubar$1.onClick(fubar.java:49)E/AndroidRuntime(  221):    at android.view.View.performClick(View.java:2344)E/AndroidRuntime(  221):    at android.view.View.onTouchEvent(View.java:4133)E/AndroidRuntime(  221):    at android.widget.TextView.onTouchEvent(TextView.java:6510)E/AndroidRuntime(  221):    at android.view.View.dispatchTouchEvent(View.java:3672)E/AndroidRuntime(  221):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  221):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  221):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  221):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  221):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)E/AndroidRuntime(  221):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)E/AndroidRuntime(  221):    at android.app.Activity.dispatchTouchEvent(Activity.java:1987)E/AndroidRuntime(  221):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)E/AndroidRuntime(  221):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)E/AndroidRuntime(  221):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  221):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  221):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime(  221):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  221):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  221):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime(  221):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime(  221):    at dalvik.system.NativeStart.main(Native Method)I/Process (   50): Sending signal. PID: 221 SIG: 3I/dalvikvm(  221): threadid=7: reacting to signal 3E/dalvikvm(  221): Unable to open stack trace file '/data/anr/traces.txt': Permission deniedI/ARMAssembler(   50): generated scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at [0x34aa18:0x34aabc] in 572941 nsI/ARMAssembler(   50): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x34aac0:0x34ac10] in 1098617 nsI/Process (  221): Sending signal. PID: 221 SIG: 9I/ActivityManager(   50): Process com.games.dg (pid 221) has died.I/WindowManager(   50): WIN DEATH: Window{43949420 com.games.dg/com.games.dg.fubar paused=false}W/UsageStats(   50): Unexpected resume of com.android.launcher while already resumed in com.games.dgW/InputManagerService(   50): Got RemoteException sending setActive(false) notification to pid 221 uid 10022</code></pre>","488179","","488179","","2010-10-27 00:30:38","2010-10-27 00:36:25","Android program crashes when I call a class from another java file","<android><crash>","1","4","","",""
"4028664","1","4028690","","2010-10-26 22:43:06","1","1821","<p>I want to create an event to change what my image button looks like, but only when it is being pushed down. So far I have been using an onTouch listener, but that just changes it permanently. I can't find anything like an onKyeUpListener() type of thing for the button.</p><p>Does anything like this exist?</p><p><strong>SOLVED</strong></p><pre><code>    final ImageButton button = (ImageButton) findViewById(R.id.ImageButton01);    button.setOnTouchListener(new View.OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            if(event.getAction() == (MotionEvent.ACTION_UP)){                //Do whatever you want after press            }            else{                //Do whatever you want during press            }            return true;        }    });</code></pre>","348261","","746010","","2012-01-29 07:46:04","2012-01-29 07:46:04","How would I set an ImageButton to change only when my finger is touching it","<android><image><onclick><imagebutton>","3","0","","",""
"4028693","1","4028919","","2010-10-26 22:50:06","0","1025","<p>I'm developing a mapping app using Eclipse 3.5.</p><p>I'm setting the minimum update period with the LocationManager's requestLocationUpdates method, via a configuration activity. When I set the property I see in Logcat that the system process sets the value OK.</p><p>When I actually send a new location from the DDMS emulator control and the location changes on the map view, I see that the system process then sets the minimum time to zero. </p><p>Below is a capture of the system's log messages. You can see that I'm setting the period to 32 seconds, then 16, then, after I've sent a simulated location change the system sets it to zero</p><p>The map responds to location changes to location changes instantly even if they are sent only a couple of seconds apart.</p><p>Does anyone know why my minimum time is overridden by the system?</p><pre><code>10-26 22:21:09.770: DEBUG/GpsLocationProvider(54): setMinTime 3200010-26 22:21:53.011: DEBUG/GpsLocationProvider(54): stopNavigating10-26 22:21:57.810: DEBUG/GpsLocationProvider(54): setMinTime 1600010-26 22:21:57.810: DEBUG/GpsLocationProvider(54): startNavigating10-26 22:21:57.900: DEBUG/GpsLocationProvider(54): setMinTime 1600010-26 22:22:39.099: DEBUG/GpsLocationProvider(54): TTFF: 4129010-26 22:22:39.350: DEBUG/GpsLocationProvider(54): setMinTime 010-26 22:22:51.740: DEBUG/GpsLocationProvider(54): TTFF: 5392510-26 22:22:51.820: DEBUG/GpsLocationProvider(54): setMinTime 010-26 22:22:56.780: DEBUG/GpsLocationProvider(54): TTFF: 5896710-26 22:22:56.879: DEBUG/GpsLocationProvider(54): setMinTime 0</code></pre><p>pertinent code, below, enableGPS() called in onResume()</p><pre><code>    private void enableGPS() {    if (confData.getTrackMode() == AppConstants.GPS_ON) {        if (lm == null)            lm = (LocationManager) getSystemService(LOCATION_SERVICE);        long updateMillis = confData.getMapUpdatePeriod() * 1000;        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,                updateMillis, confData.getMapMinResendDistance(), this);    }}</code></pre><p>and listener is</p><pre><code>    public void onLocationChanged(Location location) {    List&lt;Overlay&gt; overlays = mv.getOverlays();    lo = new MyLocationOverlay(this, mv);    overlays.add(lo);    lo.enableMyLocation();    int lat = (int) (location.getLatitude() * 1E6);    int lng = (int) (location.getLongitude() * 1E6);    GeoPoint point = new GeoPoint(lat, lng);    mc.setCenter(point);    mv.invalidate();}</code></pre>","440010","","440010","","2010-10-27 07:40:00","2010-10-27 12:07:27","Why is Location manager's minimum update time overridden when location changes?","<android><location>","1","1","","",""
"4028742","1","4598457","","2010-10-26 22:57:03","3","2017","<p>In my app, I'm creating a notification with the FLAG_ONGOING_EVENT flag set as such..</p><pre><code>Notification notification = new Notification(iconId, text, System.currentTimeMillis());  notification.flags |= Notification.FLAG_ONGOING_EVENT;</code></pre><p>I'm cancelling the notification in onDestroy, but if my app crashes before calling onDestroy, is there any way to have my notification go away?</p><p>Rob W.</p>","326430","","","","","2011-01-04 21:11:27","How to clear a notification if activity crashes?","<android><crash><activity><notifications><cancel>","3","3","1","",""
"4028782","1","","","2010-10-26 23:04:45","0","254","<p>When I change the layout_height of an EditText field in Android, the nice looking gradient becomes a hard gray line as you can see here:</p><p><img src=""http://i.stack.imgur.com/uUBMX.png"" alt=""alt text""></p><p>Is there a way to either fix or disable this gradient?</p><p>thxBen</p>","372405","","","","","2010-10-26 23:14:57","changing EditText","<android><colors><height><gradient><edittext>","1","0","","",""
"4029042","1","4029148","","2010-10-27 00:11:57","2","545","<p>I want to parse information out of the text file this serves up:</p><p><a href=""http://finance.yahoo.com/d/quotes.txt?s=GOOG+YHOO&amp;f=sak2"" rel=""nofollow"">http://finance.yahoo.com/d/quotes.txt?s=GOOG+YHOO&amp;f=sak2</a></p><p>Is there a way to do it within an app without downloading the file first? Somehow stream the text content?</p>","92259","","","","","2010-10-27 00:41:46","Read data from a txt file without downloading it?","<java><android>","1","1","","",""
"4029047","1","4029090","","2010-10-27 00:12:18","2","1839","<p>I have a custom listview row that contains a number of textView components.  Instead of the ""standard"" single text item, I have created a item where each listview row contains several bits of information.  For this example, I have a record id, a name, and a description for each row in the listview.</p><p>I have my listview populated via </p><pre><code>this.mDbHelper = new RecordDBAdapter(this);this.mDbHelper.open();Cursor c = this.mDbHelper.fetchAllRecords();startManagingCursor(c);String[] from = new String[] {RecordDBAdapter.ROW_ID, RecordDBAdapter.NAME, RecordDBAdapter.DESCRIPTION};int[] to = new int[] {R.id.recordId, R.id.lblName, R.id.lblDescription};// Now create an array adapter and set it to display using our rowSimpleCursorAdapter records =  new SimpleCursorAdapter(this, R.layout.record_row, c, from, to);this.list.setAdapter(dives);</code></pre><p>Now what I want is to be able to access the recordId value within each clicked item.  I've tried to follow the Android tutorials to no avail.  They do something like</p><pre><code>Object o = adapter.getItemAtPosition(position);</code></pre><p>but that still doesn't help either.  What I REALLY want is to get the value of the recordId WITHIN each selected listItem.  Does anyone know how this would be accomplished?  Here is my onItemClick event:</p><pre><code>     protected OnItemClickListener onListItemClick = new OnItemClickListener()        {            @Override            public void onItemClick(AdapterView&lt;?&gt; adapter, View view, int position, long rowId) {// My goal is either to grab the value of the// recordId value from the textView, or from the adapter.                //Object o = adapter.getItemAtPosition(position); //Tried this, no joy                Intent intent = new Intent(NeatActivity.this, SomeOtherActivity.class);                     //      intent.putExtra(""selectedRecordId"",val); //val here is a numerical record row id being passed to another activity.                startActivity(intent);            }               };</code></pre>","411435","","","","","2011-07-06 09:35:06","Android Custom ListView selected item children?","<android><listview><adapter><listviewitem><listadapter>","1","0","1","",""
"4029054","1","4029143","","2010-10-27 00:14:27","2","3097","<p>I have a list that i fill with data from a database, and now i want to sort this data by title and date.</p><p>Im still new to programming for Android, so cant figure out how to do this here, hope someone can help.</p><p>Here is how the list is filled:</p><pre><code>    public void fillData(){    // get all the data from database    DBAdapter db = new DBAdapter(this);    db.open();    mCategoriesCursor = db.getAllTitles();        startManagingCursor(mCategoriesCursor);    String[] from = new String[] { DBAdapter.KEY_TITLE, DBAdapter.KEY_DATE };    int[] to = new int[] { R.id.text1, R.id.text2 };    // Now create an array adapter and set it to display using our row    SimpleCursorAdapter categories =        new SimpleCursorAdapter(this, R.layout.categories_row, mCategoriesCursor, from, to);    setListAdapter(categories);    db.close();}    </code></pre><p>Here is the sql:</p><pre><code>    //---retrieves all the categories---public Cursor getAllTitles() {    return db.query(DATABASE_TABLE, new String[] {            KEY_ROWID,             KEY_TITLE,            KEY_DATE,            KEY_EXTRA},             null,             null,             null,             null,             null);}</code></pre>","484146","","484146","","2010-10-27 10:36:47","2012-01-24 07:22:58","Android - How to sort list","<sql><android><database><list><sorting>","2","3","","",""
"4029186","1","4052620","","2010-10-27 00:53:26","3","4879","<p>I've written a nice little Android app to check data usage, unfortunately it relies heavily on android.net.TrafficStats which was introduced with Froyo (Android 2.2).</p><p>I'm attempting to back-port this class for my non-Froyo users, and what I'm able to determine from the <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/jni/android_net_TrafficStats.cpp;h=ff46bdd2ba39380a0a673cbf8aadfc5a3529156c;hb=refs/heads/master1."" rel=""nofollow"">Android source</a> is:</p><ol><li>TrafficStats.java is just a native pointer to a c file</li><li>The c file opens two files (see below) and reads their contents</li><li>If either contains a numeric value it spits it back as the ""bytes used"" count </li></ol><p>Here's my challenge... when I call TrafficStats via the API on my device, I get a reading (ex. 1113853 bytes). When I open the two files and check their contents, one file doesn't exist and the other file is 0 bytes.  </p><p>So clearly I mis-understood what TrafficStats is doing. Can anyone shed some light on how it's working it's magic? </p><p>Thanks for the help. </p><p>(here is my attempt to port the c file to java)</p><pre><code>package com.suttco.net;import java.io.File;import java.io.FileNotFoundException;import java.io.IOException;import com.suttco.IOUtils;import com.suttco.StringUtils;import android.util.Log;public class TrafficStatsFile { private static final String mobileRxFile_1 = ""/sys/class/net/rmnet0/statistics/rx_bytes""; private static final String mobileRxFile_2 = ""/sys/class/net/ppp0/statistics/rx_bytes""; private static final String mobileTxFile_1 = ""/sys/class/net/rmnet0/statistics/tx_bytes""; private static final String mobileTxFile_2 = ""/sys/class/net/ppp0/statistics/tx_bytes""; private static final String LOGGING_TAG = TrafficStatsFile.class.getSimpleName(); public long getMobileRxBytes() {  return tryBoth(mobileRxFile_1, mobileRxFile_2); } public long getMobileTxBytes() {  return tryBoth(mobileTxFile_1, mobileTxFile_2); } // Return the number from the first file which exists and contains data private static long tryBoth(String a, String b) {  long num = readNumber(a);  return num &gt;= 0 ? num : readNumber(b); } // Returns an ASCII decimal number read from the specified file, -1 on error. private static long readNumber(String filename) {  File f = new File(filename);  if(f.exists()) {   if(f.canRead()) {    try {     Log.d(LOGGING_TAG, ""f.length() = "" + f.length());     String contents = IOUtils.readFileAsString(f);     if(StringUtils.IsNotNullOrEmpty(contents)) {      try {       return Long.parseLong(contents);      }      catch(NumberFormatException nfex) {       Log.w(LOGGING_TAG, ""File contents are not numeric: "" + filename);       }     }     else {      Log.w(LOGGING_TAG, ""File contents are empty: "" + filename);      }    }    catch (FileNotFoundException fnfex) {     Log.w(LOGGING_TAG, ""File not found: "" + filename, fnfex);    }    catch(IOException ioex) {     Log.w(LOGGING_TAG, ""IOException: "" + filename, ioex);    }   }   else {    Log.w(LOGGING_TAG, ""Unable to read file: "" + filename);   }  }  else {   Log.w(LOGGING_TAG, ""File does not exist: "" + filename);  }  return -1; }}</code></pre>","215166","","80425","","2011-11-18 12:07:40","2012-09-06 06:00:06","Can someone explain how TrafficStats works its magic in the Android OS?","<android>","2","3","6","",""
"4029250","1","4029533","","2010-10-27 01:11:11","1","768","<p>I'm coding a very basic FTP client on top of my application and I have 2 activities. The first one is the file explorer and the second one is the image viewer. Once I click on the image filename on the explorer, I want to pass the connection to the other activity to handle extra stuff. Basically, I want to keep the same <code>org.apache.commons.net.ftp.FTPClient</code> object (which handles the connection) alive in-between the 2 activities. I know I can't pass an object inside an intent so I don't know what my best bets are.</p><p>Thanks.</p>","140212","","","","","2010-10-27 02:21:23","How to keep FTP connection (or any connection object) alive between activities","<android><ftp><activity>","1","0","1","",""
"4029261","1","4029623","","2010-10-27 01:14:42","43","18223","<p>Is it possible to populate the options of a Spinner right in the layout xml? <a href=""http://developer.android.com/guide/tutorials/views/hello-spinner.html"">This page</a> suggests I should use an ArrayAdapter? It seems awkward not being able to do it..</p>","368864","","","","","2010-10-27 02:47:15","Populating spinner directly in the layout xml","<android>","1","0","6","",""
"4029321","1","4050131","","2010-10-27 01:29:43","0","1791","<p>I can not find any related layout implementation in android build in layouts.</p><p>I found one implementation in this post, <a href=""http://stackoverflow.com/questions/549451/line-breaking-widget-layout-for-android"">http://stackoverflow.com/questions/549451/line-breaking-widget-layout-for-android</a>, but in that post's case, there is a precondition that the child's width is not wider than the parent's.</p><p>But in my case, the child's width is wider than the parent's. Like say, there is one textview and one image in the layout, the layout's width is 200, while the textview's whole width is 300, and the image's width is 50.</p><p>Any build-in implementation in android for this ? Or any suggestion about how to implement this layout by myself ?</p><p>Thanks.</p>","441316","","","","","2010-10-29 08:14:32","Is there any flowlayout-like layout in android?","<android><layout><flowlayout>","2","0","1","",""
"4029331","1","4029678","","2010-10-27 01:32:23","2","196","<p>I am new in android world. I am trying to learn it. I have a question about inner classes in android code. Why and when do we need to creat inner class. We can create an individual class and by creating its object we can access its methods. So why do we need to create inner class and when it is necessary to create as inner class. </p><p>One advantage which i know is that we cant extend more than one class. So by creating inner classes we can extend more classes. What else ??</p><p>//Shan</p>","367121","","","","","2010-10-27 03:01:48","Why and When we need to create inner class in android","<java><android>","2","0","","",""
"4029399","1","4030045","","2010-10-27 01:49:09","0","998","<p>Im brand new to Android Application development and I am working on an application that will get an RSS feed from a specific url that returns JSON data , what I am wondering is what is the best way to translate this from JSON to populate the list ,</p><p>I was thinking of making objects to hold the individual posts and then create a list of them from the json but is this the best way it seems a little rough </p><p>Just looking for idea on how others perform this action May also be helpful to other beginners as no concrete reference base is around for this subject.</p><p>thanks chris</p>","445350","","","","","2010-10-27 04:49:28","Parsing RSS Feed with JSON and Populating a List Android App","<java><android><json><listview>","2","0","","",""
"4029633","1","","","2010-10-27 02:50:36","5","1856","<p>I need a Sample application that demonstrates saving cache files in Android and also how to use getCacheDir() method? <br>Can Anyone help me in sorting out this issue?I need to save file in an absolute directory and need to parse that file. <br>Thank in Advance.</p>","429501","","","","","2013-12-31 21:40:12","Need Sample Program on ""saving Cache Files "" in Android","<android>","3","1","","",""
"4029702","1","4029715","","2010-10-27 03:08:51","7","968","<p>I have developed a database application for Android. Now I want to make it available to deploy it. But I don't how to deploy it with the database. </p>","476747","","73488","","2010-10-27 03:11:58","2011-09-30 14:44:51","Deploying Android App","<android><database><deployment>","1","0","3","",""
"4029966","1","4030494","","2010-10-27 04:27:28","3","2322","<p>Hi friends i have set my layout thru TabLayout within LinearLayout but still my button in the end couldn't be set properly as TabLayout divides all the fields in number of columns so can anyone help how to set 2 Layouts in one XML filemeans all the fields in TabLayout and remaining both Login and Register buttons in Linear Layout ore some other so that they can set properly.</p><p>Thanks in advance. </p><h1>Layout</h1><h2>Username  !  EditTextBox</h2><h2>Password  ! EditTextBox</h2><h2>Login     ! Register</h2><h2>Button    ! Button</h2><p>I want my Layout in above Format so i have used TabLaout but in that case it is causing my button's view as well as it is stretching one button than other one as EditText is larger than TextView   </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:gravity=""center_horizontal""    android:textSize=""26sp""    android:text=""@string/login_text""/&gt;    &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    &gt;    &lt;TableRow&gt;    &lt;TextView          android:layout_width=""120px""          android:text=""User name""        /&gt;    &lt;EditText        android:id=""@+id/txtUserName""        android:singleLine=""true""        android:maxLength=""20""        android:width=""195px""    /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;    &lt;TextView          android:layout_width=""120px""          android:text=""Password""        /&gt;    &lt;EditText        android:id=""@+id/txtPassword""        android:width=""195px""        android:maxLength=""20""        android:singleLine=""true""        android:password=""true""    /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;            &lt;TextView /&gt;            &lt;CheckBox android:id=""@+id/chkRememberPassword""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:text=""Remember Password""                /&gt;           &lt;/TableRow&gt;        &lt;TableRow&gt;        &lt;Button                 android:id=""@+id/buttonRegister""                 android:text=""Register""                 android:layout_width=""124px""                android:layout_height=""wrap_content""                android:layout_below=""@+id/chkRememberPassword""                android:layout_alignRight=""@+id/chkRememberPassword""                /&gt;        &lt;Button             android:id=""@+id/buttonSignIn""             android:text=""Log In""             android:layout_width=""124px""            android:layout_height=""wrap_content""            android:layout_below=""@+id/chkRememberPassword""            android:layout_alignLeft=""@+id/chkRememberPassword""            /&gt;            &lt;/TableRow&gt;    &lt;TextView      android:id=""@+id/statusError""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     /&gt;    &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;</code></pre>","457146","","457146","","2010-10-27 06:02:36","2012-07-17 17:50:58","How to set different Layouts in 1 XML file in Android","<android><android-layout><android-sdk-2.2><android-xml>","3","3","","",""
"4029969","1","","","2010-10-27 04:29:03","0","739","<p>Hi I want to pass an Arraylist from one activity to another.I use putStringArrayListExtra(), but there shows an error :""The method putStringArrayListExtra(String,ArrayList is undefined for the type bundle.""Is there any other method available for passing ArrayList?</p><pre><code>  String test[]=new String[3];  ArrayList&lt;String[]&gt; al=new ArrayList&lt;String[]&gt;();   int x,y;                test[0]=""1"";                test[1]=""2"";                test[2]=""3"";                al.add(test);                test = new String[3];               test[0]=""4"";                test[1]=""5"";                test[2]=""6"";                al.add(test);               Bundle list_bundle=new Bundle();              list_bundle.putStringArrayListExtra(""lists"",al);              Intent list_intent= new Intent(v.getContext(), view_all_selected.class);              list_intent.putExtras(list_bundle);              startActivityForResult(list_intent, 2);</code></pre><p>Please help me..</p>","453607","","453607","","2010-10-27 04:47:37","2012-08-18 08:21:56","problems with putStringArrayListExtra() in Android","<android><multidimensional-array><arraylist>","1","0","","",""
"4030032","1","4030048","","2010-10-27 04:44:47","2","14503","<p>I created a method and keep getting an error that I need to include a } at the end of my method. I put the } in and the error is still there! If I then delete that } the same error will pop up on a prior method; and that error wasn't there before. in other words, if i type the } on my most recent method then the error stays there and only there. if i delete it, it duplicates that error on my prior method. </p><pre><code>private void putThreeBeepers() {for (int i = 0; i &lt; 2; i++) {    putBeeper();    move();}putBeeper();}private void backUp() {turnAround();move();turnAround();   }</code></pre>","479180","","65868","","2012-10-18 16:12:11","2014-01-12 03:30:10","syntax error: insert } to complete ClassBody","<java><android>","6","4","1","",""
"4030037","1","","","2010-10-27 04:47:38","0","1542","<p>I am facing a problem.I just want to reboot the device just after the installation package has installed on the device. How can i do this?Is there any way to do this?</p><p>please help me.</p><p>BR,gsmaker</p>","424854","","","","","2010-10-28 19:45:26","How to reboot android device?","<android>","2","2","","",""
"4030053","1","4030348","","2010-10-27 04:52:15","4","3879","<p>I am new to Android.Can anyone give some ideas for my problem.</p><pre><code>    /* Parent Linear Layout */    final LinearLayout par_layout=new LinearLayout(this);    par_layout.setOrientation(LinearLayout.VERTICAL);    /* Child Linear Layout */    final LinearLayout chl_layout=new LinearLayout(this);    chl_layout.setOrientation(LinearLayout.VERTICAL);    TextView tv_name=new TextView(this);    tv_name.setText(""Name "");    TextView tv_item=new TextView(this);    tv_item.setText(""Items "");    Button btn_submit=new Button(this);    btn_submit.setText(""Submit"");    btn_submit.setOnClickListener(new OnClickListener() {                   @Override        public void onClick(View v) {            // TODO Auto-generated method stub            par_layout.removeAllViewsInLayout();                        }    });    chl_layout.addView(tv_name);    chl_layout.addView(tv_item);    chl_layout.addView(btn_submit);            par_layout.addView(chl_layout);     setContentView(par_layout);</code></pre><p>In the above code at the time of button click i wish to clear the chl_layout from the par_layout.But i can't . Can anyone give some ideas ??</p><p>Note :The following code also not working </p><pre><code> par_layout.removeView(chl_layout);</code></pre>","482568","","482568","","2010-10-27 13:17:02","2012-07-13 07:24:00","how to remove sublayout from the Layout in Android?","<android>","4","0","1","",""
"4030083","1","4034604","","2010-10-27 04:58:44","4","1358","<p>How can we make Android assets secure so that no one can read them after app deployment?</p>","476747","","476747","","2010-10-27 05:47:46","2010-10-27 14:55:37","Assets Security in Android","<android><security><assets>","2","1","2","",""
"4030109","1","","","2010-10-27 05:04:31","1","1098","<p>I am having a file in the folder res/raw/a.xml.I want to write some data to this file?How it can be done in Android?How can we access a file stored in local directory in order to write data to that file. <br>can anyone help me in sorting out this issue ?Thanks in Advance,</p>","429501","","","","","2010-10-27 07:45:39","How to write to a file saved in local folder in Android","<android>","1","2","","",""
"4030115","1","4030587","","2010-10-27 05:04:50","4","10646","<p>Hi I want to pass an <code>Arraylist</code> from one <code>activity</code> to another. I use <code>putStringArrayListExtra()</code>, but there shows an error : <code>""The method putStringArrayListExtra(String,ArrayList is undefined for the type bundle.""</code> Is there any other method available for passing <code>ArrayList</code>?</p><pre><code>String test[]=new String[3];   ArrayList&lt;String[]&gt; al=new ArrayList&lt;String[]&gt;();    int x,y;   test[0]=""1"";     test[1]=""2"";     test[2]=""3"";     al.add(test);             test = new String[3];            test[0]=""4"";             test[1]=""5"";             test[2]=""6"";             al.add(test);            Bundle list_bundle=new Bundle();           list_bundle.putStringArrayListExtra(""lists"",al);           Intent list_intent= new Intent(v.getContext(), view_all_selected.class);           list_intent.putExtras(list_bundle);           startActivityForResult(list_intent, 2); </code></pre>","453607","","1595795","","2014-02-26 09:00:11","2014-02-26 09:00:11","How to pass ArrayList using putStringArrayListExtra()","<android><arraylist>","4","0","1","",""
"4030151","1","4031152","","2010-10-27 05:13:29","0","404","<p>I wanted to display an Alert Dialogue inside thread or alternatively such a way that AlertDialogue opens up directly after finding some records in database negative, w/o clicking on any button..Alert dialogue may contain Few lines and 2-3 buttons..</p><p>referred following link and tried on my own but not getting how to create an AlertDialogue without using onClickListener as its working with it(onClickListener) very smoothly:</p><p><a href=""http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog</a></p><p>Thanks in Advance.</p>","457146","","","","","2010-10-27 08:16:21","how to create an Alert Dialogu in Android without onCliclkListener","<android>","2","0","","",""
"4030161","1","4102553","","2010-10-27 05:15:30","0","2007","<p>I have a mapview and i wish to display a ContextMenu when longclick but so far the closest solution i've found is <a href=""http://www.anddev.org/map-problems-f26/context-menu-can-t-be-created-on-mapview-t4155.html"" rel=""nofollow"">here on anddev</a> , the main reason i do not like that method is because any click activate the ContextMenu instead of a long click.</p><p>Question: </p><p>Is there a way to display the ContextMenu of a Map without using Overlays? Why?</p>","382920","","382920","","2010-10-30 03:38:58","2010-11-27 11:11:28","Creating MapView with ContextMenu without Overlays","<android><google-maps><maps><android-mapview>","3","0","","",""
"4030258","1","4030285","","2010-10-27 05:36:29","0","935","<pre><code>        item = [[NSMutableDictionary alloc] init];    [[self item] setObject:self.currentDay forKey:@""day""];</code></pre><p>This is the code for iphone wat is its equivalent in java</p>","450487","","300798","","2010-10-27 05:49:42","2010-10-27 05:49:42","Iphone code and android","<java><iphone><android><objective-c><dictionary>","1","0","","",""
"4030379","1","4033361","","2010-10-27 06:02:56","2","1854","<p><br>Is there any way to add the x-graphics in the android Editbox like the of iPhone So that by clicking on that x graphic it can clear all the values in the Editbox</p><p><img src=""http://i.stack.imgur.com/qJ970.jpg"" alt=""alt text""></p><p>Is there any way to listen weather i touch a specific part of an edit textThank you</p>","477754","","477754","","2012-12-12 06:11:27","2014-01-28 08:24:37","EditText with cross(x) button at end of it","<android><editbox>","2","0","1","",""
"4030389","1","4184722","","2010-10-27 06:05:27","1","8239","<p>I would like to implement <code>onfling</code> (or some similar swipe) in listview in each and every item in list. If I swipe that particular item it should display three buttons next to the name.</p><p>Is there any idea to implement this. </p>","430652","","437301","","2010-10-27 11:02:55","2012-05-12 15:04:06","how to implement fling in android listview","<android><listview><swipe>","2","0","9","",""
"4030404","1","4030632","","2010-10-27 06:08:13","2","1103","<p><br>I have a file which I created and is present in data/data/com.andr.filedemo/files/a.xml.Now I want to parse this file using XML Pull parser. How can we give the path of that file or how we can access that file and then parse that file using XML Pull parser.<br>Can anyone help me in sortig out this issue?<br>Thanks in Advance,</p>","429501","","","","","2010-10-27 06:49:22","How to parse the file present on SDCArd","<android>","1","0","0","",""
"4030492","1","4030599","","2010-10-27 06:23:08","0","516","<p>friends,</p><p>i am using following code to get GPS location </p><p>it is causing two problems</p><p>1) when my location is changed / I move my phone from one area to another I dont get updated gps location(latitude/longitude)</p><p>2) after getting gps location my gps of phone is enabled how to disable it?</p><pre><code> double MyDeviceLatitude,MyDeviceLongitude;public void GetGPSLocation(){ LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);                        LocationListener myLocationListener = new CurrentLocationListener();                        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30, 30, myLocationListener);                   Location   currentLocation = locationManager.getLastKnownLocation(""gps""); if(currentLocation != null)                       {                       MyDeviceLatitude = currentLocation.getLatitude();                       MyDeviceLongitude = currentLocation.getLongitude();}else{ currentLocation = locationManager.getLastKnownLocation(""network""); MyDeviceLatitude = currentLocation.getLatitude(); MyDeviceLongitude = currentLocation.getLongitude();}public class CurrentLocationListener implements LocationListener{            public void onLocationChanged(Location argLocation)             {                if (argLocation != null)                 {                    MyDeviceLatitude = argLocation.getLatitude();                    MyDeviceLongitude = argLocation.getLongitude();                }            }            public void onProviderDisabled(String provider) {            }            public void onProviderEnabled(String provider) {            }            public void onStatusChanged(String provider, int status, Bundle arg2) {            }            }</code></pre><p>}</p><p>any help would be appreciated.</p>","249991","","437301","","2010-10-27 10:59:10","2010-10-27 10:59:10","how to get Updated location & Disable GPS after getting it in android?","<android>","1","0","","",""
"4030554","1","","","2010-10-27 06:32:01","0","338","<p>Have you seen stretchable scrolls in HTC sense? When you scroll up to last and still try to scroll it, it scratches and goes back to original state.</p><p>How to achieve this effect?</p>","229106","","","","","2010-10-27 06:35:31","Stretchable ScrollView (like HTC sense UI)","<android><scrollview>","1","0","0","",""
"4030690","1","4034516","","2010-10-27 06:59:51","1","609","<p>What is the suggested video/audio codec for encoding videos for android devices which works on most of the devices?<br>I tried using H.264/AAC, but the output mp4 only works in android 2.2, devices running older os versions says ""this video can not be played"". I am using normal progressive playback (via http) i.e. no streaming servers etc. <br>So how can I encode my videos (which video/audio codec and what settings) so that it works in normal progressive playback on most of the devices.</p>","195802","","","","","2010-10-27 14:47:23","Encoding video for android device","<android><video><encoding><codec><progressive>","1","0","","",""
"4030813","1","4382616","","2010-10-27 07:18:52","3","753","<p>I have a simple overlay for a Google Map: <a href=""http://pastebin.com/Rg8miMSh"" rel=""nofollow"">http://pastebin.com/Rg8miMSh</a> and I add/remove items on it depending on the zoom level. After removing/adding I call populate on the overlay and invalidate on the map view. Everything works just fine, except 1 glitch: after an item was removed, if I tap its location onTap is still triggered and because the OverlayItem is not there anymore i get <em>java.lang.ArrayIndexOutOfBoundsException</em> in <em>com.google.android.maps.ItemizedOverlay.maskHelper(ItemizedOverlay.java:562</em>) (full stack trace - <a href=""http://pastebin.com/KThn4ZLE"" rel=""nofollow"">http://pastebin.com/KThn4ZLE</a> )</p><p>Anyone knows why this is happening? Initially i called clear and added all items all over again which didn't seems to cause this problem. However having many items this was becoming a performance issue. Adding/removing only the difference works much faster and I would like to keep this method.Thanks!</p>","292921","","","","","2010-12-07 23:08:09","After removing OverlayItem tap events still trigger","<android><google-maps><overlay>","1","0","1","",""
"4030830","1","4057451","","2010-10-27 07:20:54","0","658","<p>I have a ViewGroup that gets inflated dynamically. I have set Id's to all the inflated views. I am still not able to retain the inflated ViewGroup whenever the orientation is changed.</p><p>Any particular check that i am missing here ?</p>","366053","","","","","2010-10-30 05:54:32","Android Handling dynamically added views while orientation change","<android>","1","0","","",""
"4030907","1","4031039","","2010-10-27 07:36:53","1","549","<p>For allow user only can input lower case alphabet and number, how can I setup my EditText in a xml file ?</p><p>Sorry, I did not provide clear information. I just want to filter or check user's input.</p>","206630","","206630","","2010-10-27 08:19:03","2010-10-27 08:19:03","How to setup my EditText xml in Android","<android>","1","0","","",""
"4030984","1","","","2010-10-27 07:51:19","0","1431","<p>My client wants to create themes like this:<a href=""http://mappn.com/community/index.php?topic=42.0"" rel=""nofollow"">http://mappn.com/community/index.php?topic=42.0</a></p><p>I have no clue where to start. When I Googled it I just get themes for style/theme for application.</p><p>Can anyone suggest where to start learning customizing themes for android phones?</p><p>Please share if you find any opensource.</p>","286831","","441574","","2012-02-21 16:00:02","2012-02-21 16:00:02","How to create android themes","<android>","2","1","1","",""
"4031055","1","4031086","","2010-10-27 08:00:52","0","2706","<p>This is my code but i can't fill my string with the value put in by the user.</p><p>I've tried a lot of solutions from other sites but it won't work.</p><pre><code>package app.android.Melimport 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.TextView;import android.widget.Toast;public class RedFlashlightActivity extends Activity {private EditText text;private TextView myRecord;private Button myButton;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    text = (EditText) findViewById(R.id.txtName);    myButton = (Button) this.findViewById(R.id.myButton);    myRecord = (TextView) findViewById(R.id.myRecord);    final String rec = text.getText().toString();    myButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            myRecord.setText(rec);            Toast.makeText(RedFlashlightActivity.this,rec, Toast.LENGTH_SHORT).show();        }    });}}</code></pre>","488500","","489560","","2012-01-15 20:16:04","2012-01-15 20:16:04","EditText get toString","<java><android><tostring><edittext>","3","0","","",""
"4031062","1","","","2010-10-27 08:01:21","5","1955","<p>I need to open camera from NDK to enhance the performances and I have search several days in internet. But nothing get help.</p><p>Does anyone know how to open the camera using NDK?</p>","488502","","","","","2010-10-28 08:14:23","How to open camera using Android NDK","<android><android-ndk>","1","0","","",""
"4031283","1","","","2010-10-27 08:37:25","0","173","<p>HI,</p><p>I have a textView of text email id, when i click the email id, i want to open a email app which is located in the device, and in the ""To"" address bar should be filled with the clicked email id,Any example or similar code will be a great helpful to me.Please help ?</p>","487604","","","","","2010-10-27 08:49:09","Email Applicaiton in Android?","<android><email>","1","0","","",""
"4031410","1","","","2010-10-27 08:53:09","1","1893","<p>I have a tabHost with tree tabs. How can I access a specific tab from the tabHost activity when this tab is not active at the moment.And a second question to this topic... How can I access the activity of a tab from another tab?</p><p>I need this, because I have to update the second tab when something changes on the first tab.</p><p>Thank you</p>","488567","","","","","2013-07-29 10:27:08","Android tabHost accessing specific tabs","<android><android-tabhost>","1","0","","",""
"4031434","1","","","2010-10-27 08:57:07","1","22196","<p>I am trying to use Bluetooth SPP to communicate over it. In some Android phones, SPP profile is not activated. I faced the problem in the application that SPP was not activated and so the connection could not be established over bluetooth and when I started another app that is 3g hotspot which I think activates SPP and I was able to connect over bluetooth in my app.</p><p>So, how can we actually activate SPP profile of bluetooth in Android devices? And does all the android devices has SPP profile?</p>","261566","","","","","2011-10-25 13:04:31","Activate Bluetooth SPP in Android?","<android><bluetooth><activate>","2","0","3","",""
"4031585","1","","","2010-10-27 09:15:07","1","380","<p>i'm new on Android plattform. I'm trying make a View that divide the screen in three sections. The first section should be 200dip high, the third section should be 50 dip high and the middle section should take the remaining place in the middle. Is there any way to implement it? I tried some ways but either it doesn't work or the app crashed.Thanks for helpPatrik</p>","438953","","","","","2010-11-11 08:31:04","Dynamic view high","<android>","2","0","","",""
"4031649","1","8688813","","2010-10-27 09:24:08","0","514","<p>Some lines's copy....:</p><pre><code>        eclipse.buildId=        java.version=1.6.0_18        java.vendor=Sun Microsystems Inc.        BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=tr_TR        Framework arguments:  -product org.eclipse.epp.package.pulsar.product        Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.pulsar.product        This is a continuation of log file D:\Huseyin\PROJECTS\Android\.metadata\.bak_0.log        Created Time: 2010-10-27 12:15:23.242        Error        Wed Oct 27 12:15:24 EEST 2010        Unknown format name 'string' in &lt;attr name=""targetClass""&gt;, file 'D:\Huseyin\TOOLS\Android\android-sdk-windows\platforms\android-4\data\res\values\attrs_manifest.xml'.        java.lang.IllegalArgumentException: No enum const class com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo$Format.STRING        at java.lang.Enum.valueOf(Unknown Source)        at com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo$Format.valueOf(Unknown Source)        at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseAttributeTypes(Unknown Source)        at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseAttr(Unknown Source)        at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseDeclaredStyleable(Unknown Source)        at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseResources(Unknown Source)        at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.preload(Unknown Source)        at com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser.run(Unknown Source)        at com.android.ide.eclipse.adt.internal.sdk.Sdk$5.run(Unknown Source)        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)    eclipse.buildId=    java.version=1.6.0_18    java.vendor=Sun Microsystems Inc.    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=tr_TR    Framework arguments:  -product org.eclipse.epp.package.pulsar.product    Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.pulsar.product    This is a continuation of log file D:\Huseyin\PROJECTS\Android\.metadata\.bak_0.log    Created Time: 2010-10-27 12:15:23.242    Error    Wed Oct 27 12:15:24 EEST 2010    Unknown format name 'string' in &lt;attr name=""data""&gt;, file 'D:\Huseyin\TOOLS\Android\android-sdk-windows\platforms\android-4\data\res\values\attrs_manifest.xml'.    java.lang.IllegalArgumentException: No enum const class com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo$Format.STRING    at java.lang.Enum.valueOf(Unknown Source)    at com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo$Format.valueOf(Unknown Source)    at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseAttributeTypes(Unknown Source)    at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseAttr(Unknown Source)    at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseDeclaredStyleable(Unknown Source)    at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseResources(Unknown Source)    at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.preload(Unknown Source)    at com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser.run(Unknown Source)    at com.android.ide.eclipse.adt.internal.sdk.Sdk$5.run(Unknown Source)    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)    eclipse.buildId=java.version=1.6.0_18java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=tr_TRFramework arguments:  -product org.eclipse.epp.package.pulsar.productCommand-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.pulsar.productThis is a continuation of log file D:\Huseyin\PROJECTS\Android\.metadata\.bak_0.logCreated Time: 2010-10-27 12:15:23.242ErrorWed Oct 27 12:15:24 EEST 2010Unknown format name 'integer' in &lt;attr name=""updatePeriodMillis""&gt;, file 'D:\Huseyin\TOOLS\Android\android-sdk-windows\platforms\android-4\data\res\values\attrs.xml'.java.lang.IllegalArgumentException: No enum const class com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo$Format.INTEGERat java.lang.Enum.valueOf(Unknown Source)at com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo$Format.valueOf(Unknown Source)at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseAttributeTypes(Unknown Source)at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseAttr(Unknown Source)at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseDeclaredStyleable(Unknown Source)at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.parseResources(Unknown Source)at com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser.preload(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser.run(Unknown Source)at com.android.ide.eclipse.adt.internal.sdk.Sdk$5.run(Unknown Source)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</code></pre>","483988","","","","","2014-01-17 18:48:30","what does it mean?? I finished my project, but now It errors that i dont kow what to do","<android>","2","0","","",""
"4031667","1","4031697","","2010-10-27 09:25:35","1","4731","<p>I'm developing an Android application.</p><p>Is there any way to show a message on a ListView only with it's empty?</p><p>I'm using a custom ArrayAdapter, so I have to create a specific object with the text I want to show.</p><p>I'm wondering if there is a specific field on ListView to setup a message when it's empty.</p><p>Any advice?</p><p>Thanks.</p>","68571","","","","","2010-10-27 09:29:30","empty ListView, how can I show a message on a ListView when it's empty?","<android><listview>","1","0","","",""
"4031740","1","","","2010-10-27 09:35:11","19","17435","<p>I want to receive the Android broadcast messages. Is there a list of all intents?</p>","488607","","1242357","","2013-06-13 07:11:34","2013-10-21 04:42:17","Where is the all Android broadcast Intent list","<android><android-intent><broadcast>","4","0","14","",""
"4031741","1","","","2010-10-27 09:35:11","1","901","<p>when I invoke webservices method working fine without parameters. But with parameters I am getting null in the inside the webservice method.</p><p>Here my code and wsdl file</p><pre><code>  private static final String METHOD_NAME = ""getCityList"";  private static final String SOAP_ACTION = ""http://service.country.com/"" + METHOD_NAME;  private static final String NAMESPACE = ""http://service.country.com"";  private static final String URL = ""http://192.168.1.11:8080/Services/ws/country"";/** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    try{  SoapObject request = new  SoapObject(NAMESPACE, METHOD_NAME);  request.addProperty(""countryId"",5);               SoapSerializationEnvelope   envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);               envelope.dotNet = true;               envelope.setOutputSoapObject(request);               AndroidHttpTransport  androidHttpTransport = new AndroidHttpTransport(URL);               androidHttpTransport.call(SOAP_ACTION,envelope);               Object result =   envelope.getResponse();               System.out.println(""RESULT""+ result.toString());</code></pre><p>my xml file below</p><pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;    &lt;SOAP-ENV:Body&gt;        &lt;m:getCityList xmlns:m=""http://service.com/""&gt;            &lt;arg0&gt;                &lt;code&gt;String&lt;/code&gt;                &lt;msg&gt;String&lt;/msg&gt;            &lt;/arg0&gt;            &lt;arg1&gt;                &lt;countryId&gt;0&lt;/countryId&gt;            &lt;/arg1&gt;        &lt;/m:getCityList&gt;    &lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;</code></pre>","290189","","1008639","","2011-12-15 20:56:48","2011-12-15 20:56:48","android webservices method getting null parameter value while calling","<android><web-services><spring><cxf>","0","1","","",""
"4031800","1","4132460","","2010-10-27 09:42:31","6","7611","<p>I'm trying to download a large .zip file from a web server but I have a weird behaviour, the description is:</p><ul><li>I'm executing the code in the device emulator, API level 3 (version 1.5) with an SD card of 512MB. I start the device with ""Wipe data user""</li><li>The length of the size from conexion.getContentLength() is 7012725</li><li>The server address is localhost (10.0.2.2), but I've tried with an external server and the behaviour is the same. I've double checked that I can download the file through a web browser.</li><li>I have these permisions in the manifest file:</li></ul><p>-</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&gt;</code></pre><p>The error:</p><ul><li>It starts downloading the file, I can see the text 10, 20, 30, 40, 50 and then it stops at 60.</li><li>After a while, the emulator reboots itself.</li></ul><p>Workarounds:</p><ul><li><a href=""http://stackoverflow.com/questions/2635786/android-download-large-file"">This</a> issue in stackoverflow is working in the device, not in my case.</li><li><p>About this wifi lock <a href=""http://stackoverflow.com/questions/3629210/download-large-file-in-android"">issue</a> what I've done is add this permission ""android.permission.WAKE_LOCK"" and then this piece of code, but with exactly the same behaviour:</p><p>WifiManager.WifiLock wifilock;WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);wifilock = manager.createWifiLock(""wifilock"");wifilock.acquire();...wifilock.release();</p></li></ul><p>Here is the code, that it's being executing in a separate thread:</p><pre><code>private void downloadData(){    try{        Log.v(TAG, ""downloading data"");        URL url  = new URL(""http://10.0.2.2/1.zip"");        URLConnection conexion = url.openConnection();        conexion.connect();        int lenghtOfFile = conexion.getContentLength();        Log.v(TAG, ""lenghtOfFile = ""+lenghtOfFile);        InputStream is = url.openStream();        File testDirectory = new File(Environment.getExternalStorageDirectory()+""/testDirectory/"");    if(!testDirectory.exists()){        testDirectory.mkdir();    }        FileOutputStream fos = new FileOutputStream(testDirectory+""/files.zip"");        byte data[] = new byte[1024];        int count = 0;        long total = 0;        int progress = 0;        while ((count=is.read(data)) != -1)        {            total += count;            int progress_temp = (int)total*100/lenghtOfFile;            if(progress_temp%10 == 0 &amp;&amp; progress != progress_temp){                progress = progress_temp;                Log.v(TAG, ""total = ""+progress);                }            fos.write(data, 0, count);        }        is.close();        fos.close();    Log.v(TAG, ""downloading finished"");    }catch(Exception e){        Log.v(TAG, ""exception in downloadData"");        e.printStackTrace();    }}</code></pre><p>Any clue?Thank you very much.</p><p><strong>Update with more log description:</strong></p><blockquote>  <p>Hi Chris, I've tried to discover what  was going on at first with this log in  the Eclipse environment.  Here are a  little bit more detail about what is  happening (time - action), note that  I've changed the file to download for  another one in orther to do more  tests, but the results are quite the  same:</p></blockquote><pre><code>00:00 It starts downloading:V/iPhoto  (  853): downloading dataV/iPhoto  (  853): lenghtOfFile = 7732809V/iPhoto  (  853): total = 10V/iPhoto  (  853): total = 20V/iPhoto  (  853): total = 30V/iPhoto  (  853): total = 40V/iPhoto  (  853): total = 50 (round 00:05)-&gt; Here it stops and the DDMS disconnects the device immediatly03:40 It finish the download (not always) and the device reboots on its own:I/Process (  595): Sending signal. PID: 595 SIG: 3I/dalvikvm(  595): threadid=7: reacting to signal 3D/dalvikvm(  722): GC freed 2193 objects / 135808 bytes in 176 secV/iPhoto  (  853): total = 60I/dalvikvm(  595): Wrote stack trace to '/data/anr/traces.txt'I/ActivityManager(  595): Process com.google.android.apps.maps:FriendService (pid 778) has died.I/ActivityManager(  595): Process com.android.mms (pid 732) has died.V/iPhoto  (  853): total = 70V/iPhoto  (  853): total = 80V/iPhoto  (  853): total = 90V/iPhoto  (  853): total = 100V/iPhoto  (  853): downloading finishedV/iPhoto  (  853): thread finish loadingI/Process (  595): Sending signal. PID: 595 SIG: 9I/ActivityThread(  757): Removing dead content provider: settingsI/ActivityThread(  748): Removing dead content provider: settingsI/ActivityThread(  722): Removing dead content provider: settingsI/ActivityThread(  700): Removing dead content provider: settingsI/ServiceManager(  549): service 'package' died... services dieing...I/ServiceManager(  549): service 'wifi' diedE/installd(  557): eofE/installd(  557): failed to read sizeI/installd(  557): closing connectionD/qemud   (  560): fdhandler_event: disconnect on fd 11D/qemud   (  560): fdhandler_event: disconnect on fd 12E/vold    (  550): Framework disconnectedI/Zygote  (  554): Exit zygote because system server (595) has terminatedI/ServiceManager(  549): service 'simphonebook' diedI/ServiceManager(  549): service 'isms' diedI/ServiceManager(  549): service 'iphonesubinfo' diedI/ServiceManager(  549): service 'phone' diedD/AndroidRuntime(  949): D/AndroidRuntime(  949): &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;... and starting ...</code></pre><p>Could anyone try my code and to download a zip file with size round 8MB? Does it works for you?</p>","245638","","245638","","2010-10-29 10:05:25","2010-11-09 10:05:01","Android download large files","<android><file-download>","2","0","4","",""
"4031829","1","","","2010-10-27 09:46:12","0","2538","<p>I have passed one multi-dimensional array to another activity using putSerializable() and retrieve using getSerializable. But I got some problems. Please help me to solve my problem..</p><p>First activity:</p><pre><code>  String [][] selected_list= new String[10][];             Bundle list_bundle=new Bundle();  list_bundle.putSerializable(""lists"",selected_list);  Intent list_intent= new Intent(v.getContext(), second_activity.class);  list_intent.putExtras(list_bundle);  startActivityForResult(list_intent, 2);</code></pre><p>Second Activity:</p><pre><code>  String [][] list_new= new String[10][];      Bundle b=this.getIntent().getExtras();  Serializable list= b.getSerializable(""list"");  list_new=(String[][])list;   </code></pre><p>When I am running my application, my application is suddenly stopped.Is this the right method to retrive the String array?Please give me the solution..Thank you...</p><hr><p>This is the output from Debug window:</p><blockquote>  <p>CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>  CalorieCounter [Android Application]<br>      DalvikVM[localhost:8605]<br>          Thread [&lt;1> main] (Suspended (exception RuntimeException))<br>              ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2663<br>              ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679<br>              ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125               ActivityThread$H.handleMessage(Message) line: 2033<br>              ActivityThread$H(Handler).dispatchMessage(Message) line: 99               Looper.loop() line: 123               ActivityThread.main(String[]) line: 4627<br>              Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]<br>              Method.invoke(Object, Object...) line: 521<br>              ZygoteInit$MethodAndArgsCaller.run() line: 868<br>              ZygoteInit.main(String[]) line: 626               NativeStart.main(String[]) line: not available [native method]<br>          Thread [&lt;6> Binder Thread #2] (Running)           Thread [&lt;5> Binder Thread #1] (Running)           Thread [&lt;7> Binder Thread #3] (Running) </p></blockquote>","453607","","1288","","2011-11-04 02:26:03","2011-11-04 02:26:03","Passing multidimensional array using Serializable","<android><multidimensional-array>","1","3","","",""
"4031883","1","4031951","","2010-10-27 09:52:44","0","4350","<p>How can I clear all cookies in android ?</p><p>Any sample code provided will be really helpful.</p>","422405","","1122476","","2012-08-20 02:56:03","2012-08-20 02:56:03","Clear cookies in Android","<android>","2","1","2","",""
"4031959","1","","","2010-10-27 10:00:48","2","1003","<p>I have doubt on thread Life cycle in android.This is my scenario I have downloaded data from web and stored it in the DB.all this activity i have done using thread,once the activity finished i passed the object to handler and proceed .But my doubt is whether i need to stop the thread?</p><p>This is the Example</p><pre><code>               showDialog(0);              Thread  t=new Thread()                     {                        public void run()                            {                            downloadFromNet();                            }                    };                    t.start();                     void downloadFromNet()                      {                          Message myMessage=new Message();            myMessage.obj=""SUCCESS"";            handler.sendMessage(myMessage);                        }           private Handler handler = new Handler()       {        @Override        public void handleMessage(Message msg) {              String loginmsg=(String)msg.obj;              if(loginmsg.equals(""SUCCESS""))               {                  removeDialog(0);                    }           };</code></pre><p>Should I need to stop the Thread or Its lifecycle will be over?</p>","461972","","","","","2010-10-27 10:09:51","Thread on Android","<android><thread-safety>","1","0","","",""
"4031990","1","4032272","","2010-10-27 10:04:54","1","640","<p>I need to implement an xml parser and the parsed result into an expandablelistview. Please help</p>","450487","","","","","2012-05-09 04:22:47","Anyone got a xml parser with expandablelistview","<java><android><xml>","1","0","","",""
"4032030","1","4032107","","2010-10-27 10:09:28","2","253","<p>I have a huge set of xmls(2000 files each having 500 lines) to be parsed in Android for fetching the information from it. All the files will be present in the device. I had this to be done in iPhone and i accomplished it by converting all the XMLs to PLIST files. The PLIST processing in a iOS was faster than parsing a XML in iphone. Similarly for android is there any options available? or What are the best way to parse those XMLs in android as i feel the same problem we had in iphone(performance incurred in parsing) will be here also?</p>","380167","","","","","2010-10-27 10:16:44","What are the various options to parse a XML in android mobile device?","<java><android><xml><java-me>","2","0","1","",""
"4032075","1","","","2010-10-27 10:14:20","5","7144","<p>i want to configure gmail in my android emulator, i went to the ""Add a Google Account"" under settings/Add Account, i have given gmail username and password, but after some time it is saying that ""Can't establish reliable data connection to the Server"" ? What is this error ?Can i configure gmail in emulator?  please help ?</p>","487604","","","","","2012-07-27 05:03:46","Can i configure gmail in Android emulator?","<android><configuration><gmail><emulator>","2","2","3","",""
"4032095","1","","","2010-10-27 10:15:32","2","750","<p>We are trying to develop an app that uses compass information, and facing a similar problem on the Droid Incredible [http://www.youtube.com/watch?v=qSDpHksACRc][at time-2:02].</p><p>my prob is similar to the link:http://androidforums.com/incredible-support-troubleshooting/73860-compass-calibration.html</p><p>**I have tested my app with nexus one also and its working fine in it. The only problem is Droid incredible.**</p><p>I do not think repeatedly doing a factory reset will be a good idea for users. Ideally we would like to detect the abnormal magnetic field and ask the user to reset just the compass. </p><p>Can you please suggest how we can detect the abnormal magnetic field through code and trigger the compass reset?</p><p>Thanks</p>","488599","","","","","2010-10-27 10:15:32","How to detect abnormal magnetic field/orientation readings and recalibrate orientation sensor (compass reset)?","<android>","0","0","4","",""
"4032163","1","4034184","","2010-10-27 10:23:40","0","1131","<p>I have listview that contain checkbox and an image when the checkbox is clikced I show a button at bottom of the screen that perform deletion, but when listview height more ,then the listview some portion move under the button ,so I need an alternative option for delete can anyone help me, I except something like menu?</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;  &lt;Button android:layout_centerHorizontal=""true"" android:layout_width=""150dp"" android:layout_height=""wrap_content"" android:id=""@+id/DelPhto"" android:text=""Delete"" android:layout_alignParentBottom=""true"" /&gt;   &lt;ListView android:layout_width=""280dp"" android:layout_height=""fill_parent"" android:id=""@+id/list_pictures"" android:layout_alignParentTop=""true"" android:layout_above=""@+id/DelPhto"" /&gt;   &lt;/RelativeLayout&gt;</code></pre>","487219","","1288","","2011-07-18 19:02:24","2011-07-18 19:02:24","Android Delete from listview","<android>","3","0","0","",""
"4032291","1","6446981","","2010-10-27 10:36:31","1","1647","<p>I started implementation of android live wallpaper, following the examples and tutorials found on the internet, and I can't include png background as wallpaper. Also checked with similar problems here, and still can't make it work.</p><p>This is the code:</p><pre><code>public class LiveWallpaper extends WallpaperService {    /* IDs of recurces needed for animations*/    private SurfaceHolder holder;    private static final String TAG = ""MyActivity"";    @Override    public void onCreate() {        super.onCreate();    }    @Override    public void onDestroy() {        super.onDestroy();    }    @Override    public Engine onCreateEngine() {        return new WallpaperEngine();    }    class WallpaperEngine extends Engine {    public final Runnable mDrawWallpaper = new Runnable(){         public void run(){            drawWallpaper();         }    };    @Override    public void onCreate(SurfaceHolder surfaceHolder){        super.onCreate(surfaceHolder);        setTouchEventsEnabled(false);        loadImagesIntoMemory(R.drawable.wallpaper);        holder = getSurfaceHolder();    }    void drawWallpaperContent(Canvas c, int resourceId){        Bitmap decodeResoure = BitmapFactory.decodeResource (getResources(), resourceId);        c.drawBitmap(decodeResoure, 0, 0, null);    }    void drawWallpaper(){        final SurfaceHolder holder = getSurfaceHolder();        Canvas c = null;            c = holder.lockCanvas();        if(c!=null){            c.save();            drawWallpaperContent(c, R.drawable.wallpaper);                    c.restore();        }        }        private void loadImagesIntoMemory(int resourceId){        Resources res = getResources();        BitmapFactory.decodeResource(res, resourceId);        }        @Override        public void onDestroy(){        super.onDestroy();        mHandler.removeCallbacks(mDrawWallpaper);                   }    }}</code></pre><p>Bitmap is stored in drawable folder, and the version of android sdk is 2.2.After launching the live wallpaper, I only get 'Loading Wallpaper' without showing the wallpaper image.</p><p>Does anyone knows what could be the problem?</p><p>Thank you.Dj.</p>","488678","","327402","","2012-12-27 16:13:50","2012-12-27 16:13:50","Android Live Wallpaper - not showing background image?","<android><wallpaper>","1","0","0","",""
"4032349","1","4068980","","2010-10-27 10:43:38","3","5331","<p>i am trying to send a json string from my android client to my .net Rest service...can anyone help me in this issue?</p><pre><code>HttpClient client = new DefaultHttpClient();HttpPost post = new HttpPost(""http://myURL""); JSONObject json = new JSONObject(); json.put(""name"", ""i am sample""); StringEntity str = new StringEntity(json.toString()); str.setContentType(""application/json; charset=utf-8""); str.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,""application/json; charset=utf-8"")); post.setEntity(str); HttpResponse response = client.execute(post);</code></pre><p>Response is bad request. am i sending the json object as string? is this code correct?</p>","430652","","440502","","2010-10-27 10:52:16","2013-10-09 07:08:53","how to send a json string to a .NET REST service from java?","<.net><android><web-services>","3","2","5","",""
"4032391","1","","","2010-10-27 10:49:12","4","7154","<p>I want to connect 3 devices via Bluetooth.As for example I use BluetoothChat. So How I understand I should use different UUID for this devices. I have been trying to connect via such UUID=766c82f0-e1b4-11df-85ca-0800200c9a66, which I 've get it from Web UUID generator. But it doesn't work at all.I have succesfully connected (to 1 device) if I used UUID=00001101-0000-1000-8000-00805F9B34FBWhere can I get  UUID? </p>","448147","","","","","2014-04-11 14:25:11","Android Bluetooth Where can I get UUID?","<android><bluetooth><uuid>","3","0","2","",""
"4032435","1","4041980","","2010-10-27 10:55:38","1","536","<p>I'm trying to run unit tests on my Android app and I'm getting a NoClassDefFoundError when referencing 3rd party jars.</p><p>The classes in those jars are only referenced by the app itself, not the unit tests. The jars are on the apps classpath and have been exported in the eclipse settings to allow tyhem to be found by dependant apps - which, of course, the test app is.</p><p>Thanks in advance.</p><p>p.s. Please don't simply tell me that my jars aren't on the classpath - I can see that, I'm just not seeing how to get them on the classpath...</p>","398293","","","","","2010-10-28 10:33:10","Unit Testing Android project gets a NoClassDefFoundError for 3rd Party Jars","<android>","1","4","","",""
"4032482","1","4032564","","2010-10-27 11:00:17","4","4150","<p>I am trying to setup at ServerSocket on my Android phone, and send a char or int or anything from my computer.</p><p>The code on the phone creates a ServerSocket and then blocks whilst waiting for a connection:</p><pre><code>ServerSocket serverSocket = ServerSocketFactory.getDefault()                            .createServerSocket(4444);Log.d(""HostThread"", ""ServerSocket created:""+serverSocket                             .getInetAddress().getHostAddress());Socket socket = serverSocket.accept();</code></pre><p>(The log says ""10-27 11:41:43.437: DEBUG/HostThread(23957): ServerSocket created:0.0.0.0"")</p><p>A simple bit of code running on my PC tries to connect to the phone:</p><pre><code>Socket s = new Socket(""xx.xx.xx.xx"", 4444);</code></pre><p>... (plus some more bits if the socket is created. But I'm not getting this point, so left that out!)</p><p>Basically, the phone is getting to accept, and the computer is not connecting. The xx.xx.xx.xx is the public IP of the phone I obtain programatically (and it matches up with checking on whatismyip.com).</p><p>I have set the INTERNET permission on the phone. I have also been able to do this in reverse (ServerSocket on pc, client on phone).</p><p>Any ideas where I am going wrong?</p>","222383","","","","","2012-08-01 18:34:58","ServerSocket accept() not accepting connections on Android","<java><android><client-server>","1","0","1","",""
"4032493","1","4035890","","2010-10-27 11:01:34","0","338","<p>I'm trying to read from a file while it still opened for witing.How it can be done?Thanks,Eyal.</p>","341497","","","","","2013-09-12 11:29:46","writing to and reading from a file simultaneous","<android>","1","0","","",""
"4032523","1","","","2010-10-27 11:05:01","-1","516","<p>I have a relative layout with various text view aligned in it.But the alignment goes wrong if value of any textview goes multiline.is there any way to avoid it?The view required is something like :</p><p>Name:   Abc</p><p>address: 23,abc street,fhjhg apartments,Country</p><p>Email: abcdgehfhf@mail.com  </p><p>address text view has width set as wrap-contentbut it appears like:</p><p>Name:   Abc</p><p>address: 23,abc street</p><p>Email:  fhjhg apartments,Country</p><pre><code>        abcdgehfhf@mail.com</code></pre>","424831","","424831","","2010-10-27 11:16:23","2011-05-22 03:00:55","Relative layout alignment goes wrong on a multiline textview","<android><android-layout><relativelayout>","1","0","","",""
"4032676","1","4032733","","2010-10-27 11:22:33","2","5656","<pre><code>text = text + CepVizyon.getPhoneCode() + ""\n\n""            + getText(R.string.currentversion) + CepVizyon.getLicenseText();    activationText.setText(text);   myTextView.setText(text);</code></pre><p>I want to change color for CepVizyon.getPhoneCode()'s string...  how can I do this??</p>","483988","","","","","2011-08-26 17:38:04","how can I change color part of a TextView?","<android><uitextview><textview>","4","0","3","",""
"4032709","1","4032774","","2010-10-27 11:26:49","3","2091","<p>I have a list view holding text views and when the text gets too big, it wraps and the item takes up two spaces. I am wondering if there is a way to turn off line wrap in this case, and if it should be done in the textview or the listview.</p>","348261","","","","","2011-08-26 14:14:51","Is there a way to disable line wrap in a List View in android?","<android><listview><line><textview><wrap>","2","0","","",""
"4032713","1","4035463","","2010-10-27 11:27:23","2","1056","<p>How can I localize my application to support some Right to Left languages?How can I localize my application to support Hebrew? Arabic? and other languages?Thanks,Eyal.</p>","341497","","","","","2010-10-27 16:29:55","Supporting Right to Left languages","<android>","1","0","","",""
"4032806","1","","","2010-10-27 11:41:23","1","449","<p>I have the following code for a spinner:</p><pre><code>public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView&lt;?&gt; parent,     View view, int pos, long id) {   String TABLE_NAME = parent.getItemAtPosition(pos).toString();            int spinnerYearsPos = parent.getSelectedItemPosition();  Cursor cursor = getStats(TABLE_NAME);             showStats(cursor); } public void onNothingSelected(AdapterView&lt;?&gt; parent) {   // Do nothing. }</code></pre><p>}</p><p>What I would like to do is be able to pass the spinnerYearsPos variable in the above code into this method:</p><pre><code>public void clickHandler(View v ){  if (v.getId() == R.id.TableTab) {   Intent myIntent = new Intent(getApplicationContext(), Table.class);      myIntent.putExtra(""spinnerYearsPos"", spinnerYearsPos);       startActivity(new Intent(getApplicationContext(), Table.class));      }      if (v.getId() == R.id.OtherStatsTab) {      startActivity(new Intent(getApplicationContext(), OtherStats.class));      }      }  </code></pre><p>At present Eclipse is underlining the spinnerYearsPos reference in red. How do I call the clickHandler method and then pass the spinnerYearsPos variable into it?</p>","485508","","485508","","2010-10-27 11:45:53","2010-10-27 12:13:23","Calling the clickHandler method and passing a value","<java><android><eclipse><parameter-passing>","1","0","","",""
"4032838","1","4071631","","2010-10-27 11:47:31","10","5699","<p>I have been searching around for free or commercial AR toolkits and need some advice on the best one!</p><p>I don't want to have one that recognises a pattern and creates a shape.  The idea I have uses the local location and uses POI's from a server to present them onto an AR view.</p><p>Any ideas?</p>","103999","","","","","2012-12-20 11:01:08","Augmented Reality Toolkit - Android","<android><augmented-reality>","2","2","10","",""
"4032891","1","4042415","","2010-10-27 11:56:37","0","1375","<p>I am working on application wherein I need to create a List of lists. For example</p><p>EmployeeGroup1 GroupName, GroupId, JobTypeEmpployee1 Name, DesignationEmpployee2 Name, DesignationEmpployee3 Name, DesignationEmpployee4 Name, DesignationEmployeeGroup2 GroupName, GroupId, JobTypeEmpployee5 Name, DesignationEmpployee6 Name, DesignationEmpployee7 Name, DesignationEmpployee8 Name, Designation... And so on</p><p>The employee details in this case are retrieved from SQLite database. The employee group are fixed(5). Hence I created 5 Relative layout Groups and put a list view in each as done delow</p><pre><code>        &lt;RelativeLayout        android:id=""@+id/ltGroup1""                  android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;              &lt;TextView android:text=""GroupName:""             android:id=""@+id/lblGroupName_1""             android:layout_width=""80dip""             android:layout_height=""25dip""            android:layout_alignParentLeft=""true""            android:textColor=""@color/BLACK""            android:textSize=""14dip""                  android:textStyle=""bold""              android:paddingLeft=""5dip""            android:gravity=""center"" /&gt;              &lt;TextView android:text=""0 cal""             android:id=""@+id/txtGroupName_1""            android:layout_width=""75dip""             android:layout_height=""25dip""            android:layout_toRightOf=""@+id/lblGroupName_1""            android:textColor=""@color/TITLEBAR_TABS""            android:textSize=""13dip""                android:textStyle=""bold""            android:paddingRight=""5dip""                      android:gravity=""right|center_vertical"" /&gt;                         &lt;ListView android:id=""@+id/lstEmployeeGroup_1""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:fadingEdge=""none""                            android:background=""#ffffff""                  android:scrollbars=""none""             android:divider=""#ffcccccc""             android:dividerHeight=""1dip""             android:layout_below=""@+id/lblGroupName_1""/&gt;                        &lt;/RelativeLayout&gt;  </code></pre><p>If I put all the Relative layout groups in a LineraLayout and then in a Scroll View the employee list shows just one item and to see others I need to scroll through individiual list. When the screen is full the scrollview start scrolling and then I cannot scroll through individual lists also, making it worse.Is there a way wherein the employee list will always show all the records instead of showing only one?  </p>","486243","","","","","2010-10-28 11:28:08","Android Creating List of Lists","<android>","2","0","1","",""
"4032893","1","","","2010-10-27 11:56:39","3","1606","<p>I want to customize the DatePicker dialog which i am using in my Android application so that it allows the user to select only the current and the future dates. Is there any way this can be done ?</p>","282826","","","","","2011-06-20 09:29:34","Restricting Previous Dates in DatePicker Dialog Android","<android>","1","0","1","",""
"4032960","1","4033005","","2010-10-27 12:06:20","46","42448","<p>How do I get the apk file from an android device? Or how do I transfer the apk file from device to system?</p>","430278","","1223693","","2013-09-01 14:02:19","2013-11-08 20:19:12","How do I get an apk file from an Android device?","<android><adb><apk>","8","0","27","",""
"4032969","1","","","2010-10-27 12:08:24","0","643","<p>I m using the followinf application ==> <a href=""http://code.google.com/p/pedometer/"" rel=""nofollow"">pedometer</a></p><p>As i run this pedometer application on my emulator it starts showing some random values ...so could you please suggest me some ways in order to run this application on android emulator!</p><p>THANK YOU</p>","478535","","478535","","2010-10-27 12:17:28","2010-10-27 13:19:32","Problems using pedometer application - http://code.google.com/p/pedometer/","<android>","1","0","","",""
"4032995","1","","","2010-10-27 12:11:19","-1","2206","<p>Hello In my android application i am trying to run a application using GPRS connection and not WIFI.When tried to run in wifi the app runs fine.The browser works fine with the APN settings set but when trying to connect to server using my application it gives me socket exception.</p><p>I am using the below permissions in manifest file.</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&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&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""&gt;&lt;/uses- permission&gt;&lt;uses-permission android:name=""android.permission.CHANGE_WIFI_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name= ""android.permission.CHANGE_NETWORK_STATE""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name= ""android.permission.WRITE_APN_SETTINGS"" &gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" &gt;&lt;/uses-permission&gt;</code></pre><p>I am receiving Socket not connected exception.Is there any other permission which i need to add for using GPRS connection other than WIFI.</p><p>Log details</p><blockquote>  <p>10-27 18:26:19.689: WARN/CalSyncSvc(166): com.motorola.blur.service.email.protocol.activesync.ASException: Problem executing HTTP POST  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendRequest(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendXMLCommandNoProvisoning(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendXMLCommand0(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendXMLCommand(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendFolderSyncCommand(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ProviderAPI.sendFolderSync(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ProviderAPI.updateMapFromFolderSync(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.service.email.protocol.activesync.ProviderAPI.updateFromFolderSync(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.calendar.sync.activesync.SyncService.syncAccount(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.calendar.sync.activesync.SyncService$QueueEntry.run(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:416)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.lang.Thread.run(Thread.java:1058)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at com.motorola.blur.util.concurrent.BlurThreadFactory$BlurPooledThread.run(Unknown Source)  10-27 18:26:19.689: WARN/CalSyncSvc(166): Caused by: java.net.SocketTimeoutException: Socket is not connected  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocket(OSNetworkSystem.java:140)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:229)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:521)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at java.net.Socket.connect(Socket.java:1019)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:317)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)  10-27 18:26:19.689: WARN/CalSyncSvc(166):     ... 17 more  Please let me know your valuable suggestions.</p></blockquote><p>Thanks in advance :)</p>","420261","","420261","","2010-10-27 13:06:51","2011-03-22 11:13:18","socket exception socket not connected android","<android>","1","2","","",""
"4033046","1","4035554","","2010-10-27 12:17:54","1","5511","<p>Have a server-socket running in an android application, which I debug using the emulator. Using the emulators console and ""redir add tcp:8888:8888"" I can make the service available to a program running on my development machine (as localhost:8888).</p><p>The redir port is however not available on any other network interface, meaning I can't access it through the host-ip on either the local development machine, or from a secondary machine on the network. Anyone know if its possible to make the emulator bind to all network interfaces, or have some other trick to enable other hosts on the network to connect to the emulator?</p><p>Thanks</p>","470553","","","","","2014-01-27 20:39:14","Android emulator access redir port from other host","<android><emulator>","3","1","2","",""
"4033087","1","4033148","","2010-10-27 12:22:23","0","489","<p>i have created a textview with the below code:</p><pre><code>&lt;TextView     android:id=""@+id/txtDescription""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:textSize=""16dip""    android:textStyle=""bold""    android:maxLines=""5""&gt;</code></pre><p>As above, i have set the 5 Lines as maximum for the textview.</p><p>But my doubt is: if the string which i am going to display in Textview if it exceeds 5 lines, then it will be fitted upto 5 lines ending with ""..."" characters.</p><p>e.g. </p><pre><code>Hello this is the demo of string which i have created especially forthe demo of textviewand setting maximum...</code></pre><p>As same as above, i want to display in TextView output.</p><p>Pls give me suggestion, code or any link.</p><p>Thanx</p>","379693","","21234","","2010-11-30 17:31:52","2010-11-30 17:31:52","TextView should be displayed with ... character at the end","<android><textview>","1","0","1","",""
"4033088","1","","","2010-10-27 12:22:37","1","6546","<p>How can I assign value to a 2-dimensional array?My array is </p><p>String[][] arr=new String[2][3];</p><p>And when I am assigning value to this array, application is stopped.</p><p>Example: arr[0][0]=""hello"";</p><p>Please give me the solution...</p>","453607","","","","","2010-10-27 12:25:41","assigning value to a 2-Dimensional array","<android><multidimensional-array>","1","1","","",""
"4033144","1","","","2010-10-27 12:29:36","1","289","<p>Good Morning (Afternoon, evening, i dunno what time it is when ur reading this .. lol but its 8:30 AM here :) )</p><p>I was yesterday in a Meetup about android programming and The presenter had a sample code about how to create an app with database access in android..</p><p>We talked about various classes, methods and so on.</p><p>Lets assume we have a table in the database called MyItem .. We create a class called MyItem.java that has the same fields (similar to object relational mapping concept).</p><p>Now the presenter created a class called MyItemList.java that goes like this</p><pre><code>package androidenthusiasts.androiddbproject;import java.util.ArrayList;// The MyList class is used to store MyItem objects in an ArrayListpublic class MyList { public ArrayList&lt;MyItem&gt; mylist; // NonParameterized Constructor - Called when class is created public MyList() {  mylist = new ArrayList&lt;MyItem&gt;(); } // AddItem method public boolean AddItem(MyItem item) {  mylist.add(item);  return true; } // GetCount method public int GetCount() {  return mylist.size(); } // getItem method public MyItem getItem(int index) {  MyItem item = null;  if (index &lt; GetCount())  {   item = mylist.get(index);  }  return item; }}</code></pre><p>This is an object that only has a list.. and all the methods implemented are in the ArrayList .. Is it a good practice to create a new object for this list? Is it better to define the ArrayList wherever you want to use it as an ArrayList? Or even more, should we create a class for MyItem that extends the ArrayList? </p><p>What do the masses of StackOVerFlow Think?</p><p>Thanks</p>","24835","","","","","2010-10-27 12:44:16","A Question about Good Practices in Android and Java Development","<java><android><optimization>","2","3","1","",""
"4033292","1","","","2010-10-27 12:42:35","4","704","<p>I have some .png files in my app. I need to load these during runtime, and get the exact colors of certain pixels from them. It's important, that I do not want to scale these pictures. I don't show them on the UI directly, they serve as maps.</p><p>Now, on Android 1.5, there's no problem with this. I put these images in the '/res/drawable' dir, load them with BitmapFactory into a Bitmap object, and use it to get the color of the desired pixels. E.g. pixel (100, 50) has the color RGB(100, 1, 100).</p><p>On Android 2.2 tho, the same procedure results varying colors (for the same pixel), so I get RGB(99, 3, 102) / RGB(101, 2, 99) / etc. for the same (100, 50) pixel. I checked the resolution of the Bitmap object, it seems that is didn't get scaled.</p><p>Could somebody explain, why I get distorted colour values?</p>","446529","","","","","2011-07-23 14:52:35","Android 2.2 distorts picture colors?","<android><image><png>","4","0","2","",""
"4033307","1","","","2010-10-27 12:43:38","1","1160","<p>i'm working on gpsprovider,If user click on a gps based applications for suppose map application it has check whether the gps provider enabled or not if not alert the user enable the gpsprovider .</p><p>There will be a Broadcast Receivier. Will define a message for requesting the service from any application. Will start service if not started. Will define a message for stating that the application no longer needs it. Will stop service if no app needs it anymore</p>","488827","","","","","2011-10-28 22:02:26","How to notify the user to enable gpsprovider","<android>","2","0","","",""
"4033410","1","4035851","","2010-10-27 12:54:51","1","1870","<p>I get the  YUV to RGB function 1&amp;2 (from stack overflow)</p><p>but the result is wrong like this <a href=""http://163.18.62.32/device.jpg"" rel=""nofollow"">http://163.18.62.32/device.jpg</a></p><p>I dont understand what's wrong in the step </p><p>my device is Moto Milestone with 2.1 update 1</p><p><strong>function 1</strong></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><strong>function 2</strong></p><pre><code>public void decodeYUV(int[] out, byte[] fg, int width, int height)  throws NullPointerException, IllegalArgumentException {int sz = width * height;if (out == null)  throw new NullPointerException(""buffer out is null"");if (out.length &lt; sz)  throw new IllegalArgumentException(""buffer out size "" + out.length          + "" &lt; minimum "" + sz);if (fg == null)  throw new NullPointerException(""buffer 'fg' is null"");if (fg.length &lt; sz)  throw new IllegalArgumentException(""buffer fg size "" + fg.length          + "" &lt; minimum "" + sz * 3 / 2);int i, j;int Y, Cr = 0, Cb = 0;for (j = 0; j &lt; height; j++) {  int pixPtr = j * width;  final int jDiv2 = j &gt;&gt; 1;  for (i = 0; i &lt; width; i++) {      Y = fg[pixPtr];      if (Y &lt; 0)          Y += 255;      if ((i &amp; 0x1) != 1) {          final int cOff = sz + jDiv2 * width + (i &gt;&gt; 1) * 2;          Cb = fg[cOff];          if (Cb &lt; 0)              Cb += 127;          else              Cb -= 128;          Cr = fg[cOff + 1];          if (Cr &lt; 0)              Cr += 127;          else              Cr -= 128;      }      int R = Y + Cr + (Cr &gt;&gt; 2) + (Cr &gt;&gt; 3) + (Cr &gt;&gt; 5);      if (R &lt; 0)          R = 0;      else if (R &gt; 255)          R = 255;      int G = Y - (Cb &gt;&gt; 2) + (Cb &gt;&gt; 4) + (Cb &gt;&gt; 5) - (Cr &gt;&gt; 1)              + (Cr &gt;&gt; 3) + (Cr &gt;&gt; 4) + (Cr &gt;&gt; 5);      if (G &lt; 0)          G = 0;      else if (G &gt; 255)          G = 255;      int B = Y + Cb + (Cb &gt;&gt; 1) + (Cb &gt;&gt; 2) + (Cb &gt;&gt; 6);      if (B &lt; 0)          B = 0;      else if (B &gt; 255)          B = 255;      out[pixPtr++] = 0xff000000 + (B &lt;&lt; 16) + (G &lt;&lt; 8) + R;  }}}</code></pre><p>and i use them like this</p><p><strong>function 1</strong></p><pre><code>int[] rgbBuf =decodeYUV420SP(_data,height,width);</code></pre><p><strong>function 2</strong></p><pre><code>int[] rgbBuf = new int[height*width];decodeYUV(rgbBuf,_height,.width);</code></pre><p>than convert to Bitmap and show on</p><pre><code>Bitmap bm = Bitmap.createBitmap(rgbBuf,width,height);View01.setImageBitmap(bm);</code></pre>","235473","","127880","","2011-07-14 21:53:34","2011-07-15 07:42:41","YUV decode function error or hardware problem?","<android><graph><yuv>","2","0","","",""
"4033685","1","","","2010-10-27 13:21:18","0","267","<p>I want to get the displayed name, id the label, that is associated with a android account.</p><p>For instance, when you create a new contact, you have to precise the type of the account and to do so, you can pick up one of the account that enable contact synchronisation, or the 'telephone' type.</p><p>I have search thru the AccountManager, ContactsContract.Settings and SyncAdapterType but cannot find this label.</p><p>thanks a lot</p>","487811","","","","","2010-10-28 15:18:17","how to get the label associated with an android account?","<android><account>","1","0","","",""
"4033754","1","4035379","","2010-10-27 13:27:54","0","152","<p>So started recently experimenting with the Android SDK and eclipse IDE and during this time I have found it very hard for various reasons to develop applications the main ones being</p><p>Poor emulator makes it hard to see your applications current state as its slow and buggy and often takes an age to load up.</p><p>Steep learning curve for xml based views and lack of consistency in application architecture.</p><p>Lack of support for dynamic web based applications </p><p>I have no experience of iPhone development but how does this compare and does this relate to the better quality of apps on the iPhone</p>","445350","","","","","2010-10-27 16:20:51","App quality Android vs IPhone ? The Reasons behind it?","<java><android><android-emulator>","1","0","","",""
"4033877","1","4034292","","2010-10-27 13:40:52","0","1218","<p>I am trying to implement asynchronus http client for Android and I am haveing a trouble with type mismatch:</p><pre><code>The method execute(HttpUriRequest) in the type HttpClient is not applicable for the arguments (HttpRequest)    </code></pre><p>I am doing all based on this tutorial: <a href=""http://blog.androgames.net/12/retrieving-data-asynchronously/"" rel=""nofollow"">http://blog.androgames.net/12/retrieving-data-asynchronously/</a></p><p>Have found a type in AsynchronousSender - private HttpRequest request; but I have still problem with above which occurs in:</p><pre><code>public void run() {    try {        final HttpResponse response;        synchronized (httpClient) {            response = getClient().execute(request); //&lt;-- here is that problem        }        // process response        wrapper.setResponse(response);        handler.post(wrapper);    } catch (ClientProtocolException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }}</code></pre><p>Can you suggest anything ?</p><p>cheers,/Marcin</p>","193400","","","","","2010-10-27 14:22:50","Android asynchronus HTTP client problem","<android><asynchronous><httpresponse>","1","0","","",""
"4034205","1","","","2010-10-27 14:13:46","0","304","<p>I would like to know what is the best and fastest way to exchange data between services. I have been trying to bind one service to another using <code>ServiceConnection</code> but the actual connection never happened. Also I did not saw anything strange in LogCat.</p><p>Thanks in advance for all your replies. </p>","1205130","","","","","2010-10-27 14:30:30","How to exchange data between Android services","<android><service>","1","0","","",""
"4034224","1","4034287","","2010-10-27 14:16:03","0","436","<p>How to start an Android application when the phone boots up? I have done this previously using a <strong>BroadcastReceiver</strong> with the <strong>BOOT_COMPLETED</strong> intent. Are there any alternative ways to accomplish the same?</p>","421372","","421372","","2010-10-27 14:34:40","2010-10-27 14:34:40","How to start an Android application when the phone boots up?","<android><boot>","1","0","","",""
"4034303","1","4257800","","2010-10-27 14:24:06","2","858","<p>I have a button.The button is constructed from the StateListDrawable (made of 3 9-patch images).I need to add an extra drawable that will reside on the button's right side, and i need it to be aligned with the button's right side.I tried to use the following:</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 android:drawable=""@drawable/blue_back_button_drawable"" /&gt;    &lt;item&gt;      &lt;bitmap android:src=""@drawable/filter_by_button_v_mark"" android:gravity=""right""/&gt;    &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>it didn't work and the V image is indeed aligned right but it has a diff from the button's right side. here's a snapshot: <img src=""http://i.stack.imgur.com/UktI0.png"" alt=""alt text""></p><p>I want the image to be aligned with the button's left, the only way right now i think i can do it is:</p><ol><li>inherit button, in onLayout AFTER the width has been set get the right edge.</li><li>get the background drawable (layerDrawable)</li><li>calc the button's width minus the v image width and set it as left margin in the drawable.</li></ol><p>I should not mention this sounds horrid :-) i hoped there's a better way. Oh the reason it's not part of the image is that i need to know it's width so i can calc the text padding so it wont be hidden by the button's text and because it's not so nice looking as a 9-patch.</p>","312288","","","","","2010-11-23 15:38:44","Android Layer_Drawable as a button","<android><image><alignment><drawable>","1","1","1","",""
"4034356","1","","","2010-10-27 14:28:48","0","535","<p>I need to get the latitude and longitude from the GPS and I got a tutorial regarding this but it is not showing me any results and its onLocationChanged method is not working.</p><p>I have also given the permission in the manifest file, but it's still not working.</p><p>Here is the link, kindly tell me if anybody can have any idea about:</p><p><a href=""http://hejp.co.uk/android/android-gps-example/"" rel=""nofollow"">http://hejp.co.uk/android/android-gps-example/</a></p><p>I'd be really thankful.</p>","397901","","441574","","2012-02-21 16:00:39","2012-02-21 16:00:39","Android GPS not giving any values of Latitude and longitude","<android><gps>","0","7","","",""
"4034451","1","","","2010-10-27 14:39:06","0","836","<p>I hear that to access permission like:- READ_FRAME_BUFFER</p><p>The app needs to be signed with system key.If I understand correctly, that means the manufacturer sign the .apk file.</p><p>Question:- Is it required that the manufacturer signed .apk to be shipped with a system image?  or can it still be downloaded in the market place?- In real life, after manufacture creates genetic ROM, it is the network provider (eg. Rogers, AT&amp;T) who does little modification to the ROM. Then, who really has the </p>","432056","","","","","2010-10-27 20:17:49","Android: Signing my application with system key","<android><permissions><system><key>","1","0","","",""
"4034504","1","","","2010-10-27 14:45:58","1","558","<p>Given a multi-line EditText, how can I know the line number at cursor position?</p>","62192","","","","","2012-02-21 18:00:14","How to get a line number under cursor","<android><cursor-position>","3","1","","",""
"4034532","1","4035778","","2010-10-27 14:49:05","0","760","<p>I am trying to stream mp3 stream from my local http server indeed hosted on my phone to android media player.When local server gets the new socket , it starts writing some http headers followed by mp3 stream. but mediaplayer socket is throwing ""Broken pipe"" exception.Wat may be the issue causing this.</p><p>Thanks in advance </p>","196579","","","","","2012-05-16 08:04:36","Broken Pipe exception when tried to stream mp3 stream from local server to android mediaplayer","<android><android-emulator>","1","0","","",""
"4034558","1","4038085","","2010-10-27 14:51:28","8","3394","<p>I am planning to do an app on all Mobile Platform. I found Phone gap is a solution for write once deploy anywhere. </p><p>The app just have to talk to a webservice and display information in a grid layout grouped under categories.</p><p>Anyone who has developed apps in phone gap can share your views and thoughts on this.</p><p>Does phone gap really serve this purpose? - Write once and deploy any?</p><p>Will the look and feel be the same in Android, iphone etc. (these are 2 platforms I am most interested on.)</p><p>How about the performance on different platforms ?What are the other blocks I might hit down the road?</p><p>Thank you all in Advance..</p>","284606","","284606","","2011-01-30 13:35:18","2011-09-28 03:29:48","How advantageous is PhoneGap?","<iphone><android><cross-platform><phonegap>","4","0","8","",""
"4034610","1","","","2010-10-27 14:56:32","2","1106","<p>I'm using xml file to define progress bar.I defined padding on background shape. But this setting will be sometimes displayed correctly, sometimes not.So If I start my application or Activity with progressbar inside, there will be correctly displayed progressbar with background and 'padded' progress. Then I close my application and start it again, and, progressbar is displayed without padded background, on next start will be displayed correctly and son on ...  Could you please advice possible reasons for this?</p><p>xml file:    </p><pre><code>&lt;item android:id=""@android:id/background"" &gt;    &lt;shape&gt;        &lt;corners android:radius=""15dip"" /&gt;        &lt;padding                android:left=""1dp""                android:top=""6dp""                android:right=""1dp""                android:bottom=""6dp""         /&gt;        &lt;solid                android:color=""#00000000"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item android:id=""@android:id/progress"" &gt;    &lt;clip android:clipOrientation=""horizontal"" android:gravity=""left"" &gt;        &lt;shape            xmlns:android=""http://schemas.android.com/apk/res/android""            android:shape=""rectangle""&gt;            &lt;corners android:radius=""15dip"" /&gt;            &lt;stroke             android:width=""1px""             android:color=""#ffffffff""             android:dashWidth=""2px""             android:dashGap=""0px""/&gt;            &lt;solid                android:color=""#ff0000ff"" /&gt;        &lt;/shape&gt;    &lt;/clip&gt;&lt;/item&gt; </code></pre><p>    </p>","488991","","","","","2010-10-28 12:13:57","Padding on Shape in Progressbar","<java><android>","1","0","","",""
"4034700","1","","","2010-10-27 15:05:29","1","2287","<p>i am new to android development.currently i am facing a problem while inserting/retrieving image to sqlite database using android.</p><p>//code for inserting imageInputStream in = OpenHttpConnection(imgurl);</p><p>byte[] bb = new byte[in.available()];</p><p>in.read(bb);//here the length of bb is 2040</p><p>//update query</p><p>myDataBase.execSQL(""Update Product SET Image='""+bb+""' Where CatPID='""+pcpid+""'"");</p><p>//function OpenHttpConnectionprivate InputStream OpenHttpConnection(String urlString)     throws IOException    {        InputStream in = null;        int response = -1;</p><pre><code>    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>//code for retrieve image from database</p><p>byte[] bb = cursor.getBlob(cursor.getColumnIndex(""Image""));//here length is only 12</p><p>ByteArrayInputStream imageStream = new ByteArrayInputStream(bb);</p><p>Bitmap theImage = BitmapFactory.decodeStream(imageStream);</p><p>img.setImageBitmap(theImage);</p><p>but no image is shown.Log shows ""Factory returned null""</p><p>can anyone help me to find out where i am wrong and provide me code snippet of a working solution?</p><p>thanks in advance</p>","466847","","","","","2010-10-27 16:00:05","problem on inserting&retrieve image data in sqlite database using android","<android><sqlite>","1","0","","",""
"4034965","1","","","2010-10-27 15:34:48","0","503","<p>I've run the HelloWorld without problem, but the GridView will not work.The Sample_0, Sample_1, etc icons are not visible in the R class within the ImageAdapter file.They ARE visible within the main class.</p><p>Going back to the HelloWorld example, I noticed there is an 'icon' in each drawable for three resolutions.So as a test, I created a new class to access it, ( and yes I did import android.R)Sadly, the R class does not refer to icon.png.</p><p>The only place where R.drawable.icon exists is in the main class.</p><p>Why does my R class (which is correctly generated with a reference to icon.png) not seem to be the same in a new java class file?</p><p>Help!Jurimo</p>","489039","","489039","","2010-10-27 15:46:15","2010-10-27 18:41:49","Android: GridView ImageAdapter can't refer to R.drawable icons - They are missing ","<android><gridview>","1","2","","",""
"4035005","1","","","2010-10-27 15:37:51","0","593","<p>I'm using MapView in my app. I have API key from google fore my release key store.</p><p>I'exporting signed APK with eclipse and trying to install it on devices.</p><p>On G1 device with Android 1.6 everything works well, but on HTC Desire with android 2.2 maps doesn't appear. I see just grey grid and zoom controls.</p><p>Where problem can be?</p><p>Please help!</p><p>Thanks</p>","564272","","27727","","2010-10-27 15:48:23","2010-10-27 16:27:37","Google map API key on diferent android devices","<android><android-mapview><api-key>","1","0","","",""
"4035098","1","4035270","","2010-10-27 15:49:24","2","3407","<p>I want call the function startActivity in two ways:</p><p><strong>First (It works):</strong></p><pre><code>        public class HelloWorld extends Activity{        public boolean onOptionsItemSelected(MenuItem item) {            if(item.getItemId() == 1){                startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(""tel:660718109"")));            }            else {                return super.onOptionsItemSelected(item);            }            return true;}</code></pre><p><strong>Second:</strong>in HelloActivity.java</p><pre><code>    public class HelloWorld extends Activity {    public boolean onOptionsItemSelected(MenuItem item) {        if(item.getItemId() == 1){            IntentsUtils.tryOneOfThese(this);        }        else {            return super.onOptionsItemSelected(item);        }        return true;}</code></pre><p>in IntentsUtils.java</p><pre><code>public class IntentsUtils{   public static void tryOneOfThese(Activity activity)   {       IntentsUtils.call(activity);   }   public static void call(Activity activity)   {      Intent intent = new Intent(Intent.ACTION_CALL);      intent.setData(Uri.parse(""tel:5555555555""));      Log.v(""MyLogs"", ""It's works!"");      activity.startActivity(intent);   }}</code></pre><p>The second way doesn't work - I have a error in aplication when I clicked on position in menu. I know function ""call"" in IntentsUtils work because analise logs in ""LogCat""</p><p>This is my logs from LogCat:android.permission.CALL_PHONE</p><p>android.permission.CALL_PHONE> 10-27 16:10:56.702:</p><blockquote>  <p>WARN/ActivityManager(52): Permission  Denial: starting Intent {  act=android.intent.action.CALL  dat=tel:5555555555 flg=0x10000000  cmp=com.android.phone/.OutgoingCallBroadcaster  } from ProcessRecord{43dbf4b8  363:com.androidbook/10025} (pid=363,  uid=10025) requires  android.permission.CALL_PHONE</p>    <p>10-27 16:10:56.722:  WARN/dalvikvm(363): threadid=3: thread  exiting with uncaught exception  (group=0x4001b188)</p>    <p>10-27 16:10:56.722:  ERROR/AndroidRuntime(363): Uncaught  handler: thread main exiting due to  uncaught exception</p>    <p>10-27 16:10:56.752:  ERROR/AndroidRuntime(363):  java.lang.SecurityException:  Permission Denial: starting Intent {  act=android.intent.action.CALL  dat=tel:5555555555 flg=0x10000000  cmp=com.android.phone/.OutgoingCallBroadcaster  } from ProcessRecord{43dbf4b8  363:com.androidbook/10025} (pid=363,  uid=10025) requires  android.permission.CALL_PHONEandroid.permission.CALL_PHONE</p></blockquote><p>Thanks in advance,Michael</p>","489027","","489027","","2010-10-27 16:28:21","2010-10-27 16:29:15","Calling the function ""startActivity"" in other class and file doesn't work","<android><activity>","2","1","","",""
"4035114","1","4035297","","2010-10-27 15:51:36","1","1945","<p>I am new in android development, and I need advice about structure.I want to develop Tic tac toe game, and <strong>have 3 images</strong>: 1 - 3×3 grid 2 - circle 3- cross.</p><p><strong>My idea:</strong>I need some layout with background image(3×3 grid) and table 3 x 3 with ImageViews, after clicking on some position we load image(circle or cross) in our table.</p><p><strong>Questions:</strong></p><p>-First of all is my idea correct?</p><p>-I tried to set background with <code>view.setBackgroundResource(res)</code> but it looks not very good, grid(black colour) loading with background colour black ant is difficult to see something.</p><p><strong>UPDATE</strong>: I found Tic tac toe game example in android sdk, ..\samples\android-8, maybe it helps to somebody</p><p><strong>UPDATE</strong>: The best solutin is to use SurfaceView</p><p><strong>update:</strong> If any body need it <a href=""https://andoid-tictactoe.googlecode.com/"" rel=""nofollow"">https://andoid-tictactoe.googlecode.com/</a></p>","278279","","179850","","2011-12-08 21:22:48","2013-04-22 05:36:21","Android : Tic tac toe game, need advice about structure","<android>","2","0","0","",""
"4035142","1","","","2010-10-27 15:54:51","13","35988","<p>Using Eclipse on win XP. I've previously created an app or 2, but am now working on the 'real' version and get the above error.</p><p>I was having funnies creating a 1.5 version, so have started a new project for 2.1.</p><pre><code>package xxx.guest;import android.R;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.os.Bundle;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;import android.widget.TextView;public class briefme extends Activity { private String strURL;           ........           ........  @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main ); </code></pre><p>Project as below (note I've removed some names for confidentiality reasons!)</p><p>Any ideas what's gone wrong?</p><p>Thanks,</p><p>Martin.</p><p><a href=""http://it-helps.co.uk/eclipse_err.jpg"">Project screenshot here</a></p>","1885069","","289182","","2011-11-22 23:29:34","2013-11-24 07:20:59","R.layout.main cannot be resolved","<eclipse><android>","7","0","3","",""
"4035223","1","4035634","","2010-10-27 16:03:43","0","157","<p>i am trying to get the text input/values from an EditText widget as its being typed. please anybody know how or which method i should use? can't seem to find one that will help. thanks for your consideration.</p><p>i tried this but not working: </p><pre><code>  Entry = (EditText)findViewById(R.id.typeEntryId);          viewEntry = (TextView)findViewById(R.id.viewEntryId);       if(Entry != null){            //viewEntry.setText(Entry.getEditableText().toString());                  viewEntry.setText(Entry.getText().toString());        }</code></pre>","316843","","316843","","2010-10-27 16:45:14","2011-01-06 18:09:40","getting text dynamically from EditableText android","<android>","2","0","","",""
"4035239","1","4035797","","2010-10-27 16:06:31","4","4504","<p>I am developing Android Web App using JSP with xml parsing. I developed it in Java using Tomcat Server but I couldn't develop in Android. I am new to the web app development. So can anyone kindly suggest me how to proceed further...</p><p>waiting for a response guys...Thank you</p>","489068","","203907","","2010-10-27 17:10:46","2013-06-24 05:45:51","Can we use Tomcat Server in android app","<android><xml><jsp>","5","0","1","",""
"4035347","1","","","2010-10-27 16:17:21","13","3677","<p>I need to place built-in zoom controls of MapView into position different from the default position. While it's easy to do using getZoomControls() method, this method is deprecated in recent API versions. </p><p>Does anyone has idea how to do this <strong>without</strong> calling getZoomControls()?</p>","209310","","73488","","2011-10-16 10:51:17","2014-04-07 12:39:27","How to reposition built-in zoom controls in MapView?","<android><android-mapview>","2","1","10","",""
"4035362","1","","","2010-10-27 16:18:43","0","662","<p>I have a big question. There are an application, which contain the following method:socket(AF_INET, SOCK_STREAM, 0);The socket return 29 and I don't see the port in the terminal (netstat).<p>I use this method in Android-ndk and I use the INTERNET permission in the Android Manifest file.<p>What is the problem in the method?</p><p>Thanks</p>","311146","","","","","2010-10-27 16:31:01","C socket() problem","<android><c>","3","1","","",""
"4035385","1","4035500","","2010-10-27 16:21:57","3","5146","<p>If I change one <code>ImageView</code>'s source to another, (and thus changing the Image) but then have more changes occur within the method and such.  How can I force it to refresh to show the changes before the method ends?  (As waiting for the method to end to show the changed images is not good for my purposes at all)</p>","487645","","900435","","2012-03-15 02:27:25","2012-07-25 09:47:22","How do I refresh the Screen before a method ends in droid?","<android><refresh><validation>","1","0","","",""
"4035410","1","4035764","","2010-10-27 16:24:03","1","924","<p>Is there a way to access and alter the settings of the standard Android browser programmatically?</p>","19601","","","","","2010-10-27 17:07:10","How to access the Android browser settings via code","<android><browser>","1","2","","",""
"4035465","1","4036050","","2010-10-27 16:30:29","15","15934","<p>If I set a radio button to be selected on the first time, it works fine. But if I unselect it by calling      ((RadioButton) findViewById(R.id.ID)).setChecked(false);then, later even if I try to make it selected by calling setChecked(true) will not work unless the user select it from the screen.</p><p>Have any one come across this? or is it only me?</p><pre><code>        if(Val != null){        if( ((RadioButton) findViewById(R.id.ID1)).getText().toString().trim().equals(Val))        ((RadioButton) findViewById(R.id.ID1)).setChecked(true);        else if(((RadioButton) findViewById(R.id.ID2)).getText().toString().trim().equals(Val))        ((RadioButton) findViewById(R.id.ID2)).setChecked(true);        }        else {            ((RadioButton) findViewById(R.id.ID1)).setChecked(false);            ((RadioButton) findViewById(R.id.ID2)).setChecked(false);        }</code></pre><p>If the else part is executed atleast once then everything gets mess up.When I step thro my debugger, I can see the execution goes in the correct path and setting it to true. It is getting executed only once, I checked that. And I am not resetting it back to false in any other part of the code.</p>","284606","","284606","","2013-06-07 14:03:14","2013-09-15 10:06:36","Android RadioButton not able to set using setChecked(false) method","<android><radio-button><uncheck>","2","4","5","",""
"4035529","1","","","2010-10-27 16:39:00","0","464","<p>I need to add 'balloon'- like markers to my map view. The difficult thing here - these markers  include a variable-length text labels so these balloons have variable sizes. Actually this is exactly what implemented in native google-maps application to show labels. Any idea what is optimal  way to do this?</p>","209310","","","","","2011-06-14 19:15:57","Adding variable-size labels on top of MapView","<android><android-mapview><android-maps>","2","0","","",""
"4035603","1","4037389","","2010-10-27 16:49:01","2","2795","<p>I tried</p><pre><code>btn.click();</code></pre><p>And the error message is 'Cannot call property click in object ti.modules.titanium.ui.ButtonProxy@44f61.  It is not a function, it is ""object""'</p>","46076","","46076","","2010-10-27 16:56:30","2010-10-27 20:26:58","In Titanium how do I execute a button click event from code?","<iphone><android><titanium>","2","0","","",""
"4035644","1","4035808","","2010-10-27 16:52:50","8","1613","<p>I'm trying to access this list of public twitts here,<br>from an android application through a HttpClient:  </p><p><strong><a href=""http://api.twitter.com/1/statuses/public_timeline.json"">http://api.twitter.com/1/statuses/public_timeline.json</a><a href=""http://api.twitter.com/1/statuses/public_timeline.json""></a></strong>  </p><p>I keep getting an Exception when connecting:  </p><pre><code>java.net.UnknownHostException: api.twitter.com</code></pre><p>Why is this happening?<br>How can I fix this?  </p><p>Thank you</p>","243376","","","","","2012-04-25 16:51:00","UnknownHostException when accessing api.twitter.com","<android><exception><twitter><httpclient>","1","0","","",""
"4035853","1","4038346","","2010-10-27 17:17:52","1","974","<p>I am trying to design an activity in Android which consist in a ListView with a button to add items to the List.</p><p>When the button is clicked, it opens a chain of Dialogs to configure the new item (each Dialog configures one attribute of the item Object). When the last Dialog is validated, the item is added to the list.</p><p>I was thinking of creating a new item Object when the first Dialog opens and using a setXXX() method on each Dialog validation to configure the object, but how am I supposed to pass the object from one Dialog to another?</p><p>I got it working using final objects, but it doesn't look clean to me at all. Plus I would have liked to use the activity Dialog manager methods such as onCreateDialog() and showDialog() to manage the Dialogs.</p><p>What is the cleanest way to do this?</p><p>Thank you!nbarraille</p>","488054","","","","","2010-10-27 22:47:14","Android: How to pass objects from Dialog to Dialog","<android><dialog>","1","1","","",""
"4035936","1","4047219","","2010-10-27 17:28:33","0","645","<p>I'm in the middle of implementing themes for my application right now, and everything's been going really smooth until as of late. I've been using the android:background=""?thin_border"" tag to provide a background for linearlayouts with items that I want visually grouped together. The problem I'm running into is when I try to use this tag in an xml with a custom class as one of the elements, and try to add this background tag.</p><p>I've got an xml file that looks generally like so:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.atraudes.CustomLayout1 xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""    android:layout_gravity=""fill_vertical""&gt;    &lt;LinearLayout android:orientation=""vertical""         android:layout_height=""fill_parent""        android:layout_weight=""0""         android:background=""?thin_border""         android:layout_width=""wrap_content"" /&gt;    ...&lt;/com.atraudes.CustomLayout1&gt;</code></pre><p>and the custom class has two constructors:</p><pre><code>public class CustomLayout1 extends LinearLayout {    public CustomLayout1(Context context, AttributeSet attrs) {        super(context, attrs);    }    public CustomLayout1(Context context) {        super(context);    }    ...}</code></pre><p>with some other functions that store values, manipulate the data, etc. The custom layout class is only ever called directly in the xml, and the xml is inflated like so:</p><pre><code>LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);v = (CustomLayout1) inflater.inflate(R.layout.customlayout1, null);</code></pre><p>The problem I'm running into is that I'm getting these error messages:</p><pre><code>10-27 17:13:15.312: ERROR/AndroidRuntime(4281): Uncaught handler: thread main exiting due to uncaught exception10-27 17:13:15.351: ERROR/AndroidRuntime(4281): android.view.InflateException: Binary XML file line #7: Error inflating class java.lang.reflect.Constructor10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at com.atraudes.CustomListAdapter.getView(CustomListAdapter.java:97)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.AbsListView.obtainView(AbsListView.java:1269)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.ListView.makeAndAddView(ListView.java:1623)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.ListView.fillDown(ListView.java:607)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.ListView.fillFromTop(ListView.java:664)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.ListView.layoutChildren(ListView.java:1481)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.Gallery.setUpChild(Gallery.java:813)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.Gallery.makeAndAddView(Gallery.java:757)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.Gallery.layout(Gallery.java:627)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.Gallery.onLayout(Gallery.java:339)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.layout(View.java:6133)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.ViewRoot.performTraversals(ViewRoot.java:929)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.os.Handler.dispatchMessage(Handler.java:99)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.os.Looper.loop(Looper.java:123)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.app.ActivityThread.main(ActivityThread.java:3948)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at java.lang.reflect.Method.invokeNative(Native Method)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at java.lang.reflect.Method.invoke(Method.java:521)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at dalvik.system.NativeStart.main(Native Method)10-27 17:13:15.351: ERROR/AndroidRuntime(4281): Caused by: java.lang.reflect.InvocationTargetException10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:92)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at java.lang.reflect.Constructor.constructNative(Native Method)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     ... 48 more10-27 17:13:15.351: ERROR/AndroidRuntime(4281): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/divider_horizontal_dark.9.png from drawable resource ID #0x010-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.content.res.Resources.loadDrawable(Resources.java:1641)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.&lt;init&gt;(View.java:1725)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.View.&lt;init&gt;(View.java:1674)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:271)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     ... 52 more10-27 17:13:15.351: ERROR/AndroidRuntime(4281): Caused by: java.io.FileNotFoundException: res/drawable/divider_horizontal_dark.9.png10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.content.res.AssetManager.openNonAssetNative(Native Method)10-27 17:13:15.351: ERROR/AndroidRuntime(4281):     at android.c</code></pre><p>The error seems to be caused by the android:background=""?thin_border"" tag. If I remove it from the layout, it inflates fine, and the program continues on. As soon as I add it back in, I get these errors and the program stops.</p><p>I would be incredibly grateful of any input you might have. Thank you!</p>","443659","","","","","2010-10-28 21:15:12","Tag that references current theme in xml causes force close","<android>","2","2","","",""
"4035971","1","","","2010-10-27 17:33:45","0","831","<p>I have a simple, classic, statement that every 200 milliseconds plays a sound (a metronome).</p><p>I wrote it using Handlers, and then in another way, using Threads.The problem is the same in both ways: when I press hardware home button, or also simply when I press a button to open a ListView, the metronome terribly slowdown for a while. </p><p>This problem (not so strong, but however present) presents also doing nothing and leaving the application in foreground.</p><p>Any ideas? </p><p>Here's the code:</p><p>public class Metronome implements Runnable{</p><pre><code>private Handler mHandler = new Handler();public static long mStartTime;Main mainContext; public Metronomo(Main context) {    mainContext = context;}public void play() {    mStartTime = System.currentTimeMillis();    mHandler.postDelayed(this, 100);}public final void stop(){    mHandler.removeCallbacks(this);}public void run(){        //play the ogg file in position 1        mSoundManager.playSound(1);        //reschedule the next playing after 200ms        mHandler.postAtTime(this, SystemClock.uptimeMillis() + 200);   }</code></pre><p>};</p>","489146","","489146","","2010-11-04 10:03:43","2010-11-04 10:03:43","Metronome Timer slowdown (via Handler, or Threads too)","<android><timer><real-time><slowdown>","2","1","","",""
"4036142","1","","","2010-10-27 17:53:42","0","727","<p>So I have the App User store images from my App to a folder that I programmatically created in the Android phone.</p><p>Say the path is /sdcard/mnt/Android/data/mypackage/images</p><p>To navigate to that folder and view what they saved in there I want to create a button in my app that will help them navigate to that folder with absolute path to view what are the contents of the folder. Is that possible, if yes, please give me some hints.</p><p>Thanks for any help stackoverflowers...you guys rock!!</p>","447886","","","","","2010-10-27 17:53:42","Open folder navigation when button clicked in Android App?","<java><android><folderbrowserdialog>","0","7","","",""
"4036250","1","","","2010-10-27 18:06:09","4","4668","<p>i am trying to get the following code to work on an androind 2.1 phone (HTC Sense UI):</p><pre><code>h1 {    font-size: 14px;    font-weight: bold;    color: #FFF;    white-space: nowrap;    text-overflow: ellipsis;    overflow: hidden;   }</code></pre><p>however, the text-overflow property does not seem to work. has anybody else had this problem, or found a way to work around it?</p>","489188","","31671","","2012-05-29 00:36:49","2012-10-05 13:57:15","android/webkit text-overflow: ellipsis not working","<android><css><webkit>","2","0","1","",""
"4036419","1","4037264","","2010-10-27 18:26:04","2","402","<p>I've recently begun experimenting with a mediaPlayer instance in my Android app.  I implemented a couple different beeps for feedback to the user.  Now, when I implemented an audioTrack (for a completely different purpose), I discovered that it pretty much sets itself up as a separate thread automatically (as far as I can tell).  It certainly appears as a separate thread when I run my code in the debugger:     Thread [&lt;17> AudioTrackThread] (Running)</p><p>My question is: Does mediaPlayer do something similar?  My first guess is that it does not -- or I would see thread descriptions in the debugger, right??</p><p>Anyway, now I've got to questions:1)  Can I set up my mediaPlayers as separate threads and still have them work right?2)  Does it make sense even to try it?</p><p>Thanks,R.</p>","453989","","","","","2010-10-27 20:12:34","Does it make sense to set up mediaPlayer to run in a separate thread in Android?","<android><multithreading><media-player>","1","1","","",""
"4036440","1","4036730","","2010-10-27 18:28:21","0","609","<p>I need display data from a web page in a ListView, for example if I were to send a request to a time server for the U.S. time zone's times and the web server responded with an HTML web page that contained the current time's of each zone and a small icon image of each geographic region time zone, what steps would I need to take to put that data into a ListView?</p><p>For example, if I use http to communicate with the time server, it will respond with an http response, will I have to somehow extract the HTML from the response and find the image of the geographic region as well as the text for the current time?  Is there a better way to do something like this?</p>","487840","","","","","2010-10-27 20:51:19","Displaying Web data, not web page, in Android","<html><android><http><listview>","2","0","","",""
"4036492","1","","","2010-10-27 18:34:57","6","5919","<p>i have a spinner with an arrayadapter that is dynamically managed.  when it gets displayed, the spinner text also displays the radio button.  how do i get rid of this radio button?  the drop down arrow is all strecthed and yucky... thats my problem.NOTE: i'm not talking about the radio buttons that appear in the list that is displayed when i select the drop down on the spinner.</p><p>here are the appropriate code snippet... couple of points:</p><ul><li>this code is in the constructor of widget which is a subclass of Spinner</li><li>value is an array of Object instances (passed when the widget gets created)</li><li>there are no XML resources; all widgets are dynamically created</li><li>thinking i need to ""manipulate"" the prompt, i added setPrompt(...) in the constructor and also in the onitemclicked event listener... this had no effect.</li></ul><p>Q: what am i missing?  seems to me i'm missing some attribute of the Spinner which is causing the radio button to also display in the text part of the spinner.</p><p>-- snip code -- </p><pre><code>public class ChoiceGroupImpl extends Spinner implements OnItemSelectedListener {    public ChoiceGroupImpl(Activity activity, WidgetContainer container, Value widget, AttributeImpl attributes, Object[] value, int selected) {...        adapter = new ArrayAdapter&lt;CharSequence&gt;(activity, R.layout.simple_spinner_dropdown_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        for (int i = 0; i &lt; value.length; i++)            adapter.add(value[i].toString());        if (attributes.isReadonly())            setEnabled(false);        setAdapter(adapter);        setSelection(selected);        setPrompt(adapter.getItem(selected));        setOnItemSelectedListener(this);...}    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {        setPrompt(adapter.getItem(position));        ((ToolkitImpl) Toolkit.getInstance()).hiddenCommand(container, ""SelectionChanged"");    }...</code></pre><p>-- end snip code --</p>","489216","","705210","","2011-06-22 08:56:26","2012-10-21 09:33:27","why does my android spinner display the radio button in the textview?","<android><button><spinner><radio>","2","1","","",""
"4036494","1","4091274","","2010-10-27 18:35:10","2","1738","<p>It might sound a little odd but I am in the final phases of finishing up my app that would pay users. </p><p>There is an activity in the app where as and when the users use the app, money keeps accruing. I have a button in that activity called Cash Out which when the user reaches a certain amount can be clicked and is supposed to let the users take the money accrued from the app. </p><p>I have contacted Google Checkout and Paypal so far and Paypal suggested personal payments can be integrated in my case and sent me the Paypal for Android API doc. The doc itself is very useful but does not describe this kind of a scenario that I am looking for. Any clues how to integrate such a functionality. I appreciate anyone willing to help me out.</p>","447886","","","","","2011-07-19 20:07:30","How can I integrate Paypal to payout users when a button is clicked?","<java><android><paypal><google-checkout>","1","0","2","",""
"4036530","1","4036551","","2010-10-27 18:41:22","1","259","<p>I added a table to a database that my application uses and wrote some code to work with that table. Everything worked fine for my on my phone and in the emulator, so I sent the update to the market.</p><p>This cause me to receive quite a few stack traces in the developers console cause by</p><pre><code>android.database.sqlite.SQLiteException: no such table: flag</code></pre><p>(flag is the new table).</p><p>This got me to wondering, are databases deleted when the application is updated? Presently in my application I am looking to see if the database exists, and if it does then I don't recreate it.</p><p>I didn't catch this before I sent out the update because I uninstalled the application before uploading the debug version.</p><p>I've since rolled out a quick update that has a try catch blocks around all accesses to the new table(which should have been there in the first place, I know, I know).</p>","192549","","","","","2011-01-24 15:24:07","Are databases deleted when an application is updated?","<android><database><google-play>","2","0","","",""
"4036572","1","4036622","","2010-10-27 18:46:20","1","1058","<p>In the AVD manager for Android in Eclipse I can specify the size of the SD card storage, the ""skin"", the screen resolution, and certain hardware specs.</p><p>But what if I wanted to make something that specifically resembled a particular phone, say the Droid Incredible?   Then I'd also need to have a row of little buttons below the screen for Home, Menu, Back and Search.    Is there a step-by-step document describing how to configure/customize an AVD to that level of detail?</p><p>Thanks in advance.  </p>","424690","","","","","2010-10-27 18:52:25","Android/Eclipse: Configuring a custom AVD?","<android><android-emulator>","1","0","","",""
"4036586","1","4036926","","2010-10-27 18:48:26","0","149","<p>I have a bunch of code in Surround SCM, which I would like to get into a workspace in Eclipse. I will need to be able to work off of two branches. One for bug fixes, and one for new features, which can then be merged into my main branch. What is the best way to do this?</p>","413414","","","","","2010-10-27 19:28:30","Surround SCM integration with Eclipse for Android project","<android><surroundscm>","1","0","","",""
"4036676","1","","","2010-10-27 19:00:21","9","2110","<p>I'm having a problem with my <code>ListView</code> (using <code>CursorAdapte</code>r).  When I call <code>getListView().getLastVisiblePosition()</code> I am receiving <code>-1</code>.  This is a problem since my list is populated with items.  Additionally, <code>getListView().getFirstVisiblePosition()</code> always returns 0, no matter where I am scrolled on the list.  Any ideas?</p><p>It has something to do with startManagingCursor</p><pre><code>    @Override    public void changeCursor(Cursor cursor) {        super.changeCursor(cursor);        MyActivity.this.mCursor = cursor;        //startManagingCursor(MyActivity.this.mCursor);    }</code></pre><p>If I comment out startManagingCursor, everything works fine.  I've also tried adding <code>stopManagingCursor()</code> before changing the <code>Cursor</code> and still have the same problem.</p>","406790","","557179","","2011-07-28 03:17:47","2012-04-10 07:09:30","getLastVisiblePosition returning -1","<android><listview><cursor>","3","2","","",""
"4036738","1","4037088","","2010-10-27 19:07:44","0","336","<p>I'm writing a bitmap editor. Each document consists of about 3 bitmap layers and documents are, at the moment, saved as a custom file with a .bme extension. These files can be converted to standard jpg/png files by rendering each bitmap on top of one bitmap and saving the latter.</p><p>I need some way for the user to be able to select .bme files they've created already. Is there anything in Android that can make this easier for me?</p><p>The only option I can see is to write an activity that creates a list view and write a list adapter that looks for .bme files on disk i.e. a copy of the standard ""Media Gallery"" app that works for my .bme files. The list adapter will either have to generate a thumbnail preview of the image to show to the user or I'll have to package such a preview in the .bme file when they're created.</p><p>This is the only option I can think of. I thought I'd ask in case there is more Android friendly way of doing this. For example, can you add custom file support to the ""Media Gallery"" app? </p>","483701","","","","","2010-10-27 19:48:58","Is there a file picker widget for custom file formats?","<java><android><mobile>","1","0","","",""
"4036746","1","4036895","","2010-10-27 19:08:49","3","1686","<p>I am not getting is this is right way to solve problem or not...Situation is... I am creating Library for Android project..</p><p>Activity is declared in the Library Project..As it will be reusable in different projects.Lets Name it ActivityA</p><p>ActivityA is using images which are Project Specific.. I have added images in Main Project...</p><p>I am not getting how to access resources from Main project in the Library</p><p>Thanks,</p>","413594","","","","","2012-04-29 21:24:20","Android Library using Main Project Resources","<android><activity>","1","0","","",""
"4036820","1","","","2010-10-27 19:18:01","1","1326","<p>I'm currently working on a project which requires the detection of user state (walking, running, driving), I've looked through some of the existing solutions on Android platform such as pedometer or calculating velocity with given acceleration, but I'm still unsure how I can approach this problem. Is there a way to accomplish this without much of data mining/signal processing? How can I solve this with simple logic? Or is this better solved with gps instead of accelerometer? The program will only need to return simple user-state descriptions like walking. </p>","396962","","","","","2010-10-27 20:11:50","Android accelerometer detect user state","<android><accelerometer><user-activity>","1","0","1","",""
"4036990","1","4053458","","2010-10-27 19:35:32","31","8549","<p>I have a GridView in my Android application that has a number of ImageViews in it. The space on my screen is limited and I want the images to take up as much of the available space as they can. Unfortunately, the GridView always leaves 5 pixels of empty screen space around the outside edge of the ImageViews (the space between ImageViews is set with horizontal/vertical spacing and behaves correctly). The empty space acts kind of like a margin around the ImageViews, but I can't get rid of it. Does anyone know what's causing this ""border"" and how I can get rid of it (or at least make it smaller)? Thanks.</p><p>Update: I'm creating the ImageViews by inflating an .xml file in the getView() method of my Adapter class. Here's the xml I'm inflating:</p><pre><code>&lt;ImageView  xmlns:android=""http://schemas.android.com/apk/res/android""  android:background=""#FF00FF"" /&gt;</code></pre><p>I defined the GridView in my layout xml file like this:</p><pre><code>&lt;GridView   android:id=""@+id/mygrid""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_above=""@+id/abutton""   android:layout_marginBottom=""8dp""   android:numColumns=""5"" android:background=""#FF0000""/&gt;</code></pre><p>Here's a screen shot of the problem. The red area in my GridView. The purple areas are my ImageViews. The image being displayed is a simple blue rectangle with a transparent center. The image is 45x45 pixels (but is only 30x30 pixels in my app - I'll worry about that later). The red border around the purple is what I am trying to eliminate.</p><p><img src=""http://i.stack.imgur.com/6ZxDA.png"" alt=""alt text""></p>","65180","","65180","","2010-10-28 20:39:52","2013-10-25 13:55:47","Why are there extra pixels around my Android GridView?","<android><gridview><imageview>","4","0","16","",""
"4037114","1","4838445","","2010-10-27 19:52:35","3","1300","<p>I am trying to convert dips to pixels using the following function.  I’ve tried low, medium, and high density emulators and regardless of the emulator I use, the pixel value remains the same value as the dip value I pass into the function.</p><pre><code>private int ConvertDips(float dips) { int pixels = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float) dips, getResources().getDisplayMetrics()); return pixels;}</code></pre><p>What the heck am I doing wrong here?</p>","432209","","1140748","","2012-05-06 16:42:14","2012-05-06 16:42:14","Dip to pixel conversion results in the exact same value","<java><android>","1","0","0","",""
"4037202","1","","","2010-10-27 20:04:18","0","882","<p>Does anybody have and want to share layout.xml file and working Activity class in which have example of using OpenGL in android ?</p>","485865","","","","","2010-10-27 20:35:04","OpenGL functional example needed in Android","<android>","3","0","","",""
"4037221","1","","","2010-10-27 20:06:47","1","465","<p>In my application, I am going to create a few listviews that are dependent on the listview before it. For example,</p><p><strong>1st list has these items</strong><br>Illinois<br>Indiana</p><p>Then, depending on user choice, will go next screen, let's say, it contains a submenu of each type of school,that may be different or may be the same to other states  </p><p><strong>Click Illinois, get 2nd list with these</strong><br>State Universities<br>High Schools<br>Private Universities  </p><p><strong>Click Indiana, get 2nd list with these</strong><br>Community Colleges<br>High Schools<br>State Universities</p><p>Then once a user selects one of these, a similar list will be generated.Let's say <strong>Indiana</strong> is selected, and then <strong>State Universities</strong></p><p><strong>3rd List</strong><br>Purdue University<br>Indiana University<br>Ball State</p><p>Finally, when the user selects one of these, a window showing some simple statistics would be shown, such as Number of students, location, mascot, etc. It would also keep track of what state it was in, and what 'type' of school it was.</p><p>What I want to know, is how to populate these different lists dynamically as the user goes on? I don't know what the best of doing this is, and I seem to be looking in the all the wrong places because I keep getting stuck. Once all the data is added into whatever structure is used, it will be static. I basically just need help as to how to code information into some sort of hashtable or anything of the sort that can be easily referenced, and later when the Application is updated, be able to add more schools/states/submenus etc. Any sort of help would be appreciated.</p>","489304","","","","","2011-02-02 11:06:28","Creating a static data structure on application startup for Android","<java><android><data-storage>","1","0","1","",""
"4037268","1","","","2010-10-27 20:12:55","1","988","<p>i'm looking for an intent filter for when you are at the contact list and you long press a contact so a menu comes up</p>","219554","","219554","","2011-08-09 12:48:41","2011-08-09 12:48:41","android contacts intent?","<android><android-intent><contact>","2","2","","",""
"4037507","1","4037647","","2010-10-27 20:39:03","0","2360","<p>Is there are a reason why android menu icons are always monochrome and not color?  Is there any reason why i shouldn't use color menu icons?</p>","202064","","","","","2010-10-27 23:47:25","android color menu icons","<android><menu><icons>","4","0","","",""
"4037559","1","4037839","","2010-10-27 20:45:09","0","870","<p>I'm trying to import an Android project into my Eclipse workspace, using existing source code. When I point Eclipse to my existing source location, it doesn't populate the Build Target area on the New Android Project dialog. Why isn't it letting me pick a build target?</p>","413414","","","","","2010-10-27 21:22:40","Can't pick build target when importing Android project from existing source","<android><eclipse><build>","2","0","","",""
"4037657","1","4038004","","2010-10-27 20:56:23","0","3181","<p>Currently my ListView is filling up with the given String[] but I wanted to alternate some styles on the ListView items.Something weird is happening (I'm surely missing something obvious); The ListView Index is not fixed and the styles are not alternating as supposed.</p><p>My Code is the following:</p><pre><code>package com.blah.blah;import android.app.ListActivity;import android.content.Context;import android.graphics.Color;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;public class Help extends ListActivity {    public class CustommAdapter&lt;E&gt; extends ArrayAdapter&lt;E&gt;{        public CustommAdapter(Context context, int textViewResourceId,                E[] objects) {            super(context, textViewResourceId, objects);        }        public View getView(int position, View convertView, ViewGroup parent){if(convertView == null){    LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);    convertView = inflater.inflate(R.layout.help_item, null);}if(convertView != null){    TextView tvfila = (TextView) convertView.findViewById(R.id.tvfila);                         if(position % 2 == 0){                convertView.setBackgroundColor(Color.LTGRAY);                tvfila.setTextColor(Color.BLACK);            }                    }            return super.getView(position, convertView, parent);        }        @Override        public boolean areAllItemsEnabled() {            return false;        }        @Override        public boolean isEnabled(int position) {            if(position % 2 == 0){            return false;            }else{                return true;            }        }    }        @Override        protected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            String[] questions = getResources().getStringArray(R.array.help_questions);            String[] answers = getResources().getStringArray(R.array.help_answers);            String[] DATA = new String[questions.length + answers.length];            int dataindex = 0;            for (int i = 0; i &lt; questions.length; i++){                DATA[dataindex] = questions[i];                dataindex++;                DATA[dataindex] = answers[i];                dataindex++;            }            setListAdapter(new CustommAdapter&lt;String&gt;(this, R.layout.help_item, DATA));            ListView lv = getListView();            lv.setTextFilterEnabled(true);        }}</code></pre><p>The question is:<strong>is there a way to fix the ListView index so that I can use if(position % 2 == 0) to separate odds and evens matching Questions and Answers??</strong></p><p>NOTES:<br>Both StringArrays from resources are of the same size.<br>The help_item.xml contains only a TextView  </p><p>Images that show the problem:<br>The expected behavior  </p><p><img src=""http://i.stack.imgur.com/xGjgD.png"" alt=""Expected behavior""><br>.<br>.  </p><p>The result of this code  </p><p><img src=""http://i.stack.imgur.com/XPWnl.png"" alt=""alt text""></p>","356828","","","","","2010-10-27 21:50:46","Alternating styles on ListView using extended ArrayAdapter<E> random results","<android><listview><styling><android-arrayadapter>","3","0","1","",""
"4037670","1","4038112","","2010-10-27 20:57:22","1","402","<p>What is the state of maturity of javascript on these platforms? Is safe write a prototype app and trust that it'll work on all of these devices without headaches?</p>","234580","","75204","","2010-10-28 14:20:49","2010-10-28 14:20:49","Javascript maturity on Blackberry, Android, Windows Phone 7 and iPhone","<javascript><iphone><android><blackberry><windows-mobile>","1","1","","",""
"4037795","1","4038195","","2010-10-27 21:14:36","80","31725","<p>Is there an easy way to add padding between the checkbox in a CheckBox control, and the associated text?</p><p>I cannot just add leading spaces, because my label is multi-line.</p><p>As-is, the text is way too close to the checkbox:<img src=""http://i.stack.imgur.com/1uKaG.jpg"" alt=""alt text""></p>","205192","","","","","2014-04-05 01:33:35","Android - Spacing between CheckBox and text","<android><checkbox><padding>","17","1","27","",""
"4037851","1","4038845","","2010-10-27 21:25:16","5","2132","<p>I'm working on an Android application (in Java, obviously) and I recently updated my UDP reader code.  In both versions, I set up some buffers and receive a UDP packet:</p><pre><code>byte[] buf = new byte[10000];short[] soundData = new short[1000];DatagramPacket packet = new DatagramPacket (buf, buf.length);socket.receive (packet);</code></pre><p>In the initial version, I put the data back together one byte at a time (it's actually 16 PCM audio data):</p><pre><code>for (int i = 0; i &lt; count; i++)    soundData[i] = (short) (((buf[k++]&amp;0xff) &lt;&lt; 8) + (buf[k++]&amp;0xff));</code></pre><p>In the updated version, I used some cool Java tools I didn't know about when I started:</p><pre><code>bBuffer  = ByteBuffer.wrap (buf);sBuffer  = bBuffer.asShortBuffer();sBuffer.get (soundData, 0, count);</code></pre><p>In both cases, ""count"" is being populated correctly (I checked).  However, there appear to be new problems with my streaming audio -- perhaps it isn't being handled fast enough -- which doesn't make any sense to me.  Obviously, the buffer code is compiling into a lot more than three statements of JVM code, but it sure seemed like a reasonable assumption when I start this that the 2nd version would be faster than the 1st.</p><p>Patently, I'm not insisting that my code HAS to use Java NIO buffers, but at first glance at least, it DOES seem like a mo' betta' to go about this.</p><p>Anybody got any recommendations for a fast, simple Java UDP reader and whether there is a generally accepted ""best way""??</p><p>Thanks,R.</p>","453989","","122207","","2010-10-27 22:15:09","2012-05-11 08:28:29","Are the ByteBuffer/IntBuffer/ShortBuffer Java classes fast?","<java><android><nio><bytebuffer>","3","7","","",""
"4037885","1","4037906","","2010-10-27 21:31:44","0","270","<p>I had Eclipse running with the Android plug-in and I decided to add the Emacs plug-in. I downloaded and it worked. Then I decided to go back to the Eclipse key bindings and the Android plug-in disappeared. I could not update it, because Eclipse said it was installed, but it was not showing up in the menu.</p><p>I had to re download Eclipse, and reinstall the plug-in.</p><p>Why don't different plug-ins cooperate? I had the same issue when I tried to download the Blackberry plug-in alongside the Android plug-in (in different workspaces) and that also did not work. The only solution is to have two separate Eclipse each with a different plug-in.</p><p>Am i doing something wrong or is Eclipse that fragile!</p><p>Thanks for any comments.</p>","327415","","","","","2010-10-27 21:34:38","In Eclipse, why additional plugin break the Android plug-in?","<android><eclipse><blackberry-eclipse-plugin>","1","3","","",""
"4038268","1","4038366","","2010-10-27 22:33:46","0","2114","<p>I'm using and ArrayAdapter to populate a ListView. After selecting and item, it displays a confirmation Y/N dialog. If the user's choice is negative, then he should be able to select another item showing the same dialog. And so on.</p><p>Here's my code:</p><pre><code>lView.setOnItemClickListener(new OnItemClickListener() {      public void onItemClick(final AdapterView&lt;?&gt; parent, final View v, final int index, final long id) {       Toast.makeText(""Selected file""+ mFiles.get(index).getfileName(),       Toast.LENGTH_SHORT).show();       SelectedFile = mFiles.get(index);          showDialog(DIALOG_CONFIRMIMPORT_ID);       }    });</code></pre><p>The weird thing is that while the ""Toast"" shows the clicked item every time, only the first selected item since the Activity is initiated is being passed to ""SelectedFile"". No matter how many times you click a diferent item, ""SelectedFile"" always assumes the same value, the value of the first clicked item, outside of this code.</p><p>Heres's my Dialog code:</p><pre><code>Protected Dialog onCreateDialog(int id) {switch(id) { case DIALOG_CONFIRMIMPORT_ID:  {  AlertDialog.Builder builder = new AlertDialog.Builder(this);  String message = String.format(getString(R.string.importstudentfileconfirm),SelectedFile.getfileName());  builder.setMessage(message)  .setCancelable(false)  .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {  public void onClick(DialogInterface dialog, int id) {  //     Activity.this.finish();  //     startActivity(new Intent(Activity.this, LOL.class));  }  }) .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {  public void onClick(DialogInterface dialog, int id) { SelectedFile = null; dismissDialog(DIALOG_CONFIRMIMPORT_ID); mFiles.notifyAll(); } }); AlertDialog alert = builder.create(); return alert; } }  return null; }</code></pre><p>Thank you very much for any help!</p>","416619","","","","","2010-10-27 22:49:50","Android: onItemClick only returns first selected Item","<android><listview><dialog><android-arrayadapter>","1","0","","",""
"4038333","1","4039018","","2010-10-27 22:45:12","12","6529","<p>I am developing an Android application and I need to retrieve the Google account used on the phone. I want to do this for the C2DM, but I don't want to ask the user to enter in his/her Google email account if they are already logged in. Is there any way to do it?</p>","172082","","","","","2010-10-28 01:26:23","How do I retrieve the logged in Google account on android phones?","<android>","1","0","10","",""
"4038479","1","4038637","","2010-10-27 23:13:54","150","136911","<p>I want to do something simple on android app. How is it possible to go back to a previous activity. </p><p>What code do I need to go back to previous activity</p>","371301","","523325","","2011-08-10 08:06:22","2014-02-15 23:45:46","Android: Go back to previous activity","<android><android-intent>","12","3","37","",""
"4038509","1","4048777","","2010-10-27 23:20:20","2","191","<p>I am trying to parse an xml file using SAX with Android and the problem is that the function characters(...) is getting called multiple times with what appears to be the same data just offset by a few characters.</p><p>As you can tell from the output below the first time it gets called with ""\talabama"" and the second time it gets called with ""labama"". I am not sure as to why it is doing this but if anyone could help that would be awesome.</p><p>XML Input:</p><pre><code>&lt;?xml version=""1.0""  encoding=""utf-8""?&gt;&lt;dir&gt;&lt;name&gt;.&lt;/name&gt;    &lt;dir&gt;&lt;name&gt;alabama&lt;/name&gt;        &lt;dir&gt;&lt;name&gt;sub_dir_name&lt;/name&gt;            &lt;file&gt;&lt;name&gt;file_name.kml&lt;/name&gt;&lt;/file&gt;        &lt;/dir&gt;    &lt;/dir&gt;&lt;/dir&gt;</code></pre><p>Output of Characters(...):</p><pre><code>10-27 23:04:47.033: DEBUG/LocationHandler(10299):     10-27 23:04:49.000: DEBUG/LocationHandler(10299):     alabama10-27 23:04:51.835: DEBUG/LocationHandler(10299): labama10-27 23:04:52.129: DEBUG/LocationHandler(10299): labama        abama10-27 23:04:52.408: DEBUG/LocationHandler(10299): labama        abamasub_dir_name10-27 23:04:52.519: DEBUG/LocationHandler(10299): ub_dir_name10-27 23:04:52.649: DEBUG/LocationHandler(10299): ub_dir_name            _dir_name10-27 23:04:52.809: DEBUG/LocationHandler(10299): ub_dir_name            _dir_namefile_name.kml10-27 23:04:52.989: DEBUG/LocationHandler(10299): ile_name.kml10-27 23:04:53.158: DEBUG/LocationHandler(10299): ile_name.kml        le_name.kml10-27 23:04:53.358: DEBUG/LocationHandler(10299):     le_name.kml10-27 23:04:53.529: DEBUG/LocationHandler(10299):     le_name.kml        le_name.kml10-27 23:04:53.698: DEBUG/LocationHandler(10299):     le_name.kml</code></pre><p>Handler Overides:</p><pre><code>@Overridepublic void startElement(String uri, String localName, String qName,    Attributes attributes) throws SAXException{}@Overridepublic void endElement(String uri, String localName, String qName)    throws SAXException{  _currentElementValue = """";}@Overridepublic void characters(char[] ch, int start, int length) throws SAXException{  _currentElementValue += new String(ch);  Log.d(TAG, _currentElementValue);}</code></pre>","265609","","265609","","2010-10-28 14:11:44","2010-10-29 03:31:41","SAX on Android is getting called multiple times with the same data but offset","<java><android><saxparser>","1","4","","",""
"4038551","1","4038961","","2010-10-27 23:31:08","1","118","<pre><code>public class TestCamera extends Activity implements SurfaceHolder.Callback, View.OnClickListener {...Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {    @Override    public void onPictureTaken(byte[] data, Camera camera) {        // TODO Auto-generated method stub        picture = data;    }};@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER)) {        mCamera.takePicture(null, null, mPictureCallback);        return true;    }    return super.onKeyDown(keyCode, event);}@Overridepublic void onClick(View view) {    switch(view.getId()) {    case R.id.camera:        picture_intent = new Intent(this, PictureViewer.class);        picture_intent.putExtra(""picture"", picture);        mCamera.startPreview();        startActivity(picture_intent);    }}</code></pre><p>In the emulator, the program behaves like it should.  However, when I put this application on my phone (Nexus one), it doesn't switch to the new Activity when I touch the screen after I take a picture.  If I touch the screen without taking a picture, it switches to the new activity.</p><p>I can't figure out why my phone won't switch to the new Activity after taking a picture.</p>","489481","","","","","2010-10-28 01:11:31","Program will not switch to activity on my phone","<android>","2","0","","",""
"4038595","1","4038669","","2010-10-27 23:42:15","1","885","<p>I'm writing a bitmap editor where I use the Command Pattern to represent actions that will transform the document. I keep all the commands executed so far in a list and, to implement undo, I restore the document to its initial state and then replay all but the last command.</p><p>I would like my undo/redo system to have the following feature: When the user closes the editor and returns, the document, <i>including the available undo and redo commands</i>, should be restored to the state it was in when the user left.</p><p>I'm implementing this for Android where your application can be given very little notice before it will be cleared from memory if e.g. the user gets a phone call. Also, some of my commands are e.g. a list of all the x,y co-ord the user painted on so these might take a few moments to save to disk.</p><p>My current idea is as follows:</p><ol><li>When a new action is performed, the command object is added to a list S for commands that need to be saved to disk.</li><li>A background thread is used that will continually take commands from list S and save them  to disk. The postfix of the filenames used will be numbered in sequence. For example, if the user filled the screen then drew 2 circles, the command files might be called FillCommand1.cmd, DrawCircleCommand2.cmd, DrawCircleCommand3.cmd.</li><li>Periodically, we save a ""checkpoint"" command whose purpose is to store the full document state so that, even if one of the .cmd files is corrupted, we can restore a recent version of the document.</li><li>When the user exits the app, the background thread attempts to finish up saving all the commands it can (but it might get killed). </li><li>On startup, we look for the most recent .cmd file that represents a checkpoint that we can load successfully. All the .cmd files we can load after this (i.e. some files might be corrupt) go in the redo command list, all the .cmd files we can load between the first checkpoint loaded and the oldest checkpoint we can load go in the undo list.</li></ol><p>I want the undo limit to be about 20 or 30 commands back so I need extra logic for discarding commands, deleting .cmd files and I've got to worry about multi-threading behaviour. This system seems pretty complex and will need a lot of testing to make sure it doesn't go wrong. </p><p>Is there anything in Java or Android than can help make this easier? Am I reinventing the wheel anywhere? Maybe a database would be better?</p>","483701","","","","","2010-10-27 23:55:04","Implementing a robust persistent undo/redo feature","<android><design-patterns><mobile><undo>","2","4","1","",""
"4038597","1","4039775","","2010-10-27 23:43:03","0","5538","<p>I looked at the 2 examples on Stack, but can't get them to work.  I'm simply trying to grab an image from a folder in assets and set it as in ImageView, but get a null pointer returned.  What am I doing wrong?</p><p>Main Activity:    package com.xxx.xxx;</p><pre><code>import java.io.InputStream;import android.app.AlertDialog;import android.graphics.Bitmap;import android.os.Bundle;import android.view.View;import android.view.Window;import android.widget.ImageView;import android.widget.ViewFlipper;public class SamplesViewFlipper extends SamplesViewCreator {    private Bitmap returnedImage;    ImageView imgView;    ViewFlipper vf;    private String imageName = ""testImage.png"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        returnedImage = getImageFromAsset(imageName);        imgView = (ImageView) findViewById(R.id.dynamicImageView);        imgView.setImageBitmap(returnedImage); //&lt;-null pointer happens here        vf = (ViewFlipper) findViewById(R.id.SamplesViewFlipper);        setContentView(R.layout.view_flipper_samples);     }    public void buttonClickHandler(View view) {        switch (view.getId()) {            case R.id.nextSampleButton:                vf.showNext();                break;            case R.id.backSampleButton:                vf.showPrevious();                break;        }    }}</code></pre><p>Extender Class:</p><pre><code>package com.xxx.xxx;import java.io.IOException;import java.io.InputStream;import android.app.Activity;import android.content.res.AssetManager;import android.graphics.Bitmap;import android.graphics.BitmapFactory;public class SamplesViewCreator extends Activity {     private InputStream is;     private Bitmap bitmap;    public Bitmap getImageFromAsset(String imageName) {        AssetManager mngr = getAssets();        try {            is = mngr.open(""file:///android_asset/Samples/"" + imageName);            bitmap = BitmapFactory.decodeStream(is);                    //also tried ""Files/"" + imageName per example on Stack        } catch (final IOException e) {            e.printStackTrace();        }        return bitmap;    }}</code></pre><p>And my two xml files:</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/SamplesLayout""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;RelativeLayout        android:id=""@+id/samples_menu""        android:layout_width=""fill_parent""         android:layout_height=""50dp""         android:gravity=""center""        android:background=""#0061F9""&gt;        &lt;Button android:id=""@+id/nextSampleButton""              android:layout_marginRight=""10dp""            android:gravity=""center""                android:layout_width=""50dp""            android:layout_height=""30dp""            android:text=""Next""            android:textColor=""#FFFFFF""            android:textSize=""13dp""            android:layout_weight=""1""            android:background=""@drawable/button""            android:layout_alignParentRight=""true""            android:onClick=""buttonClickHandlerSamples""/&gt;        &lt;Button android:id=""@+id/backSampleButton""            android:layout_marginLeft=""10dp""            android:gravity=""center""                android:layout_width=""50dp""            android:layout_height=""30dp""            android:text=""Back""            android:textColor=""#FFFFFF""            android:textSize=""13dp""            android:layout_weight=""1""            android:background=""@drawable/button""            android:onClick=""buttonClickHandler""/&gt;    &lt;/RelativeLayout&gt;    &lt;LinearLayout android:id=""@+id/SamplesViewFlipperLayout""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;ViewFlipper android:id=""@+id/SamplesViewFlipper""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            &lt;!--adding views to ViewFlipper--&gt;              &lt;LinearLayout                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:paddingLeft=""@dimen/header_pad_left""                android:paddingRight=""@dimen/header_pad_right""                android:paddingBottom=""@dimen/header_pad_bot""                android:paddingTop=""@dimen/header_pad_top""                android:orientation=""vertical""                android:background=""@color/background"" &gt;            &lt;/LinearLayout&gt;        &lt;/ViewFlipper&gt;    &lt;/Linear</code></pre><p>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:id=""@+id/dynamicImageView""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:src=""@drawable/default_samples_image""/&gt;</code></pre><p>EDIT:</p><p>Also tried this, but still get a file not found exception. </p><pre><code>Public Bitmap getImageFromAsset() throws IOException {        try {            is = getAssets().open(""test3.png"");                    bitmap = BitmapFactory.decodeStream(is);        } catch (final IOException e) {            e.printStackTrace();        }        System.out.println(""bitmap is "" + bitmap);        return bitmap;    }</code></pre>","375566","","375566","","2010-10-28 16:45:04","2011-05-05 19:03:15","Null-pointer issue displaying an image from assets folder Android 2.2 SDK","<java><android><android-assets>","2","3","","",""
"4038613","1","4038642","","2010-10-27 23:45:08","7","25828","<p>I want to run and debug my Android apps on my HTC Incredible.    On <a href=""http://developer.android.com/guide/developing/device.html"">http://developer.android.com/guide/developing/device.html</a> it says I have to install the Windows USB driver.  And the instructions for that says: </p><p><em>""1.    Connect your Android-powered device to your computer's USB port. Windows will detect the device and launch the Hardware Update Wizard""</em></p><p>But it <strong>doesn't</strong>.   When I connect my phone it's visible as a drive letter and its SD card is visible as a second drive letter and I can transfer files.   But Hardware Update Wizard doesn't launch.   Nor is it already connected -  if I go to my SDK tools directory and do ""adb devices"" it returns blank. </p><p>So what do I have to do to debug on my phone?     Thanks in advance!! </p>","424690","","","","","2013-06-28 01:55:08","Debugging on my phone (Eclipse, Android)","<android><debugging>","3","0","","",""
"4038690","1","4042785","","2010-10-28 00:00:52","3","2513","<p>I am trying to use ProGuard with Android.  I have found several ProGuard scrips to use, with the following one being an example (I have found several others that are the same or very similar).  However, when I try and run ProGuard using this script, I get the error:</p><p>""Expecting java type before ';' in line 23 of file ...""</p><p>I am completely new to ProGuard.  Can someone explain what is going wrong here</p><p>Thanks.</p><pre><code>-injars      bin(!.svn/**)-outjars     obfuscated-libraryjars C:\android-sdk_r04-windows\android-sdk-windows\platforms\android-1.6\android.jar-libraryjars C:\GoogleAnalyticsAndroid_0.7\libGoogleAnalytics.jar-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*-printmapping proguard.map-keepattributes SourceFile,LineNumberTable-keep public class * extends android.app.Activity-keep public class * extends android.app.Application-keep public class * extends android.app.Service-keep public class * extends android.content.BroadcastReceiver-keep public class * extends android.content.ContentProvider-keep public class com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native ;}-keepclasseswithmembernames class * {    public (android.content.Context, android.util.AttributeSet); }-keepclasseswithmembernames class * {    public (android.content.Context, android.util.AttributeSet, int); }-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}</code></pre>","457607","","211292","","2011-08-10 02:32:40","2011-08-10 02:32:40","Using ProGuard with Android.","<java><android><proguard>","3","1","1","",""
"4039024","1","4053733","","2010-10-28 01:26:54","1","2169","<p>I'm making an App that needs to be able to draw new graphics on top of the last set.</p><p>This is my current onDraw() method - </p><pre><code>protected void onDraw(Canvas canvas) {    canvas.drawColor(Color.WHITE);    if(points.size() &gt; 0) {        //do some stuff here - this is all working ok        canvas.drawLine(p1.x, p1.y, p2.x, p2.y, linePaint);    }   }</code></pre><p>Basically, I need to draw the new graphics as a layer on top of the last, so what I'm looking for is a way to carry the image of the last canvas to the current.</p><p>I have tried to figure it out myself using the canvas.setBitmap() method but it acts very funny.</p><p>Any help appreciated :)</p><p>P.S if it's needed, the the class extends <code>SurfaceView</code> and implements <code>SurfaceHolder.Callback</code></p><p>Edit: This is what I have tried in the onDraw() method but it just force closes</p><pre><code>if(bitmap != null) {        canvas.drawBitmap(bitmap, 0, 0, paint);        canvas.setBitmap(bitmap);      }</code></pre>","451575","","641020","","2011-09-22 10:06:34","2011-09-22 10:06:34","Draw From Old Canvas - Android","<java><android><android-canvas><ondraw>","2","0","3","",""
"4039076","1","4090697","","2010-10-28 01:41:23","2","1989","<p>I'm having a troubling problem testing some code for and Android app. My app has two parts, and activity where the user changes some settings, and a broadcast receiver that responds to SMS messages, both in the same package. </p><p>Here's the problem, I first implemented some simple code to test out the broadcast receiver and the activity, and both worked fine. But then as I tried to refine the code, I noticed the emulator wasn't picking up any of my changes. Event went so far as to uninstall the app from the emulator and try again, no luck. Then I added some extra Toast popups to my receiver, nothing, still running the old code. I know its running the old code because its sending out an SMS using a string constant that is no longer in the current code, so it should be impossible that it respond with that value.</p><p>Here's the kicker that has me confused. For fun I made a change to my activity. Ran the project from Eclipse and that change showed up! Tried to test the receiver code again, runs the old code that doesn't even exist anymore!! </p><p>How in the world can half the package update, and the other half not?Can anyone help me out 'cause I'm about ready to lose my mind.</p>","178014","","","","","2013-07-21 08:45:20","Android Emulator Debugging, Code will not Update","<android><eclipse><android-emulator>","5","2","","",""
"4039086","1","","","2010-10-28 01:45:10","2","2086","<p>I'm working on my first Android app and can't figure out how to get my <code>SimpleCursorAdpater</code> to populate the view.  The cursor that I'm passing in has results in it, so the problem must be somewhere in instantiating the adapter or in binding it to the view.  I'm sort of at my wits end since no exceptions are thrown and I can't really step into setListAdapter.</p><p>Here is how i get my cursor in the first place:</p><pre><code>    Searches searches = new Searches(this);    SQLiteDatabase db = searches.getReadableDatabase();    //select _id, Name, Search FROM Searches;    Cursor c = db.query(                SearchConstants.TABLE_NAME,                 FROM, null, null, null,                 null, null);    startManagingCursor(c);</code></pre><p>And this is the schema do my db:</p><pre><code>CREATE TABLE Searches (_id INTEGER PRIMARY KEY, Name Text, Search TEXT)</code></pre><p>Here are the two lines where things start to fall apart:</p><pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.search, cursor, FROM, TO);setListAdapter(adapter);</code></pre><p>My main layout looks like this:</p><pre><code>&lt;ListView    android:id=""@android:id/android:list""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;TextView    android:id=""@android:id/android:empty""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/empty"" /&gt;</code></pre><p>Here is the view to fill with each result:</p><pre><code>&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:orientation=""horizontal""  android:padding=""10sp""&gt;  &lt;TextView    android:id=""@+id/_id""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;  &lt;TextView    android:id=""@+id/name""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;  &lt;TextView    android:id=""@+id/colon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text="": ""    android:layout_toRightOf=""@id/name"" /&gt;  &lt;TextView    android:id=""@+id/search""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:ellipsize=""end""    android:singleLine=""true""    android:textStyle=""italic""    android:layout_toRightOf=""@id/colon"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Finally here are the static variables I used:</p><pre><code>//search query stuffprivate static String[] FROM = {SearchConstants._ID, SearchConstants.NAME_COLUMN, SearchConstants.SEARCH_COLUMN};//where to paste search resultsprivate static int[] TO = {R.id._id, R.id.name, R.id.search};/** * Table name */public static final String TABLE_NAME = ""Searches"";/** * Name Column */public static final String NAME_COLUMN = ""Name"";/** * Search Column */public static final String SEARCH_COLUMN = ""Search"";</code></pre><p>I think this is all of the relevant code.  I have no idea how to proceed at this point, so any suggestions at all would be helpful.</p><p>Thanks,brian</p><p>PS:  Looks like theres a lot of great suggestions here - i'm not ignoring them i just havent had the chance yet.  Thanks for the advice!  At some point i'll go thru them all and try to give some feedback as to which things worked well for me.</p>","2170994","","2170994","","2010-11-10 14:53:57","2011-11-20 04:06:26","Debugging SimpleCursorAdapter","<android><listview>","7","4","","",""
"4039189","1","4039747","","2010-10-28 02:10:07","0","168","<p>Someone recently told me that there was a licencing constraint that prevented Android from running on anything other than a tablet or mobile phone. I couldn't find any evidence for the constraint.  Does such a limitation exist? </p>","489576","","","","","2010-10-28 04:24:28","Android Restrictions as Embedded OS","<android><ip-restrictions>","1","0","","",""
"4039206","1","","","2010-10-28 02:13:04","6","2750","<p>I have a child Activity that contains a ListView. This Activity is populated asynchronously from a SQLite cursor. The list items contain a TextView, a RadioButton, and a normal Button. The XML is shown below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/rlCategoryListItemLayout"" 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/tvCategoryListItemTitle"" style=""@style/uwLargeListItemLabelStyle"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_centerVertical=""true"" android:singleLine=""true"" android:text=""This is a test note title"" /&gt; &lt;LinearLayout android:orientation=""horizontal"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_alignParentRight=""true"" android:gravity=""center_vertical""&gt;  &lt;RadioButton android:id=""@+id/rdoCategoryListItemSelect"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_centerVertical=""true"" android:layout_marginRight=""10dip"" /&gt;  &lt;Button android:id=""@+id/btnCategoryListItemDelete"" android:background=""@drawable/delete_red"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_centerVertical=""true"" /&gt; &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I have to do some logic to determine which RadioButton is selected by default, and I can't do it until the ListView is already loaded. The problem is that with all the events I have tried so far (onCreate, onPostCreate, onResume, onWindowFocusChanged), the ListView child count is zero. I've also tried using the getView method in the ArrayAdapter class, but that method is called mutliple times and the ListView child count is potentially different every time, leading to unexpected results. Apparently, these events are firing before the ListView has finished being completely populating with its child items.</p><p>Is there an event I can listen for, or some other way to determine when the ListView is finished populating and has all of its children accessible to be modified programmatically?</p><p>Thank you!</p>","398641","","","","","2014-02-14 21:20:26","How to know when an Android ListView is done being populated","<android><events><listview><populate>","3","0","","",""
"4039220","1","4039248","","2010-10-28 02:16:53","1","401","<p>I'm looking for ""<a href=""http://developer.android.com/guide/developing/tools/hierarchy-viewer.html"" rel=""nofollow"">hierarchyviewer</a>"" tool, but it's missing in my SDK installation.Is ""<a href=""http://developer.android.com/guide/developing/tools/hierarchy-viewer.html"" rel=""nofollow"">hierarchyviewer</a>"" part of Android SDK or there's something else I need to install on top of SDK to get it?</p>","323684","","","","","2010-10-28 02:22:40","hierarchyviewer tool is missing","<android>","1","0","","",""
"4039236","1","","","2010-10-28 02:21:02","0","102","<p>In Linux, when a program is running, its base dir will the PWD at the time of starting. Like that, in Android, what will the base dir of application? Is it the application folder or the root folder?</p>","423671","","","","","2010-10-28 02:21:02","Android Appl base dir","<android>","0","2","","",""
"4039347","1","","","2010-10-28 02:43:14","2","372","<p>When I create Android emulator with resolution 480 X 854 (to match Mot Droid ), the onscreen keyboard disappears. Any idea why ?</p>","474375","","","","","2011-04-19 15:06:39","Android Emulator Keyboard dissapears","<android>","1","0","","",""
"4039360","1","4039674","","2010-10-28 02:45:43","0","51","<p>I have many different items on my main.xml layout (30+). I have to constantly throughout an activity I have to use...</p><pre><code>tv1.setVisibility(View.GONE);tv2.setVisibility(View.GONE);</code></pre><p>...for at least 20 of the items. I think it would be easier if some how you could make it so, instead of View.GONE, you can choose what items to show and hide the rest.</p><pre><code>tv3.setVisibility(View.SHOW);tv4.setVisibility(View.GONE);// Some code to hide the rest</code></pre><p>Is there anything I can do to make this similar, or maybe some code that just hides the rest?</p>","478297","","","","","2010-10-28 04:22:23","Android: Just Show This, Instead of Don't Show Everything Else","<java><android><xml>","2","0","","",""
"4039409","1","4039764","","2010-10-28 02:55:26","0","168","<p>I can't seem to use data that is in an EditText box.</p><p>I have one activity for entering a url and a submit button.</p><p>When the user clicks submit, a new activity opens as a WebView and should display the url thatthe user typed in the EditText box.</p><p>This should be the simplest of tasks but I can't find how to do it anywhere...</p>","487840","","","","","2010-10-28 04:27:08","Sustaining EditText data through activity changes","<android><edittext>","2","0","","",""
"4039522","1","4427211","","2010-10-28 03:29:10","1","121","<p>I am developing an Android App which gives users an option 'Browse Alphanumerically'. Using this option let users view the list of items starting with a particular letter or number. Problem is that I cannot decide how to implement screen for this, which can work properly on any screen size. Please suggest me the best solution.</p><p>Thanks.</p>","476747","","","","","2010-12-13 09:06:37","Alphanumeric View in Android","<android><gui>","2","1","1","",""
"4039576","1","4039586","","2010-10-28 03:46:06","4","780","<p>Is there a way to ensure that my Android UI will display as expected across different phones ?</p>","474375","","","","","2010-10-28 03:53:25","Android UI for multiple devices","<android>","3","0","1","",""
"4039619","1","","","2010-10-28 03:57:52","1","275","<p>I have an application which is designed for a fixed screen size.But when i install the application on a device with different screen size ,i am not able to view the complete application.Is it possible to allow layout adjustments based on variable screen sizes?  ... like setting width with some % of screen size which is decided when application installation is doneFor eg: 60% of screen size or 60% of relative layout</p>","424831","","","","","2011-01-10 19:24:42","screen adjusting ability feature in android","<android><touchscreen><android-layout>","2","0","","",""
"4039707","1","4039771","","2010-10-28 04:15:58","0","4951","<p>I would like to create a custom made menu on the bottom of the screen, This menu will be as buttons and, it will always be visible first, if the user scrolls down, it will be visible, and scrolls upp. </p><p>How is this possible?</p>","371301","","371301","","2010-10-28 04:39:08","2011-03-25 14:43:13","Android: creating a custom menu on the bottom","<android><menu>","2","1","","",""
"4039713","1","4039731","","2010-10-28 04:17:17","8","20491","<p>i'm trying to develop a simple pie chart class for android. For now, it can take a map of labels and values and draw the pie chart. I'm yet to add the legends for the pie, which is where i need to place the texts near small rectangles on the screen corner. Any help appreciated, since i'm new to Android dev. Thanks.</p>","408412","","","","","2013-07-28 19:37:21","How to draw text on canvas?","<android><canvas><drawable>","2","0","2","",""
"4039810","1","4040114","","2010-10-28 04:37:36","1","251","<p>I want to use the button style on another control. How can I call that bg?</p>","371301","","","","","2010-10-28 05:43:38","Android: How can I use the Button background(style)","<java><android><eclipse>","1","2","","",""
"4039849","1","","","2010-10-28 04:47:35","0","380","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4032163/android-delete-from-listview"">Android Delete from listview</a>  </p></blockquote><p>        </p><p>This is my layout that suppot delete from listview ,the problem is when listview height is higher than screen height it goes under the button , so need a solution for avoding it</p>","487219","","302328","","2010-10-28 05:04:19","2011-06-24 20:58:31","Android delete from listview","<android><listview><layout>","0","0","0","2011-07-18 19:01:50",""
"4039961","1","4040095","","2010-10-28 05:14:29","1","359","<p>I assumed this feature would be activated by default.  </p><p>How do I set an EditText box to do the normal orange highlighting when a user touches it?</p>","487840","","","","","2010-10-28 05:42:08","EditText isn't highlighted when touched","<android><android-widget><edittext>","1","0","","",""
"4039987","1","","","2010-10-28 05:21:17","0","1164","<p>I am stuck with text parsing in android. I have to read a textfile from url and display the contents in a listview. The contents of textfile include images and texts which are seperated by delimeters (like ^, ~,|,~^~^~). How can i remove the delimeters and display in a listview with the help of array adapter class? Can anyone help with the code?</p>","489692","","","","","2010-10-29 04:26:33","Text Parsing in android","<android>","2","0","","",""
"4040077","1","4040156","","2010-10-28 05:38:40","1","1629","<p>how can we get network signal strength in android 1.6</p>","432559","","","","","2010-10-28 11:29:00","how can we get network signal strength in android 1.6","<android>","1","0","1","",""
"4040139","1","4041185","","2010-10-28 05:46:40","1","380","<p>Hi i want to move the image left right,down,up directions according to track ball .for this please give me the some code suggestions.Thanks in advance</p>","479027","","","","","2010-10-28 08:46:22","move the image according to trackball","<android>","1","0","1","",""
"4040154","1","","","2010-10-28 05:48:47","0","517","<p>i m facing prob in parsing this obj</p><pre><code>{ ""id"": 1909,            ""permalink"": ""http:some url"",            ""title"": ""Voting begins for third phase of Bihar polls"",            ""excerpt"": ""some data."",            ""date"": ""October 27, 2010 21:23"",            ""tags"": [                ""bihar"",                ""india-politics""            ]}</code></pre><p>pls tell how to read tags value how to read value of tags</p>","489717","","88442","","2010-10-28 07:20:58","2010-10-28 07:20:58","how to parse this json obj android","<android>","4","0","","",""
"4040354","1","4403727","","2010-10-28 06:29:01","3","809","<p>I have some bitmap A which I modify to produce bitmap B. I want to efficiently produce a bitmap D by XORing the pixels values of A and B together such that D XOR A produces bitmap B and D XOR B produces bitmap A. I want to store the differences between the bitmaps so I can reverse changes that I've made.</p><p>So far I've tried:</p><ol><li><p>Drawing A onto B with a paint object that I've called .setXfermode(new PorterDuffXfermode(PorterDuff.Mode.XOR)) on. This works when the alpha of A and B is 255 everywhere but anything below produces undesirable results. If I XOR A onto A, for example, I'd expect the result to be a blank image. With this xfer mode, most of A will disappear but the parts without full alpha will remain.</p></li><li><p>Drawing A onto B with a paint object that I've called .setXfermode(new PixelXorXfermode(0)) on. This xfer mode destroys alpha values, which isn't what I want. I'm also not sure what useful things I can set the constructor value to.</p></li></ol><p>What can I do? I need something that will treat the pixel values as plain values and not treat the alpha values as a special case. I need this to be fairly fast (like the above paint types are) and using something like setpixel/getpixel or doing the calculations myself in a byte[] will  be far too slow.</p><p>Edit: Can anyone help with this? Even knowing that most people don't believe there is an API call that will do this for me will help. I'm almost desperate enough to switch to OpenGL rendering as this has an XOR rendering mode (which I hope doesn't have the same issue above).</p>","483701","","483701","","2010-11-28 14:44:02","2010-12-12 18:53:12","How to XOR the pixels values of two bitmaps together?","<java><android><mobile>","2","0","","",""
"4040430","1","","","2010-10-28 06:42:41","0","1047","<pre><code>10-28 11:24:10.579: ERROR/AndroidRuntime(748): Uncaught handler: thread main exiting due to uncaught exception10-28 11:24:10.610: ERROR/AndroidRuntime(748): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.build/com.example.build.ComBuild}: android.content.res.Resources$NotFoundException: File res/drawable/progress_large.xml from drawable resource ID #0x7f02000310-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.os.Handler.dispatchMessage(Handler.java:99)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.os.Looper.loop(Looper.java:123)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.ActivityThread.main(ActivityThread.java:3948)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at java.lang.reflect.Method.invokeNative(Native Method)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at java.lang.reflect.Method.invoke(Method.java:521)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at dalvik.system.NativeStart.main(Native Method)10-28 11:24:10.610: ERROR/AndroidRuntime(748): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/progress_large.xml from drawable resource ID #0x7f02000310-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.content.res.Resources.loadDrawable(Resources.java:1625)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.content.res.Resources.getDrawable(Resources.java:535)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at com.example.build.ComBuild.onCreate(ComBuild.java:15)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     ... 11 more10-28 11:24:10.610: ERROR/AndroidRuntime(748): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: invalid drawable tag animated-rotate10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:745)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:695)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     at android.content.res.Resources.loadDrawable(Resources.java:1622)10-28 11:24:10.610: ERROR/AndroidRuntime(748):     ... 15 more</code></pre>","489752","","3171","","2010-10-28 07:59:00","2010-10-28 08:03:14","Resource not found exception in 1.5 version","<android><xml>","1","0","","",""
"4040436","1","","","2010-10-28 06:43:38","0","258","<p>I have a listview in my program. the problem is that. the list is in single choice mode and when i select any item i have 4 buttons on the footer of my page for that item.. alll i want is to know that. how can i keep that item selected and while cliking any button i can get the selected item.</p>","352767","","","","","2010-10-28 09:59:36","ListView Select Problem","<android><android-widget>","2","0","","",""
"4040488","1","","","2010-10-28 06:52:57","3","598","<p>i am trying to implement gdata map api in my android project.. but i am unable to solve this error</p><pre><code>""java.lang.VerifyError: com.google.gdata.client.media.MediaService""</code></pre><p>i am using all the libraries required to implement gdata apis</p><pre><code>MapsService myService = new MapsService(""createMap""); error is coming due to this line</code></pre><p>is there any clue..</p><p>thnx..</p><p>i am trying with following code</p><p>//</p><pre><code> **MapsService myService = new MapsService(""createMap"");**try {     // Replace username and password with your authentication credentials      myService.setUserCredentials(""username"",""password"");      createMap(myService);    } catch(AuthenticationException e) {      System.out.println(""Authentication Exception"");    } catch(ServiceException e) {      System.out.println(""Service Exception: "" + e.getMessage());    } catch(IOException e) {      System.out.println(""I/O Exception"");    }  }  public static MapEntry createMap(MapsService myService)    throws ServiceException, IOException {    // Replace the following URL with your metafeed's POST (Edit) URL // Replace userID with appropriate values for your map    final URL editUrl = new URL(""http://maps.google.com/maps/feeds/maps/userID/full"");    MapFeed resultFeed = myService.getFeed(editUrl, MapFeed.class);    URL mapUrl = new URL(resultFeed.getEntryPostLink().getHref());    // Create a MapEntry object    MapEntry myEntry = new MapEntry();    myEntry.setTitle(new PlainTextConstruct(""Demo Map""));    myEntry.setSummary(new PlainTextConstruct(""Summary""));    myEntry.getAuthors().add(new Person(""My Name"", null, ""username""));    return myService.insert(mapUrl, myEntry);  }</code></pre>","489762","","760489","","2011-09-19 06:52:06","2011-11-11 11:28:42","Gdata map Api in android","<android>","1","2","1","",""
"4040565","1","4049011","","2010-10-28 07:07:23","2","1039","<p>i have image in sqlserver db.using ksoap2 client webservice for getting image.there i am converting image into base64 encoding and in mobile i am converting it into base64 decoding but i am unable to get image </p><p>whats the problem.how i will get image  or any alternative solution for this problem</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2010-10-29 04:38:38","get image from remote server","<android>","2","1","","",""
"4040624","1","4040667","","2010-10-28 07:16:28","14","12577","<p>Am downloading a ZipFile from web. where it contain folders and  files. Uncompressing them using zipInputstream and zipentry . zipentry.getName giving name of file as ""htm/css/aaa.htm"".</p><p>so i am creating New File(zipentry.getName);</p><p>But problem it throwing an exception File not found. i got that it is creating subfolders htm and css. My question is that , how to create a file including its sub directories , by passing above path ?</p><p>Can anyone sort out this problem , please am thankful to you .</p><p>Thanking you,Sai Srinivas</p>","414777","","342852","","2011-12-07 10:57:13","2013-09-04 16:07:51","How to create a file , including folders  for a given path?","<java><android><file>","3","0","2","",""
"4040684","1","4042362","","2010-10-28 07:26:59","0","856","<p>I need to input latitude and longitude separately in 2 EditTexts and diplay the location at the click of a button. Somehow i'm not able to get the correct layout as i precisely require 2 EditTexts aligned side by side and a button below them. </p><p>Here is what i already have:  </p><p>    </p><pre><code> &lt;LinearLayout android:id=""@+id/zoom""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""         android:layout_centerHorizontal=""true""         /&gt;&lt;EditText  android:layout_width=""wrap_content"" android:text=""@+id/EditText01"" android:layout_height=""wrap_content"" android:id=""@+id/edLat"" android:layout_toRightOf=""@+id/mapView""&gt;&lt;/EditText&gt; &lt;EditText android:layout_marginLeft=""-237dip"" android:layout_marginTop=""100dip"" android:layout_width=""wrap_content"" android:text=""@+id/EditText01"" android:layout_height=""wrap_content"" android:id=""@+id/edLong"" android:layout_toRightOf=""@+id/mapView""&gt;&lt;/EditText&gt; &lt;Button android:layout_marginLeft=""-237dip"" android:layout_marginTop=""200dip"" android:layout_width=""wrap_content"" android:text=""Show Location"" android:layout_height=""wrap_content"" android:id=""@+id/btnShowLoc"" android:layout_toRightOf=""@+id/mapView""&gt;&lt;/Button&gt;    &lt;com.google.android.maps.MapView         android:id=""@+id/mapView""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""0p8EoZESYekrClENQbOlN5EN16DgXv7Rx0CPTMg""        /&gt;&lt;/LinearLayout&gt;</code></pre>","2355649","","379693","","2010-10-30 08:41:54","2010-10-30 08:41:54","How to get my layout correct for inputting coordinates in EditTexts for Maps","<android><android-layout><android-sdk-2.1><android-sdk-2.2>","2","1","","",""
"4040804","1","","","2010-10-28 07:46:40","2","842","<p>is it somehow possible to have horizontal scrollable tabbar if there are more than e.g. 10 tabs in it?</p><p>Have anybody implemented something like this?</p><p><img src=""http://i.stack.imgur.com/kWsv7.png"" alt=""alt text""></p><p>Mur</p><p>Ps.It was not nice, what I did: I've deleted almost the same topic, I'd started yesterday. A big SORRY for man, who answered it already, even if it wasn't really the answer I'm looking for.</p>","408780","","","","","2010-10-28 07:46:40","Android scrollable Tabbar","<android><tabs><tabbar>","0","0","1","",""
"4040912","1","","","2010-10-28 08:08:50","13","9093","<p>Is it possible to easily get the size of a folder on the SD card? I use a folder for caching of images, and would like to present the total size of all cached images. Is there a way to this other than iterating over each file? They all reside inside the same folder?</p>","184844","","","","","2014-03-27 15:49:06","How can I get the size of a folder on SD card in Android?","<android><size><folder><sd-card>","7","0","6","",""
"4040999","1","4067895","","2010-10-28 08:23:59","0","1123","<p>I have an alert dialog which lists around 100 cities. Is there a way to search within it? Or maybe autocomplete?</p><p><img src=""http://i.stack.imgur.com/ZGplf.png"" alt=""alt text""></p><p>I want to add a textbox which will filter the list according to what I type.</p><p>EDIT: I'm very SORRY. What I meant was that I wanted to FILTER the above list based on what I type in a textbox. For example if I type 'D', I should get only Dhaka..</p>","481239","","481239","","2010-10-28 10:01:20","2012-04-01 07:07:29","Searching within AlertDialog","<android><search><dialog>","5","1","","",""
"4041101","1","7449223","","2010-10-28 08:35:41","1","2335","<p>I recently read that the content provider <code>content://sms</code> shouldn't be used to access the SMS store, as there could be some mobile phones that might not know how to deal with it.</p><p>So, what would be the best way to access the SMS database in Android? How can I access mmssms.db (this should be the database I need to deal with, right?) directly from my own application to query text messages and conversations?</p><p>Thanks!</p><p>S.</p>","419501","","419501","","2010-10-28 10:59:28","2011-09-16 19:00:36","How to access the SMS/MMS database on Android without using ""content://sms""","<android><sms><database-connection><android-contentprovider>","1","1","2","",""
"4041132","1","4042665","","2010-10-28 08:39:06","0","498","<p>mycontext.startActivity(new Intent(mycontext, logoSplash.class)); //this finishis after 3 seconds</p><pre><code>    initcontrols();    final Timer timerStartAll = new Timer();    timerStartAll.schedule(new TimerTask() {    @Override  public void run() {     handler.post(new Runnable() { public void run() {    timerStartAll.cancel();    start();    }});    }}, 4000, 5000);</code></pre><p>function start:</p><p>utils.showLoaderDialog(""refresh!"", ""refresh."");</p><p>in utils class:</p><pre><code>public static ProgressDialog dialog;public static void showLoaderDialog(String sHead, String sMess) {dialog =ProgressDialog.show(myActivityStart.mycontext, sHead, sMess, true, true);}public static void hideLoaderDialog() {dialog.dismiss();}</code></pre><p>why cant see the process dialog?</p>","472537","","","","","2010-10-28 12:11:46","Android cant show processdialog","<android><dialog>","1","0","","",""
"4041194","1","8974445","","2010-10-28 08:47:34","1","734","<p>I am implementing C2DM for push notification in an android application, it need at leastone log in Google account. I create a Google g mail account and login on device, but I am not able to sync it.</p><p>Please help me.</p><p>Thanks in advance.  </p>","361288","","437301","","2010-10-28 10:46:26","2012-01-23 15:53:31","google account sync on android 2.2 device","<android><android-c2dm>","1","0","","",""
"4041291","1","4042587","","2010-10-28 09:01:24","2","2193","<pre><code> I have a large image on the screen and I want to display a small image on that image where I touch the screen. but I do not know how to change the position of the image when I touch on the screen and the small image must display where ever I touch on screen.</code></pre><p>any suggestions or hint will be appreciative.</p><p>thanks</p>","397901","","437301","","2010-10-28 10:41:14","2010-10-28 11:51:17","change the position of a bitmap where ever i touch on screen","<android><imageview>","3","0","","",""
"4041379","1","4041517","","2010-10-28 09:14:05","0","720","<p>I know that we can get the current location of Android device using getLastKnownLocation and by registering a listener in requestForUpdates method. But, this method works for an Activity which I think means that the updates will be sent to that particular activity only. </p><p>I want to receive the location update in any activity. It should be registered when the application is started and any visible activity should be able to get the current location.</p><p>Do I need to then make a different class and extend it with Service class and start the service when the application is started? Or Is there any other way around?</p><p>Also, can someone let me know what will happen if two different activities registers for requestForUpdate method. Will the first one be automatically unregistered? or they both will receive the updates? </p><p>Also, I am not sure but I think whenever the activity is destroyed the location listener are automatically unregistered or they need to be unregistered in the onDestroy method of activity?</p><p>Does someone have any idea about all this?</p>","261566","","","","","2010-12-15 07:35:42","Set current location listener for entire application in Android?","<android><location>","1","0","","",""
"4041536","1","4255095","","2010-10-28 09:34:33","0","190","<p>I'm learning Android development and I'm a bit confused about how Android manages killing process when an activity is on the task's stack.Let's say I have a task with 4 activities: A-B-C-D.</p><p>Let A,B,D be part of process P1 and C be part of process P2.</p><p>Let's suppose that while the user is interacting with D Android kills P2 since D needs a lot of memory. What happens when the user press the back key?</p><p>1) Since P2 has been killed and C is missing, B will be on the top (i.e. the stack becomes A-B).2) A new process (let it be P3) is created and activity C is restarted (but of course its state will be the ""starting"" state)</p>","62811","","","","","2010-11-23 10:32:23","Pressing ""back"" key when a killed process was on the stack","<android>","1","2","","",""
"4041649","1","4057280","","2010-10-28 09:48:45","0","375","<p>I'm not really fascinated by TabView in Android.</p><p>So I've got a crazy idea how to do a ""handmade""-almost-TabView.</p><p>Before I start to implement it, I decide to ask you, if this idea too bad, what are negative or positive sides of it.</p><ul><li><p>Assume the whole application shouldinclude tabbar.</p></li><li><p>The Layout of every activity willget as tabbar for example in itslayout a horizonatally orientedlinear layout with tabs.</p></li><li><p>Selected tab identificator will be a staticvariable and will just affect, whichtab-icon should be selected.</p></li><li><p>For complicated uses (if it desired to save activities history within each tab) activitygroups will be used. each activity group will be associated with corresponding tab.</p></li></ul><p>Thank you in advance for every criticism and suggestions.</p><p>Mur</p><p>Ps.I hope, it's not a wrong place for discussion. But if, just suggest, where would it be to discuss this topic</p>","408780","","","","","2010-10-30 04:43:25","""Handmade"" TabView for Android","<android><tabs><tabbar>","1","0","","",""
"4041682","1","","","2010-10-28 09:53:31","8","13443","<p>I am using an Android device running Froyo supporting OpenGL ES 1.1 and OpenGL ES 2.0</p><p>I want to render the depth buffer to a texture. Having seen a number of examples for OpenGL, OpenGL ES on other platforms (including iPhone) I have tried a number of FBO configurations.</p><p>I seem to be able to get an FBO set-up with a colour texture but every time I attach a depth texture it fails.</p><p>My current code is based on <a href=""http://www.fabiensanglard.net/shadowmapping/index.php"">this example</a> but creating a colour texture as well instead of setting draw and read buffers to none.</p><p>Is there a simple example of configuring an OpenGL ES FBO on Android to render depth to a texture? Alternatively is there a document describing what is and is not supported?</p><hr><p>Thanks for the comments - I specifically needed a solution for ES 1.1, if it could be found and work on Android. I also want to look at ES 2 - I am not sure I understand the idea of packing the depth information into colour buffer - do you have a reference I can look at to understand the idea better? </p><p>Regarding code - my source is barely different from the link I posted above. The Framebuffer status is that it is not complete.</p><hr><p>Thanks for the fragment shader suggestion - I get the idea now. Will look at that if I can't get another solution working. My ideal is to get depth and colour at the same time - don't really want to render colour and depth separately if I can help it.</p>","489932","","489932","","2010-11-24 11:54:44","2012-04-13 22:08:53","Android OpenGL ES Framebuffer objects - rendering to texture","<android><opengl-es><depth-buffer>","2","3","9","",""
"4041849","1","","","2010-10-28 10:16:20","0","2433","<p>I am developing an application in which I converted a bitmap to string for some purprose.How can I convert that String  into a Bitmap again? </p>","489005","","766108","","2012-10-15 11:39:08","2012-10-15 11:39:08","String to Bitmap java/android","<java><android>","1","2","","",""
"4041974","1","","","2010-10-28 10:32:34","0","123","<p>I'm currently trying to run some unit tests on a class that uses HTTPtransport and is part of an Android application.  The docs for google-api says that this should be fine since the Apache transport is built into Android.</p><p>However, when running my tests I get the following error:</p><blockquote>  <p>java.lang.IllegalStateException:  unable to load NetHttpTrasnport at  com.google.api.client.http.HttpTransport.useLowLevelHttpTransport(HttpTransport.java:98)  at  com.google.api.client.http.HttpTransport.(HttpTransport.java:156)  at  com.google.api.client.googleapis.GoogleTransport.create(GoogleTransport.java:58)  at  uk.co.redfruit.android.whogotwhat.googlebase.GoogleBaseSearch.search(GoogleBaseSearch.java:41)  at  uk.co.redfruit.android.whogotwhat.test.GoogleBaseSearchTest.testSearchForBarcode(GoogleBaseSearchTest.java:22)  at  java.lang.reflect.Method.invokeNative(Native  Method) at  android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)  at  android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)  at  android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)  at  android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</p></blockquote><p>Is this a bug? Or am I just missing something?</p>","398293","","","","","2010-10-29 12:39:45","Problem with LowLevelHttpTransport in unit tests","<android><junit><google-api>","2","0","","",""
"4042162","1","","","2010-10-28 10:54:08","0","672","<p>HI,I have a imageView iv1 in my app, and i want to set a phone number as id to the imagview,so that whenever i click i need to do some operation using the phone no.i have done like this :<code>String res = util.removeCharacters(value, ""0123456789"");Long var = Long.parseLong(res);     System.out.println(""Sketch""+var.intValue());     iv2.setId(var.intValue());</code>Here removerCharacters returns String, that i was converted to long and then i was converted to integer. But i got -1 as the id when i click. Please help whats wrong with this ?</p>","487604","","","","","2010-10-28 10:54:08","view.setId problem in Android?","<android>","0","2","","",""
"4042264","1","4084915","","2010-10-28 11:07:57","0","4628","<p>I'm trying to have an <code>EditText</code> and the possibility to display a keyboard at the bottom of the screen when the user taps the <code>EditText</code>. I'm aware of the <code>InputMethodService</code> and the SoftKeyboard example, but I can't use it in that fashion as my keyboard should only be available to this very <code>EditText</code>.</p><p>Furthermore, there should be a context menu, but that's not part of this question (I think).</p><p>I've read plenty of code fragments, but in many cases they contain methods that aren't available anymore (i.e., <code>getViewInflate()</code>) or are written in a context that I don't understand or can't translate into my code (mind that I'm a newbie regarding Android).</p><p>In most attempts I fail with this exception when I tap the <code>EditText</code>:</p><pre><code>java.lang.IllegalArgumentException: width and height must be &gt; 0</code></pre><p>followed by a stack-trace that doesn't contain any of my classes. As you can see in the code below all sizes are set.</p><p>What you see below is the current status of the code (I removed some of the code and I hope it still makes sense). I also tried to use what's inside of <code>handler.post()</code> in the main thread, use the commented stuff instead of the <code>handler.post()</code> ...</p><p>What's not below is an attempt to use a <code>RelativeLayout</code> with the <code>EditText</code> and the <code>KeyboardView</code> in one layout-XML. There was a different exception, something like ""invalid type 0x12"" or something when creating the layout.</p><p>It just doesn't work or I just don't know how to do it. Can anyone please guide me through this? Please let me know if something is missing.</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;EditText    android:id=""@+id/field_input""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:inputType=""textMultiLine|textImeMultiLine""    android:typeface=""monospace""    android:gravity=""top|left""    android:maxLength=""255""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>keyboard.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.messenger.keyboard.LatinKeyboardView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/keyboard""    android:layout_alignParentBottom=""true""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;</code></pre><p>LatinKeyboardView.java:</p><pre><code>import android.inputmethodservice.KeyboardView;public class LatinKeyboardView extends KeyboardView {    :}</code></pre><p>EditorActivity.java</p><pre><code>import android.app.Activity;public class EditorActivity extends Activity {    private View keyboardLayout;    @Override    public void onCreate(Bundle savedInstanceState) {        final EditText inputField;        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        keyboardLayout = (View)getLayoutInflater().inflate(R.layout.keyboard, null, false);        inputField = (EditText)findViewById(R.id.field_input);        registerForContextMenu(inputField);        inputField.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View view) {                    Handler handler = new Handler(Looper.getMainLooper());                    handler.post(new Runnable() {                            @Override                            public void run() {                                LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                                //PopupWindow pw = new PopupWindow(inflater.inflate(R.layout.input, null, false), 100, 100, true);                                PopupWindow pw = new PopupWindow(keyboardLayout, 100, 100, true);                                pw.showAtLocation(findViewById(R.id.field_input), Gravity.CENTER, 0, 0);                            }                        });/*                    if (keyboardLayout.getVisibility() == View.GONE) {                        // Show Media Player                        TranslateAnimation mAnimUp =                             new TranslateAnimation(                                    Animation.RELATIVE_TO_SELF, 0,                                    Animation.RELATIVE_TO_SELF, 0,                                    Animation.RELATIVE_TO_SELF, -keyboardLayout.getHeight(),                                    Animation.RELATIVE_TO_SELF, 0);                        mAnimUp.setStartOffset(500);                        mAnimUp.setDuration(500);                        keyboardLayout.setVisibility(View.VISIBLE);                        keyboardLayout.setAnimation(mAnimUp);                    }*/                }            });    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        :    }    @Override    public boolean onPrepareOptionsMenu(Menu menu) {        :    }    @Override    public boolean onOptionsItemSelected(final MenuItem item) {        :    }    @Override    public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {        :    }}</code></pre>","483113","","","","","2012-01-14 06:44:59","Android: KeyboardView doesn't appear above EditText","<android><popupwindow>","2","0","","",""
"4042282","1","4042506","","2010-10-28 11:11:02","0","1278","<p>Hai Friends,           I have created an sample application, in which i have a list view, when the user clicks the listview the next intent is called with no problem in sometimes, but most of the times it display Force Close or Wait Message as shown in the Image attached here, i want to stop displaying this Force Close or Wait Dialog, I have no idea how to stop this warning message, so guide me, to stop this.Pls refer my output![alt text][1]Pls refer my Logcat Message</p><pre><code>10-28 16:30:54.640: DEBUG/NetworkLocationProvider(76): getLocation(): triggering a wifi scan10-28 16:30:55.410: DEBUG/NetworkLocationProvider(76): updateWifIScanResults(): 5 APs10-28 16:30:55.430: DEBUG/LocationMasfClient(76): getNetworkLocation(): Returning cache location with accuracy 75.010-28 16:31:05.220: DEBUG/dalvikvm(15032): GC freed 15 objects / 600 bytes in 124ms10-28 16:31:05.690: INFO/ActivityManager(76): Stopping service: com.google.android.apps.maps/com.google.googlenav.friend.android.LocationFriendService10-28 16:31:09.960: DEBUG/WifiService(76): ACTION_BATTERY_CHANGED pluggedType: 210-28 16:31:13.186: DEBUG/KeyguardViewMediator(76): wakeWhenReadyLocked(82)10-28 16:31:13.190: DEBUG/KeyguardViewMediator(76): handleWakeWhenReady(82)10-28 16:31:13.190: DEBUG/KeyguardViewMediator(76): pokeWakelock(5000)10-28 16:31:13.250: DEBUG/WifiService(76): ACTION_SCREEN_ON10-28 16:31:13.430: DEBUG/SurfaceFlinger(76): Screen about to return, flinger = 0x1896a010-28 16:31:15.610: DEBUG/KeyguardViewMediator(76): pokeWakelock(5000)</code></pre>","424413","","424413","","2011-01-21 18:37:38","2011-01-21 18:37:38","Need Help in Fixing Force Close Issue in Android?","<android>","3","0","1","",""
"4042314","1","","","2010-10-28 11:15:53","1","1454","<p>While developing an alarm based application, i have stuck in a scenario.</p><p>When my alarm is fired, i can receive the event in BroadCastReceiver::onReceive().Within this function, i want to notify/call a function, which is located on MainActivity.</p><p>How to achieve the same??</p>","419685","","","","","2012-01-24 10:10:48","Calling main activity from BroadcastReceiver","<android>","2","0","","",""
"4042352","1","4042810","","2010-10-28 11:21:21","1","553","<p>Would this Android code be a correct way to test for http network availability during a phone call, or does it exclude networks that should be included or vice versa:</p><pre><code>public boolean isOnline() {    TelephonyManager tm = (TelephonyManager)              getSystemService(Context.TELEPHONY_SERVICE);    if (tm.getNetworkType() &gt; TelephonyManager.NETWORK_TYPE_EDGE)        return true;    return false;}</code></pre>","271813","","","","","2010-10-28 12:17:26","What mobile network types allow http traffic during phone calls?","<android><networking><mobile>","1","0","1","",""
"4042416","1","","","2010-10-28 11:28:09","0","2837","<p>I added dynamic message successfully to my progressdialog.But when adding the button it doesn't take the button Please help me out.</p><pre><code>private Handler progressHandler = new Handler() {            @Override            public void handleMessage(Message msg) {                // process incoming messages here                switch (msg.what) {                case 0:                    // update progress bar                    progressDialog.setMessage("""" + (String) msg.obj);                    break;                case 1:                    progressDialog.setMessage("""" + (String) msg.obj);                    finish();                    break;                case 2:                    Log.d(TAG,""in case 2........."");//                  progressDialog.cancel();                    progressDialog.setMessage("""" + (String) msg.obj);                    progressDialog.setButton(""HOME"", new DialogInterface.OnClickListener() {                        @Override                        public void onClick(DialogInterface dialog, int which) {//                          progressDialog.cancel();                            finish();                        }                    });                    break;                }                super.handleMessage(msg);            }        };</code></pre><p>Regards,Rajendar Are</p>","486216","","","","","2014-03-21 10:54:42","how to add button dynamically to progress dialog android?","<android>","2","0","","",""
"4042548","1","","","2010-10-28 11:45:35","3","1456","<p>I'm trying to import and export contact on an Android phone as vCards. Export works fine and I get the vCard string.</p><p>But how can I insert a contact from a vCard string? I wasn't able to find any sample code.</p>","373138","","1288","","2012-08-04 17:28:12","2012-08-04 17:28:12","Insert vCard in Android","<android><vcard>","1","0","2","",""
"4042565","1","4042805","","2010-10-28 11:47:22","-1","274","<p>I connect a ip cam(jpeg), and show this image, and i  repeat continually, After a while my app error this. And I tested other phone and showed this one. </p><pre><code>10-28 15:12:51.525: ERROR/AndroidRuntime(675): Uncaught handler: thread Thread-11 exiting due to uncaught exception</code></pre><p>my codes:</p><pre><code>public void parse(InputStream is){  try {   if (!type.isMjpegStream()) {    CameraManagerScreen.ActiveCam.setConnected(true);    setImage(is);    is.close();    System.gc();    if(!mjpeghttp.isCanceled())      go();   }   } catch (Exception e) {  } }</code></pre><p>and my connection is:</p><pre><code>protected void connect() { InputStream is = null;try { HttpParams httpParameters = new BasicHttpParams(); // Set the timeout in milliseconds until a connection is // established. int timeoutConnection = 20000; HttpConnectionParams.setConnectionTimeout(httpParameters,   timeoutConnection); // Set the default socket timeout (SO_TIMEOUT) // in milliseconds which is the timeout for waiting for data. int timeoutSocket = 20000; HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket); client = new DefaultHttpClient(httpParameters); method = new HttpGet(getUrl()); System.out.println(""Baglaniyor:  "" + method.getURI().toString()); method.addHeader(""Authorization"", getBase64Encode()); res = client.execute(method); System.out.println(""RESPONSE: ""   + res.getStatusLine().getStatusCode()); is = res.getEntity().getContent(); if (!cancel) {  onReturn(res.getStatusLine().getStatusCode(), is); }} catch (Exception e) { System.out.println(e.getMessage()); try {  cancel = true;  Thread.sleep(60); } catch (Exception ie) {} onError(new Exception(""0""));}}</code></pre><p>Error...</p><pre><code> 10-28 14:13:06.794: INFO/dalvikvm(3502): Stack overflow, expanding (0x439b0200 to 0x439b0000)10-28 14:13:06.794: INFO/dalvikvm(3502): Shrank stack (to 0x439b0200, curFrame is 0x439b0268)10-28 14:13:06.794: WARN/dalvikvm(3502): threadid=17: thread exiting with uncaught exception (group=0x4001b180)10-28 14:06:19.944: ERROR/AndroidRuntime(3420): Uncaught handler: thread Thread-11 exiting due to uncaught exception    10-28 14:06:19.994: ERROR/AndroidRuntime(3420): java.lang.StackOverflowError    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.util.Hashtable.get(Hashtable.java:274)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.util.Properties.getProperty(Properties.java:177)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.lang.System.getProperty(System.java:440)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.lang.System.getProperty(System.java:412)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.lang.Boolean.getBoolean(Boolean.java:174)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.harmony.luni.net.NetUtil$Action.run(NetUtil.java:89)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.harmony.luni.net.NetUtil$Action.run(NetUtil.java:80)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.security.AccessController.doPrivilegedImpl(AccessController.java:264)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.security.AccessController.doPrivileged(AccessController.java:84)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.harmony.luni.net.NetUtil.preferIPv4Stack(NetUtil.java:61)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:266)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.net.Socket.checkClosedAndCreate(Socket.java:889)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at java.net.Socket.connect(Socket.java:1036)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:140)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.connect(Http.java:75)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.connect(MjpegHttp.java:33)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.go(Http.java:46)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.CameraHttp.go(CameraHttp.java:13)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.go(Camera.java:121)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.parse(Camera.java:170)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.onReturn(MjpegHttp.java:23)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.connect(Http.java:82)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.connect(MjpegHttp.java:33)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.go(Http.java:46)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.CameraHttp.go(CameraHttp.java:13)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.go(Camera.java:121)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.parse(Camera.java:170)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.onReturn(MjpegHttp.java:23)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.connect(Http.java:82)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.connect(MjpegHttp.java:33)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.go(Http.java:46)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.CameraHttp.go(CameraHttp.java:13)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.go(Camera.java:121)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.parse(Camera.java:170)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.onReturn(MjpegHttp.java:23)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.connect(Http.java:82)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.connect(MjpegHttp.java:33)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.go(Http.java:46)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.CameraHttp.go(CameraHttp.java:13)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.go(Camera.java:121)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.parse(Camera.java:170)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.onReturn(MjpegHttp.java:23)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.connect(Http.java:82)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.connect(MjpegHttp.java:33)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.go(Http.java:46)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.CameraHttp.go(CameraHttp.java:13)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.go(Camera.java:121)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.parse(Camera.java:170)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.onReturn(MjpegHttp.java:23)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.connect(Http.java:82)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.MjpegHttp.connect(MjpegHttp.java:33)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.Http.go(Http.java:46)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.connection.CameraHttp.go(CameraHttp.java:13)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepvizyon.camera.Camera.go(Camera.java:121)    10-28 14:06:19.994: ERROR/AndroidRuntime(3420):     at spexco.cepviz</code></pre>","483988","","483988","","2010-10-28 12:14:55","2012-01-27 11:26:42","I can't solve this problem...( After a while my app error this...)","<android><stackoverflowexception>","3","0","","",""
"4042753","1","4043971","","2010-10-28 12:11:01","1","1937","<p>I’m building a small app that is using a surfaceview class that extends surfaceholder.callback.  It is implemented just like the lunarlander example.  My problem is that each type of emulator I use (low, medium or high density) doesn’t seem to actually change the density of the screen or the resolution to what I would expect.  I recently asked <a href=""http://stackoverflow.com/questions/4037114/dip-to-pixel-conversion-results-in-the-exact-same-value"">this question</a> on stack overflow and it is dawning on me that I’m not doing anything wrong with that function, the problem is that somehow any emulators I use are all getting recognized at medium density.</p><p>The high density emulator screen shows very pixilated images.  The medium density emulator images look fantastic.  The low density emulator images look pixilated, but not as bad as the hdpi.</p><p>I did a mySurfaceHolder.getSurfaceFrame() on each emulator and came up with this:</p><ul><li>WVGA800 - 480x800 - hdpi - generates a surface 320 x 508</li><li>Default(HVGA) - mdpi - generates a surface 320 x 455</li><li>QVGA - 240x320 - ldpi - generates a surface 320 x 402</li></ul><p>Shouldn’t these surfaces be 480x800, 320x480 and 240x320 respectively?  Edit:  the 320x455 makes sense, the rest is probably taken up in the title bar.  But what about the low/high?</p><p>So, I’m unsure if my problem is:</p><ol><li><p>How I’m setting up the emulator.  –I use HVGA, QVGA, WVGA800, andWVGA854 with standard settings (nocustom resolutions)</p></li><li><p>Something wrong with my code in the surfaceview class. Note than I do not manually set a size, I rely on the size returned from this callback method: </p></li></ol><p>.</p><pre><code>public void surfaceChanged(SurfaceHolder holder, int format, int width,        int height) {    thread.setSurfaceSize(width, height);}</code></pre><p>Any thoughts?  As always, I appreciate all your help!</p>","432209","","432209","","2010-10-28 13:33:03","2010-10-28 14:50:58","Android emulators not simulating correct density or resolution. Possibly a surfaceview implementation issue","<java><android><eclipse><android-emulator><surfaceview>","2","0","0","",""
"4042762","1","","","2010-10-28 12:13:00","0","3015","<p>Did anyone know how to get the full url to the content that should be downloaded in webview.I notice there is  setDownloadListener (DownloadListener listener) method where we can get the url onDownloadStart method.</p><p>But i have problem when i open page A, i click hyperlink in page A and directly open a new page B. In page B i download some files so i want to know the full url of the file i just download, but i can't use the method above. Any solution??</p><p>Thanks.</p>","430926","","430926","","2010-10-28 12:25:11","2012-11-19 10:07:19","Android WebView Download Listener","<android><android-webview>","1","0","","",""
"4042812","1","4042914","","2010-10-28 12:17:46","0","625","<p>I have an app that works as intended when run on API 8, but when I run it on any older API version, it crashes with:</p><pre><code>10-28 12:10:50.755: ERROR/AndroidRuntime(1864): Uncaught handler: thread main exiting due to uncaught exception10-28 12:10:50.765: ERROR/AndroidRuntime(1864): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nw.caremeter/com.nw.caremeter.CareMeter}: android.view.InflateException: Binary XML file line #35: Error inflating class &lt;unknown&gt;10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.os.Handler.dispatchMessage(Handler.java:99)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.os.Looper.loop(Looper.java:123)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.ActivityThread.main(ActivityThread.java:4595)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at java.lang.reflect.Method.invokeNative(Native Method)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at java.lang.reflect.Method.invoke(Method.java:521)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at dalvik.system.NativeStart.main(Native Method)10-28 12:10:50.765: ERROR/AndroidRuntime(1864): Caused by: android.view.InflateException: Binary XML file line #35: Error inflating class &lt;unknown&gt;10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.Activity.setContentView(Activity.java:1629)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at com.nw.caremeter.onCreate(CareMeter.java:48)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     ... 11 more10-28 12:10:50.765: ERROR/AndroidRuntime(1864): Caused by: java.lang.reflect.InvocationTargetException10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:105)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at java.lang.reflect.Constructor.constructNative(Native Method)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     ... 22 more10-28 12:10:50.765: ERROR/AndroidRuntime(1864): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/needle_green.xml from drawable resource ID #0x7f02000510-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.content.res.Resources.loadDrawable(Resources.java:1693)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:115)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     ... 26 more10-28 12:10:50.765: ERROR/AndroidRuntime(1864): Caused by: java.lang.NullPointerException10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.graphics.drawable.RotateDrawable.inflate(RotateDrawable.java:207)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     at android.content.res.Resources.loadDrawable(Resources.java:1690)10-28 12:10:50.765: ERROR/AndroidRuntime(1864):     ... 28 more</code></pre><p>What reasons might there be for this failing on API7? My drawable resources are in res/drawable (I've tried making copies in /drawable, and the problem persists regardless of drawable-{hdpi,ldpi} folders). For the sake of completeness, needle_green.xml:</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=""90""                android:toDegrees=""90""                android:pivotY=""125""                android:drawable=""@drawable/needle_base_green"" /&gt;</code></pre><p>And needle_base_green:</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=""line""&gt;    &lt;stroke     android:width=""2dp""                android:color=""#00ff00"" /&gt;&lt;/shape&gt;</code></pre><p>This is pretty much a first android app, so it's likely something shockingly trivial. Thanks for any help.</p>","404525","","404525","","2010-10-28 12:35:06","2010-10-28 12:41:49","Unexplained NullPointerError when referencing drawable on API < 8","<android><drawable>","2","2","","",""
"4042844","1","4049609","","2010-10-28 12:21:42","0","375","<p>I am new to android.I have a list view in one activity. Displaying data in it... I want to use another activity as a tab-bar for 1st activity which allow user to switch to other activity... Is there any way so that 2 different views can be displayed in 1 activity. And then how can i start a new activity inside this activity. Like when user click on any button in tab-bar the corresponding activity should be start but we should not Re-initiate tab-bar view... </p>","486139","","","","","2010-10-29 06:45:30","How to display 2 dirrent views in 1 activity?","<android>","1","0","","",""
"4042849","1","4042881","","2010-10-28 12:22:39","1","2026","<p>Can I add a group of ArrayList into a single ArrayList?The ArrayList groups are of different sizes. Then How can I recognize each ArrayList?</p>","453607","","","","","2010-10-28 13:47:27","Can I add a group of ArrayList into a single ArrayList?","<java><android><arraylist>","3","0","1","",""
"4042924","1","","","2010-10-28 12:30:26","1","3653","<p>Hi I am facing a problemI want my application to pick up resources from the framework. Here is my code snippet of an xml.</p><p></p><p>For this to be achieved following changes were made in attrs.xml </p><p>  </p><p>and themes.xml at the framework level</p><p>@android:drawable/btn_minus_ss    </p><p>The drawable btn_minus_ss.png is added to drawable-hdpi folder at the location framework/base/core/res/res/drawable-hdpiWhenever I open the application, it crashes.I get the following error in logs</p><p>ERROR/AndroidRuntime(3701): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #5:  tag requires a 'drawable' attribute or child tag defining a drawable</p><p>However, when I use thisandroid:background=""?android:attr/theme_btn_minus_ss""I don't get any error. I want to use android:drawableWhat is the cause and how can this problem be solved. </p><p>Thanks &amp; RegardsAviral</p>","490096","","","","","2012-06-04 14:00:49","Error Parsing XML for android:drawable","<android><xml><parsing>","3","0","","",""
"4043049","1","","","2010-10-28 12:47:35","-3","2029","<p>I create one TextField.When i click the TextField i wish to open the menu .how to do this ?</p>","482568","","","","","2010-10-28 13:36:45","How to show menu in android?","<android>","2","0","","2012-11-16 08:29:09",""
"4043243","1","4057266","","2010-10-28 13:12:37","0","454","<p>I am writing an Android App which used TabHost. I created 3 Tabs. Now my doubt is when I click a tab it should come forward and  other tabs should be visible partially in such a way that the width of middleTab should increase evenly in left and right directions, so that the other tabs in left and right should slip out of window partially.How can this be achieved in android. It should be some thing like the CurrencyConverter market App in Android. Can any one help me in sorting out this issue. <br><br></p><p>Thanks in Advance,</p>","429501","","","","","2010-10-30 04:37:54","How to Highlight a paricular tab in Android so that other tabs were made partially visible in Android","<android>","1","0","","",""
"4043338","1","","","2010-10-28 13:26:22","1","1043","<p>Hi friends  i am doing one app which requires to use ProximityIntent  for showing proximity alerts i was surfing from one day but i did'nt find any sample app which shows it. i found some links but they are complex please help to find out some useful links </p><p>the links i have seen which is complex and not clear is </p><p><a href=""http://blog.brianbuikema.com/2010/07/part-3-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/"" rel=""nofollow"">http://blog.brianbuikema.com/2010/07/part-3-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/</a></p><p>please help me...</p>","400942","","400942","","2010-11-01 12:09:10","2013-01-16 14:42:47","please provide sample app on proximity alerts in android","<android><proximity>","1","1","1","",""
"4043367","1","4044813","","2010-10-28 13:29:48","0","352","<p>i need to read organization name from phone contacts in 2.1 i can read name and phone number using following code</p><pre><code>         Cursor cur = User.cr.query(ContactsContract.Contacts.CONTENT_URI, null,                   null, null, null);           if (cur.getCount() &gt; 0) {               while (cur.moveToNext()) {                   // ID AND NAME FROM CONTACTS CONTRACTS                   String id = cur.getString(cur                           .getColumnIndex(ContactsContract.Contacts._ID));                   String name = cur                           .getString(cur                                   .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));     //              Log.i(""Pratik"", ""ID :"" + id);      //             Log.i(""Pratik"", ""NAME :"" + name);                   // GET PHONE NUMBERS WITH QUERY STRING                   if (Integer                           .parseInt(cur                                   .getString(cur                                           .getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {                       Cursor pCur = User.cr.query(                               ContactsContract.CommonDataKinds.Phone.CONTENT_URI,                               null,                               ContactsContract.CommonDataKinds.Phone.CONTACT_ID                                       + "" = ?"", new String[] { id }, null);                       // WHILE WE HAVE CURSOR GET THE PHONE NUMERS                     HashMap tempMap=new HashMap();                     while (pCur.moveToNext()) {                           // Do something with phones                            phone = pCur                                   .getString(pCur                                           .getColumnIndex(ContactsContract.CommonDataKinds.Phone.DATA));                           String phoneType = pCur                                   .getString(pCur                                           .getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));                         tempMap.put(phoneType, phone);                     }                      pCur.close();                    if(name!=null&amp;&amp;tempMap!=null)                  if (!(Pattern.matches(""^[A-Za-z0-9.\\-]+.[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,4}$"",name)))                  { User.provider_name_phoneno.put(name, tempMap);                    User.phoneContactName.add(name);                 }                  }             }           }  </code></pre>","487219","","","","","2010-10-28 16:07:30","android phone contact","<android>","1","0","1","",""
"4043376","1","4043485","","2010-10-28 13:30:51","3","182","<p><br>I am just starting out programming on Android.  </p><p>What is the most computationally expensive Java constructs to avoid when programming an Android App?  </p><p>Of cause every algorithm costs instructions, but what about use of Method calls, Object references, Interfaces, Collections and such? What do I need to avoid, and what is ""cheap"" when I'm programming for speed?</p>","355942","","226476","","2010-10-28 13:34:11","2010-10-28 14:14:02","What are the most important optimizations in Java code on Android?","<java><android>","2","0","3","",""
"4043398","1","7625085","","2010-10-28 13:33:40","29","31131","<p>So im trying to animate when i set the visibility of a linearlayout with other widgets, from GONE to VISIBLE and the opposite.Im using togglebuttons to show and hide. Here's an image to show what i want to do:</p><p><img src=""http://i.stack.imgur.com/tAmrq.png"" alt=""enter image description here""></p><p>I can show and hide, but im not following how can i animate the sliding correctly....:(</p><p>Heres my 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/LinearLayout01""     android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:orientation=""vertical""&gt;&lt;ScrollView     android:id=""@+id/ScrollView01""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;LinearLayout        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""         android:orientation=""vertical""&gt;        &lt;!-- TITULO1 --&gt;            &lt;LinearLayout                 android:layout_height=""wrap_content""                android:layout_width=""fill_parent""                 android:orientation=""horizontal""                 android:background=""#848284""                android:padding=""4px""&gt;                  &lt;TextView                     android:layout_height=""wrap_content""                    android:layout_width=""wrap_content""                    android:id=""@+id/TextView01""                     android:text=""Informação Geral""                     android:textColor=""#FFFFFF""                    android:gravity=""left""                    android:textStyle=""bold""                    android:singleLine=""true""                    android:ellipsize=""end""                    android:layout_gravity=""center_vertical""                    android:textSize=""18px""                     android:paddingLeft=""4px""&gt;                &lt;/TextView&gt;                &lt;LinearLayout                     android:layout_height=""wrap_content""                    android:layout_width=""fill_parent""                     android:layout_gravity=""right|center_vertical"" android:gravity=""right|center_vertical"" android:paddingTop=""2px""&gt;                        &lt;ToggleButton                             android:layout_height=""wrap_content""                             android:layout_width=""wrap_content""                             android:textOff=""Expandir""                             android:textOn=""Minimizar""                            android:id=""@+id/mostrar""                             android:width=""80px""&gt;                        &lt;/ToggleButton&gt;                &lt;/LinearLayout&gt;            &lt;/LinearLayout&gt;            &lt;!--LINHA SEPARADORA--&gt;            &lt;View                 android:id=""@+id/View01""                 android:layout_width=""wrap_content""                 android:background=""#B5B5B5""                 android:layout_height=""2px""&gt;            &lt;/View&gt;            &lt;!-- CONTENT INITIALLY HIDDEN (GONE) --&gt;            &lt;LinearLayout                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:visibility=""gone""                  android:id=""@+id/informgeral""                android:orientation=""vertical""&gt;                 &lt;LinearLayout                     android:id=""@+id/LinearLayout01""                     android:layout_height=""wrap_content""                    android:layout_width=""fill_parent""                     android:paddingBottom=""5px""                     android:paddingTop=""5px""                     android:paddingLeft=""8px""                    android:orientation=""vertical""&gt;                    &lt;LinearLayout                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:orientation=""horizontal""&gt;                        &lt;TextView                            android:id=""@+id/consult_nrprocesso""                            android:textStyle=""bold""                            android:layout_height=""wrap_content""                            android:layout_weight=""1""                            android:gravity=""left""                            android:ellipsize=""end""                            android:layout_width=""wrap_content""                             android:singleLine=""true""                             android:text=""@string/srch_number_proc""/&gt;                        &lt;TextView                            android:id=""@+id/consult_nrprocessovalue""                            android:layout_width=""0px""                            android:layout_height=""wrap_content""                            android:layout_weight=""1""                            android:gravity=""right""                            android:singleLine=""true""                            android:ellipsize=""end""/&gt;                    &lt;/LinearLayout&gt;                    &lt;LinearLayout                        android:layout_height=""wrap_content""                         android:layout_width=""fill_parent""&gt;                        &lt;TextView                            android:id=""@+id/consult_tipoprocinfo""                            android:text=""Numero Atribuido ao Processo""                            android:layout_height=""wrap_content""                            android:layout_weight=""1""                            android:gravity=""left""                            android:singleLine=""true""                            android:ellipsize=""end""                             android:layout_width=""wrap_content""                             android:textSize=""12px""/&gt;                    &lt;/LinearLayout&gt;                &lt;/LinearLayout&gt;                &lt;View                     android:id=""@+id/View01""                     android:layout_width=""wrap_content""                     android:background=""#B5B5B5""                     android:layout_height=""1px""&gt;                &lt;/View&gt;&lt;LinearLayout     android:id=""@+id/LinearLayout02""     android:layout_height=""wrap_content""    android:orientation=""vertical""     android:paddingTop=""5px""     android:paddingBottom=""5px""     android:layout_width=""fill_parent""     android:paddingLeft=""8px""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;            &lt;TextView                android:id=""@+id/consult_tipoproc""                android:textStyle=""bold""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""left""                android:ellipsize=""end""                android:layout_width=""wrap_content""                 android:singleLine=""true""                 android:text=""@string/proc_type""/&gt;            &lt;TextView                android:id=""@+id/consult_tipoprocvalue""                android:layout_width=""0px""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""right""                android:singleLine=""true""                android:ellipsize=""end""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_height=""wrap_content""         android:layout_width=""fill_parent""&gt;    &lt;TextView            android:id=""@+id/consult_tipoprocinfo""            android:text=""Variante do Processo em causa""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""left""            android:singleLine=""true""            android:ellipsize=""end""             android:layout_width=""wrap_content""             android:textSize=""12px""/&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;View android:id=""@+id/View01""         android:layout_width=""fill_parent""         android:background=""#B5B5B5""         android:layout_height=""1px""&gt;&lt;/View&gt;&lt;LinearLayout    android:id=""@+id/LinearLayout03""     android:layout_height=""wrap_content""    android:orientation=""vertical""     android:paddingTop=""5px""     android:paddingBottom=""5px""     android:layout_width=""fill_parent""     android:paddingLeft=""8px""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;            &lt;TextView                android:id=""@+id/consult_etapa""                android:textStyle=""bold""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""left""                android:ellipsize=""end""                android:layout_width=""wrap_content""                 android:singleLine=""true""                 android:text=""@string/srch_task""/&gt;            &lt;TextView                android:id=""@+id/consult_etapavalue""                android:layout_width=""0px""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""right""                android:singleLine=""true""                android:ellipsize=""end""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""&gt;    &lt;TextView            android:id=""@+id/consult_etapainfo""            android:text=""Etapa onde se encontra o processo""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""left""            android:singleLine=""true""            android:ellipsize=""end""             android:layout_width=""wrap_content""             android:textSize=""12px""/&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;View android:id=""@+id/View01""         android:layout_width=""wrap_content""         android:background=""#B5B5B5""         android:layout_height=""1px""&gt;&lt;/View&gt;    &lt;LinearLayout    android:id=""@+id/LinearLayout04""     android:layout_height=""wrap_content""    android:orientation=""vertical""     android:paddingTop=""5px""     android:paddingBottom=""5px""     android:layout_width=""fill_parent""     android:paddingLeft=""8px""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;            &lt;TextView                android:id=""@+id/consult_criadopor""                android:textStyle=""bold""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""left""                android:ellipsize=""end""                android:layout_width=""wrap_content""                 android:singleLine=""true""                 android:text=""@string/criado_por""/&gt;            &lt;TextView                android:id=""@+id/consult_criadoporvalue""                android:layout_width=""0px""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""right""                android:singleLine=""true""                android:ellipsize=""end""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""&gt;    &lt;TextView            android:id=""@+id/consult_criadoporinfo""            android:text=""Entidade responsável pela criação do Processo.""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""left""            android:singleLine=""true""            android:ellipsize=""end""             android:layout_width=""wrap_content""             android:textSize=""12px""/&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;View android:id=""@+id/View01""         android:layout_width=""wrap_content""         android:background=""#B5B5B5""         android:layout_height=""1px""&gt;&lt;/View&gt;&lt;LinearLayout    android:id=""@+id/LinearLayout05""     android:layout_height=""wrap_content""    android:orientation=""vertical""     android:paddingTop=""5px""     android:paddingBottom=""5px""     android:layout_width=""fill_parent""     android:paddingLeft=""8px""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;            &lt;TextView                android:id=""@+id/consult_assunto""                android:textStyle=""bold""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""left""                android:ellipsize=""end""                android:layout_width=""wrap_content""                 android:singleLine=""true""                 android:text=""@string/proc_subject""/&gt;            &lt;TextView                android:id=""@+id/consult_assuntovalue""                android:layout_width=""0px""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""right""                android:singleLine=""true""                android:ellipsize=""end""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""&gt;    &lt;TextView            android:id=""@+id/consult_assuntoinfo""            android:text=""Assunto do Processo""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""left""            android:singleLine=""true""            android:ellipsize=""end""             android:layout_width=""wrap_content""             android:textSize=""12px""/&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;View android:id=""@+id/View01""         android:layout_width=""wrap_content""         android:background=""#B5B5B5""         android:layout_height=""1px""&gt;&lt;/View&gt;&lt;LinearLayout    android:id=""@+id/LinearLayout05""     android:layout_height=""wrap_content""    android:orientation=""vertical""     android:paddingTop=""5px""     android:paddingBottom=""5px""     android:layout_width=""fill_parent""     android:paddingLeft=""8px""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;            &lt;TextView                android:id=""@+id/consult_datainicio""                android:textStyle=""bold""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""left""                android:ellipsize=""end""                android:layout_width=""wrap_content""                 android:singleLine=""true""                 android:text=""@string/srch_datebeg""/&gt;            &lt;TextView                android:id=""@+id/consult_datainiciovalue""                android:layout_width=""0px""                android:layout_height=""wrap_content""                android:layout_weight=""1""                android:gravity=""right""                android:singleLine=""true""                android:ellipsize=""end""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""&gt;    &lt;TextView            android:id=""@+id/consult_dataincioinfo""            android:text=""Data da criação do Processo""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""left""            android:singleLine=""true""            android:ellipsize=""end""             android:layout_width=""wrap_content""             android:textSize=""12px""/&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;!-- TITULO2 --&gt;&lt;LinearLayout     android:layout_height=""wrap_content""    android:layout_width=""fill_parent""     android:orientation=""horizontal""     android:background=""#848284"" android:padding=""4px""&gt;     &lt;TextView         android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:id=""@+id/TextView01""         android:text=""Informação Complementar""         android:textColor=""#FFFFFF""        android:gravity=""left""        android:textStyle=""bold""        android:singleLine=""true""        android:ellipsize=""end""        android:layout_gravity=""center_vertical"" android:paddingLeft=""4px"" android:textSize=""16px""&gt;    &lt;/TextView&gt;    &lt;LinearLayout         android:layout_height=""wrap_content""        android:layout_width=""fill_parent""         android:layout_gravity=""right|center_vertical""         android:gravity=""right|center_vertical""         android:paddingTop=""2px""&gt;        &lt;ToggleButton             android:layout_height=""wrap_content""             android:layout_width=""wrap_content""             android:textOff=""Expandir""             android:textOn=""Minimizar""            android:id=""@+id/mostrar2""             android:width=""80px""&gt;        &lt;/ToggleButton&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;View     android:id=""@+id/View01""     android:layout_width=""wrap_content""     android:background=""#B5B5B5""     android:layout_height=""2px""&gt;&lt;/View&gt;&lt;!-- TITULO3 --&gt;&lt;LinearLayout     android:layout_height=""wrap_content""    android:layout_width=""fill_parent""     android:orientation=""horizontal""     android:background=""#848284""    android:padding=""4px""&gt;      &lt;TextView         android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:id=""@+id/TextView01""         android:text=""Documentos Anexados""         android:textColor=""#FFFFFF""        android:gravity=""left""        android:textStyle=""bold""        android:singleLine=""true""        android:ellipsize=""end""        android:layout_gravity=""center_vertical""        android:textSize=""18px""         android:paddingLeft=""4px""&gt;    &lt;/TextView&gt;    &lt;LinearLayout         android:layout_height=""wrap_content""        android:layout_width=""fill_parent""         android:layout_gravity=""right|center_vertical""         android:gravity=""right|center_vertical""         android:paddingTop=""2px""&gt;        &lt;ToggleButton             android:layout_height=""wrap_content""             android:layout_width=""wrap_content""             android:textOff=""Expandir""             android:textOn=""Minimizar""            android:id=""@+id/mostrar""             android:width=""80px""&gt;        &lt;/ToggleButton&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;!--LINHA SEPARADORA--&gt;&lt;View     android:id=""@+id/View01""     android:layout_width=""wrap_content""     android:background=""#B5B5B5""     android:layout_height=""2px""&gt;&lt;/View&gt;&lt;!-- TITULO4 --&gt;&lt;LinearLayout     android:layout_height=""wrap_content""    android:layout_width=""fill_parent""     android:orientation=""horizontal""     android:background=""#848284""    android:padding=""4px""&gt;      &lt;TextView         android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:id=""@+id/TextView01""         android:text=""Etapas""         android:textColor=""#FFFFFF""        android:gravity=""left""        android:textStyle=""bold""        android:singleLine=""true""        android:ellipsize=""end""        android:layout_gravity=""center_vertical""        android:textSize=""18px""         android:paddingLeft=""4px""&gt;    &lt;/TextView&gt;    &lt;LinearLayout         android:layout_height=""wrap_content""        android:layout_width=""fill_parent""         android:layout_gravity=""right|center_vertical""         android:gravity=""right|center_vertical""         android:paddingTop=""2px""&gt;        &lt;ToggleButton             android:layout_height=""wrap_content""             android:layout_width=""wrap_content""             android:textOff=""Expandir""             android:textOn=""Minimizar""            android:id=""@+id/mostrar""             android:width=""80px""&gt;        &lt;/ToggleButton&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;&lt;!--LINHA SEPARADORA--&gt;&lt;View     android:id=""@+id/View01""     android:layout_width=""wrap_content""     android:background=""#B5B5B5""     android:layout_height=""2px""&gt;&lt;/View&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p></p><p>And here's the java code that calls the button event:</p><pre><code>final ToggleButton bt=(ToggleButton) findViewById(R.id.mostrar);    bt.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            if (bt.isChecked()) {                /*TranslateAnimation slide = new TranslateAnimation(0, 0, 0,                          -findViewById(R.id.informgeral).getHeight()*2);                           slide.setDuration(500);                           slide.setFillAfter(true);                           findViewById(R.id.informgeral).startAnimation(slide);*/                findViewById(R.id.informgeral).setVisibility(View.VISIBLE);;            } else {            /*  TranslateAnimation slide = new TranslateAnimation(0, 0, 0,                          findViewById(R.id.informgeral).getHeight());                           slide.setDuration(500);                           slide.setFillAfter(true);                           findViewById(R.id.informgeral).startAnimation(slide);*/                           //findViewById(R.id.listBut).startAnimation(slide);                findViewById(R.id.informgeral).setVisibility(View.GONE);;            }        }});</code></pre>","382115","","901200","","2014-02-12 22:09:36","2014-02-12 22:09:36","Animate visibility modes, GONE and VISIBLE","<android><animation><visibility><slide>","6","2","6","",""
"4043417","1","4043567","","2010-10-28 13:36:01","0","390","<p>When my app loads the following error comes up on some devices.  It refers to none of my source files at all!  How do I go about fixing this one?</p><pre><code>java.lang.NullPointerExceptionat com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)at com.google.android.maps.MapView.onDraw(MapView.java:494)at android.view.View.draw(View.java:6739)at android.view.ViewGroup.drawChild(ViewGroup.java:1648)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)at android.view.ViewGroup.drawChild(ViewGroup.java:1646)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)at android.view.View.draw(View.java:6742)at android.widget.FrameLayout.draw(FrameLayout.java:352)at android.view.ViewGroup.drawChild(ViewGroup.java:1648)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)at android.view.View.draw(View.java:6742)at android.widget.FrameLayout.draw(FrameLayout.java:352)at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)at android.view.ViewRoot.draw(ViewRoot.java:1422)at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:144)at android.app.ActivityThread.main(ActivityThread.java:4937)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</code></pre>","103999","","","","","2010-10-28 13:55:09","NullPointerException app loading","<android><nullpointerexception>","1","0","","",""
"4043421","1","","","2010-10-28 13:36:17","1","282","<p>In the method ""OnCreate"" of my actvity, I'm displaying a little progress dialog while loading data. It's done every time the ""OnCreate"" method is called so even when the screen orientation change.$</p><p>In the nominal case, there is no problem even if the user change the screen orientation.</p><p>But, if the user opens another dialog (used to select an item in a list), then change the orientation, the progress dialog is displayed behind the ""list"" dialog and is not impacted by the ""removeDialog"".</p><p>Do you have any clues on that behavior ?</p><p>Thanks</p>","465803","","","","","2010-10-28 14:19:39","""removedialog"" issue when displaying 2 dialogs at the same time","<java><android><dialog>","1","0","","",""
"4043490","1","","","2010-10-28 13:45:18","14","14062","<p>I would like to be able to send an actual SMS message from a shell using just the command line and not relying on any apk to do so.  I am interested in sending this message between phones, not from the emulator to the phone.  For example, by running the command:</p><pre><code>service call phone 2 s16 ""1234567890""</code></pre><p>I can place a call from phone to phone using the command line.  The 'service list' command shows an isms service, which I can't seem to provide the correct arguments for.  I would assume that one of the args should be a PDU string but haven't had any luck so far.</p>","489380","","225647","","2012-01-01 23:49:04","2013-05-30 23:51:07","How do I send an SMS from a shell?","<android>","6","0","8","",""
"4043617","1","4043673","","2010-10-28 14:01:14","4","1973","<p>I am starting an android camera app for taking pictures. When I ctrl-shift-O to get the import for the Camera class there are two choices: android.graphics.camera and android.hardware.camera. Which one should I use and what are the main differences?</p>","","user490074","","","","2011-02-01 10:43:46","Should I import android.graphics.camera or android.hardware.camera?","<java><android><camera>","3","0","","",""
"4043799","1","","","2010-10-28 14:20:43","3","869","<p>My MediaRecorder is setup to record audio from the mic.  This works ... except that the first .65 seconds is completely dead air - its as if the first .65 second the record button was pressed but the mic had not turned on yet.  </p><p>I need to determine if:</p><ol><li>Something is wrong with my code</li><li>This is just a flaw in the way MediaRecorder works</li><li>1 and 2 are true, but there is a work around!</li></ol>","209940","","213269","","2011-08-15 19:54:54","2011-11-03 08:48:52","MediaRecorder Silence at Beginning of Recording (Delay?)","<android><audio><delay><mediarecorder>","1","0","","",""
"4043836","1","4043919","","2010-10-28 14:26:37","0","230","<p>I launch my app from Eclipse on an emulator and Eclipse creates a new blank file called main.out.xml then refuses to launch because this new file is blank.  What is causing this?  What do I do about it?</p>","467090","","","","","2010-10-28 14:35:33","Android App Launch Creates Blank xml File","<android><xml><eclipse><android-emulator>","1","0","","",""
"4043864","1","4048938","","2010-10-28 14:29:12","0","593","<p>I have done one project in android which is to display map using GOOGLE API KEY.</p><p>goto: [<strong>http://mobiforge.com/developing/story/using-google-maps-android</strong>]</p><p>I <strong>generated MAP API key for my system</strong> by following the procedure mentioned in above link correctly. It works well and <strong>displays map on EMULATOR.</strong></p><p>I took a BUILD of my project and uploaded into my android MOBILE. Here <strong>Map DOESN'T display on my mobile</strong>. But all other functions work well.</p><p>Don't know what is the reason behind this problem :(</p><p><strong>My AVD Version Details:</strong> </p><p>AVD Name: Google APIs(Google Inc.)Platform : 2.1API Level: 7</p><p><strong>My android Mobile Details:</strong></p><p>It also supports GoogleAPI 2.1(Level 7) only. All other functionalities work well except displaying map.<br> (I am getting <strong>Polylines</strong> only)</p><p><strong>My XML file looks:</strong></p><p></p><pre><code>&lt;com.google.android.maps.MapView     android:id=""@+id/mapView""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:enabled=""true""    android:clickable=""true""    android:apiKey=""0l4sCTTyRmXTNo7k8DREHvEaLar2UmHGwnhZVHQ""    /&gt;</code></pre><p></p><p>Can anyone help me to recover this problem?</p><p>Thanks in advance!</p>","393502","","21234","","2010-10-28 14:32:05","2010-10-29 04:17:24","Android: Map displays on emulator(Version: Google APIs 2.1,level:7). But when uploaded into android mobile,it doesn't display","<android><android-maps>","1","0","","",""
"4043896","1","5330770","","2010-10-28 14:33:36","4","1000","<p>I am planning to develop an application using Titanium Framework for iPhone and Android. Can someone list the best practices, do's and don'ts for the development using your experience with the framework? </p>","189006","","","","","2013-08-27 22:06:45","what are the best Practices for developing applications using Titanium Framework targeting iPhone & Android?","<iphone><android><titanium>","2","0","3","",""
"4044031","1","4044059","","2010-10-28 14:50:16","1","1101","<p>Is there any way to always do a fresh install when I'm ""Running"" my Android app for testing on either a real device or an emulator. It always tells me ""No need to install because application is already on device"", then just launches the main Intent.</p><p>Any ideas? Thanks!</p>","312390","","","","","2010-10-28 20:36:00","Using Eclipse for Android App: App won't install freshly because it's already on the device","<java><android><eclipse>","2","2","","",""
"4044034","1","4998137","","2010-10-28 14:50:31","1","2349","<p>I want to get a DatePicker Dialog with no day picker (only year and month) for credit cards expiration in a form.I checked the DatePicker source code and it's not seem to be suporting such feature as not showing once of it's pickers.Any other widget to do it or do i have to create my own widget <strong>again</strong>...</p>","312288","","237260","","2011-06-01 10:56:11","2013-02-06 09:04:04","Using DatePicker with no day picker","<android><dialog><datepicker><android-widget>","1","1","1","",""
"4044087","1","","","2010-10-28 14:55:07","1","851","<p>I'm doing a android app. I want to add icon before the preference. I want to add icon before the title of the inner preferencescreen, checkboxpreference,... like icon|titleThank you for your help.like that picture:</p><p><a href=""http://2.bp.blogspot.com/_bbZoRtK3YH8/S0QbkvWxSiI/AAAAAAAAAwI/jU9vRI50ZDw/s320/Top+Android+App+Quick+Settings+Dialogue+View.png"" rel=""nofollow"">Top Android App: Quick Settings Dialogue View</a></p>","464012","","808940","","2011-10-11 18:49:39","2012-12-27 12:25:57","Add icon before the preference","<android>","4","1","","",""
"4044123","1","4044153","","2010-10-28 14:59:23","0","238","<p>I'm new to android sdk. I started with the HelloAndroid program. I followed all specified instructions, but to my surprise, the emulator is not diplaying the ""Hello Android"" text.</p><p><img src=""http://i.stack.imgur.com/ZHZNH.png"" alt=""alt text""></p><p>Instead the emulator looks like the one shown above(You can see ""LogCat"" at the bottom of the image).</p><p>The Console shows msgs like,</p><hr><p>[2010-10-28 20:14:59 - HelloAndroid] New emulator found: emulator-5554[2010-10-28 20:14:59 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...[2010-10-28 20:15:34 - HelloAndroid] HOME is up on device 'emulator-5554'[2010-10-28 20:15:34 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'[2010-10-28 20:15:35 - HelloAndroid] Installing HelloAndroid.apk...[2010-10-28 20:16:13 - HelloAndroid] Success![2010-10-28 20:16:13 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device [2010-10-28 20:16:18 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.helloandroid/.HelloAndroid }</p><hr><p>After some 7 min, ""request time failed"" error message is thrown in ""LogCat"".</p><p>Can someone help, please? Thanks.</p>","441575","","","","","2010-10-28 15:03:48","HelloAndroid Program","<android><android-emulator>","2","0","","",""
"4044132","1","","","2010-10-28 15:00:41","16","23234","<p>There is a TextField ""Filter"" below the LogCat output. However, it seems to filter only the Message-column. Id like to filter Tags also. Because there are my class names.</p><p>How can I achieve it?</p>","433718","","","","","2014-03-31 15:41:59","Filter tags in LogCat (in Android Eclipse Plug-In)","<android><logging><adb><logcat><ddms>","9","1","7","",""
"4044198","1","4045053","","2010-10-28 15:08:21","0","213","<p>I have a TextView I use to display email addresses to my users</p><pre><code>                &lt;TextView                     android:id=""@+id/profile_email""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:padding=""6dip""                    android:textColor=""#000000""                    android:maxLines=""1""                    android:ellipsize=""end"" /&gt;</code></pre><p>My issue is that many email addresses get cut off in the middle instead of having an ellipse at the end.  Here is an example:</p><p>If my email address is</p><pre><code>short.name@mydomain.com</code></pre><p>everything works fine.  However, If my email address is</p><pre><code>really.longfreakennameforanemailaddressandscreenisntwideenough@mydomain.com</code></pre><p>the only thing that will display is</p><pre><code>really.</code></pre><p>Any ideas?</p>","406790","","","","","2010-10-28 16:30:20","Problem with ellipsesize","<android><textview><ellipse>","1","0","","",""
"4044242","1","4057503","","2010-10-28 15:12:17","0","783","<p>I am  getting the following error while using a sample code of FBConnect. Earlier i was using Facebook rocket, but suddenly it started throwing some exceptions. Now when i am trying FBConnect it's also giving some errors:<br><br></p><pre><code>10-28 20:32:29.779: ERROR/FBDialog(261): java.io.FileNotFoundException: http://www.facebook.com/login.php?connect_display=touch&amp;fbconnect=1&amp;api_key=1fb0a3d3903ac1838da1668143e64ecc&amp;next=fbconnect%3A%2F%2Fsuccess10-28 20:32:29.779: ERROR/FBDialog(261):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.codecarpet.fbconnect.FBDialog.loadURL(FBDialog.java:687)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.codecarpet.fbconnect.FBDialog.loadURL(FBDialog.java:647)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.codecarpet.fbconnect.FBLoginDialog.loadLoginPage(FBLoginDialog.java:73)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.codecarpet.fbconnect.FBLoginDialog.load(FBLoginDialog.java:84)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.codecarpet.fbconnect.FBDialog.show(FBDialog.java:609)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.codecarpet.fbconnect.FBLoginActivity.onCreate(FBLoginActivity.java:34)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.os.Handler.dispatchMessage(Handler.java:99)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.os.Looper.loop(Looper.java:123)10-28 20:32:29.779: ERROR/FBDialog(261):     at android.app.ActivityThread.main(ActivityThread.java:4627)10-28 20:32:29.779: ERROR/FBDialog(261):     at java.lang.reflect.Method.invokeNative(Native Method)10-28 20:32:29.779: ERROR/FBDialog(261):     at java.lang.reflect.Method.invoke(Method.java:521)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)10-28 20:32:29.779: ERROR/FBDialog(261):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-28 20:32:29.779: ERROR/FBDialog(261):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","405521","","405521","","2010-10-29 06:15:08","2010-11-01 19:51:58","Android: FBConnect error","<android><fbconnect>","2","0","","",""
"4044356","1","","","2010-10-28 15:24:11","5","1583","<p>I've looked around a bit on stackoverflow and Google Groups and haven't really found an answer for this exact question.</p><p>I simply want to be able to know what <em>country</em> the user of an Android phone is currently in.</p><p>I assume the TelephonyManager doesn't work if the user is using wifi only.  Is this true?</p><p>We've tried passing the user's current latitude and longitude using android.location.Geocoder, but it's really flaky.  It will frequently return empty results.  Sometimes we can keep asking it and it will eventually return results, but it's really ugly.  Is there a more reliable way?</p><p>Thanks,Rob Sz</p>","299234","","","","","2011-11-04 00:07:56","What Country is the User Currently In?","<android><location>","3","1","1","",""
"4044479","1","4044852","","2010-10-28 15:34:47","3","2964","<p>I wanted to know if it is possible the comunication between two Android Emulators started on two different machines networked.</p><p>For example- Emulator A run on machine M1- Emulator B run on machine M2</p><p>Can A and B exchange messages?</p><p>If yes, what ip address do I use?</p><p>Thank you very muchDeborah</p>","385561","","","","","2011-04-09 07:02:45","Comunication between Android Emulators","<android><android-emulator>","2","0","5","",""
"4044509","1","4062318","","2010-10-28 15:37:51","24","8317","<p>I am trying to build an android application for a message board. To display formatted html for the post contents I have chosen the TextView and the Html.fromHtml() method. That, unfortunately, covers only a few html tags. The unknown tags are handled by a class that implements TagHandler and has to be generated by myself.</p><p>Now, I googled a lot and can't find an example of how this class should work. Let's consider I have an u tag for underlining some text (I know that this is deprecated, but whatever). How does my TagHandler look like? </p><p>It is called in the following way: </p><pre><code>public void handleTag(boolean opening, String tag, Editable output, XMLReader xmlReader) {</code></pre><p>The first two arguments are fine. I guess I have to modify output using output.append(). But how do I attach something underlined there?</p><p>Best regards and thanks in advance,Jan Oliver</p>","169748","","169748","","2010-10-28 15:51:59","2012-07-13 18:17:33","Android: How to use the Html.TagHandler?","<html><android><textview>","2","0","22","",""
"4044563","1","4048957","","2010-10-28 15:43:01","4","8091","<p>I am trying to programatically define my program layout and add a button to it at a certain position. I am not using the layout xml as the content view.</p><pre><code>RelativeLayout mainLayout;    mainLayout = new RelativeLayout(this);    mainLayout.setLayoutParams(newLayoutParams(LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.FILL_PARENT));</code></pre><p>I have then added a button that I want to apply the properties </p><pre><code>layout align centerparent align leftheight 60pxwidth 60px</code></pre><p>here is the button so far</p><pre><code>Button BtnNext = new Button(this);    BtnNext.setWidth(60);    BtnNext.setHeight(60);    BtnNext.setFocusable(true);    BtnNext.setId(idBtnNext);    BtnNext.setText(""Next"");    mainLayout.addView(BtnNext, 1);</code></pre><p>Height and width DON'T work correctly.</p>","353674","","","","","2010-10-29 04:23:54","Android, programatically layout a button view?","<android><layout><view>","2","2","2","",""
"4044775","1","4044888","","2010-10-28 16:04:38","1","392","<p><br>I am using the default simulator, Can I make simulator identical to some common device<br>I mean one identical to HTC, one identical to droid motorla, one of samsung, dell, acer,..etc<br>Here identical I mean all the features that it provide.<br>Thanks </p>","477754","","54200","","2010-10-28 16:32:40","2010-12-29 15:17:42","android: simulator identical to product of perticular companies","<android><device>","4","4","","",""
"4044802","1","4051818","","2010-10-28 16:06:47","2","2323","<p>I create a very simple activity where I create and set the view in java code instead of xml. The width I pass to the outer LinearLayout though has no effect at all (200). The view is displayed on the entire width of the screen, no matter what value I pass here.</p><p><em>(Note that this is just sample code; I know that in a real app you don't use fixed values. I just want to point out my problem here for easier clarification).</em></p><pre><code>public class MyActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // outer linear layout        LinearLayout ll = new LinearLayout(this);        ll.setLayoutParams(new LinearLayout.LayoutParams(                200,   // *** this param has no effect, regardless of the value I set here ***                LinearLayout.LayoutParams.FILL_PARENT        ));        ll.setBackgroundColor(Color.parseColor(""#00ff00""));        // inner linear layout        LinearLayout ll2 = new LinearLayout(this);        ll2.setLayoutParams(new LinearLayout.LayoutParams(                100,    // ** this width for the inner view is working fine **                LinearLayout.LayoutParams.FILL_PARENT        ));        ll2.setBackgroundColor(Color.parseColor(""#0000ff""));        ll.addView(ll2);        setContentView(ll);    }}</code></pre><p>But if I replace <code>setContentView(ll);</code> and use a xml layout instead where the outer LinearLayout has a value of 200px, it's applied properly and the view only takes 200px of the screen.</p><pre><code>setContentView(com.example.R.layout.main);</code></pre><p>where main.xml 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=""200px""    android:layout_height=""fill_parent""    android:background=""#ff0000""    &gt;    &lt;TextView          android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""@string/hello""        /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Why does setting a fixed width in java code for the outer layout has no effect?</strong></p>","241475","","","","","2010-10-29 12:32:05","Width of LayoutParams is ignored for the outer view when set in java code (instead of xml layout)","<android><android-layout>","3","0","1","",""
"4044836","1","4045135","","2010-10-28 16:09:18","9","4969","<p>I am using Android 2.2 (API Level 8). The camera is enabled in the manifest. When I try the camera icon provided by the emulator model, it runs for a few seconds showing a gray box moving around a black and white checkerboard, then dies with the error message: </p><blockquote>  <p>Sorry! The application Camera (process  com.android.camera) has stopped  unexpectedly. Please try again.</p></blockquote><p>Trying again, of course, doesn't help. I am using the provided emulator camera to compare behavior with a camera application I am working on. Why does the android emulator camera stop unexpectedly?</p>","","user490074","","user490074","2011-01-06 12:23:51","2012-12-12 20:02:04","Why does the android emulator camera stop unexpectedly?","<java><android><android-emulator><camera>","5","1","2","",""
"4044937","1","","","2010-10-28 16:18:03","0","2470","<p>I am trying to implement search in my application.</p><p>My application contain 4 activities and I want to add the search dialog only on 3 of them while only one of them (ProductsActivity) will be the default context.</p><p>unfortunately while I activate the search I keep getting the following error:""Key android.app.default_searchable expected String but value was a java.lang.Integer.  The default value  was returned.""</p><pre><code> &lt;activity android:label=""@string/app_name"" class="".AppEntry"" android:name="".AppEntry""&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="".category.CategoriesListActivity""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.SEARCH"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.app.searchable"" android:resource=""@xml/searchable""/&gt; &lt;/activity&gt; &lt;activity android:name="".product.ProductsActivity""&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.default_searchable"" android:resource=""@xml/searchable""/&gt;    &lt;/activity&gt;</code></pre><p>Any idea why ? </p><p>Thanks</p>","474643","","","","","2013-04-29 13:43:50","How to declare default searchable activity","<android>","3","0","1","",""
"4045028","1","4045139","","2010-10-28 16:27:29","2","5658","<p>I am trying to download a zip file that is just less than 22 mb on start.  I changed the default BufferedInputStream after these exceptions, but still get an out of memory error.</p><pre><code>public void downloadFromUrl(String fileName) {        //avoid unknown host exception        try {            InetAddress i = InetAddress                    .getByName(""http://xxx/Android/"" + fileName);        } catch (UnknownHostException e1) {            e1.printStackTrace();        }        try {            URL url = new URL(""http://xxx/Android/"" + fileName);            File file = new File(fileName);            long startTime = System.currentTimeMillis();            Log.d(""DownloadManager"", ""download begining"");            Log.d(""DownloadManager"", ""download url:"" + url);            Log.d(""DownloadManager"", ""downloaded file name:"" + fileName);            URLConnection ucon = url.openConnection();            InputStream is = ucon.getInputStream();            BufferedInputStream bis = new BufferedInputStream(is, 23 * 1024);            ByteArrayBuffer baf = new ByteArrayBuffer(23 * 1024);            int current = 0;            while ((current = bis.read()) != -1) {                baf.append((byte) current);            }            FileOutputStream fos = new FileOutputStream(file);            fos.write(baf.toByteArray());            fos.close();            Log.d(""DownloadManager"",                    ""download ready in""                            + ((System.currentTimeMillis() - startTime) / 1000)                            + "" sec"");        } catch (IOException e) {            Log.d(""DownloadManager"", ""Error: "" + e);        }    }</code></pre><p>stack:</p><pre><code>10-28 10:18:16.885: DEBUG/ImageManager(1804): download begining10-28 10:18:16.885: DEBUG/ImageManager(1804): download url:http://xxx/Android/Samples.zip10-28 10:18:16.885: DEBUG/ImageManager(1804): downloaded file name:Samples.zip10-28 10:18:17.204: INFO/global(1804): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.10-28 10:18:17.845: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 1803 objects / 185168 bytes in 96ms10-28 10:18:18.415: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 229 objects / 105296 bytes in 78ms10-28 10:18:18.425: INFO/dalvikvm-heap(1804): Grow heap (frag case) to 3.184MB for 376848-byte allocation10-28 10:18:18.545: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 0 objects / 0 bytes in 109ms10-28 10:18:20.555: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 44 objects / 190080 bytes in 65ms10-28 10:18:20.575: INFO/dalvikvm-heap(1804): Grow heap (frag case) to 3.721MB for 753680-byte allocation10-28 10:18:20.675: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 0 objects / 0 bytes in 95ms10-28 10:18:22.725: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 3 objects / 376904 bytes in 66ms10-28 10:18:23.145: INFO/dalvikvm-heap(1804): Grow heap (frag case) to 4.799MB for 1507344-byte allocation10-28 10:18:23.245: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 0 objects / 0 bytes in 95ms10-28 10:18:25.415: WARN/ActivityManager(59): Launch timeout has expired, giving up wake lock!10-28 10:18:26.205: WARN/ActivityManager(59): Activity idle timeout for HistoryRecord{43ef1378 com.xxx.xxxe/.TabViewMain}10-28 10:18:27.995: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 3 objects / 753736 bytes in 65ms10-28 10:18:28.655: INFO/dalvikvm-heap(1804): Grow heap (frag case) to 6.956MB for 3014672-byte allocation10-28 10:18:28.765: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 0 objects / 0 bytes in 102ms10-28 10:18:33.275: DEBUG/dalvikvm(123): GC_EXPLICIT freed 833 objects / 48984 bytes in 2059ms10-28 10:18:37.275: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 3 objects / 1507400 bytes in 69ms10-28 10:18:38.115: INFO/dalvikvm-heap(1804): Grow heap (frag case) to 11.268MB for 6029328-byte allocation10-28 10:18:38.275: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 0 objects / 0 bytes in 151ms10-28 10:18:53.885: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 3 objects / 3014728 bytes in 70ms10-28 10:18:53.895: INFO/dalvikvm-heap(1804): Forcing collection of SoftReferences for 12058640-byte allocation10-28 10:18:54.055: DEBUG/dalvikvm(1804): GC_FOR_MALLOC freed 0 objects / 0 bytes in 158ms10-28 10:18:54.055: ERROR/dalvikvm-heap(1804): Out of memory on a 12058640-byte allocation.</code></pre><p>EDIT:  Ok, I was able to get <a href=""http://stackoverflow.com/questions/2121833/permission-to-write-to-the-sd-card"">this example</a> working, but even with the correct permissions, I get a permission denied error: </p><pre><code>`10-2`8 11:33:15.478: WARN/System.err(1781): java.io.FileNotFoundException: /mnt/sdcard/testDirectory/Samples.zip (Permission denied)</code></pre>","375566","","237917","","2012-02-03 16:13:37","2012-09-25 20:59:26","Android download file out of memory woes","<java><android><bytebuffer>","3","2","2","",""
"4045085","1","4147412","","2010-10-28 16:34:40","2","1040","<p>I have button, which displays a Context menu. In the menu are few items (some of them are disabled - setEnabled(false)).</p><p>Which event is called when a user click on the disabled item? It's not onContextItemSelected nor onContextMenuClosed. But the menu is closed after the click.</p><p>Thanks for your help.</p>","490351","","","","","2010-11-10 17:50:08","Which event is called when a user click on the disabled item in context menu?","<android><contextmenu>","1","2","","",""
"4045146","1","4045795","","2010-10-28 16:43:18","1","733","<p>I am using setPixel and getPixel functions but they are using matrices which is naturally rectangle.I am trying to copy pixels shaped like circle !</p><p>update :now i am using this but i hope there is something more efficient than this one :</p><pre><code>for(int i=0;i&lt;eHeight ; i++)        for(int j=0;j&lt;eWidth ; j++)            if( Math.pow((i-eHeight/2),2) +  Math.pow((j-eWidth/2),2) &lt; Math.pow((eHeight/2),2))                 mutable.setPixel((int)xpos+j, (int)ypos+i, r[i*eWidth + j]) ;</code></pre>","458678","","458678","","2010-10-28 17:55:21","2010-10-28 18:02:21","How to copy pixels from one bitmap to another shaped like a circle?","<android><bitmap><circle><getpixel>","2","0","","",""
"4045198","1","","","2010-10-28 16:48:37","5","2690","<p>I have a Service which tracks the location of the user.  Currently, the Service boots when the application starts and stops when the application terminates.  Unfortunately, if users keep the application in the background, the Service never stops and drains battery.</p><p>I would like the Service to stop when my application is not in the foreground.  I was hoping the Application class would let me Override onPause and onResume handlers, but it does not have them.  Is there another way I can accomplish this?</p>","406790","","","","","2014-03-24 15:11:10","Stopping and starting a Service based on application state","<android><service><battery>","8","2","1","",""
"4045341","1","4045478","","2010-10-28 17:05:14","2","867","<p>The desktop application emulator works fine.Settings > Applications > Development > USB debugging is checked.The ""USB debugging connected"" alert is displayed on the Nexus One when the USB cable is attached but I can't seem to get the debugger to run the code on it.Is there something else I need to do to get the debugger to work on the device?</p>","","user490074","","","","2010-10-28 17:22:40","Android: how to debug application on Nexus One","<android><android-emulator>","2","0","1","",""
"4045370","1","4281714","","2010-10-28 17:08:50","3","4658","<p>Following is simple html, when viewed on android browser(nexus one) results into continuos orientationchange event chain when you change phone's orientation just once.<pre><code>&lt;html>&lt;body>&lt;script type=""text/javascript"">window.addEventListener(""orientationchange"",function(){alert(""test"");},false);&lt;/script>&lt;/body>&lt;/html></code></pre>Can somebody please explain and suggest some workaround?</p>","195802","","","","","2013-01-09 08:59:11","Android Browser orientationchange event keeps firing","<javascript><android><events><browser><orientation>","3","2","1","",""
"4045400","1","","","2010-10-28 17:12:09","18","2284","<p>I have a class that sends a status bar notification in Android. I can't find a way to test whether the notification was sent or not, which makes it very hard to write any kind of useful unit test.</p><p>Does anyone have a solution for this?</p>","6007","","","","","2013-12-12 09:22:01","Can I test status bar notifications using Android's testing framework?","<java><android><unit-testing><junit><android-notifications>","6","1","2","",""
"4045645","1","","","2010-10-28 17:42:04","3","14339","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2800386/could-not-open-selected-vm-debug-port-8700"">Could not open Selected VM debug port (8700)</a>  </p></blockquote><p>I am getting an error when opening eclipse: ""Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences."" - pretty sure DDMS is the Andoid debugger, and I am also pretty sure it is not turned on. Does anyone know how to start it?</p>","291059","","","","","2011-07-21 11:52:44","Eclipse Android: Could not open Selected VM debug port (8700)","<android><eclipse><ddms>","3","0","","2012-01-13 19:19:41",""
"4045666","1","4046456","","2010-10-28 17:44:25","5","2816","<p>If user repeatedly presses back button, I need a way to detect when they are on the very last activity of my task/app and show ""Do you want to exit?"" dialog befor they return to Home Screen or whatever previous app they had running.</p><p>Its easy enough to hook <code>onkeypressed()</code>, but how do I figure out that this is a ""last"" activity in the task? </p>","450741","","","","","2010-10-28 19:23:33","show dialog yes/No before leaving the app via Back button","<android><user-interface><button><dialog><back>","3","2","3","",""
"4045793","1","4051415","","2010-10-28 18:01:30","0","757","<p>I just want to ask a simple question related the GLSurfaceView and drawn objects on it. I am drawing a rect and bind a texture to it. It works great. Then, the textured rect I am drawing is on a GLSurfaceView. I am drawing a ""button""-like object for which I should know whether the user clicked on the button or not. </p><p>I imagined that like this: if the user taps the screen and the .y of the tap are in the rect of the drawn object (in my case the button), I need another operation to be performed (i.e. change another view or so...). Is my idea correct? </p><p>Now the question: How do I handle user interactions? And how can I get the Rect of the drawn object (button) maped on the GLSurfaceView (i.e. Rect(120, 80)) so that I can then check whether the user clicked the button or not? Or there is some other approach.</p><p>Also I am interested in the following:I have in mind to make my application full opengl es based. I won't use Button views from Android. I am working with big textures and I think OpenGL ES is the better way to do it since animations via translations and rotations and scaling are much easier to handle. Am I right? </p><p>Thanks</p>","584513","","","","","2010-10-29 11:36:47","GLSurfaceView textured rect as button clicks","<android><opengl-es><glsurfaceview>","1","0","","",""
"4045894","1","4045970","","2010-10-28 18:11:27","2","2355","<p>I am trying to use one of these algorithms to convert a RGB image to grayscale :</p><blockquote>  <p>The lightness method averages the most prominent and least prominent colors:   (max(R, G, B) + min(R, G, B)) / 2.</p>    <p>The average method simply averages the values: (R + G + B) / 3.</p>    <p>The formula for luminosity is 0.21 R + 0.71 G + 0.07 B.  But i get very weird results ! I know there are other ways to acheive this but is it possible to do this way ?</p></blockquote><p>here is the code :</p><pre><code>for(int i = 0 ; i &lt; eWidth*eHeight;i++){        int R = (pixels[i] &gt;&gt; 16) ;     //bitwise shifting        int G = (pixels[i] &gt;&gt; 8) ;        int B = pixels[i] ;        int gray = (R + G + B )/ 3 ;        pixels[i] = (gray &lt;&lt; 16) | (gray &lt;&lt; 8) | gray   ;}</code></pre>","458678","","458678","","2010-10-28 18:49:07","2010-10-28 18:49:07","How to apply , converting image from colored to grayscale algorithm to android?","<android><colors><rgb><grayscale>","4","3","1","",""
"4046068","1","4046088","","2010-10-28 18:33:15","1","254","<p>Lets say I have three Activities in my App. </p><p>1) Signup Activity2) AccountActivate Activity3) Main Activity</p><p>Order 1 -> 2 -> 3 (User Signs Up -> if Sign up is successful -> Enters PIN and activates account -> if activation successful -> lands in Main Activity</p><p>Now here is the problem.</p><p>Once I am in Main and the activation is complete, and I press the hardware key (BACK) on the phone or the emulator I am taken to AccountActivate Activity (2) again. I do not really want this to happen since the Account has been activated so the user should not really see this again. Is there a way I can handle this?</p><p>Thanks for all the help guys.   </p>","447886","","","","","2010-10-28 18:37:57","Handling Activity Stack in Android Apps","<android><android-emulator>","1","1","2","",""
"4046227","1","4046294","","2010-10-28 18:53:21","2","261","<p>I read here: <a href=""http://www.androidguys.com/2009/10/11/developers-can-now-target-by-carrier-in-android-market/"" rel=""nofollow"">http://www.androidguys.com/2009/10/11/developers-can-now-target-by-carrier-in-android-market/</a> that it can be done if you go to the Android Market, and go to your app, then go to Publishing Options -> Locations, but I don't see anything to select a specific carrier there, only specific countries. </p><p>Is this something that Google changed? Can this still be done, or is it done automatically? Can't the carrier be detected from the device?</p>","413414","","","","","2010-10-28 19:02:48","Targeting specific carriers in Android","<android><target>","1","0","","",""
"4046255","1","4046376","","2010-10-28 18:57:09","4","243","<p>I'm writing a game where the player tilt the phone to control a character.</p><p>The problem is: the music(when playing loud) and sound effect(like gun shots) disturbs the accelerometer values. This result in weird character movement.</p><p>Please give me some advice on how to solve this.</p><p>Thank you in advance!</p>","461783","","7724","","2010-10-28 19:00:51","2010-10-28 19:20:44","Music in my game disturbs accelerometer values. How to solve this?","<android><accelerometer><sensor>","1","2","","",""
"4046319","1","","","2010-10-28 19:05:33","1","2171","<p>I am trying to convert a UTF-8 data to String. The UTF-8 data is obtained by HTTP connection.My problem is the converted String does not display UTF-8 Characters properly.</p><p>Here is my code {extra bits removed }</p><pre><code>URLConnection urlconn = url.openConnection();httpConn = (HttpURLConnection) urlconn;httpConn.connect();InputStream in= httpConn.getInputStream();String text = """";InputStreamReader isr = new InputStreamReader(in,""UTF-8"");int charRead;char[] inputBuffer = new char[2048];while((charRead = isr.read(inputBuffer))&gt;0){String readString = String.copyValueOf(inputBuffer,0,charRead);text += readString;inputBuffer = new char[BUFFER];}</code></pre><p>Where am i doing wrong ? The generated text is not UTF-8 !!</p><p>Thanks</p>","388044","","388044","","2010-10-28 19:23:44","2010-10-28 19:23:44","Android: UTF-8 encoded HTTP response to String","<android><http><utf-8><connection>","0","4","","",""
"4046377","1","4053163","","2010-10-28 19:12:00","7","5337","<p>I have a single-channel PNG file I'd like to use as an alpha mask for Porter-Duff drawing operations.  If I load it without any options, the resulting Bitmap has an RGB_565 config, i.e. treated as grayscale.  If I set the preferred config to ALPHA_8, it loads it as a grayscale ARGB_8888 instead.</p><p>How can I convince Android to treat this file as an alpha mask instead of a grayscale image?</p><pre><code>mask1 = BitmapFactory.decodeStream(pngStream);// mask1.getConfig() is now RGB_565BitmapFactory.Options maskOpts = new BitmapFactory.Options();maskOpts.inPreferredConfig = Bitmap.Config.ALPHA_8;mask2 = BitmapFactory.decodeStream(pngStream, null, maskOpts);// mask2.getConfig() is now ARGB_8888 (the alpha channel is fully opaque)</code></pre>","180891","","","","","2013-06-09 01:59:38","Android: loading an alpha mask bitmap","<android><graphics>","1","4","4","",""
"4046586","1","","","2010-10-28 19:41:27","2","175","<p>I am developing an app where a single activity is instantiated multiple times by itself.  I guess you could think of it like a book where each activity is a page.  At the end of the page (activity) the user presses a button to go to a new page.  I fire off an Intent for the same Activity, but I push different data into the Bundle so that a different page is loaded.</p><p>This works fine, and I like the fact that the user can back up to a previous point, but my question is whether this will eventually be a problem?  What happens if this activity is instantiated 10 times, or 50, or 100?  Will the device run out of memory, will GC come along and clean up old activities, or what?</p><p>If GC does clean them up, what happens when the user presses Back and the previous Activity is no longer on the stack?</p><p>Is it better to keep track of the user's path, finish() the activity, and override the Back button so that whether the user is moving forward or backwards, I only load a single Activity?  Another approach I could take is to refresh all the data on the page so that it's still the same activity, but with new data.  The Back button would not work as expected in this case.</p><p>Thoughts?</p>","434574","","","","","2010-10-29 09:46:07","Is there anything I need to take into account when repeatedly calling the same activity?","<android><activity><android-intent>","2","0","","",""
"4046612","1","","","2010-10-28 19:45:49","1","967","<pre><code>Activity myActivity  = AssumeSomeActivityExists();    Intent openActivity = new Intent();    openActivity.setAction(Intent.ACTION_VIEW);    openActivity.setClass(myActivity,B.class);    myActivity.startActivity(openActivity);</code></pre><p>When we do something like above how to make <code>B</code> instance know that it is been called and created by Activity <code>myActivity</code>?</p>","465778","","1029088","","2013-01-09 10:19:37","2013-01-09 10:19:37","Activity to Activity Communication","<android><activity><communication><android-intent>","1","0","","",""
"4046615","1","4117869","","2010-10-28 19:46:58","2","1483","<p>I'm trying to avoid that when a user has connected to Facebook from my webview, the next time he do it, doesn't need to put the email and password. I'm getting the cookie from the ""facebook.com"" domain with this sentence:</p><pre><code>String cookie = CookieManager.getInstance().getCookie(""facebook.com"");</code></pre><p>and storing it in a SQLite database. When the user try to connect another time to Facebook, I use this sentence after removing all another cookies:</p><pre><code>CookieManager.getInstance().setCookie(""facebook.com"", user_acc.getSessionCookie());</code></pre><p>but doesn't work. That cookie I suppose that is not valid because the user has to put his username and his password again and after login, I get a different cookie that the one I had stored.</p><p>What I'm doing wrong? Is there another way to accomplish that?</p><p>Thank you in advance.</p>","383628","","","","","2010-11-07 13:17:24","Store the session of Facebook from WebView","<java><android><session><cookies><webview>","3","0","","",""
"4046644","1","4047172","","2010-10-28 19:51:16","8","12233","<p>I want to decompose my UI into several XML Layouts. The first one would be the main layout, and the other ones would be the content layouts.</p><p>I would like to be able to set which content_layout should be included dynamically at run-time, so I don't want to set a <code>""layout=""@+layout/content_layout""</code> in my XML file.</p><p>Here are my layouts:</p><p>main_layout.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=""600dp""    android:layout_height=""800dp"" &gt;    &lt;TextView        android:id=""@+id/title""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true"" /&gt;    &lt;include /&gt; &lt;!-- I WANT TO INCLUDE MY CONTENT HERE --&gt;    &lt;Button        android:id=""@+id/cancelButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        android:text=""Cancel"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>content_layout.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/whatever""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" /&gt;</code></pre><p>content_layout2.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/whatever2""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" /&gt;</code></pre><p>How can I do that?</p><p>Thanks!</p>","488054","","885464","","2012-02-17 13:23:19","2012-05-21 11:06:31","Android: How to dynamically include a XML Layout?","<android><layout><android-layout><include>","2","0","2","",""
"4046717","1","4047021","","2010-10-28 20:00:24","2","854","<p>I'm attempting to use a <a href=""http://stackoverflow.com/questions/631238/modifying-the-android-seekbar-widget-to-operate-vertically/3349669#3349669"">custom Android vertical scrollbar widget</a> that seems to work fine in its own example project, but I am having trouble trying to include it into my project.  I've exported a <code>.jar</code> from it to use in my project, but it seems to be a minefield of problems, from duplicate resources, to my XML layouts not able to get at styles inside the library, and errors ""inflating class"" when reading my XML layout file.</p><p>How should I go about using the widget from another project in my own?</p><p>Quite new to Java development (know the language, but not much of the overarching project/package management), so if there's some good text regarding that it would be appreciated.</p>","194586","","","","","2010-10-28 20:55:23","Using custom Android widget from one project in another","<android><widget>","2","0","","",""
"4046836","1","4046973","","2010-10-28 20:18:11","0","1114","<p>I've to do a memo card game in android for my project. As for now i'm at the stage where i try to figure out the basic shape of my app.</p><p>I've read some tutorials, but i can;t figure out how to modify a lot of dynamically created buttons (ie. in 'for' loop), from xml, or even from the code.To make my question clear here's the code i made</p><pre><code>package piotrek.test1;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.*;import android.widget.*;import java.util.ArrayList;import java.util.*;public class test1 extends Activity implements View.OnClickListener {private ArrayList&lt;Integer&gt; listaKart = new ArrayList&lt;Integer&gt;();    private int rozmiar = 0;    private int licznik = 0;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TworzKarty();    //tu tworzymy definicje nowego wygladu (layout) czyli w formie tabeli    TableLayout layout = new TableLayout (this);    layout.setLayoutParams( new TableLayout.LayoutParams(4,5) );    //ustawienie odstepow do 'scian'    layout.setPadding(10,10,10,10);    //petle 'populujace' miejsca w tabeli przyciskami    for (int f=0; f&lt;=5; f++) {        TableRow tr = new TableRow(this);        for (int c=0; c&lt;=4; c++) {            ToggleButton b = new ToggleButton (this);            //b.setText(""""+f+c);            b.setText(Integer.toString(listaKart.get(licznik)));            b.setTextSize(10.0f);            b.setTextColor(Color.rgb( 100, 200, 200));            b.setOnClickListener(this);            tr.addView(b, 60,60);            licznik++;        } // for        layout.addView(tr);    } // for    super.setContentView(layout);} // ()public void TworzKarty(){for (int i=0;i&lt;=14;i++){    this.listaKart.add(i);    this.listaKart.add(i);}//pomieszanie kolejnosci numerkówCollections.shuffle(listaKart);rozmiar=listaKart.size();}public void onClick(View view) {//((Button) view).setText(""*"");//((Button) view).setEnabled(false);if (((ToggleButton) view).isChecked()) {    Toast.makeText(test1.this, Integer.toString(rozmiar), Toast.LENGTH_SHORT).show();} else {    Toast.makeText(test1.this, ""Not checked"", Toast.LENGTH_SHORT).show();}}} // class</code></pre><p>What happens when i run the app is, that i have 30 togglebuttons on the screen, each of them has a number form 0 to 14 (15 pairs). That's what i wanted to have, but when i press any of them buttons besides showing the toast button text changes form what i want it to be to ON and then after another press to OFF.I can't figure out how to control this behaviour - i would really appreciate some tips on how to achieve this strictly in code or using xml. Another case is how to use xml to define such layout and randomness of the text set on buttons.</p>","490584","","","","","2010-10-28 20:36:03","How to modify ToggleButton behaviour with or without xml in Android","<android><xml><togglebutton><settext>","1","1","","",""
"4046850","1","","","2010-10-28 20:20:18","0","160","<p>I am trying to implement serialization for an email application on the android (stroring username, password, server etc.), but in order to test it I have to close the application in the emulator and then re-open it to ensure that it looks and finds the file with the serialized objects.  The problem is that when I close the application on the emulator uninstalls the application.  I close the application with the finish() function.  Any inklings as to why this happens?  And it wasn't doing it until further along in my development stage.  Thank you for any help provided.</p>","490587","","","","","2010-10-29 01:51:51","Android emulator unistalls application after the app is closed, but I need to test serialization","<android><android-emulator>","1","2","","",""
"4046922","1","","","2010-10-28 20:29:30","1","96","<p>I have 2 <code>TextView</code>'s in a horizontal <code>LinearLayout</code>. The <code>LinearLayout</code> fills the screen horizontally. How can I achieve the following behaviour:</p><ol><li><p>If the first <code>TextView</code> is too big, it is ellipsized at the end like this:</p><p><code>[firstTextViewIsTooBig...|secondTextView]</code></p></li><li><p>If the first <code>TextView</code> is not big, the layout should look like this:</p><p><code>[firstTextViewIs|secondTextView---------]</code></p></li></ol><p><strong>Important:</strong></p><ul><li>I don't know <code>LinearLayout</code>'s width, so I can't set fixed <code>maxWidth</code> on the first <code>TextView</code>.</li><li>Second <code>TextView</code> should be always aligned to the left of the first, not to the right of the layout.</li></ul>","243225","","243225","","2010-10-28 20:40:04","2010-10-28 20:51:02","Android layout problem","<android><layout>","1","0","1","",""
"4047056","1","4047128","","2010-10-28 20:47:57","0","968","<p>I wounder if there is some different way of validating EditText on android controlls.. Or should I use the regular java way of doing this?</p>","371301","","","","","2011-12-14 14:43:19","Validation on TextEdit boxes on android","<java><android><eclipse><validation>","4","1","1","",""
"4047123","1","","","2010-10-28 20:58:03","0","286","<p>In the following example, how would I access the ""position"" variable from outside the parent class?</p><pre><code>void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {    Country country = (Country) parent.getAdapter().getItem(position);    spinner2.setAdapter(new ArrayAdapter(country.getStates());}</code></pre>","490621","","899126","","2013-11-22 13:54:31","2013-11-22 13:54:31","How to access position variable in onItemSelected()","<android>","1","0","","",""
"4047138","1","","","2010-10-28 21:00:43","2","625","<p>I am trying to run this code, but get an error. Can anyone tell me why? The debugger shows the following</p><p>Thread [&lt;3> main] (Suspended (exception NegativeArraySizeException))  ViewRoot.handleMessage(Message) line: 1704  ViewRoot(Handler).dispatchMessage(Message) line: 99  Looper.loop() line: 123  ActivityThread.main(String[]) line: 4203  Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 791  ZygoteInit.main(String[]) line: 549  NativeStart.main(String[]) line: not available [native method] </p><pre><code>  public void convertAudio () throws IOException {   Log.d(""FILE"", ""Converting Audio"");   java.io.File fileExist = new java.io.File(""/sdcard/"" , ""test1.3gp"");   java.io.File fileNew = new java.io.File(""/sdcard/"" , ""test2.3gp"");   if (fileNew.exists()) {    FileInputStream fExist = new FileInputStream(fileExist);        FileInputStream fNew = new FileInputStream(fileNew);       long lengthExist = fileExist.length();       if (lengthExist &gt; Integer.MAX_VALUE) {             // File is too large       }       byte[] bytesExist = new byte[(int)lengthExist];       int offset = 0;       int numRead = 0;       try {        while (offset &lt; bytesExist.length &amp;&amp; (numRead=fExist.read(bytesExist, offset, bytesExist.length-offset)) &gt;= 0) {             offset += numRead;        }       } finally {       }       // Ensure all the bytes have been read in       if (offset &lt; bytesExist.length) {             throw new IOException(""Could not completely read file ""+fileExist.getName());       }       byte[] cleanExist = convert3gpDataToAmr(bytesExist);       long lengthNew = fileNew.length();       if (lengthNew &gt; Integer.MAX_VALUE) {             // File is too large       }       byte[] bytesNew = new byte[(int)lengthNew];       int offsetNew = 0;       int numReadNew = 0;       try {        while (offset &lt; bytesNew.length &amp;&amp; (numRead=fNew.read(bytesNew, offsetNew, bytesNew.length-offsetNew)) &gt;= 0) {         offsetNew += numReadNew;        }        } finally {        }       // Ensure all the bytes have been read in       if (offset &lt; bytesNew.length) {             throw new IOException(""Could not completely read file ""+fileExist.getName());       }       byte[] cleanNew = convert3gpDataToAmr(bytesNew);          }  }</code></pre><p>// #!AMR\n</p><pre><code> private static byte[] AMR_MAGIC_HEADER = {0x23, 0x21, 0x41, 0x4d, 0x52, 0x0a};  public byte[] convert3gpDataToAmr(byte[] data) {     if (data == null) {         return null;     }     ByteArrayInputStream bis = new ByteArrayInputStream(data);         // read FileTypeHeader     FileTypeBox ftypHeader = new FileTypeBox(bis);     // You can check if it is correct here     // read MediaDataHeader     MediaDataBox mdatHeader = new MediaDataBox(bis);     // You can check if it is correct here     int rawAmrDataLength = mdatHeader.getDataLength();     int fullAmrDataLength = AMR_MAGIC_HEADER.length + rawAmrDataLength;     byte[] amrData = new byte[fullAmrDataLength];     System.arraycopy(AMR_MAGIC_HEADER, 0, amrData, 0, AMR_MAGIC_HEADER.length);         bis.read(amrData, AMR_MAGIC_HEADER.length, rawAmrDataLength);     return amrData; }}</code></pre>","488521","","234039","","2010-10-28 21:02:49","2010-10-28 22:13:26","NegativeArraySizeException in Android","<android>","1","0","","",""
"4047159","1","4047347","","2010-10-28 21:05:55","1","1083","<p>I keep getting a file not found error, even though it exists at /mnt/sdcard/folder/Samples.zip.  I downloaded the file there, so there are ""write"" permissions, but it just doesn't want to unzip!  Why is this?</p><pre><code>        ZipInputStream in = null;        try {            final String zipPath = ""/folder/Samples.zip"";            in = new ZipInputStream(getAssets().open(                    Environment.getExternalStorageDirectory() + zipPath));            for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in            .getNextEntry()) {            }        } catch (IOException e) {            System.out.println(""file error of some kind"" + e);        } finally {            try {                if (in != null) {                    in.close();                }            } catch (IOException ignored) {            }            in = null;        }</code></pre>","375566","","","","","2010-10-29 04:03:54","Unzipping from SD card - filenotfound error - Android 2.2 SDK","<java><android>","4","0","","",""
"4047251","1","4048218","","2010-10-28 21:19:10","4","706","<p>I'm porting a small (&lt;10 classes) C++ project to Java. The project manipulates sound files, and in C++ does this using <a href=""http://www.mega-nerd.com/libsndfile/"" rel=""nofollow"">libsndfile</a>. The code includes stuff like:</p><pre><code>const int channels = audioFileInfo.channels;...sf_readf_double( audioFile, inputBuffer, MAX_ECHO );...sf_writef_double( outputAudioFile, &amp;currentAudioBuffer[WINDOW_SIZE * channels], SEGMENTATION_LENGTH );</code></pre><p>In Java, what's the best way to manipulate sound files on a low level? I'm talking about stuff like normalizing, adding echoes etc. </p><p><strong>Progress Report</strong></p><p>After a bit of digging I've found <a href=""http://download.oracle.com/javase/6/docs/api/javax/sound/sampled/package-summary.html"" rel=""nofollow"">javax.sound.sampled</a>, which looks like it might do the job. </p><p><strong>Edit 2</strong> On closer inspection, it won't work (or at least not in any usable way), since it relies on the <code>com.sun.sound</code> package.</p><p><strong>Edit 3</strong> On even more inspection, and experimentation, the <code>com.sun.sound</code> and <code>sun.misc</code> packages are released under the GNU GPLv2, and I've downloaded them into my project. Having renamed <code>javax.sound.sampled</code> to <code>imp.javax.sound.sampled</code>, the project compiles, and I can create <code>AudioFileFormat</code> objects without any exceptions being thrown, yet. I haven't had a chance to play around much yet but I'll keep you updated.</p><p><strong>Edit 4</strong> Ok, Some things appear to work with javax.sound.sampled, others do not. For example, calls such as:</p><pre><code>AudioInputStream stream = AudioSystem.getAudioInputStream(waveFile));</code></pre><p>do not work, however I can get around this by doing:</p><pre><code>WaveFileReader wfr = new WaveFileReader();AudioInputStream stream = wfr.getAudioInputStream(waveFile);</code></pre><p>In general, calls to things like <code>AudioSystem.getAudioFileTypes()</code> return empty lists. I can delve into the packages and see it's something to do with providers, but I'm at a loss how to remedy this. Having got my <code>stream</code> object it does report its encoding etc. correctly, which is encouraging.</p><p>My big problem at the moment is creating a Clip object. This needs to be created with a Line object, which would normally come from AudioSystem. Can anyone think of a way around this?</p>","319618","","319618","","2010-11-05 14:44:49","2010-11-08 04:59:06","What should I use in Android when porting C++ code written with libsndfile?","<java><c++><android><porting><libsndfile>","3","1","2","",""
"4047331","1","4047352","","2010-10-28 21:31:05","0","546","<p>I have two images overlayed and i copy pixels from bottom image to top image while ACTION_MOVE. My goal is to give erasing feeling to the user but sometimes it doesn't copy(erase) some parts and it gets worse if touch event is fast( dragging finger fastly).</p><p>This is the code i am using for copying pixels </p><pre><code>mutable.getPixels(pixels, 0, width, xPos,  yPos, width, height) ;mutable2.setPixels(pixels, 0, width,xPos,  yPos, width, height) ;</code></pre>","426815","","345717","","2010-10-28 22:55:01","2010-10-29 03:58:34","Image manipulation while on touch event is inefficient !","<android><image-processing><image-manipulation><touch><ontouchevent>","2","0","","",""
"4047359","1","","","2010-10-28 21:35:35","4","3227","<p>I have seen this problem off and on while running the Eclipse (Galileo) under Fedora 11-13, whether the target is my device or an emulator. But now with my new device, the HTC T-Mobile G2 (Android 2.2), I see it much more frequently: I successfully download the app (complete with lots of Log.d() calls), the system successfully launches it, but the LogCat pane in the DDMS perspective is completely blank.</p><p>Sometimes, only sometimes, I seem to be able to kick it into action by clicking on the tool for Debug (the little bug one). But that doesn't even work all the time. Worse yet, it forces me to restart the whole program, which is very cumbersome.</p><p>And yes, I did remember to connect the device and make sure the device shows up under ""adb devices"", AND make sure that is the device the ADT downloaded to. I can even hit breakpoints in the code.</p><p>I suppose I could try relying only on the debugger, but I put a lot of work into writing those Log.d statements in the right place, it would be a giant leap backwards to do without them now. So any suggestions concerning what the problem might be, workarounds, or how to find relevant bugs logged against either ADT, SDK or the G2, would be welcome.</p><p>TIA</p><p>PS: Google searches such as ""android ddms logcat"" have not helped so far.</p><p>PS: I have also considered running ddms from the commandline, but the instructions on how to do this wtihout conflicting with the port already chosen by ADT for running DDMS are not clear enough to inspire confidence: so I always quit Eclipse before running the command line version of ddms. But then I lose the handy ability (provided by Eclipse) of navigating my source code while reading the log, so this too, is an inferior solution. Perhaps if someone can connect a few more of the dots in Google's instructions on this by explaining how to get the device and command-line DDMS to agree on a port while still running Eclipse, that would be a good solution.</p>","490651","","","","","2011-12-21 18:06:05","Logcat tab in Eclipse DDMS Persepctive (Android ADT plugin) Keeps Coming up Blank","<java><android><eclipse>","4","0","1","",""
"4047391","1","4261308","","2010-10-28 21:41:01","0","987","<p>I have a context menu on a TextView representing a user name in my app. When the context menu appears I want to have certain options such as ""View Statistics"" etc. The context menu is appearing fine and everything is working great except it's adding ""Input method"" to the context menu and I do not want it there. It's irrelevant to what the context menu is there for and there is not text entry. How can I remove this item from the context menu? I've tried removing item 0 in the context menu and adding android:editable=""false"" to the XML file to no avail. Any ideas?</p>","490642","","","","","2010-11-23 21:49:14","How to remove input method from android's TextView context menu","<android><xml><contextmenu><textview>","2","0","","",""
"4047446","1","","","2010-10-28 21:51:55","0","1169","<p>I am trying to simply test my app under a QVGA setting, but 95% of the time when I run the QVGA emulator I created, it loads the resources associated with HVGA. I have custom bitmaps that I include in my app, so it's crucial for me to be able to verify the appearance.</p><p>To see what the density was being treated as, I added the following code and displayed the results in a Toast:</p><pre><code>DisplayMetrics dm = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);// will either be DENSITY_LOW, DENSITY_MEDIUM or DENSITY_HIGHint dpiClassification = dm.densityDpi;// these will return the actual dpi horizontally and verticallyfloat xDpi = dm.xdpi;float yDpi = dm.ydpi;Output was -&gt; DensityClass = 160 - xDpi = 164.75 - yDpi = 165.88</code></pre><p>Perhaps I am simply misunderstanding, but for starters, shouldn't the density class have a value of 120?</p><p>I created a QVGA emulator in the AVD manager with the following settings:</p><pre><code>Target: 1.6 level 4Hardware Property: Abstracted LCD Density = 120 (verified in config.ini file)</code></pre><p>In my Manifest file, I added the following:</p><pre><code>&lt;supports-screens android:smallScreens=""true"" android:normalScreens=""true"" android:largeScreens=""true"" android:anyDensity=""true""/&gt;</code></pre><p>In my res folder, I have:</p><pre><code>drawabledrawable-hdpidrawable-ldpidrawable-mdpi</code></pre><p>Can someone tell me why the emulator is not loading the low density drawables? The drawables in this QVGA emulator are the same exact size as the drawables in the HVGA emulator (not what I want), and yes, I scaled down the pictures before adding them to the LDPI folder (drastically smaller). For no apparent reason, once in a while the emulator will actually load properly and everything displays correctly, but again, this only happens about 5% of the time with no apparent reason for why.</p>","449070","","1140748","","2012-05-06 16:41:46","2012-05-06 16:41:46","Android Emulator loading wrong density","<android><android-emulator>","1","0","","",""
"4047455","1","4047541","","2010-10-28 21:53:48","0","416","<p>Is it true that ANY Android phone can be used for App development and testing? </p><p>I'm trying to find some inexpensive off-contract hardware for development and testing of our Apps. I've found some devices I can buy New with No Contract for $150 to $300 (like the HTC Aria or the Huawei Ascend). Is there anything that would prevent me from using these devices for USB debugging and app testing? I guess I'm concerned because  I've read how the HTC Aria has been locked down by AT&amp;T to limit applications. I suspect this won't affect me loading apps using ADB, but I'd like to be sure.</p>","90236","","12388","","2010-10-28 21:58:36","2010-10-28 22:06:22","Are there Android phones that cannot be used for app development?","<android>","2","0","","",""
"4047522","1","4047740","","2010-10-28 22:03:38","4","3248","<p>I have an existing android app.I added a simple widget to it using the following:</p><ul><li>updated my manifest with a <code>&lt;receiver&gt;</code> block which provides information about my <code>AppWidgetProvider</code> implementation</li><li>added a new xml files in res/xml with a <code>&lt;appwidget-provider&gt;</code> element that contains the height/width/updatePeriod/initialLayout/icon/label attributes</li><li>added a simple default layout with an <code>ImageView</code> and a <code>TextView</code></li><li>implemented my <code>AppWidgetProvider</code></li></ul><p>When I build and deploy this to the emulator my Widget doesn't show up in the list of widgets. Am I missing some step to 'install' the widget? Do I need to do anything special to make it appear in the emulator?</p><p>EDIT:Here's what my manifest receiver looks like:</p><pre><code>&lt;receiver android:name="".MyAppWidgetProvider""          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/my_appwidget_info"" /&gt;&lt;/receiver&gt;</code></pre><p>and here's what my my_appwidget_info.xml looks like:</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:icon=""@drawable/ic_logo""    android:label=""MySampleApp""    android:minWidth=""294dp""    android:minHeight=""72dp""    android:updatePeriodMillis=""86400000""    android:initialLayout=""@layout/my_app_widget"" &gt;&lt;/appwidget-provider&gt;</code></pre>","106095","","106095","","2010-10-28 23:22:06","2013-05-25 23:24:02","Android widget in emulator","<android><android-emulator><android-widget>","5","6","2","",""
"4047641","1","4048543","","2010-10-28 22:26:58","6","534","<p>Although not really a programming question I believe many developers would have come across this and therefore give the best answer.</p><p>Currently I am developing an App for iPhone for the organisation I work for. Its close to release and there is heaps of interest when I present it but the occasional question comes up am I going to port it to Android. My answer is I would like to but according to web stats more than 90% of phones hitting our website are iPhones and the other 10% is declining (probably people migrating away from Blackberry, last count was 98% was iOS)</p><p>Now if you read the media many people would like you to believe that its a split market between Android and iPhone but this might be just in the U.S where the single carrier for the iPhone has limited its consumer uptake because all the information available to us (at least in my organisation) states otherwise.</p><p>I was curious to hear from other people who have looked into these stats both inside and outside the U.S because when I tell the person asking that there is no demand they dismiss it and say its growing, once again contradicting the stats available for our organisation.</p><p>I am really interested in Android dev so don't really want to hear that I should just make it to give people an alternative, it's hard to justify to management that I should spend their money to deliver content to 5% of our market. Currently it makes more sense to make a cut down web App rather than an Android App.</p><p>Be interested to hear your thoughts. Cheers</p>","196420","","","","","2010-10-29 02:41:32","Demand for iPhone App ported to Android?","<iphone><android><statistics><mobile-website>","5","9","2","",""
"4047683","1","4048069","","2010-10-28 22:35:57","3","3893","<p>I am trying to program my notification to RESUME my app, instead of simply starting a new instance of my app... I am basically looking for it to do the same thing as when the Home button is long-pressed and the app is resumed from there.</p><p>Here is what I am currently doing:</p><pre><code>void notifyme(String string){    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager)                                                getSystemService(ns);    int icon = R.drawable.notification_icon;        // icon from resources    CharSequence tickerText = string + "" Program Running..."";     // ticker-text    long when = System.currentTimeMillis();         // notification time    Context context = getApplicationContext();      // application Context    CharSequence contentTitle = *********;  // expanded message title    CharSequence contentText = string + "" Program Running..."";//expanded msg text    Intent notificationIntent = new Intent(this, Main.class);    PendingIntent contentIntent = PendingIntent.getActivity(                                                this, 0, notificationIntent, 0);    // the next two lines initialize the Notification, using the configurations    // above    Notification notification = new Notification(icon, tickerText, when);    notification.setLatestEventInfo(context, contentTitle, contentText,                                                                contentIntent);    final int HELLO_ID = 1;    mNotificationManager.notify(HELLO_ID, notification);}</code></pre><p>I am guessing that the new Intent line is where the problem lies... any help would be appreciated!</p>","482550","","281545","","2013-07-19 15:51:18","2013-08-12 14:23:15","Android: How to resume an App from a Notification?","<android>","2","1","4","",""
"4047727","1","","","2010-10-28 22:43:27","9","5338","<p>Im tossing up at the moment whether or not to start developing for iPhone or Android. The main thing drawing me towards Android at the moment is that apps are developed using Java, which I like, as opposed to Objective-C, which I hate. </p><p>Really though, the next thing on my list is to consider the costs. Apple requires you to join their iPhone developer program for $99/year, plus yield 30% of each sale of your app to Apple.</p><p>I noticed that google charges $25 to register as a developer. I wanted to confirm firstly, is that $25 recurring or is it just one off? Second, are there commisions charged when our apps are purchased, or do we recieve the whole sale price?</p><p>I also wanted to ask, does google provide an Android emulator that we can use to test applications without actually copying them over to an actual Android device?</p><p>Thanks so much everyone. Cheers.</p>","490690","","","","","2010-10-29 03:48:14","What fees are involved in publishing an android app?","<android><android-emulator>","1","1","1","",""
"4047731","1","","","2010-10-28 22:44:15","2","9270","<p>I have an image sitting on my SDcard (of type jpg) and I am trying to send the image via HttpPost to my servlet running on Apache Tomcat 7.0</p><p>So far I have google-ing the way to do this but I can't seem to find the perfect way.</p><p>Do any of you might have some suggestion or solution to this problem?</p><p>Thank you in advance,Sammy Stevan Djap</p>","448732","","","","","2011-04-20 10:50:45","Send image(jpg) via HttpPost from Android to Servlet(WebServer)","<android><image><servlets><send><http-post>","2","0","2","",""
"4047769","1","4047792","","2010-10-28 22:51:31","0","453","<p>I am using SonyEricsson X10i phone. I have developend an application that just shows the current location of a user. Now the problem is When i turn on my application it just keep searching. It is not showing anything. Even if i try to use built in navigation system it does not work. I have turned on GPS receiver. My firmware version is 1.6 and kernel version is 2.6. I am not sure but i came to know from some resource that 1.6 firmware does not support GPS. Let me know if someone knows the solution.  </p>","367121","","246246","","2012-05-13 07:28:45","2012-05-13 07:28:45","unable to get current location on SonyEricsson X10i","<android><android-maps>","1","0","","",""
"4047783","1","","","2010-10-28 22:55:25","1","986","<p>I'm new to Android programming. I have a program that looks like this:</p><p>Here is the main java block:</p><pre><code>public class MyAndroid extends Activity {    private EditText input1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mContext = this;        setContentView(R.layout.main);        input1 = (EditText) findViewById(R.id.input1);}</code></pre><p>This is what my main.xml file looks like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout android:id=""@+id/widget45"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;EditText android:id=""@+id/input1"" android:layout_width=""160px""  android:layout_height=""wrap_content"" android:textSize=""18sp""  android:numeric = ""decimal|signed""  android:layout_x=""8px"" android:layout_y=""13px""&gt; &lt;/EditText&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>However, I'm getting an error message:</p><p>R.id.input1 cannot be resolved.  Why can't I access 'input1' from main.xml?</p><p>I've looked around on the web and haven't found this answer.</p><p>Thanks</p>","490698","","241475","","2010-10-28 22:59:55","2010-10-29 00:04:26","Access variables within main.xml","<android>","2","4","","",""
"4047838","1","4078197","","2010-10-28 23:06:31","3","404","<p>I have 3 questions to clarify my workflow of AIR apps:</p><ul><li><p>Can I use Spark components when I'm making a game with Flash CS5?</p></li><li><p>Can I import SWC (created in Flash) in my AIR for Android projects when I'm using Flash Builder?</p></li><li><p>Can I load a full SWF game (created in Flash) in an AIR for Android app (example: Main menu of the game written in MXML and game in Flash) and run it smoothly?</p></li></ul><p>Thank you.</p>","252711","","252711","","2010-10-28 23:23:38","2010-12-02 14:29:57","Flash, Flash Builder, AIR. Three simple questions","<android><flash><air>","2","0","","",""
"4048114","1","4048402","","2010-10-29 00:11:25","0","774","<p>How would I capture two clicks of any of the physical buttons (including the optical button)?</p><p>Something like what QuickDesk does with the two clicks of the Home button.</p><p>Thanks</p>","149166","","","","","2010-10-29 04:25:53","Capture two physical button clicks","<android><button><double-click>","1","0","","",""
"4048116","1","","","2010-10-29 00:11:59","2","5044","<p>I want to search for GPS locations for with Google Maps. I have already registered with Google Maps API, and got the key. I can successfully pinpoint my current location on a map. The next part is to search for items around the current GPS location.</p><p>Approach 1: I tried using Android's <code>geocoder.getFromLocationName(""UPS"",5)</code> but I am not getting anything. </p><p>Approach 2: hit Google <code>https://maps.googleapis.cm/maps/apo/place/search</code> but it needs a client id. To get a client id I have to create a premier account. Do I have to do all this? </p><p>Any suggestion how to use maps to search location for Android?</p>","477254","","477254","","2010-10-29 07:10:58","2011-03-22 00:57:16","google maps API and geocoder.getFromLocationName","<android><google-maps>","2","0","1","",""
"4048224","1","4048373","","2010-10-29 00:45:13","0","169","<p>I'm trying to create custom listview in andorid.</p><p>When I try to access my arraylist variale <code>historyArrayList</code> in <code>HistoryAdapter</code> -> <code>getView</code>, <code>historyArrayList</code> always return me last added element arraylist.</p><pre><code>public class HistoryDetails extends Activity {    List&lt;HistoryInfoClass&gt; historyArrayList = new ArrayList&lt;HistoryInfoClass&gt;() ;       DBAdapter db = new DBAdapter(this);     private class HistoryAdapter extends BaseAdapter {         private LayoutInflater mInflater;         public HistoryAdapter(Context context) {             mInflater = LayoutInflater.from(context);         }         public int getCount() {             return historyArrayList.size();         }         public Object getItem(int position) {             return position;         }         public long getItemId(int position) {             return position;         }         public View getView(int position, View convertView, ViewGroup parent) {         ViewHolder holder;         if (convertView == null) {             convertView = mInflater.inflate(R.layout.history_listview, null);             holder = new ViewHolder();             holder.text = (TextView) convertView.findViewById(R.id.TextView01);             holder.text2 = (TextView) convertView.findViewById(R.id.TextView02);             convertView.setTag(holder);         } else {             holder = (ViewHolder) convertView.getTag();         }      //PROBLEM HERE "" historyArrayList.get(position).Time "" always give me last element in historyArrayList, and historyArrayList.get(0).Time give me last element too, and get(1)          holder.text.setText(Integer.toString( historyArrayList.get(position).Time ));         holder.text2.setText(Integer.toString( historyArrayList.get(position).Time1 ));         return convertView;         }         private class ViewHolder {         TextView text;         TextView text2;         }     }    @Override    protected void onCreate(Bundle savedInstanceState) {        setContentView(R.layout.historydetails);        super.onCreate(savedInstanceState);        HistoryFromDBToArray();         ListView l1 = (ListView) findViewById(R.id.ListView01);         l1.setAdapter(new HistoryAdapter(this));         l1.setOnItemClickListener(new OnItemClickListener(){            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                    long arg3) {                Toast.makeText(getBaseContext(), ""You clciked "", Toast.LENGTH_LONG).show();                }            });         }     class HistoryInfoClass {         Integer Time = 0,                 Time1 = 0;        }    private void HistoryFromDBToArray(){        HistoryInfoClass History = new HistoryInfoClass();              historyArrayList.clear();        db.open();          int i =0;        Cursor c = db.getHistory(""history"");        startManagingCursor(c);        if (c.moveToFirst())        {            do {                          History.Time = c.getInt(1);                History.Time1 = c.getInt(2);                historyArrayList.add(History);// Here ""historyArrayList.get(i).Time"" return true value (no last record)i++;            } while (c.moveToNext());        }        db.close();    }    }</code></pre>","432848","","185655","","2012-01-15 05:28:18","2012-01-15 05:28:18","Android custom listview ","<java><android>","2","1","","",""
"4048228","1","4048315","","2010-10-29 00:45:37","0","1954","<p>I'm trying to test a test app I developed on android 2.2 sdk on my htc phone with Froyo on it (2.2).In the emulator it works fine, when I export as unsigned app and try to install on the phone, it doesn't allow me, just telling me 'application non installed'.The phone has the settings to accept installation of non android application, so I'm not sure why I can't test on it.Is it because it's not signed?</p><p>Any idea?</p><p>Thx fellas</p>","452208","","","","","2010-10-29 01:12:06","Android test application on a real device","<android><sdk><emulator>","2","3","","",""
"4048741","1","4567366","","2010-10-29 03:23:25","0","540","<p>I've got a receiver set up in my android application to catch android.intent.action.NOTIFICATION_REMOVE intents.  On my Evo, it works fine - when a notification is cleared from the notification bar, I catch that event and can run some code.  I tried running this on a Samsung Moment though, and it is never caught.  So now I'm trying to figure out why, and I can't seem to find anything on Google about this intent action - and I set this code up a few months ago, so I don't remember where I even found this action, it doesn't seem to be in the API.</p><p>The evo is running 2.2, and the moment is running 2.1-update1, so I'm guessing that it's undocumented, and only available in 2.2.  Is there any other way to catch an event that a notification has been cleared?  Note that I'm <em>not</em> trying to cancel a notification that I put up, or trying to cancel another app's notification, just catch an event when a notification has been cleared.</p><p>Here's my receiver in AndroidManafest.xml:</p><pre><code>&lt;receiver android:name="".NotificationClearedReciever""&gt;     &lt;intent-filter&gt;         &lt;action android:name=""android.intent.action.NOTIFICATION_REMOVE"" /&gt;     &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre>","1322","","","","","2010-12-31 00:50:31","android.intent.action.NOTIFICATION_REMOVE not available on all devices?","<android>","1","0","","",""
"4048747","1","","","2010-10-29 03:24:16","0","444","<p>I am working on an Android application that displays a list of items when a tab is selected, then displays detail information about an item that was selected from the list :</p><p>Activity1Tab1 -(intent)-> Activity 2: item1    item2 -(intent)-> Activity 3: ImageView1    item3       TextView1     ...       ImageButton1           ...</p><p>The details are to be displayed using ImageViews, ImageButtons, and TextViews.  The data comes from a database query, so the TextView text and ImageView drawables have to be assigned dynamically.</p><p>The correct text from the database query gets assigned to each of the Views.  I can see everything being added when I step through the code in the onCreate method of Activity3 in the debugger.</p><p>BUT, the drawables are only displayed when I select the first item in the ListActivity. If I select another item, all TextViews display the correct information but the drawables are not displayed for the ImageViews or ImageButtons.  It looks like only the backgrounds are being displayed.</p><p>The ImageButton drawables are not being dynamically assigned, only the ImageView drawables are.  The ImageButton drawables are set in the TableLayout XML that is associated with the activity.  Here is one entry :</p><pre><code> &lt;TableRow android:id=""@+id/row11"" &gt; &lt;ImageButton android:id=""@+id/phonebutton"" android:maxHeight=""50px"" android:maxWidth=""50px"" android:background=""@drawable/ic_phone"" android:adjustViewBounds=""true""      style=""?android:attr/buttonStyleSmall"" android:src=""@drawable/phoneselector"" &gt; &lt;/ImageButton &gt; &lt;TextView android:id=""@+id/phonenumber""/&gt;</code></pre><p></p><p>(note - Originally, I had android_drawable=""@drawable/ic_phone"", then tried adding android:background=""@drawable/ic_phone"", and finally created the following selector (phoneselector.xml) :                          - end note)</p><p>If I select the first item again, its proper ImageView drawables are displayed along with the proper text in the TextViews.  The ImageView drawables that belong to the other items have no problems being displayed in Activity2's ListView. </p><p>The code successfully sets an onClickListener for the button (also in Activity3.onCreate).  If I click on what is displayed on the spot where the drawable should be, the phone number is dialed.</p><p>The code successfully sets an onClickListener for the button (also in DetailActivity.onCreate).</p><p>Has anyone seen anything like this before?  I would appreciate any help figuring out what is wrong.   </p><p>Here are more details because I wonder if the problem has to do with the use of the Views :</p><p>The Activity1 extends TabActivity and sets a TabHost view that contains a FrameLayout along with the TabWidget.  Activity1 creates the tabs dynamically.</p><p>Activity2 extends ListActivity and sets the content to its ListView (via setContentView(getListView()). </p><p>When ListActivity.onListItemClick is invoked (item in list is selected), a new Intent is created that contains an identifier in a Bundle and Activity3 is started.</p><p>The started activity (in Activity3.onCreate...) sets the content to a TableLayout view defined in a .xml file (via setContentView(R.layout.details.xml).</p><p>Here is the code from Activity3.onCreate :</p><p>Cursor c = null;</p><p>DatabaseHelper myDbHelper = null;</p><p>ImageButton button = null; TextView phoneText = null;</p><p>public void onCreate(Bundle savedInstanceState) {</p><pre><code>super.onCreate(savedInstanceState);Resources res = getResources();setContentView(R.layout.details);Bundle bundle = this.getIntent().getExtras();Integer id = (Integer) bundle.getInt(""id"");myDbHelper = new DatabaseHelper(this);c = myDbHelper.getWinery(id);if (c != null) {      c.moveToFirst();    ImageView image1 = (ImageView) this.findViewById(R.id.iconimage);    String wholeString = c.getString(c.getColumnIndex(""PhotoIcon""));    if (wholeString != null) { String[] splitString = wholeString.split("".jpg"");    String sString = splitString[0];    int path = res.getIdentifier(sString, ""drawable"", ""com.winerytour"" );    Drawable drawImage1 = this.getResources().getDrawable(path);    drawImage1.setVisible(true, true); //added to try to fix problem    try {        image1.setImageDrawable(drawImage1);        image1.refreshDrawableState(););        } catch (RuntimeException e) {            e.getMessage();        }    image1.setAdjustViewBounds(true); }    .. set other TextView text in same way ...    phoneText = (TextView) this.findViewById(R.id.phonenumber);    String phone = c.getString(c.getColumnIndex(""Telephone""));    phoneText.setText(phone);    button = (ImageButton) this.findViewById(R.id.phonebutton);    button.setOnClickListener(new ImageButton.OnClickListener() {        public void onClick(View v) {            performDial(); } });    ((ImageButton) button).refreshDrawableState(); // attempt to fix problem} // end c != null</code></pre><p>}</p>","490848","","490848","","2010-11-01 00:30:40","2010-11-01 00:30:40","Images don't display but TextView contents is correct","<android>","1","0","","",""
"4048909","1","","","2010-10-29 04:07:21","0","1914","<p>I don't know if this is programming-related (much) but I've recently started playing around with writing my own applications.</p><p>My phone is running cupcake/1.5. There is no ""unknown sources"" option, anywhere, at all. Carrier is AT&amp;T.</p><p>Does anyone know how I can overcome this issue?</p>","490868","","","","","2010-10-29 05:29:48","Android applications from unknown sources","<android>","2","0","","",""
"4049056","1","4049261","","2010-10-29 04:49:16","0","601","<p>I have several related database tables and I would like to treat their rows as objects and their tables as something like lists.  What are the considerations that I have to keep in mind (for instance, ensuring that the objects stay consistent with one another and with the database, lazy loading)?  And what is a good design pattern for implementing this?  As I imaging the answer is pretty involved, a link to a good website would suffice.</p><p>On the other hand, if someone knows of Hibernate-like thing <em>that really works</em> on Android, I might give that a whirl (although it's a little heavy weight for me right now).</p>","348056","","","","","2010-10-29 06:35:32","Design pattern for object-relational mapping","<java><android><database><oop>","2","0","","",""
"4049069","1","4057577","","2010-10-29 04:53:46","10","11523","<p>I can't seem to get a customized divider, using a Drawable I've defined, to work when using a <code>ListActivity</code> and not creating a custom <code>ListView</code>.  It almost seems like when the VM creates its own <code>ListView</code> for me, with the <code>ListActivity</code>, it uses a theme with the default divider provided; and if I try to provide one, no dividers appear in the <code>ListView</code> at all.</p><p>I know that I can create a custom <code>ListView</code> using XML and define android:divider on that <code>ListView</code>, and this does recognize my custom divider Drawable.  But I would prefer to just let the <code>ListActivity</code> create its own <code>ListView</code>, if I can figure out how to get my own divider working on it.</p><p>Here's the code I'm using now:</p><pre><code>public class Categories extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final String[] OPTIONS = {            ""Hello"",            ""Goodbye"",            ""Good Morning"",            ""Greetings"",            ""Toodaloo""        };        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(            this, android.R.layout.simple_list_item_1, OPTIONS);        setListAdapter(adapter);        ListView lv = getListView();        PaintDrawable sage = new PaintDrawable(R.drawable.sage);        lv.setDivider(sage);        lv.setDividerHeight(1);    }}</code></pre>","490873","","493939","","2012-12-22 15:02:57","2014-03-12 10:43:35","Changing a divider with setDivider in a ListActivity without a custom ListView?","<android><android-listview><drawable><listactivity><divider>","2","0","5","",""
"4049112","1","4049981","","2010-10-29 05:02:32","2","168","<p>When I watched the ""<a href=""http://sites.google.com/site/io/dalvik-vm-internals/"" rel=""nofollow"">Dalvik VM Internals</a>"" talk, I had a question about one of the slides about wise loops. Here is two of the seven loops on that slide:</p><p>(4) for (int i = 0; i &lt; array.length; i++)</p><p>(5) for (int i = 0; i &lt; this.var; i++) </p><p>and the speaks said (4) is more efficient than (5). ""array"" is just an Array object.</p><p>My question is what exactly does ""this.var"" do that makes it is more expensive than retrieving a member variable from an object?</p>","313294","","","","","2010-10-29 08:04:17","Why is ""this.var"" less efficient than ""array.length""?","<java><android>","1","0","","",""
"4049298","1","4049902","","2010-10-29 05:44:45","0","1362","<p>I am using this following code which creates a ListView with text and an icon but the problem that I have which the following I want the array to be dynamic instead of static so my list gets created dynamically not statistically. My ultimate goal is to retrieve specific strings from my Db and to display it then on the Listview where every string would be in each row.Thank you very much in advance.</p><p>My source code:</p><pre><code>    import java.util.ArrayList;    import android.app.Activity;    import android.app.ListActivity;    import android.database.Cursor;    import android.database.sqlite.SQLiteDatabase;    import android.os.Bundle;    import android.view.LayoutInflater;    import android.view.View;    import android.view.ViewGroup;    import android.widget.AdapterView;    import android.widget.AdapterView.OnItemClickListener;    import android.widget.ArrayAdapter;    import android.widget.ImageView;    import android.widget.ListView;    import android.widget.TextView;    import android.widget.Toast;    public class History extends ListActivity implements OnItemClickListener {String keyWord = """";String histDesRes = """";String history = """";String rawImage;ArrayList&lt;String&gt; Ra = new ArrayList&lt;String&gt;();SQLiteDatabase mydb;TextView selection;public String[] result={keyWord, ""ipsum"", ""dolor"",        ""sit"", ""amet"",        ""consectetuer"", ""adipiscing"", ""elit"", ""morbi"", ""vel"",        ""ligula"", ""vitae"", ""arcu"", ""aliquet"", ""mollis"",        ""etiam"", ""vel"", ""erat"", ""placerat"", ""ante"",        ""porttitor"", ""sodales"", ""pellentesque"", ""augue"", ""purus""};/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.history);    populate();}@Overrideprotected void onResume() {    // TODO Auto-generated method stub    super.onResume();    //populate();}@Overrideprotected void onPause() {    // TODO Auto-generated method stub    super.onPause();    //populate();}@Overrideprotected void onStart() {    // TODO Auto-generated method stub    super.onStart();    //populate();}void populate() {    mydb = openOrCreateDatabase(""vivo_id.db"",            SQLiteDatabase.CREATE_IF_NECESSARY, null);    Cursor c = mydb.query(""VIVOID"", null, null, null, null, null, null);    // start the managing cursor    startManagingCursor(c);    // move to first row    c.moveToFirst();    // continue searching until it is the last row in the column    while (c.isAfterLast() == false) {        rawImage = c.getString(c.getColumnIndex(""couponThumbnailResult""));        keyWord = c.getString(c.getColumnIndex(""keyWordResult""));        histDesRes = c.getString(c.getColumnIndex(""historyDescriptionResult""));        //Toast.makeText(getApplicationContext(),                //history, Toast.LENGTH_LONG).show();        history = keyWord+"" ""+ histDesRes;        c.moveToNext();        }    // close everything    c.close();    mydb.close();    setListAdapter(new IconicAdapter());    selection=(TextView)findViewById(R.id.selection);}public void onListItemClick(ListView parent, View v, int position, long id) {    Toast.makeText(getApplicationContext(),            ""Inside listen"", Toast.LENGTH_LONG).show();}class IconicAdapter extends ArrayAdapter {    IconicAdapter() {        super(History.this, R.layout.row, result);    }    public View getView(int position, View convertView, ViewGroup parent) {        LayoutInflater inflater = getLayoutInflater();        View row = inflater.inflate(R.layout.row, parent, false);        TextView label = (TextView) row.findViewById(R.id.label);        label.setText(result[position]);        ImageView icon = (ImageView) row.findViewById(R.id.icon);            icon.setImageResource(R.drawable.ok);        return (row);    }}@Overridepublic void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {    // TODO Auto-generated method stub}    }    /**     * On Item click event for the list view     */</code></pre>","490923","","2625058","","2013-07-28 14:40:04","2013-07-28 14:42:31","Dynamic array instead of static when creating ListView icons and text Android","<android><database><arrays><listview><dynamic>","1","0","","",""
"4049326","1","4049443","","2010-10-29 05:51:28","2","3698","<p>How do I parse the following json returned from Facebook? I have tried by searching on Internet, but I failed. Please help me.</p><pre><code>{""data"":    [{        ""id"":""100001746392225_137743246275036"",        ""from"":{""name"":""Narasimha Kolla"",            ""id"":""100001746392225""      },      ""picture"":""http:\/\/platform.ak.fbcdn.net\/www\/app_full_proxy.php?app=151044809337&amp;v=1&amp;size=z&amp;cksum=4cd0a75d9fd95daf93788baadc219c63&amp;src=http%3A%2F%2Ffacebook.fishville.static.zynga.com%2Fproduction%2Fassets%2Ffeedforms%2FFV_giveFishLoveV2_90x90.png"",      ""link"":""http:\/\/apps.facebook.com\/fishville\/track.php?creative&amp;cat=love_fish&amp;subcat&amp;vtype=shortfeed&amp;key=926ee25f373cf3246301de747fda493c%24%24ccF%28NVVW31sAM.ZUMQU50Q%29k%21pKUPyzJOBG2V%29_-akrU9kGoB3%2C8&amp;next=http%3A%2F%2Fapps.facebook.com%2Ffishville%2Freward.php%3FfrHost%3D100001746392225%26frId%3Df9adb5b4b77c36e11168b38e98b90f31%26frType%3DFriendReward_ILoveMyFishV2%26key%3D926ee25f373cf3246301de747fda493c%24%24ccF%28NVVW31sAM.ZUMQU50Q%29k%21pKUPyzJOBG2V%29_-akrU9kGoB3%2C8%26appRef%3DAchievements%7C%7Cshortstory%7C%7CFriendReward_ILoveMyFishV2"",      ""name"":""Narasimha has given Love to their Fish and has some Love left over to give to their friends!"",      ""description"":""Narasimha has extra Love to share with their friends to help them unlock exclusive LOVE ITEMS!"",      ""icon"":""http:\/\/photos-b.ak.fbcdn.net\/photos-ak-snc1\/v43\/9\/151044809337\/app_2_151044809337_7378.gif"",      ""actions"":            [{                ""name"":""Comment"",                ""link"":""http:\/\/www.facebook.com\/100001746392225\/posts\/137743246275036""             },             {                ""name"":""Like"",                ""link"":""http:\/\/www.facebook.com\/100001746392225\/posts\/137743246275036""             },             {                ""name"":""Get some Love!"",                ""link"":""http:\/\/apps.facebook.com\/fishville\/track.php?creative=&amp;cat=love_fish&amp;subcat=&amp;vtype=shortfeed&amp;key=926ee25f373cf3246301de747fda493c$$ccF(NVVW31sAM.ZUMQU50Q)k!pKUPyzJOBG2V)_-akrU9kGoB3,8&amp;next=reward.php%3FfrHost%3D100001746392225%26frId%3Df9adb5b4b77c36e11168b38e98b90f31%26frType%3DFriendReward_ILoveMyFishV2%26key%3D926ee25f373cf3246301de747fda493c%24%24ccF%28NVVW31sAM.ZUMQU50Q%29k%21pKUPyzJOBG2V%29_-akrU9kGoB3%2C8%26appRef%3DAchievements%7C%7Cshortstory%7C%7CFriendReward_ILoveMyFishV2""             }],             ""privacy"":                 {                    ""description"":""Everyone"",                    ""value"":""EVERYONE""                 },             ""type"":""link"",             ""created_time"":""2010-10-28T17:45:20+0000"",             ""updated_time"":""2010-10-28T17:45:20+0000"",             ""attribution"":""FishVille""          },          {             ""id"":""100001746392225_171377042878314"",             ""from"":                {                    ""name"":""Narasimha Kolla"",                    ""id"":""100001746392225""                },                ""picture"":""http:\/\/platform.ak.fbcdn.net\/www\/app_full_proxy.php?app=151044809337&amp;v=1&amp;size=z&amp;cksum=3db213d45c46a43c0520f0f1388e65c0&amp;src=http%3A%2F%2Ffacebook.fishville.static.zynga.com%2Fproduction%2Fassets%2Ffeedforms%2FFV_lonelySeaTurtle_90x90.jpg%3Frev%3D83517"",                ""link"":""http:\/\/apps.facebook.com\/fishville\/track.php?creative&amp;cat=lonely_creature&amp;subcat=seaTurtle&amp;vtype=shortfeed&amp;key=a2a0d5df9d89a1ccafe9019f3d277a9f%24%24ccF%28NVVW31sAM.ZUMQU50Q%29k%21pKUHyY-slQo5yojg4R%2Cc%281N4ne8vSnwnL.C2v_ixbs&amp;next=http%3A%2F%2Fapps.facebook.com%2Ffishville%2Flonelycreature.php%3Fowner_id%3D100001746392225%26lonely_creature_mission_id%3D5%26lonely_creature_mission_name%3DseaTurtle%26lonely_creature_sig%3D5c1029fe6c2f7f3f6117de8a9262277b"",                ""name"":""Narasimha found a scared Sea Turtle washed up on the beach! Oh no!"",                ""description"":""Narasimha was taking care of their fish when they discovered a poor little Sea Turtle far from home in FishVille. This little tyke got caught in a strong current and washed up on the beach! He would love to get back in the water. "",                ""icon"":""http:\/\/photos-b.ak.fbcdn.net\/photos-ak-snc1\/v43\/9\/151044809337\/app_2_151044809337_7378.gif"",                ""actions"":                    [{                        ""name"":""Comment"",                        ""link"":""http:\/\/www.facebook.com\/100001746392225\/posts\/171377042878314""                    },                    {                        ""name"":""Like"",                        ""link"":""http:\/\/www.facebook.com\/100001746392225\/posts\/171377042878314""                    },                    {                        ""name"":""Adopt the Sea Turtle!"",                        ""link"":""http:\/\/apps.facebook.com\/fishville\/track.php?creative=&amp;cat=lonely_creature&amp;subcat=seaTurtle&amp;vtype=shortfeed&amp;key=a2a0d5df9d89a1ccafe9019f3d277a9f$$ccF(NVVW31sAM.ZUMQU50Q)k!pKUHyY-slQo5yojg4R,c(1N4ne8vSnwnL.C2v_ixbs&amp;next=lonelycreature.php%3Fowner_id%3D100001746392225%26lonely_creature_mission_id%3D5%26lonely_creature_mission_name%3DseaTurtle%26lonely_creature_sig%3D5c1029fe6c2f7f3f6117de8a9262277b""                    }],                ""privacy"":                    {""des</code></pre>","1746300","","1725980","","2013-10-26 23:09:42","2013-10-26 23:09:42","Facebook json parsing in Android","<android><json>","1","0","","2012-08-24 12:09:08",""
"4049341","1","4050028","","2010-10-29 05:54:00","2","1011","<p>I am working with Augmented Reality application with android, and I implemented camera code.</p><p>My current base SDK version is 1.6. With this my application is working fine with devices having OS version upto 1.6 and getting problem with OS 2.0 and up..</p><p>Any solution ?</p><p>Thanks.</p>","206809","","","","","2011-01-02 18:35:59","Getting problem in Camera Preview for Android OS 2.0 and up","<android><camera>","1","0","1","",""
"4049400","1","4049427","","2010-10-29 06:05:02","2","642","<p>two activities here, A and B. A is main, B is PreferenceActivity with two EditTextPreference.</p><p>I want to be able to access the preferences generated by B from activity A, and for that I need of course (I guess) getSharedPreferences on A. But in order to do that I need to supply the preference file for the activity that generated it. This is tedious (long names), erratic at best (depends on the activity that generated it), and finally it's a mess, because it's much better to keep everything under one xml file, with a name that is well known to all my activities. And besides, if I have 100 activities, how would I keep track of preference files anyway...</p><p>So the point is: <strong>how do I ""bind"" an EditTextPreference in a way that the changes are made to a given preference file, not the one automatically generated by Android</strong>?</p>","489607","","","","","2010-10-29 06:20:00","Binding EditTextPreference to a given preference file (getSharedPreferences)","<android><file><redirect><preferenceactivity>","2","0","0","",""
"4049407","1","","","2010-10-29 06:07:20","1","3087","<p>can anybody tell what is the equivalent component in android like table view in iphone?</p><p>How to implement table view component like iphone in android?</p><p>give example</p><p>Thanks</p>","426344","","","","","2013-07-17 11:06:39","what is the equivalent component in android like table view in iphone","<android>","3","2","1","",""
"4049437","1","","","2010-10-29 06:12:01","1","441","<p>I am complete newbie to Android development and I have to make a Home screen app like this one</p><p><a href=""http://www.4shared.com/video/tjKMbnEk/noteBook.html"" rel=""nofollow"">http://www.4shared.com/video/tjKMbnEk/noteBook.html</a></p><p>It must have the scrolling folder widgets , I am not much familiar with Android terminology and having a hard time searching for this stuff. I'll appreciate any help.</p>","490924","","","","","2010-10-29 07:12:46","android Scrolling folder widgets","<android>","1","1","","",""
"4049582","1","4049689","","2010-10-29 06:40:38","2","5352","<p>I want to convert from <code>JSONObject</code></p><p><code>{""CNo"":80,""CName"":""ganesh"",""CMail"":""ganesh@ganesh.com"",""CMailType"":""home"",""CPhNo"":9878987776,""CPhNoType"":""home"",""ClientNo"":1}</code></p><p>to</p><p><code>{\""CNo\"":80,\""CName\"":\""ganesh\"",\""CMail\"":\""ganesh@ganesh.com\"",\""CMailType\"":\""home\"",\""CPhNo\"":9878987776,\""CPhNoType\"":\""home\"",\""ClientNo\"":1}</code></p>","483898","","104198","","2012-10-17 18:33:23","2012-10-17 18:41:04","how to convert json object to string in android..?","<android><json>","2","3","","",""
"4049627","1","4055452","","2010-10-29 06:49:52","15","4790","<p>I got an implementation of Parcelable working for a single class that involves no inheritance. I have problems figuring out the best way to implement the interface when it come to inheritance. Let's say I got this :</p><pre><code>public abstract class A {    private int a;    protected A(int a) { this.a = a; }}public class B extends A {    private int b;    public B(int a, int b) { super(a); this.b = b; }}</code></pre><p>Question is, which is the recommended way to implement the Parcelable interface for B (in A? in both of them? How?)</p>","490961","","490961","","2010-10-29 18:29:31","2013-09-27 20:13:18","Parcelable and inheritance in Android","<java><android><design-patterns><inheritance><parcelable>","2","4","5","",""
"4049666","1","","","2010-10-29 06:58:17","6","9109","<p>i want to change layout without calling the onCreate method. i also define android:configChanges=""orientation|keyboardHidden"" in my activity and it is not calling the onCreate method but the layout not adjust appropriately on landscape mode. </p><p>my current layout look like as follows.</p><p><img src=""http://i.stack.imgur.com/2QHYX.png"" alt=""alt text""></p><p>after change orientation as landscape it look like as follows:<img src=""http://i.stack.imgur.com/8utAA.png"" alt=""alt text""></p><p>but on landscape i want the following result.</p><p><img src=""http://i.stack.imgur.com/WaUqm.png"" alt=""alt text""></p><p>is there any auto adjacent property?</p><p>how can i do it?</p>","309990","","","","","2013-05-07 09:34:52","change orientation without onCreate call","<android>","5","1","1","",""
"4049690","1","","","2010-10-29 07:03:31","0","554","<p>Android: Map displays on emulator(Version: Google APIs 2.1,level:7). But when uploaded into android mobile,it doesn't display </p><p>Hi All,</p><p>I have done one project in android which is to display map using GOOGLE API KEY.</p><p>goto: [http://mobiforge.com/developing/story/using-google-maps-android]</p><p>I generated MAP API key by following the procedure mentioned in above link correctly. It works well and <strong>displays map on EMULATOR.</strong></p><p>I took BUILD of my project and uploaded into the android MOBILE. Here <strong>Map DOESN'T display on my mobile</strong>.</p><p>Don't know what is the reason behind this problem :(</p><p>My AVD Version Details: </p><p>AVD Name: Google APIs(Google Inc.)Platform : 2.1API Level: 7</p><p>My android Mobile Details:</p><p>It also supports GoogleAPI 2.1(Level 7) only. All other functionalities work well except displaying map.(I am getting Polylines only)</p><p>My XML file looks:</p><p></p><pre><code>&lt;com.google.android.maps.MapView     android:id=""@+id/mapView""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:enabled=""true""    android:clickable=""true""    android:apiKey=""0l4sCTTyRmXTNo7k8DREHvEaLar2UmHGwnhZVHQ""    /&gt;</code></pre><p></p><p>Can anyone help me to recover this problem?</p><p>Thanks in advance!</p><p>Vansi</p>","490945","","21234","","2010-10-29 07:26:38","2010-11-16 04:46:28","Map displays on Android 2.1 emulator but not on Android 2.1 mobile","<android><android-maps>","1","0","","",""
"4049710","1","4075533","","2010-10-29 07:07:48","0","437","<p>I am trying to implement foursquare OAuth based authentication in my android app. It works fine in my Andorid web browser, but it displays ""301 moved permanently"" in Android webview. I tried to debug it and found that it displays this error on following URL:</p><pre><code>https://foursquare.com/mobile/login?continue=%2Fmobile%2Foauth%2Fauthorize%3Foauth_token{my_token}</code></pre><p>And the same URL works fine on Andriod browser. So, I think there is something need to be done with webview seetings. </p>","278194","","","","","2010-11-02 06:59:15","How to solve ""301 moved permanently"" in android webview?","<android>","1","0","","",""
"4049711","1","4982415","","2010-10-29 07:08:02","0","547","<p>HelloWhen i am using my application using WIFI or INTERNET APn it works fine.But provides socket connection error while trying with WAP APN.</p><p>Is there anything that i can do to resolve this in android.</p><p>Do i need to use any permissions to use my application for WAP?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-02-13 04:23:28","use android application using WAP client","<android>","1","0","","",""
"4049774","1","","","2010-10-29 07:17:53","2","481","<p>I'm new to Android and Java programming, so I would like to clear up couple of questions I have.</p><p>I've written a background service that verifies something every 10 seconds, and, based on some conditions, it may execute something (or may not). This is implemented using a Timer.</p><p>My understanding until now is that the timer in the service will run even when the screen is off, so every 10 seconds, even with the screen off, the timer will fire up. </p><p>I suppose that this will have an impact on battery life, though I don't know how much or how to measure this.</p><p>Now, I don't need the service to do anything while the screen is off, so I'm thinking about registering the Screen OFF and Screen ON broadcast Intents.</p><p>On Screen OFF, the code would stop the timer – or would it be better to stop the whole service? – and on Screen ON it would start the timer (or service).</p><p>My thought on this direction is that my application will consume less of the battery than it would otherwise</p><p>Please tell me if my logic makes sense</p><p>If I'm wrong or if there are better ways to achieve this, please let me know.</p><p>Thank you!</p>","467780","","418613","","2012-06-04 02:50:14","2012-06-04 02:50:14","Screen ON/OFF receivers on a service and battery life","<android><service><screen><power-management><screen-off>","0","1","1","",""
"4049796","1","4077596","","2010-10-29 07:20:39","1","4980","<p>from my android client i am sending a json to string object.but the .net client is getting it as empty string. here is my code.</p><pre><code>HttpPost request = new HttpPost(SERVICE_URI+""/save"");JSONStringer json = new JSONStringer().object()   .key(""cno"").value(""2000"").key(""cname"").value(""HI"").key(""cmail"").value(""HI"").key(""cphno"").value(""9292"").key(""cmailtype"").value(""Home"").key(""cphnotype"").value(""Office"").key(""clientno"").value(""1"").endObject(); String a= json.toString();StringEntity entity = new StringEntity(a);entity.setContentType(""text/plain;charset=UTF-8"");entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,""text/plain;charset=UTF-8""));request.setEntity(entity); DefaultHttpClient httpClient = new DefaultHttpClient();HttpResponse response = httpClient.execute(request); </code></pre><p>is this header format correct?</p>","430652","","","","","2010-11-03 07:23:07","how to send a json object from java to a .net client?","<.net><android><http-post>","2","0","0","",""
"4049821","1","","","2010-10-29 07:23:43","2","811","<p>I need help finding the best method for networking in a multiplayer game.  I want to connect to a phone and maintain the connection until the game is over, hosting the game on one of the phones.  There are other threads, but none of them really explain how to connect or use the networking, only saying to use such-and-such library.  Examples or links to good tutorials would be extremely helpful.</p>","490985","","","","","2010-10-29 09:45:33","Android game networking","<android><networking>","1","0","2","",""
"4049836","1","","","2010-10-29 07:25:51","2","581","<p>How to? The spinner not showing, but the imageview yes. When i click on the image, then the Spinner showing up. </p>","472537","","","","","2011-09-14 05:43:24","Android use an imageview to show a Spinner","<android><spinner>","1","2","","",""
"4050029","1","","","2010-10-29 07:56:27","0","352","<p>Please help me In my Project when i m starting new activity it is crashing  </p><pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.shortnews);     showNewsListView = (ListView)findViewById(R.id.shortnewslistview);     ShortNewsListAdapter listAdapter = new ShortNewsListAdapter(this);     showNewsListView.setAdapter(listAdapter);     showNewsListView.setOnItemClickListener(new OnItemClickListener(){   public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position,     long arg3) {    newspostion = position;    Log.v(""status "",""tab on position""+position);       //showProgressDialog(true);    try {     Intent myIntent = new Intent(FirstTab.this, NewsWebView.class);     FirstTab.this.startActivity(myIntent);    } catch (Exception e) {     Log.v(""error"",""error in starting new activity"");     e.printStackTrace();    }   }  });     getUrlData(baseUrl);     }</code></pre><p>and  i m adding this part in manifiest file also</p><pre><code>&lt;activity android:name=""NewsWebView"" android:label=""WebView""&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>this is web view i want to show </p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.webview);    final String mimeType = ""text/html"";    final String encoding = ""utf-8"";    WebView wv;    wv = (WebView) findViewById(R.id.wv1);    wv.loadData(""www.gmail.com"", mimeType, encoding);}</code></pre><p><strong>Log</strong></p><pre><code>10-29 13:10:15.784: VERBOSE/status(203): tab on position010-29 13:10:15.784: INFO/ActivityManager(53): Starting activity: Intent { cmp=org.nuvus/.NewsWebView }10-29 13:10:15.814: DEBUG/PhoneWindow(203): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@4377c300 has no id.10-29 13:10:16.764: INFO/ActivityManager(53): Displayed activity org.nuvus/.NewsWebView: 925 ms (total 925 ms)10-29 13:10:16.794: INFO/AndroidRuntime(203): AndroidRuntime onExit calling exit(0)10-29 13:10:16.904: INFO/ActivityManager(53): Process org.nuvus (pid 203) has died.10-29 13:10:16.924: INFO/WindowManager(53): WIN DEATH: Window{438425d8 org.nuvus/org.nuvus.Main paused=true}10-29 13:10:16.924: INFO/WindowManager(53): WIN DEATH: Window{438e15c8 org.nuvus/org.nuvus.NewsWebView paused=false}10-29 13:10:17.064: WARN/UsageStats(53): Unexpected resume of com.android.launcher while already resumed in org.nuvus10-29 13:10:17.144: WARN/InputManagerService(53): Got RemoteException sending setActive(false) notification to pid 203 uid 1002710-29 13:13:45.264: DEBUG/dalvikvm(102): GC freed 7488 objects / 406792 bytes in 313ms10-29 13:10:16.794: INFO/AndroidRuntime(203): AndroidRuntime onExit calling exit(0)</code></pre>","491020","","","user658042","2011-09-21 20:26:45","2011-09-21 20:26:45","prob in starting new activity","<java><android>","1","2","","",""
"4050145","1","7512505","","2010-10-29 08:17:53","0","308","<p>i want to build a component that will be able to show a integer number max 5 digits in the style of the old analog car counters and animate the digit change. </p><p>that looks something like this maybe...</p><p><img src=""http://i.stack.imgur.com/lR5KR.jpg"" alt=""alt text""></p><p>i have tried searching for this kinda of examples but i couldn't find anything so far. </p><p>in your opinion what is the best approach to achieve this?</p><p>i looked at the iphone alarm time picker and as far as i can tell there is only a fixed background and they push the numbers in or out the view. but how do i place the digits in this case and reference them to a particular value?</p><p>tnx.</p>","448192","","","","","2012-12-17 21:48:38","animate number change","<android><uiviewanimation>","1","0","1","",""
"4050166","1","","","2010-10-29 08:23:10","0","3418","<p>I am going to build a client-server application. The client here is an iPad (or an android-based) tablet. The server is a normal pc. Both the clients and the server are connected to the same network (using WiFi). </p><p>Is there a standard way (protocol) for communication between the clients and the server? Are there any framework that can be used to ease this communication?</p><p>Thank you</p>","214418","","","","","2011-03-05 09:44:56","Tablet(iPad/Android)-Server Communication Protocol","<android><ipad><client-server><protocols><communication>","2","0","1","",""
"4050177","1","4050224","","2010-10-29 08:24:32","1","1736","<p>I am using android HTC HERO 2.1 version.</p><p>The activity I write :</p><pre><code>&lt;activity android:name="".gogogo""          android:label=""@string/app_name""          android:theme=""@style/Theme.mine""          android:screenOrientation=""landscape""          android:configChanges=""orientation""&gt;</code></pre><p>let my orientation change to landscape.</p><p>However, I figured out that every time I pressed ""power"" button and then come back to my activity, it always start at portrait.</p><p>I tried the game : TEETER , which was written not by me. Has the same problem too, any one know how to fix it??</p><p>Edit: <code>it always start at portrait.</code> --> I mean, if you come back from power, you have to scroll down to do everything, there is something like screen lock. </p><p>You can see that there is a ""status bar"" at the top of the screen and at this time, the orientation is ""<code>portrait</code>"". So after You scroll the ""screen lock"" a little bit down, you can see the activity (such as TEETER) is at ""<code>portrait</code>"" state. When you scroll all the way down, the activity's orientation will suddenly change to the state ""<code>landscape</code>"".</p><p>So the conclusion is : My activity is forced to orient once. And I really want to know how to fix it!</p>","408278","","408278","","2010-10-29 15:13:01","2012-06-23 20:05:01","Android screen orientation bug","<android><orientation>","3","2","","",""
"4050390","1","6229109","","2010-10-29 08:55:30","2","1698","<p>Got this really stupid problem:<br>Can find the proper name for the android folder for WVGA800 resources.<br><br>I've created a folder for WVGA854: drawable-normal-long-hdpi<br>It worked totally fine.<br>For WVGA800 I've tried 'drawable-normal-notlong-hdpi' - emulator and handset still gets resources from <br>'drawable', not even 'drawable-normal-long-hdpi'.<br>Tried using 'drawble-hdpi', 'drawable-notlong-hdpi' - nothing works, it keeps using 'drawable' for resources.<br><br>How should the folder for WVGA800 be named?<br><br>UPD:<br>Using<br><code>supports-screens android:anyDensity=""true"" <br>        android:largeScreens=""true"" <br>        android:normalScreens=""true"" <br>        android:smallScreens=""true""/><br></code>Didnt solve the problem.<br>Is there a way to debug what resource folder is used and why?</p>","453991","","958370","","2012-02-04 11:00:00","2012-02-04 11:00:00","Different resources for WVGA800 and WVGA854?","<android><android-resources>","2","1","2","",""
"4050417","1","","","2010-10-29 08:59:56","30","6819","<p>What are the best practices for logging in Android apps in production mode, keeping in mind the following requirements : </p><p>1- Ability to upload logs for debugging2- Ability to clean up logs or set rollovers </p><p>Thanks</p>","491078","","118903","","2010-11-03 12:12:45","2012-04-03 10:01:01","Android Production Logging Best Practice","<android><logging>","3","2","14","2012-07-11 11:54:15",""
"4050499","1","5213671","","2010-10-29 09:11:57","1","533","<p>I have a simple Bluetooth app on android that connects to a device using RFCOMM.  On the first connection, the device needs to be paired.  Android does this by adding a ""Bluetooth pairing request"" notification which the user then needs to click on by first pulling down the notification area.</p><p>I know this is ""standard"" Android behaviour, but is there any way to get it to either:</p><p>a) Automatically expand the notification area</p><p>or</p><p>b) (Preferred) Actually bring the pairing notification to the front</p><p>Many thanks</p>","464179","","","","","2011-08-11 13:06:04","Show pairing notification from android app","<android>","1","0","","",""
"4050587","1","","","2010-10-29 09:26:07","5","1922","<p>Hiwe are expanding one of our projects in a major bank to include access via mobile devices. We are evaluating a few tools - inc. perfecto mobile, experitest and deviceanywhere.From our initial evaluation perfecto and device anywhere cover a larger set of handsets inc feature phones. Experitest on the other hand is strong and simple to operate with smartphones(iphone, android etc).Can anyone share experience from using these tools for large scale projects? we are mainly concerened re stability, ability to work with QTP and support considerations (support for new devices etc).</p>","427953","","","","","2011-07-05 19:05:51","iPhone test automation - benchmark tools?","<iphone><android><testing><automation><qtp>","6","0","0","",""
"4050644","1","","","2010-10-29 09:35:19","1","697","<p>I am a c# programmer that loves android phones knowing that I am never going to learn Java.What I want to to is an ordinary website that starts the relevant applications from my android phone (Legend) with parameters like:</p><p>This works:Mail - this opens the email klient with correct to=john@doe.comhref=""tel:+4512345678"" opens the phone with the correct digits on the screenhref=""geo:something"" opens google map and show you your location</p><p>This does not work:href=""sms:+4512345678, body=Hello You""href=""geo:+address"" - I want to enten an adress I can navigate to...</p><p>Is the last ones possible do do or something like it? Can you send me link or descriptionHelp would be very appreciatedThanks in advance/Bo</p>","491120","","","","","2010-10-29 10:36:40","To start Android Applications from website","<html><android>","1","2","","",""
"4050766","1","4051002","","2010-10-29 09:52:01","5","13990","<p>I have this url here: <a href=""http://www.webpronews.com/feeds"">http://www.webpronews.com/feeds</a></p><p>Now i need to get the feeds and display it in android. Any clue?</p>","2355649","","","","","2013-11-04 18:04:15","How to get rss feeds android?","<android>","4","0","5","",""
"4050768","1","4066616","","2010-10-29 09:52:21","0","415","<p>Thanks !!i have two .java classes as trial.java and CommonActivity.java as:</p><pre><code>public void onClick(View v) {    switch (v.getId())     {    case R.id.btnSequence:        Intent intent1 = new Intent();        intent1.setClass(this,CommonActivity.class);        Bundle bun1 = new Bundle();        bun1.putString(""String_key"", ""value1"");        intent1.putExtras(bun1 );        startActivity(intent1);        break;    case R.id.btnVideo:        Intent intent2 = new Intent();        intent2.setClass(this,CommonActivity.class);        Bundle bun2 = new Bundle();        bun2.putString(""String_key"", ""value2"");        intent2.putExtras(bun2);        startActivity(intent2);        break;    case R.id.btnInfo:        Intent intent3 = new Intent();        intent3.setClass(this,CommonActivity.class);        Bundle bun3 = new Bundle();        bun3.putString(""String_key"", ""value3"");        intent3.putExtras(bun3);        startActivity(intent3);        break;    }}</code></pre><p>and in CommonActivity.java i want to do something like this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Bundle bun = new Bundle();//am i doing wrong here, where are bun1,bun2 and bun3 of my trialactivty.java    Intent getIntent = new Intent();    bun = getIntent.getExtras();    String param = bun.getString(""String_key"");    if(param.equals(""value1""))    {    setContentView(R.layout.main1);        }    if (param.equals(""value2""))    {    setContentView(R.layout.main2);     }            if (param.equals(""value3""))    {    setContentView(R.layout.main3);     }}</code></pre><p>also while searching on net i got confused with <strong>getExtras</strong> and getextra.can anybody please example the <strong>scenario</strong> of using getExtra vs getExtras!so that i can decide to use better one in my application  </p>","490953","","750987","","2011-06-17 00:03:59","2011-06-17 00:03:59","to call another activity","<android><android-intent>","1","0","","",""
"4050829","1","4052115","","2010-10-29 10:01:52","1","983","<p>I'd like to use a 1x1 size Nine-patch image from Android drawable resources.<br>When I'm trying to display it with <code>&lt;ImageView&gt;</code> in my layout xml file, this one is never showing up on the Android emulator device. Here's the xml code below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:padding=""10px""&gt;&lt;RelativeLayout  android:gravity=""center_vertical"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt; &lt;TextView android:id=""@+id/text_label""     android:text=""@string/text""     android:textSize=""10pt""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt; &lt;CheckBox android:id=""@+id/my_checkBox""     android:layout_alignBaseline=""@id/text_label""     android:layout_alignParentRight=""true""       android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;&lt;/RelativeLayout&gt;&lt;ImageView android:paddingTop=""10px""        android:paddingBottom=""10px""   android:layout_height=""wrap_content""  android:layout_width=""fill_parent""     android:src=""@android:drawable/divider_horizontal_bright"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I tried another one with the same size and I have the same problem it's still blank.</p><p>My research on Google was irrelevant. Hope you can find what am I doing wrong here.<br>Thanks in advance for your help.</p><p>Lorenth</p>","491053","","127013","","2010-10-29 17:27:16","2010-12-30 08:42:59","1x1 size Nine-patch image not showing up on Android emulator device","<android>","2","6","1","",""
"4050891","1","4096880","","2010-10-29 10:13:26","35","3215","<p>I have spent a while developing an Android app, and am hoping to publish in the coming days. From the Market console, I have tried to make my Checkout account a Merchant account, for which I need to provide both a private (for Google's eyes only) address - which I'm fine with - and an address which the public will see when the buy my software.</p><p>I have looked in more detail at the receipts for Android apps I have bought in the past, and sure enough they all have addresses - the difference is they were all (3 of them) businesses, with business premises. As a private individual I do not want just anybody to be given my address over the internet. I can understand completely that Google need one, to verify who I am, but the last thing I need is my address in the public.</p><p>Before I go ahead signing up for a merchant account, is there anything I can do about this? Maybe a setting inside merchant account to make your address private? I do intend to provide a support email address and such, but cannot see any valid reason why users on the Android Market need my personal address.</p><p>Thanks very much guys, I'm sure someone here has experienced the same?</p>","78105","","","","","2010-11-04 12:58:20","Selling apps as a private individual on Android Market","<android><google-checkout><google-play><selling-software>","2","2","13","",""
"4050903","1","4051602","","2010-10-29 10:14:53","3","4543","<p>I want to give the effect that the ListView has faded from whatever is around it. By default it is set to whatever colour your ListView is. I can adjust the orientation of the FadingEdge and the size of the FadingEdge but not the colour. Is it possible?</p>","348261","","","","","2013-12-09 19:28:29","Is it possible to change the colour of the FadingEdge of a Listview?","<android><listview><colors><edge><fading>","3","0","4","",""
"4050934","1","","","2010-10-29 10:19:31","0","307","<p>I am able to read incoming messages via bluetooth from my phone. I want to parse the incoming stream (new CAN message in xml format every 100 ms), read the value in the message and display a graphic on the main screen of phone.</p><p>Need help in parsing this dynamic incoming stream.</p><p>Programming in Java in Eclipse for Android.</p><p>Thank you for your time and help.</p><p>Madhu</p>","487851","","428381","","2010-10-29 10:22:34","2010-10-29 10:50:53","Parse incoming messages (which are in xml format) via bluetooth, read the value in the message and display a graphic","<java><android><xml><parsing><dynamic>","1","0","","",""
"4050981","1","","","2010-10-29 10:28:20","0","1223","<p>How can I change the fading orange color in ExpandableListView while scrolling ?</p><p>Thanks</p>","474643","","","","","2010-10-29 12:01:18","How to change the fading orange color In ExpandableListView?","<android>","1","1","","",""
"4050997","1","","","2010-10-29 10:30:48","0","866","<p>I have a Test Application with an empty main layout except for 2 buttons on the screen, next and previous.</p><p>I have two custom views called MyView1 and MyView2 that extends View.</p><p>They are animated to slide in and out using a custom animation class.</p><p>Currently I have been playing with something like the following:</p><p>when ""previous"" is clicked</p><pre><code>myView2.startAnimation(AnimClass.outToLeftAnimation());mainLayout.removeView(myView2);myView1.startAnimation(AnimClass.inFromRightAnimation());mainLayout.addView(myView1, 0);</code></pre><p>(and vice versa for the next button)</p><p>The problem I have is that although it is technically working fine, the views that are shifting in and out are drawn on top of the buttons for the layout (mainLayout, defined in the xml R.layout.main), and then when they stop animating they pop behind like they should be, but i want it to stay behind. How can I fix this?</p><p>EDIT: As per the request, this is an example of one of the animations from my AnimClass, they all use the standard built in stuff.</p><pre><code>    public static 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;}</code></pre><p><strong>EDIT2: Solved. I added a FrameLayout to my main.xml at a lower z-index to the buttons and then moved the views in and out of that.</strong></p>","353674","","353674","","2010-10-29 12:24:33","2010-10-29 12:24:33","Android, correct syntax for animating view switch","<android><animation><view>","0","2","","",""
"4051005","1","4051041","","2010-10-29 10:31:57","7","4375","<p>Removing Background color in Android   </p><p>I have set backgroundColor like this in code,</p><p>View.setBackgroundColor(0xFFFF0000);</p><p>How to remove this background color on some event.?</p>","207646","","","","","2010-10-29 10:38:31","removing backgroundcolor of a view in android","<android>","1","2","2","",""
"4051080","1","4051106","","2010-10-29 10:45:12","0","303","<p>Can anyone tell me how can we make our browser as default in Android? I want to do so thatwhen you open up the internet browser, it gives you two options: regular browser and Mybrowser (third party browser which is made by me). If you select the regular browser, it says that the phone cannot access the internet unless it is on the Mybrowser. Can we implement this feature, and how?</p>","450601","","1128737","","2012-01-15 14:26:17","2012-01-15 14:26:17","Make third party browser as default","<android>","1","0","1","",""
"4051108","1","","","2010-10-29 10:50:20","3","2920","<p>We have to use Asynchronous Task to start our new Activity on Tab Click event  but in the ListView or any view we can directly can start the new activity  Why?</p>","491020","","1400291","","2012-05-28 10:31:08","2012-10-04 08:29:36","What is the need of Asynchronous Task","<android>","3","1","1","",""
"4051297","1","4051493","","2010-10-29 11:21:08","6","21015","<p>I am an Android newbie trying to learn the UI side of things and it's doing my head in. Here's what I have right now:</p><p>breeds_listing.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=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;ListView android:id=""@+id/breedsListView""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:dividerHeight=""0px"" android:divider=""#00000000""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>breeds_listing_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:background=""@drawable/list_item_background""    android:orientation=""horizontal"" &gt;    &lt;TextView android:id=""@+id/allbreeds_single_item""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:gravity=""center_horizontal""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>list_item_background.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;solid android:color=""#043402"" /&gt;    &lt;stroke android:width=""3dp"" color=""#ffff8080"" /&gt;    &lt;corners android:radius=""8dp"" /&gt;    &lt;padding android:left=""10dp"" android:top=""10dp"" android:right=""10dp""        android:bottom=""10dp"" /&gt;&lt;/shape&gt;</code></pre><p>What I am struggling to figure out is how do I style the selected item? At the moment the selected item has a ghastly orange background which, under the rounded green rectangle, gives an orange outline effect. I'm sure I have not done things in line with best practices so any suggestions or improvements would be greatly appreciated.</p><p>Many thanks,D.</p>","150061","","","","","2012-04-11 14:15:26","How do I style selected item in Android ListView?","<android><listview><coding-style><selected>","2","0","2","",""
"4051353","1","","","2010-10-29 11:28:37","0","680","<p>i amm try to replicate the inbuilt contact app.... how can i have a + button to add multiple phone and email? also i want the fastscrollview to be enabled in it</p>","430652","","","","","2010-10-29 12:18:00","how to implement the expandablelist in android?","<android><expandablelistview><fastscroll>","1","0","","2012-08-20 10:51:37",""
"4051399","1","4051639","","2010-10-29 11:34:54","4","221","<p>Why is that the object has to be serialized or be Parcelable in order to be passed to an Intent ? </p>","474375","","","","","2010-10-29 12:04:28","Is there a reason why passing objects to intents are not straight forward?","<android>","1","0","","",""
"4051550","1","","","2010-10-29 11:53:05","1","209","<p>I'm working on an open source project for android and am wondering whether there are any best practices (or at least well-argued hints) on how to manage the private key for signing the APKs.</p><p>On the one hand, the key should be secured, on the other hand, at least the members of the core team should be able to create ""official"" releases.</p><p>My first suggestion was to just distribute the encrypted private key in the source repository and give out the passphrase to committers, but the trust (from the community to the individual) cannot be revoked.</p><p>Is there any other way to share the signing rights (e.g. by setting up a private CA and creating keys for each committer) among the members?</p>","4918","","","","","2010-10-29 15:32:54","How to handle APK signing for Android in an FOSS project?","<android><open-source><signing>","1","0","2","",""
"4051588","1","","","2010-10-29 11:57:01","1","479","<p>My live wallpaper is responding to touch events through the <code>onTouchEvent()</code>method, which works fine. The problem is: the home app also appears to be receiving these touch events, so if I swipe left in my wallpaper, the home screen also slides left.</p><p>It'd be nice if it were possible for my wallpaper to selectively consume these events, but seeing as the wallpaper <code>onTouchEvent()</code> has no return type, it's looking impossible.</p><p>Is there a way to achieve this?</p>","491236","","19750","","2011-08-31 14:25:33","2011-08-31 14:25:33","Is it possible to consume events in android live wallpaper onTouchEvent()?","<android><live-wallpaper><ontouchevent>","0","0","","",""
"4051604","1","4063795","","2010-10-29 11:59:38","8","14334","<p>I have a FrameLayout in which I have 2 controls: - a custom view which draws a image and some text on it- a textview with a text</p><p>I want to center both in the FrameLayout but I can't manage to do it. The Texview is centered just fine, my cusom view remains on the left side, when I make it visible.</p><pre><code>&lt;FrameLayout android:id=""@+id/CompassMap""               android:layout_width=""fill_parent""                android:layout_height=""wrap_content""               android:layout_weight=""1""               android:gravity=""center""&gt;             &lt;view class=""com.MyView""        android:id=""@+id/myView""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_gravity=""center_vertical|center_horizontal""        android:visibility=""gone""/&gt;                &lt;TextView android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_gravity=""center_vertical|center_horizontal""        android:text=""CENTERED"" /&gt; &lt;/FrameLayout&gt;</code></pre><p>To Mathias, I don't do anything in the constructor, it's just simple</p><pre><code>   public class MyMapView extends View {private int xPos = 0; private int yPos = 0;private Bitmap trackMap;private Matrix backgroundMatrix;private Paint backgroundPaint;private Bitmap position;private Matrix positionMatrix;private Paint positionPaint;public MyMapView(Context context) {    super(context);    init(context, null);}public MyMapView(Context context, AttributeSet attrs) {    super(context, attrs);    init(context, attrs);}public MyMapView(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);    init(context, attrs);}private void init(final Context context, AttributeSet attrs) {backgroundMatrix = new Matrix();backgroundPaint = new Paint();backgroundPaint.setFilterBitmap(true);position = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.position);positionMatrix = new Matrix();positionPaint = new Paint();positionPaint.setFilterBitmap(true);}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {  setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));}@Overrideprotected void onDraw(Canvas canvas) {    int width = getMeasuredWidth();    int height = getMeasuredHeight();    if (trackMap!=null)    {        Bitmap resizedBitmap = Bitmap.createScaledBitmap(trackMap, height, height, true);        canvas.drawBitmap(resizedBitmap, backgroundMatrix, backgroundPaint);    }        canvas.save(Canvas.MATRIX_SAVE_FLAG);        canvas.translate(xPos-position.getWidth()/2, yPos-position.getHeight()/2);        canvas.drawBitmap(position, positionMatrix, positionPaint);        canvas.restore();}    public void updatePosition(int xpos, int ypos, Bitmap trackImage)    {        xPos=xpos;        yPos=ypos;        trackMap = trackImage;        invalidate();    }}</code></pre>","379865","","379865","","2010-11-02 16:20:22","2013-03-27 18:22:51","Android center view in FrameLayout doesn't work","<android><layout><gravity>","2","3","0","",""
"4051654","1","","","2010-10-29 12:05:54","0","2008","<p>I have been trying to get a specific layout for more than two days now and really struck with it,what am trying to achieve is:</p><p>To have a layout like the following</p><p>LISTVIEW A </p><p>VIEW</p><p>LISTVIEW B</p><p>VIEW</p><p>LISTVIEW C</p><p>(VIEWS are basically for headers)</p><p>Can any one help to sort out this task?</p>","414777","","241475","","2010-10-29 12:30:20","2010-10-29 12:43:10","How to add multiple listviews to Single activity in android?","<android><listview>","1","4","","",""
"4051689","1","4051858","","2010-10-29 12:09:54","0","1450","<p>I'm designing the UI for an Android application. I have the layered PSD ready now, but I'm not sure whats the next step. For the web, I would just slice the images and write html/CSS manually.</p><p>Thanks</p>","172637","","","","","2010-10-29 12:32:13","Android app UI - PSD, what next?","<android><user-interface><psd>","1","2","1","",""
"4051745","1","4129082","","2010-10-29 12:16:16","3","1870","<p>I need some examples or tutorial, how to implement iPhone side index for Android.</p><p><img src=""http://i.stack.imgur.com/PKAjg.jpg"" alt=""alt text""></p><p>I read already <a href=""http://stackoverflow.com/questions/1201962/android-equivalent-to-iphone-indexed-uitableview"">this topic (http://stackoverflow.com/questions/1201962/android-equivalent-to-iphone-indexed-uitableview)</a> and I'm trying AlphabetIndexer, but:</p><ul><li>How do I create it properl at all?</li><li>How can be AlphabetIndexer displayed?!</li><li>Is an extra layout schema for indexed lists already defined?</li></ul><p><strong>UPD:</strong></p><p>If you downvote the topic, could you at least argue, why.</p><p>Thank you </p><p>Mur</p>","408780","","408780","","2010-11-08 23:21:04","2010-12-08 05:39:45","iPhone section index for android?","<android>","1","2","2","",""
"4051840","1","","","2010-10-29 12:29:39","0","305","<p>I want to use the accessibility classes, but I'm a beginner in Android programming and I can't understand how to use them. I don't find any example using these classes. Can somebody give me some examples or tutorials?</p><p>Also, can I set enable the Accessility mode in the emulator?</p>","480617","","815632","","2013-06-06 22:30:09","2013-06-06 22:30:09","How to set accessibility mode in Android emulator","<android><accessibility>","3","0","","",""
"4051875","1","4051993","","2010-10-29 12:34:51","15","11992","<p>i have a user preference in my app, which gets ued by different activity. I would like to know the best way to utilise those preferences between different activities in my App. </p><p>I have this idea to create a shared preference object from the main activity and from there send intents to the different activities to take actions. would it work?.. or just keep calling getsharedpreferences() from every activity?. Thank you.</p>","316843","","2369140","","2013-06-20 10:26:35","2013-06-20 10:26:35","what is the Best way to use shared preferences between activities","<android><sharedpreferences>","3","0","5","",""
"4051945","1","4052379","","2010-10-29 12:43:13","0","792","<p>I want to save something from a webpage (loaded into webview) into a Java variable. Is that possible?</p><p>Example: I have a webpage with written text: HELLO STACK!. How could I save that text into Java var (String foo = ?????)?</p><p>Could I do it with JavaScript/Java cooperation?</p>","491283","","127013","","2010-10-29 17:26:37","2011-01-13 16:14:46","Save text from webpage to String variable","<android><variables><webview><android-webview>","1","0","1","",""
"4052008","1","4052194","","2010-10-29 12:49:46","2","1924","<p>I'm working on a Synergy port to the Android (see synergy-foss.org).</p><p>The only way I've found to inject keystrokes is to use the Cyanogen Mod and write keystrokes to /dev/uinput.  However, my app does not have permissions to write to /dev/uinput.  The only way around this that I've found is to chmod 777 /dev/uinput.</p><p>However... it seems after some time the permissions on /dev/uinput are reset -- by what? I don't know. </p><p>Is there a better way or is there a way to run your app as root in the Cyanogen mod?</p><p>Thanks</p>","232416","","","","","2013-05-18 12:16:34","Cyanogen /dev/uinput key injection","<android><key><injection><cyanogenmod>","2","2","","",""
"4052010","1","4052124","","2010-10-29 12:50:00","2","127","<p>I’m not sure this is the best example, but here goes.  Let’s say I want to draw an object to a canvas in an Android application.  I need to do some math and call a method to return screen size to figure out where to draw it since my app should support multiple screens.  I really only need to do this procedure once, as every time I want the object to be drawn, it is drawn to the same place.  If I only do the procedure once, I have to hold the return values in memory so I can refer back to them later.</p><p>Alternatively, I could call the procedure to get these values every time I want to draw the object, so I don’t have to hold any values in memory for the entire lifetime of the activity.</p><p>Now I know, not all cases will be the same because I could write a fancy 100,000 line algorithm that just returned an integer value, or go to the opposite extreme, but I’m hoping that there is a common knowledge tradeoff that is generally considered acceptable.</p><p>So, what is the correct approach?  Can you elaborate?</p><p>Thanks folks!</p>","432209","","","","","2010-10-29 13:07:30","Generally speaking, do I write code that saves memory or code to save processing time for simple objects for smartphone applications?","<java><iphone><android><memory><smartphone>","2","0","2","",""
"4052094","1","4053203","","2010-10-29 12:59:05","0","66","<p>I have created a SampleItem just to test:</p><pre><code>public class SampleItem{    public string Name { get; set; }}</code></pre><p>and the method that I calling from th service looks like this:</p><pre><code>public void send(SampleItem s){    String siteName = s.Name;}</code></pre><p>And I am debugging this method, What I can notice is that the ""s (sampleitem is null)""</p><p>This is the data I am sending trough fiddler:</p><pre><code>{ ""SampleItem"" : { ""Name"": ""MyComp""} }</code></pre><p>I don't know what I am doing wrong,</p><p>Request headers:</p><pre><code>User-Agent: Fiddler</code></pre><p>Content-type: application/jsonHost: localhost:30677Content-Length: 54</p>","371301","","759866","","2013-11-04 14:57:08","2013-11-04 14:57:08","Posting data to a service","<android><visual-studio><web-services><wcf>","1","0","1","",""
"4052250","1","4053087","","2010-10-29 13:20:23","0","2920","<p>i need to parse this response in android using the android json parser but the thing i cant find the answer to anywhere is:</p><p>how do i parse the data if for example ""itineraries"" can contain one or sometimes more objects of the type itinerary?if it contains one than it is returned like this but if it contains more it is returned with []with this example ""itinerary"" cannot be placed into a JsonArray becouse obviously it is not an array. (not placed in [] right?) </p><p>how do i parse this? any examples?</p><pre><code>  {   ""plan"":{      ""date"":""2010-10-20T00:00:00+02:00"",      ""from"":{         ""name"":""??????? ??????????? ??????"",         ""stopId"":""123"",         ""lon"":""21.373255285035548"",         ""lat"":""42.00736515785779"",         ""geometry"":""{\""type\"": \""Point\"", \""coordinates\"": [21.373255285035548,42.00736515785779]}""      },      ""to"":{         ""name"":""??????? ??????????? ??????"",         ""stopId"":""123"",         ""lon"":""21.37228809181389"",         ""lat"":""42.00762790595865"",         ""geometry"":""{\""type\"": \""Point\"", \""coordinates\"": [21.37228809181389,42.00762790595865]}""      },      ""itineraries"":{         ""itinerary"":{            ""duration"":""159000"",            ""startTime"":""2010-10-20T00:00:00+02:00"",            ""endTime"":""2010-10-20T00:02:39+02:00"",            ""walkTime"":""159000"",            ""transitTime"":""0"",            ""waitingTime"":""0"",            ""walkDistance"":""212.6496008849819"",            ""elevationLost"":""0.0"",            ""elevationGained"":""0.0"",            ""transfers"":""0"",            ""legs"":{               ""leg"":{                  ""@route"":""??????? ??????????? ??????"",                  ""@mode"":""WALK"",                  ""startTime"":""2010-10-20T00:00:00+02:00"",                  ""endTime"":""2010-10-20T00:02:39+02:00"",                  ""distance"":""212.6496008849819"",                  ""from"":{                     ""name"":""??????? ??????????? ??????"",                     ""lon"":""21.373255285035548"",                     ""lat"":""42.00736515785779"",                     ""geometry"":""{\""type\"": \""Point\"", \""coordinates\"": [21.373255285035548,42.00736515785779]}""                  },                  ""to"":{                     ""name"":""??????? ??????????? ??????"",                     ""lon"":""21.37228809181389"",                     ""lat"":""42.00762790595865"",                     ""geometry"":""{\""type\"": \""Point\"", \""coordinates\"": [21.37228809181389,42.00762790595865]}""                  },                  ""legGeometry"":{                     ""length"":""3"",                     ""points"":""_qk_GymmaCf@qC{ArI""                  },                  ""steps"":{                     ""walkSteps"":{                        ""distance"":""212.6496008849819"",                        ""streetName"":""??????? ??????????? ??????"",                        ""absoluteDirection"":""EAST"",                        ""stayOn"":""false"",                        ""becomes"":""false"",                        ""lon"":""21.373255285035548"",                        ""lat"":""42.00736515785779"",                        ""elevation"":""""                     }                  },                  ""duration"":""159000""               }            },            ""tooSloped"":""false""         }      }   },   ""requestParameters"":{      ""entry"":[         {            ""key"":""optimize"",            ""value"":""QUICK""         },         {            ""key"":""time"",            ""value"":""9:40 am\""""         },         {            ""key"":""wheelchair"",            ""value"":""false""         },         {            ""key"":""maxWalkDistance"",            ""value"":""800.0""         },         {            ""key"":""fromPlace"",            ""value"":""42.0074711701039,21.3732840843651""         },         {            ""key"":""toPlace"",            ""value"":""42.0076745404488,21.3723007605583""         },         {            ""key"":""date"",            ""value"":""10/20/2010""         },         {            ""key"":""mode"",            ""value"":""TraverseMode (WALK, TRAM, SUBWAY, RAIL, BUS, FERRY, CABLE_CAR, GONDOLA, FUNICULAR, TRANSIT, TRAINISH, BUSISH)""         },         {            ""key"":""numItineraries"",            ""value"":""3""         }      ]   }}</code></pre><p>here is what i use for the first part</p><pre><code>JSONObject planObject=json.getJSONObject(""plan"");            Log.i(""date"",planObject.get(""date"").toString());            JSONObject fromObject=planObject.getJSONObject(""from"");            Log.i(""from object"",fromObject.get(""name"").toString());            Log.i(""from object"",fromObject.get(""stopId"").toString());            Log.i(""from object"",fromObject.get(""lon"").toString());            Log.i(""from object"",fromObject.get(""lat"").toString());</code></pre><p>this is the example Felix wrote and it is about multiple ""itineraries"" </p><pre><code>""itineraries"": [    {""duration"": ""123456"", ... },    {""duration"": ""789012"", ... }]</code></pre><p>this would be the same example but for one:</p><pre><code>""itineraries"": {""duration"": ""123456"", ... },</code></pre><p>so in the second case there is no JSONArray so if i try to use the code Felix gave for parsing array it will return a error.</p><p>so the question is: what is the way to check if the value can be put in a JSONArray. is The command optJSONArray(""possibleArrayValues"")!=null used or is there a better method then doing lots of if-then checks?</p>","448192","","448192","","2010-10-29 16:04:52","2010-10-29 21:07:54","json parse response can have one or multiple objects","<android><json><parsing><varying>","1","0","","",""
"4052318","1","","","2010-10-29 13:31:04","0","536","<p>I am writing a class in Android that requires certain parameters from the class that calls its functions.</p><p>For Example my class is called ""DoStuff""</p><p>DoStuff has 3 functions:</p><pre><code>public static doThis(canvas, tick, toggle, something);public static doThat(canvas, tick, toggle, something, something);public static doTheOther(canvas, tick, toggle, something, something, something);</code></pre><p>Is there a way for me to have canvas, tick and toggle implicetly passed to the ""DoStuff"" when I call on it's functions from somewhere else (that somewhere is unknown to DoStuff).</p>","353674","","","","","2010-10-29 16:04:35","implicitly pass parameters to class","<android><class><parameters>","3","0","","",""
"4052334","1","4053240","","2010-10-29 13:33:07","3","2655","<p>I have a standalone GPS enabled data recorder in my car that can function as either a USB host or device. (Its a class 0x00h USB device). I currently connect to it via a WM 6.5 app running on my Palm Treo 750.  </p><p>I would like to port my WM 6.5 app to an Android phone.  (I don't have a specific Android phone in mind, I would like it to be as generic as possible).</p><p>Replicating the GUI is not that difficult, but I am having trouble getting started on the USB communication.  </p><p>I'd appreciate it if someone could point me towards an example, or the appropriate tutorial. </p><p>Thanks</p>","491316","","","","","2010-10-29 19:04:02","How to write a app to connect an Android device to a host USB GPS device","<android><usb>","1","3","1","",""
"4052393","1","4098084","","2010-10-29 13:39:03","2","1251","<p>I have a map view which has overlay items on top of them. The overlay items have an action when they are taped on.The problem is when I use pinch to zoom if it my fingers happen to be at a location of an item when I lift them  the onTap() is called. how could i prevent this?</p><p>Thanks,Jason</p>","407133","","","","","2010-11-04 21:05:46","Disabling onTap when using pinch to zoom","<android>","2","0","2","",""
"4052548","1","4052741","","2010-10-29 14:00:03","2","271","<p>I'm teaching myself how to make custom AVD skins by editing the layout file and associated .png files in the android-sdk-windows\platforms\android-<em>nnn</em>\skins\ folders.    The syntax of the layout file is simple and pretty self-explanatory but I'm curious about it ...</p><ol><li><p>Is it meant to be hand-edited or is it generated from some tool or utility I should be using?</p></li><li><p>Any idea why they used this curly-brace syntax instead of something standard like XML?  (or is this a standard syntax I just haven't seen as a Java/Android noob?)</p></li></ol><p>Thanks in advance.</p>","424690","","","","","2010-10-29 14:24:20","Android skins layout file syntax","<android><android-emulator>","1","0","","",""
"4052550","1","4053221","","2010-10-29 14:00:15","2","183","<p>I'm writing an android app that I am going to want to create more content for (specifically images). I want the user to be able to download some type of image pack that will be listed in the Market. Obviously this download will not really be a new application, just a set of data that the user can download.</p><p>Thanks.</p>","491371","","","","","2010-10-29 15:16:05","Android Content Update","<android>","2","0","1","",""
"4052766","1","4200253","","2010-10-29 14:27:09","5","4992","<p>I would like to create an <a href=""http://developer.android.com/guide/topics/ui/menus.html"">Options Menu</a> in my Flash AIR application for Android.</p><p>I've figured out already, that this ActionScript code could be used for capturing the hardware <strong>Menu</strong> button press event:</p><pre><code>stage.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown);function onKeyDown(event:KeyboardEvent):void {    if(event.keyCode == Keyboard.MENU) {        event.preventDefault();        trace(""Menu Pressed"");    }}</code></pre><p>but how do you create the actual menu?</p><p>If you can't do it with AIR, then has anybody tried to recreate/mimic it manually already and could you please share the properties (colors, transparency, any gradients?) and transitions (sliding in/out) you've used?</p><p>I've found some <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html"">guidelines</a> already, but would appreciate any Flash-specific tips/properties (like which easing to use for sliding transitions?) you have</p><p>Thank you,Alex</p><p><img src=""http://i.stack.imgur.com/xJgTF.png"" alt=""alt text""></p>","165071","","165071","","2010-10-29 14:34:42","2013-05-15 07:04:58","How to create Android Options Menu in Adobe AIR? (not Java)","<android><flash><actionscript-3><air>","3","0","3","",""
"4053143","1","4053271","","2010-10-29 15:09:30","1","138","<p>I have this sql statement:</p><pre><code>SELECT game.game_id FROM game, userGame WHERE userGame.user_id = 1AND userGame.game_id != game.game_id;</code></pre><p>And I'm getting this:</p><pre><code>112233444555</code></pre><p>I'm running the statement on a Sqlite3 database on Android 2.1.</p><p>The tables are:</p><pre><code>USERGAME--------userIdgameIdmore_columnsGAME-----gameIdmore_columns</code></pre><p>How can I solve this error?</p><p><strong>UPDATE:</strong><br/>I want to get all game's id that they are not in usergame table when userId=1.</p><p>Thanks.</p>","68571","","","","","2010-10-29 15:27:01","Stupid sql error","<sql><android><sqlite3>","3","6","1","",""
"4053304","1","4625629","","2010-10-29 15:24:30","1","1257","<p>I'm working on an Android widget which essentially places a button on the homescreen. The button uses a <code>selector</code> in order to show a default state and a pressed state.  Each state has its own image, as you'll see in the code below.</p><p>I already have code to <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/9e215c83c3819953"" rel=""nofollow"">change the hue of an image</a> and return a new StateListDrawable for use in the ImageButton.</p><p><strong>My question</strong>: How do I actually apply the StateListDrawable to the ImageButton's <code>android:background</code> attribute using the RemoteView?</p><p>Here is the XML source for the widget layout:</p><pre><code>&lt;LinearLayout    android:id=""@+id/LinearLayout01""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""&gt;    &lt;ImageButton        android:id=""@+id/ImageButton01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:clickable=""true""        android:background=""@drawable/buttonselector"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Instead of using the hardcoded ""@drawable/buttonselector"" it needs to be the dynamic selector I'm generating.</p>","158766","","158766","","2010-10-29 16:28:25","2011-01-07 12:52:33","Dynamically change ImageButton background inside a homescreen widget","<android><android-widget><selector>","1","1","1","",""
"4053330","1","4053350","","2010-10-29 15:27:01","0","130","<p>Can anybody tell me what method of an activity executes when an application closes?. like i have a main activity and if i press back button on my phone. The Application closes so i want to know what method executes at that time.</p>","397901","","390989","","2010-10-29 15:28:12","2010-10-29 15:36:09","what method of main activity executes when application closes?","<android><activity>","1","0","","",""
"4053395","1","4053535","","2010-10-29 15:33:55","1","11210","<p>I have created a custom dialog, And I have inserted two buttons, one is called send, and the other cancel. </p><p>I would like to know hot to close down the dialog when pressing cancel?</p>","371301","","","","","2012-03-15 05:52:22","android: Dialog, cancel button","<android><dialog>","2","0","","",""
"4053441","1","4055381","","2010-10-29 15:38:51","1","2259","<p>I am trying to write a program on an embedded system running GUMSTIX(Linux) to connect and talk to an Android 2.x device over bluetooth.  The GUMSTIX is the client and the Android is the server.  I am trying to find the channel number that my Android service uses so that the GUMSTIX can connect to it but for some reason my routine isn't returning a channel number because it doesn't seem to find a service with a matching UUID.</p><p>I suspect that the UUID provided to the GUMSTIX routine and the UUID on the Android device are not actually the same number.  Android requires a 128 bit UUID :</p><p>From the <a href=""http://developer.android.com/reference/java/util/UUID.htmldetails."" rel=""nofollow"">Android Documentation</a>:</p><blockquote>  <p>UUID is an immutable representation of  a 128-bit universally unique  identifier (UUID).</p>    <p>There are multiple, variant layouts of  UUIDs, but this class is based upon  variant 2 of RFC 4122, the Leach-Salz  variant. This class can be used to  model alternate variants, but most of  the methods will be unsupported in  those cases; see each method for</p></blockquote><p>UUID used in android:</p><pre><code>public static final String UUID_STRING = ""00000000-0000-0000-0000-00000000ABCD"";private static final UUID MY_UUID = UUID.fromString(UUID_STRING);</code></pre><p>C Code in GUMSTIX <strong>Look for comment indicating where it fails</strong></p><pre><code>int main(int argc , char **argv){//Android wants a 128 bit UUID why are we only giving a 32 bit UUIDuint32_t svc_uuid_int[] = { 0 , 0 , 0 , 0xABCD } ;int status ;bdaddr_t target ;uuid_t svc_uuid ;sdp_list_t *response_list , *search_list , *attrid_list ;sdp_session_t *session = 0;uint32_t range = 0x0000ffff ;uint8_t port = 0;if(argc &lt; 2){    fprintf(stderr , ""usage: %s &lt;bt_addr&gt;\n"" , argv [ 0 ] ) ;    exit ( 2 ) ;}str2ba ( argv[1] , &amp;target ) ;// connect to the SDP server running on the remote machinesession = sdp_connect ( BDADDR_ANY, &amp;target, SDP_RETRY_IF_BUSY  );//  printf(""session %u\n"",session);sdp_uuid128_create( &amp;svc_uuid, &amp;svc_uuid_int ) ;search_list = sdp_list_append( 0, &amp;svc_uuid ) ;attrid_list = sdp_list_append( 0, &amp;range ) ;// get a list of service records that have UUID 0xabcdresponse_list = NULL ;   //ERROR: response_list SHOULD GET INITIALIZED BUT IT STAYS NULL CAUSING THE PROGRAM TO NEVER ENTER THE FOR LOOP BELOW.status = sdp_service_search_attr_req(session , search_list , SDP_ATTR_REQ_RANGE , attrid_list, &amp;response_list ) ;printf(""status %d\n"",status);if( status == 0 ){    sdp_list_t *proto_list = NULL ;    sdp_list_t *r = response_list ;    // go through each of the service records    for ( ; r ; r = r-&gt;next )    {        sdp_record_t *rec = (sdp_record_t * ) r-&gt;data ;        // get a list of the protocol sequences        if( sdp_get_access_protos( rec, &amp;proto_list ) == 0 )         {            // get the RFCOMM port number            port = sdp_get_proto_port( proto_list , RFCOMM_UUID ) ;            sdp_list_free( proto_list, 0 );        }        sdp_record_free( rec ) ;    }}sdp_list_free( response_list, 0 );sdp_list_free( search_list, 0 );sdp_list_free( attrid_list, 0 );sdp_close( session ) ;if( port != 0 ){    printf( ""found service running on RFCOMM port %d\n"" , port ) ;}return 0;</code></pre><p>}</p><p>EDIT:</p><p>Android code for the acceptThread(accepts connections), ConnectThread(completes the connection), and ConnectedThread(maintains the connection, establish handler)</p><pre><code>/** * This thread runs while listening for incoming connections. It behaves * like a server-side client. It runs until a connection is accepted * (or until canceled). */private class AcceptThread extends Thread {    // The local server socket    private final BluetoothServerSocket mmServerSocket;    public AcceptThread() {        BluetoothServerSocket tmp = null;        // Create a new listening server socket        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;        // Listen to the server socket if we're not connected        while (mState != STATE_CONNECTED) {            try {                // This is a blocking call and will only return on a                // successful connection or an exception                if(D) Log.i(""prism"", ""Waiting to connect************"");                socket = mmServerSocket.accept();                if(D) Log.i(""prism"", ""We have accepted connection and are connected***************"");            } catch (IOException e) {                Log.e(TAG, ""accept() failed"", e);                break;            }            // If a connection was accepted            if (socket != null) {                synchronized (BluetoothServer.this) {                    switch (mState) {                    case STATE_LISTEN:                    case STATE_CONNECTING:                        // Situation normal. Start the connected thread.                        connected(socket, socket.getRemoteDevice());                        break;                    case STATE_NONE:                    case STATE_CONNECTED:                        // Either not ready or already connected. Terminate new socket.                        try {                            if (D) Log.i(""prism"", ""Bluetooth already connected, abandoning request from "" + socket.getRemoteDevice().getName());                            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);        }    }}/** * This thread runs while attempting to make an outgoing connection * with a device. It runs straight through; the connection either * succeeds or fails. */private class ConnectThread extends Thread {    private final BluetoothSocket mmSocket;    private final BluetoothDevice mmDevice;    public ConnectThread(BluetoothDevice device) {        mmDevice = device;        BluetoothSocket tmp = null;        // Get a BluetoothSocket for a connection with the        // given BluetoothDevice        try {            tmp = device.createRfcommSocketToServiceRecord(MY_UUID);        } catch (IOException e) {            Log.e(TAG, ""create() failed"", e);        }        mmSocket = tmp;    }    public void run() {        Log.i(TAG, ""BEGIN mConnectThread"");        setName(""ConnectThread"");        // Always cancel discovery because it will slow down a connection        mAdapter.cancelDiscovery();        // Make a connection to the BluetoothSocket        try {            // This is a blocking call and will only return on a            // successful connection or an exception            Log.i(TAG, ""mmSocket.connect() is initiaiting in the ConnectThread"");            mmSocket.connect();            Log.i(TAG, ""mmSocket.connect() complete..."");        } catch (IOException e) {            Log.e(TAG, ""Connection attempt failed, closing the socket"");            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            BluetoothServer.this.start();            return;        }        // Reset the ConnectThread because we're done        synchronized (BluetoothServer.this) {            mConnectThread = null;        }        // Start the connected thread        connected(mmSocket, mmDevice);    }    public void cancel() {        try {            mmSocket.close();        } catch (IOException e) {            Log.e(TAG, ""close() of connect socket failed"", e);        }    }}/** * This thread runs during a connection with a remote device. * It handles all incoming and outgoing transmissions. */private class ConnectedThread extends Thread {    private 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;        // Get the BluetoothSocket input and output streams        try {            tmpIn = socket.getInputStream();            tmpOut = socket.getOutputStream();        } catch (IOException e) {            Log.e(TAG, ""temp sockets not created"", e);        }        mmInStream = tmpIn;        mmOutStream = tmpOut;    }    public void run() {        Log.i(TAG, ""BEGIN mConnectedThread"");        byte[] buffer = 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(Bluetooth.MESSAGE_READ, bytes, -1, buffer)                        .sendToTarget();            } catch (IOException e) {                Log.e(TAG, ""disconnected"", e);                connectionLost();                break;            }        }    }</code></pre><p>The Android code was adopted from the Bluetooth Chat example <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">here</a></p>","451037","","451037","","2010-10-29 20:28:54","2010-10-29 20:28:54","Linux Bluetooth not finding Android Service with UUID","<android><c><linux><bluetooth><gumstix>","1","0","","",""
"4053646","1","4062874","","2010-10-29 16:00:51","2","1614","<p>""Abstract class instantiation,"" you say. ""Impossible!""</p><p>Here's my code:</p><pre><code>public static AbstractFoo getAbstractFoo(Context context) {    try {        Class&lt;?&gt; klass = Class                .forName(""com.bat.baz.FooBar"");        Constructor&lt;?&gt; constructor = klass.getDeclaredConstructor(                String.class, String.class);        constructor.setAccessible(true);        AbstractFoo foo = (AbstractFoo) constructor.newInstance(                ""1"", ""2"");        return foo;    } catch (ClassNotFoundException e) {        // Ignore    } catch (NoSuchMethodException e) {        throw new InflateException(                ""No matching constructor"");    } catch (IllegalAccessException e) {        throw new InflateException(""Could not create foo"", e);    } catch (InvocationTargetException e) {        throw new InflateException(""Could not create foo"", e);    } catch (InstantiationException e) {        throw new InflateException(""Could not create foo"", e);    }    return null;}</code></pre><p>com.bat.baz.FooBar is a private class that extends AbstractFoo. Without Proguard, this code runs on my Android device. With it, it fails on the NoSuchMethodException try/catch.</p><p>I continue to add statements to my Proguard config file like</p><pre><code>-keep public abstract class  AbstractFoo{public *;protected *; private *;} </code></pre><p>But that doesn't solve the problem. How can I get Proguard to accept that this is a valid way to instantiate the AbstractFoo object? At least, if it works without Proguard, it should work with it.</p>","213345","","213345","","2012-11-14 02:39:33","2012-11-14 02:39:33","Proguard, Android, and abstract class instantiation","<android><abstract-class><proguard>","2","0","1","",""
"4053752","1","4054725","","2010-10-29 16:11:15","46","15489","<p>What is your Emulator feature that you could not work without? </p><p>Which unknown great shortcut, console command or startup option is there that you discovered and you think has to be also known by all other Android devs? </p><p>Share your Emulator wisdom with us.</p>","114066","","166712","","2010-10-31 16:21:19","2012-07-11 13:59:19","Android Emulator Tips and Tricks","<android><android-emulator>","12","0","44","2011-11-28 01:30:46",""
"4053953","1","4053977","","2010-10-29 16:36:00","1","798","<p>I am working on a few devices that need to send raw data to an android device wirelessly (wifi). The android devices needs to be able to support multiple devices so I figured a server is best. Is there a way to have the android device act as kind of a router/server access node by producing its own LAN network?</p><p>Any pointers appreciated,~Aedon</p>","480691","","","","","2010-10-29 16:38:23","Android acting as a wifi server?","<android><wifi><wireless><lan>","1","1","","",""
"4053994","1","","","2010-10-29 16:40:14","4","888","<p>on Android, i need an EditText  with a fixed Suffix (A String i want to add to the text).Now i'm using a TextWatcher to catch the onTextChanged Event, but if i change the Text again adding my suffix, it goes on StackOverflow caused by an infinite recursion.</p><p>Sorry if is not sounds clear, but i'm a java novice and i have a bad english.</p><hr><pre><code> msgtextview.addTextChangedListener(new TextWatcher() {        public void afterTextChanged(Editable s) {               //Doing some other stuff               msgtextview.setText(""Changed Text"") //This cause infinite recursion            }                       }</code></pre><p>Here's the code.</p>","491535","","50776","","2012-12-10 14:05:02","2012-12-10 14:05:02","Android EditText with a Fixed Suffix","<android><edittext><stackoverflow>","1","1","","",""
"4054083","1","4069580","","2010-10-29 16:51:31","4","1777","<p>Is there a java yaml library as good as snakeyaml for Android? (Or is anyone successfully using snakeyaml on Android already?)</p>","463994","","","","","2012-02-22 12:41:54","Is there a good yaml library for Android?","<java><android><yaml>","2","0","","",""
"4054158","1","4054188","","2010-10-29 16:59:37","2","365","<p>This gives me error:EditText messageEdit = (EditText)findViewById(R.id.description_text);Why can I not do like this on a eittext with lines?</p><p>This is how the Edittext looks like</p><pre><code>     &lt;EditText android:id=""@+id/message_text""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:lines=""3""         android:gravity=""top""/&gt;</code></pre>","371301","","","","","2010-10-29 17:03:13","Android error, when having Edittext lines","<android><edittext>","1","0","","",""
"4054260","1","4054720","","2010-10-29 17:12:10","3","2340","<p>Is there a generic way to determine if there is dialog currently shown ?  Sure, i can keep track of all <code>createDialog</code> and <code>dismissDialog</code> invocations, but that's cumbersome.</p><p>thanks</p>","450741","","","","","2010-10-29 18:21:51","android detect if a dialog is active?","<android><user-interface><dialog>","1","1","","",""
"4054567","1","","","2010-10-29 17:57:57","41","17212","<p><a href=""http://developer.android.com/reference/android/view/View.html#attr_android%3aminHeight"">View's have a <code>minHeight</code></a> but somehow are lacking a <code>maxHeight</code>:</p><p>What I'm trying to achieve is having some items (views) filling up a <code>ScrollView</code>. When there are 1..3 items I want to display them directly. Meaning the <code>ScrollView</code> has the height of either 1, 2 or 3 items.</p><p>When there are 4 or more items I want the <code>ScrollView</code> to stop expanding (thus a <code>maxHeight</code>) and start providing scrolling.</p><p>However, there is unfortunately no way to set a <code>maxHeight</code>. So I probably have to set my <code>ScrollView</code> height programmatically to either <code>WRAP_CONTENT</code> when there are 1..3 items and set the height to <code>3*sizeOf(View)</code> when there are 4 or more items.</p><p>Can anyone explain why there is no <code>maxHeight</code> provided, when there is already a <code>minHeight</code>? </p><p>(BTW: some views, like <code>ImageView</code> have a <code>maxHeight</code> implemented.)</p>","184367","","497356","","2011-09-18 21:26:59","2012-12-11 00:01:40","Android: why is there no maxHeight for a View?","<android><layout><view><autoresize>","6","0","7","",""
"4054568","1","4054779","","2010-10-29 17:58:22","9","1679","<p>I have a ListView which can be navigated with the dpad.  It has a footer.  I want to prevent navigation into the footer with the dpad.  I have set focusable and focusableInTouchMode of the footer view itself to false; this makes no difference (so I deduce that it is not actually <em>focus</em> I am seeing, but rather <em>selection</em>).</p><p>How do I prevent the footer from becoming selected?</p>","82118","","","","","2010-10-29 18:30:16","How do I prevent ListView footer from becoming selected?","<android><listview><focus><selection>","1","3","2","",""
"4054605","1","4054692","","2010-10-29 18:04:01","0","2626","<p>hope you guys can give me a hand now! this is tricky to me</p><p>I have run into an requirement of my application that i cant find a way to do this.</p><p>I need my application to be fullscreen and no title bar (done), and this application will have a background image. However, all the activities/views of my application must be transparent/translucent so the application background will be visible all the time behind the information i am displaying.</p><p>Basically i would like to have this behavior</p><p><a href=""http://www.geeky-gadgets.com/wp-content/uploads/2010/05/amazon-kindle-android-app.jpg"" rel=""nofollow"">http://www.geeky-gadgets.com/wp-content/uploads/2010/05/amazon-kindle-android-app.jpg</a></p><p>supousing that the image you see is not the phone wallpaper, but the application background image. What would be the application configuration in the manifest file and what would be the configuration for eacy activity/view?</p><p>I also noticed that, i need to setup each activity to be fullscreen without title bar. Is there a way to do this globaly in the application so all activities will behave this way?</p><p>Many thanks for your time</p>","491604","","","","","2010-10-29 18:18:14","Application background image with transparent activities","<android>","1","0","","",""
"4054627","1","4054653","","2010-10-29 18:08:35","0","259","<p>I want to use the Camera Image to get the google search results. I could not find a way to do that using Android API.</p>","442903","","","","","2010-10-29 18:11:00","How do I perform Visual search using Android API?","<android><search>","1","0","","",""
"4054662","1","4115170","","2010-10-29 18:12:13","11","9249","<p>My code for opening an input dialog reads as follows:</p><pre><code>final AlertDialog.Builder alert = new AlertDialog.Builder(this);  alert.setTitle(""Dialog Title"");  alert.setMessage(""Request information"");  LayoutInflater factory = LayoutInflater.from(this);final View textEntryView = factory.inflate(R.layout.edittextautotextlayout, null);final EditText inputBox = (EditText) textEntryView.findViewById(R.id.my_et_layout);alert.setView(inputBox);</code></pre><p>This works fine except that I have to tap the text entry line before the soft keyboard appears.</p><p>Following the advice given <a href=""http://stackoverflow.com/questions/2403632/android-show-soft-keyboard-automatically-when-focus-is-on-an-edittext"">here</a> I have tried inserting:</p><pre><code>inputBox.setOnFocusChangeListener(new View.OnFocusChangeListener() {    @Override    public void onFocusChange(View v, boolean hasFocus) {        if (hasFocus) {            alert.getWindow().setSoftInputMode(                WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);        }    }});</code></pre><p>but Eclipse objects that ""the method getWindow() is not defined for the type AlertDialog.Builder"".</p><p>It seems that the setOnFocusChangeListener code works for an AlertDialog object but not an AlertDialog.Builder. How should I modify my code to make the soft keyboard appear automatcially.</p>","250845","","","","","2013-06-14 16:42:42","Displaying soft keyboard whenever AlertDialog.Builder object is opened","<android><keyboard><edittext><alertdialog>","10","0","6","",""
"4054716","1","4056617","","2010-10-29 18:21:12","1","2017","<p>In my apps preferences screen, i want to pop up a dialog that shows a list of checkbox items that are dynamically generated. </p><p>How does one do that and also, how does one get the checked values? I have made custom dialogs in the past, but for some reason my brain wont function today ...</p><p>Thanks.</p>","354607","","","","","2010-10-29 23:57:30","how to display a list of checkboxes using dynamic data","<android>","2","0","","",""
"4054971","1","4054990","","2010-10-29 18:56:26","4","4342","<p>Is declaring a class that extends Activity inside another Activity class possible? If it is, how would I register that class in the manifest? Also, is that something that can be reasonably done or is it a bad idea?</p><p>I was thinking of something like</p><pre><code>class ListClass extends ListActivity{    ...    ArrayList items;    class ItemClass extends Activity{        ...        Item item;        @Override        onCreate(){            Integer pos = getIntent().getExtras().getInt(""pos"");            item = items.get(pos);        }    }    @Override    onItemClick(int position){        startActivity(new Intent(this, ItemClass.class).putExtra(""pos"", position));    }}</code></pre><p>Note the syntax isn't 100% correct obviously, mostly pseudocode.</p>","375874","","","","","2012-03-19 03:31:51","Nested inner Activity class in android","<android><activity><inner-classes><listactivity><nested-class>","3","4","","",""
"4055104","1","7484465","","2010-10-29 19:13:31","5","844","<p>this is is a pretty straight forward question, I need to detect when the default Remember password popup opens on the Android Webview (So I can make sure I am not covering it with any other component, or at least bring it to the front)</p><p>Thanks a lot, this community has been very helpful for me.</p>","367342","","","","","2011-09-20 11:38:08","Remember password popup on Android webview problem","<android><passwords><popup><webview><passwordbox>","1","0","2","",""
"4055152","1","4062472","","2010-10-29 19:19:15","1","1463","<p>I have created a ListView with TextViews as items - most of which have a certain color as background, but some have a custom @drawable/shape as background (i.e. the top and bottom items, which have rounded corners).These backgrounds are set as part of state-lists, to provide another background color when the items are tapped.The listSelector of the ListView is set to transparent, and instead the contained TextViews in the items are set to clickable.</p><p>ListView:</p><pre><code>&lt;ListView android:id=""@+id/allreminders_list"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:dividerHeight=""3px"" android:cacheColorHint=""#00000000""android:divider=""@color/trans"" android:background=""@drawable/reminderlist_background""android:listSelector=""@android:color/transparent""/&gt;</code></pre><p>ListView entry:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""?android:attr/listPreferredItemHeight""android:id=""@+id/entry_container""&gt;&lt;TextView android:id=""@+id/remindername"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:text=""dummy""android:padding=""15dp"" android:layout_marginLeft=""15px""android:layout_marginRight=""15px"" style=""@style/ReminderEntry""android:clickable=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Programmatical setting of ListView entry background:</p><pre><code>if (position == 1)textViewReminderName  .setBackgroundResource(R.drawable.reminder_entry_state_top);else if (position == remindersInSection)textViewReminderName  .setBackgroundResource(R.drawable.reminder_entry_state_bottom);elsetextViewReminderName  .setBackgroundResource(R.drawable.reminder_entry_state);</code></pre><p>State-list for top items (R.drawable.reminder_entry_state_top):</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_pressed=""true"" android:drawable=""@drawable/rounded_top_corners_selected"" /&gt;&lt;item android:state_selected=""true"" android:drawable=""@drawable/rounded_top_corners_selected"" /&gt;&lt;item android:drawable=""@drawable/rounded_top_corners"" /&gt;</code></pre><p></p><p>Shape for unselected top items (@drawable/rounded_top_corners):</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;solid android:color=""@color/entry_background""/&gt;    &lt;corners android:bottomRightRadius=""0dp"" android:bottomLeftRadius=""0dp""  android:topLeftRadius=""5dp"" android:topRightRadius=""5dp""/&gt; &lt;/shape&gt;</code></pre><p>This stuff works, functionally. BUT, the top and bottom items (which have the shape-drawable as background, which is shown above) change their color slightly under certain conditions:</p><ul><li>After scrolling down the list without tap-stopping the scroll</li><li>After clicking any item in the list</li></ul><p>The correct color of those items is only shown when I scroll the list without removing the finger before scrolling has ended.</p><p>What can this possibly be? A bug in the way StateListDrawables present drawable shapes?</p>","458603","","458603","","2010-10-29 19:32:23","2010-10-31 09:02:41","StateListDrawable in ListView strangely off-colored in certain conditions","<android><listview><colors>","1","2","","",""
"4055245","1","4055293","","2010-10-29 19:31:36","13","21853","<p>Is there right way to get Url to android market app ?I read some answer here  but I did not  success to get any ?</p>","365860","","","","","2014-03-21 18:49:53","Android Market application Url?","<android><url><google-play>","7","0","2","",""
"4055280","1","","","2010-10-29 19:37:15","10","3827","<p>How can one get audio input on the Android Emulator?  I'm using the 2.2 SDK, and emulating on Ubuntu 10.10.</p><p>I have the hw.audioinput property set to yes on my emulator, but I get the message ""Recognizer not present"" when I run the Voice Recognition API demo app on the emulator.  On my phone, of course, it works fine.</p><p>I'm trying to use the speech input stuff from the SDK as mentioned here: <a href=""http://developer.android.com/resources/articles/speech-input.html"">http://developer.android.com/resources/articles/speech-input.html</a>.  They don't mention a thing about getting it to work on the emulator.</p><p>I've seen postings all over the forums about this with little to no sure solutions or successes.  You know how it goes with forums.  That's why I'm posting this question to StackOverflow; hopefully we can get one clear-cut answer!</p>","135101","","","","","2012-06-13 19:34:18","Audio Input on Android Emulator","<android><voice-recognition>","2","0","2","",""
"4055537","1","4055570","","2010-10-29 20:12:58","56","79230","<p>I have lot of items on the screen and I need to use the scrollbar so the user can scroll down. However, the scroll is either not visible or it's not working. How is it possible to add a scrollbar to a linearlayout?          </p>","371301","","2786221","","2013-10-08 12:17:32","2013-10-08 12:17:32","Android, LinearLayout scroll","<android><android-linearlayout>","4","0","17","",""
"4055660","1","4055698","","2010-10-29 20:31:13","0","330","<p>I notice that most android apps have some sort of standard in that they all look similar.  Most of them have some sort of list of Text that are click-able.  It's somewhat hard to explain but they look really nice and I was wondering is there some sort of tool or api that allows me to change the look of an app to make it similar?  Or do I have to specifically specify the different fonts and different graphics?  Like this:</p><p><a href=""http://www.androidandme.com/wp-content/uploads/2009/03/tmobapp1.png"" rel=""nofollow"">http://www.androidandme.com/wp-content/uploads/2009/03/tmobapp1.png</a></p><p>I am new to Android programming so sorry if this sounds like a dumb question.  Thank you.</p>","491741","","","","","2010-10-29 20:37:06","How do I make my app look like a standard Android app?","<java><android>","2","0","","",""
"4055724","1","4069464","","2010-10-29 20:38:41","1","328","<p>When I try to debug my app I get  a runtimeexception when I include this xml in my layout.  I cannot see what is wrong with it, can you?I am using android eclipse plugin, eclipse 3.5.2, with the latest android plugin and the latest  java 6...21  on winxppro 32 bit sp3Thank you.</p><p></p><pre><code>&lt;ImageButton android:id=""@+id/map_button""  android:src=""@drawable/bot_map""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_weight=""1""  /&gt;&lt;ImageButton android:id=""@+id/filter_button""  android:src=""@drawable/bot_filter""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_weight=""1""  /&gt;&lt;ImageButton android:id=""@+id/sort_button""  android:src=""@drawable/bot_sort""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_weight=""1""  /&gt;&lt;ImageButton android:id=""@+id/prev_button""  android:src=""@drawable/bot_arrow_prev""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_weight=""1""  /&gt;&lt;ImageButton android:id=""@+id/next_button""  android:src=""@drawable/bot_arrow_next""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_weight=""1""  /&gt;</code></pre><p></p><p>I also get these exceptions at the same time:</p><p>java.lang.IllegalArgumentException: Argument cannot be null at org.eclipse.swt.SWT.error(SWT.java:3865) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.swt.widgets.TreeItem.checkNull(TreeItem.java:205) at org.eclipse.swt.widgets.TreeItem.(TreeItem.java:195) at org.eclipse.gef.editparts.AbstractTreeEditPart.addChildVisual(AbstractTreeEditPart.java:75) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:210) at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:771) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:718) at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:252) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:211) at org.eclipse.gef.editparts.RootTreeEditPart.setContents(RootTreeEditPart.java:140) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.UiContentOutlinePage.reloadModel(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.xmlModelChanged(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor$XmlModelStateListener.modelChanged(Unknown Source) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.fireModelChanged(AbstractStructuredModel.java:553) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.internalModelChanged(AbstractStructuredModel.java:887) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.changedModel(AbstractStructuredModel.java:382) at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.changedModel(DOMModelImpl.java:167) at org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager.undo(StructuredTextUndoManager.java:648) at org.eclipse.wst.sse.ui.StructuredTextViewerUndoManager.undo(StructuredTextViewerUndoManager.java:183) at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3938) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:921) at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1533) at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:604) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:569) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:125) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1208) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:346) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)</p>","491739","","","","","2011-09-06 00:23:01","what is the bug in this android layout xml chunk","<android><eclipse><imagebutton><android-linearlayout><runtimeexception>","2","2","","",""
"4055790","1","4055812","","2010-10-29 20:47:27","0","774","<p>I'm going through some book which tries to teach android development. In the book, the author outlines some of the directories found under res/. He mentions res/menu which holds XML based menu specifications. He also makes mention of res/raw which holds ""general-purpose files."" These folders were not created when I created a new android project. I'm using the latest Android SDK with the latest Eclipse version. Are those folders he mentions from some older version of the android SDK?</p>","479180","","","","","2010-10-29 20:52:35","res/ directory tree","<java><android>","2","0","","",""
"4055830","1","4871720","","2010-10-29 20:53:44","19","7943","<p>Google has speech recognition services available for use from mobile phones (Android has it built in, iPhone users can use the Google application) - <a href=""http://www.google.com/mobile/"">http://www.google.com/mobile/</a>. We've found one article where someone tried to reverse engineer the service at <a href=""http://waxy.org/2008/11/deconstructing_google_mobiles_voice_search_on_the_iphone/"">http://waxy.org/2008/11/deconstructing_google_mobiles_voice_search_on_the_iphone/</a>.</p><p>We want to better understand what is happening over the network when we use Android's RecognizerIntent.  Does anyone have any experience using this service over the web or know of other articles that may explain its workings?</p>","90236","","","","","2012-10-11 10:34:32","Google's voice search speech recognition service","<android><speech-recognition>","2","3","11","",""
"4055885","1","","","2010-10-29 21:00:44","1","6425","<p>I am new to programming in android. I have followed instruction and create a admob banner. How can I make it appear at certain intervals, and make it disappear if I want to? For example the admob banner can goes up and down at the bottom of the screen whenever it wants to. Thanks.</p><p>Edit:</p><p>I know that i can call <code>adView.setVisibility( View.GONE );</code> to make the ads appear and disappear, but when i try to write it into a thread to make it appear and disappear with intervals, it just hangs there with a black screen.</p><p>Or is there anyway that admob can make their ad appear and disappear at intervals?</p><p>This is how i call the thread.</p><pre><code>loadAdmob = new asyncAdmobProc();loadAdmob.execute();loadAdmob.doInBackground();//asyncAdmobProc();</code></pre><p>The code:</p><pre><code>//wakes up the admobprivate class asyncAdmobProc extends AsyncTask&lt;Integer , Void, Integer&gt; {    private boolean bconthread=true;    protected Integer doInBackground(Integer... Params) {        //wakes up and disable admob        /*AdManager.setTestDevices( new String[] {                AdManager.TEST_EMULATOR, // Android emulator                ""E83D20734F72FB3108F104ABC0FFC738"", // My T-Mobile G1 Test Phone                } );//*/        adView = (AdView)findViewById(R.id.articleList_ads);        adView.requestFreshAd();        adView.setVisibility( View.GONE );        //while(bconthread){            adView.requestFreshAd();            ShowAd();            postDelayed();            //HideAd();            postDelayed();        //}        //call this to delete all bitmaps associated with the ad        adView.cleanup();        return 0;    }    private void HideAd()    {        // Hide the ad.        adView.setVisibility( View.GONE );        // Fade the ad in over 4/10 of a second.        AlphaAnimation animation = new AlphaAnimation( 0.0f, 1.0f );        animation.setDuration( 400 );        animation.setFillAfter( true );        animation.setInterpolator( new AccelerateInterpolator() );        adView.startAnimation( animation );//*/    }    private void ShowAd()    {        // Unhide the ad.        adView.setVisibility( View.VISIBLE );        // Fade the ad in over 4/10 of a second.        AlphaAnimation animation = new AlphaAnimation( 0.0f, 1.0f );        animation.setDuration( 400 );        animation.setFillAfter( true );        animation.setInterpolator( new AccelerateInterpolator() );        adView.startAnimation( animation );//*/    }}</code></pre>","506146","","12707","","2010-10-30 01:08:42","2013-08-02 20:46:32","Admob in android. How to make it appear and disappear","<android><admob>","1","0","","",""
"4055889","1","4056413","","2010-10-29 21:01:19","0","350","<p>I'm kind of new in android AOSP development, and I'm trying to click to the trackball and launch an app already installed (Camera App).</p><p>I'm looking at the policy.androdoid, but i just doesn't understand how to gain controls of the hardware buttons and where to start.</p><p>Any help, source code example or something like that will be really helpful. </p><p>Thanks in advance!</p>","491758","","","","","2010-10-29 22:39:28","How to gain control of trackball in Nexus One Android","<android><nexus-one><android-hardware>","1","0","","",""
"4055967","1","","","2010-10-29 21:15:52","1","157","<p>When I try to use error in javax.xml.bind .messages in android app it give error...............can't find resource for javax.xml.bind .messages ,bundle key <code>en_us</code></p>","482320","","437301","","2010-10-30 04:31:11","2010-10-30 04:31:11","error in javax.xml.bind .messages","<android><amazon-ec2>","0","0","","",""
"4056003","1","4239617","","2010-10-29 21:20:46","10","760","<p>Is it possible to extend the Voice Search app?  I know I can add a button in my own app to launch the voice recognition dialog, but I was wondering if I could extend the voice search app that launches automatically when you long press the physical ""search"" key.</p><pre><code>send text to [contact] [message]listen to [artist/song/album]call [business]call [contact]send email to [contact] [message]go to [website]note to self [note]navigate to [location/business name]directions to [location/business name]map of [location]</code></pre><p>I'd basically like to add my own action to the above list.  </p><p>Is this possible or will I have to create my own?</p>","135199","","","","","2010-11-21 18:53:06","Extending Android's Voice Search app","<android>","1","0","4","",""
"4056043","1","4979073","","2010-10-29 21:28:41","3","1670","<p>Is it me or I can't find any example of how to add/configure Microsoft Exchange programatically?</p><p>It seems like </p><p>AccountManager ::  </p><pre><code>addAccount (String accountType, String authTokenType, String[] requiredFeatures, Bundle addAccountOptions, Activity activity, AccountManagerCallback&lt;Bundle&gt; callback, Handler handler)</code></pre><p>should do the work.However, I can't figure out how for Microsoft Exchange account.Could you point me to a simple working example code?</p><p>Thank you.</p>","432056","","","","","2011-02-12 16:14:39","Android How to add/configure Exchange setting programmatically?","<android><exchange-server><configure>","1","3","","",""
"4056070","1","","","2010-10-29 21:35:35","2","831","<p>After taking a photograph with an Android phone, I would like to put a timestamp in the lower right corner. How can one do this without exhausting address space/memory? Typically, when I open large images, I get out of memory errors.</p><p>Do some phones support a Camera.Parameters option to do this?</p>","491795","","","","","2010-10-29 21:35:35","How to put a timestamp on a photo with Android","<android>","0","0","2","",""
"4056118","1","","","2010-10-29 21:43:37","0","1342","<p>Is there a way to capture a key event from the Menu button using an Intent or BroadcastReceiver?</p><p>Basically I want my app's Service to be activated when the Menu key is pressed.</p><p>Thanks</p>","149166","","","","","2012-07-12 07:58:03","How to capture key events from Intent's or BroadcastReceivers","<android><android-intent><broadcastreceiver><keyevent>","1","0","","",""
"4056128","1","","","2010-10-29 21:45:08","0","263","<p>I'm tring to upload googlemap in android app, using eclipse. But the results are that I only see white grid with no map on it. Is it because I used  a temporary Maps API Key? How can I register for a new Key? </p>","482762","","73488","","2010-10-30 13:21:36","2010-10-30 13:21:36","upload googlemap in android app, using eclipse","<android><google-maps>","1","0","","",""
"4056301","1","4065259","","2010-10-29 22:18:32","0","296","<p>I want to start programming in Android. I have backgrounds in Java and j2me. As I am new and have budget constraints I was willing to purchase HTC G1 (1.5 cupcake) rather than any 2.2 device. Is that a good idea? (or let me know if there is any lowcost (around $200) 2.2 device) Please give your opinion. Thanks</p>","474986","","16828","","2010-10-31 21:43:25","2010-10-31 21:43:25","Which one to choose - Android 1.5 or Android 2.2? (I am a beginner)","<java><android><device>","4","4","","2012-08-23 14:27:48",""
"4056468","1","","","2010-10-29 22:50:57","6","5841","<p>I'm completely frustrated with the Android SDK Manager.</p><p>I'm running Win 7 Home edition and have the SDK installed in its own top level directory on my D:\ drive.  </p><p>When I run SDK Setup.exe from the command line (and I've even opened the prompt as an administrator), I get an error when trying to update the packages.</p><p>The SDK manager is telling me that I need to install the SDK Tools rev 7.  But when I accept the license, I get an error message stating:</p><p>""A folder failed to be renamed or removed"" yada yada yada.  The Installing Archives window says ""Failed to rename directory D:\android-sdk-windows\tools to D:\android-sdk-windows\temp\ToolPackage.old01.""</p><p>I looked here for help: </p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/4b784f3eb1e096fd/ecadfb28ce5daf5f?lnk=gst&amp;q=cannot+rename+folder#ecadfb28ce5daf5f"">http://groups.google.com/group/android-developers/browse_thread/thread/4b784f3eb1e096fd/ecadfb28ce5daf5f?lnk=gst&amp;q=cannot+rename+folder#ecadfb28ce5daf5f</a></p><p>but the content there didn't help.</p><ol><li><p>I DO have my antivirus (AVG) disabled.</p></li><li><p>I DO NOT have any other programs running -- just the command prompt to launch the SDK Manager.</p></li><li><p>I have even given the everyone group, for the D:\android-sdk-windows\ folder, full control.</p></li><li><p>I tried to rename the tools directory before starting the SDK Manager but then I get an error that a batch file cannot be found when I try to launch SDK Setup.exe.  Grrrr.</p></li></ol><p>None of this works.</p><p>Suggestions how to get the package to update without error are greatly appreciated.</p><p>Thanks!</p>","491842","","","","","2012-08-04 11:54:25","Error received when updating the SDK with the SDK Manager","<android>","9","0","0","",""
"4056606","1","4903715","","2010-10-29 23:55:18","14","11101","<p>I'd like to build some native libraries for android using the NDK (native development kit), but i'd like to use Visual Studio 2010 to do it. I've googled quite a bit but haven't found any information on it. Does anyone have any experience with this and know the steps necessary to make this happen? I have CYGWin installed, made sure i get Make (per the NDK instructions), but i'm not really sure of the next steps in terms of setting up the project, compiler in visual studio, etc.</p><p>If anyone knows of any write-ups, tutorials, or links to sample projects, that would be awesome, as there isn't much on google yet.</p><p>thanks!</p>","339448","","","","","2014-03-17 16:44:02","Android NDK with Visual Studio","<android><android-ndk>","5","1","12","",""
"4056846","1","","","2010-10-30 01:19:54","0","970","<p>I am wanting to develop a workout app that will involve certain types of music and I figured the easiest way to get certain genres is to see if a music app allows developers to use their API. If so I would go from there, but first I need to find someone. </p><p>Does anyone know of a Music App (Pandora, Slacker...) that will allow developers to use their API for music in my app? Or would this be better served with a Service to a music app of the users choice with a station request by me (If I can do all that from a Service)? </p>","413926","","","","","2013-03-05 21:38:24","Available Music API","<android><api>","3","0","2","",""
"4056984","1","4524826","","2010-10-30 02:23:36","0","1549","<p>While debugging, Log.d() or Log.e() methods come to LogCat, but how do I capture the runtime error or trace log on the Android device when it is not connected to the development environment ?</p>","474375","","","","","2012-04-05 12:41:14","Where and how runtime error logs are saved in Android device?","<android>","3","1","0","",""
"4057057","1","","","2010-10-30 03:01:47","2","4230","<p>I embed a mp4 video into a webpage, using the embed src script.I can view it when I browse from iphone, but not android.</p><p>I did some research and found out that I need to use html 5, which uses the  tag.</p><p>However, how do I find out what version of the video I have? I tried</p><pre><code>&lt;video width=""560"" height=""340"" controls&gt;  &lt;source src=""&lt;?php echo $video; ?&gt;"" type='video/mp4; codecs=""avc1.42E01E, mp4a.40.2""'&gt;&lt;/video&gt;</code></pre><p>But it's not working either. Any ideas? Thank you in advance </p>","225228","","","","","2012-03-11 04:25:28","Embed video and play on android","<android><html5-video>","3","0","","",""
"4057086","1","","","2010-10-30 03:13:44","3","5174","<p>using sms manager it does not work with a csv list; is there any way besides looping and sending more than one text to send to multiple recipients?</p><p>or is this by design a non-spam feature?</p>","491816","","","","","2014-02-01 18:24:01","How do I send sms to multiple phone numbers in android","<android><sms>","3","0","6","",""
"4057138","1","6772781","","2010-10-30 03:37:00","0","153","<p>I am developing an appwidget for android. It works fine when installing and running, but whenever the device is rebooted, the program can no longer use that widget. The activity is still selectable in the launcher, but there is no way to add the widget to the home screen without reinstalling the program.</p><p>Have you hear of this happening? How can I fix this problem? Thanks so much!</p>","354130","","","","","2011-07-21 07:42:14","Disappearing AppWidgets for Android Development","<android><android-widget><appwidget>","1","4","","",""
"4057215","1","","","2010-10-30 04:11:42","0","1963","<p>I am New to Android. My Requirement is to storing an audio file into database using Android Sqlite. can any one suggest me?</p><p>Thanks in advance.</p>","486291","","","","","2012-11-08 15:09:30","How to store an audio file into database using Android Sqlite?","<android>","2","0","","",""
"4057331","1","4057350","","2010-10-30 05:04:58","7","1763","<p>How can we turn automatic brightness off in android?</p>","432559","","","thyrgle","2010-10-30 05:07:15","2010-10-30 05:11:32","How can we turn automatic brightness off in android?","<android>","1","0","0","",""
"4057352","1","","","2010-10-30 05:11:53","1","163","<p>I am using android 2.x and I have four bitmaps drawn on a canvas, now i want to replace ""yahoo"" image with some other image and that image's size is different than ""yahoo"" image. Now what i want is , i want to rub the yahoo image and replace it with the new one but in such a way that if i rub ""yahoo"" image then images that are laying in the background don't get disturbed or vanished.</p><p><strong>here is the sample image</strong></p><p><img src=""http://i.stack.imgur.com/ffV13.png"" alt=""alt text""></p>","405383","","","","","2010-11-01 04:02:41","rub image in canvas","<android><canvas><bitmap>","1","0","1","",""
"4057412","1","","","2010-10-30 05:39:08","-1","944","<p>-->I am new to Android And i want to show two progress dialog one after another??</p><p>-->First i want to show when my image is load from internet, when this process is done i have set A button on that Remote image. </p><p>-->When i click that button i want Dialog for second time..(on clicking button i have set video streaming code.. before video is start i want to close that Dialog..)</p><p>Any Help????Thanks...    </p>","491215","","","","","2010-10-30 07:10:52","Progress Dialog","<android>","2","5","","",""
"4057442","1","","","2010-10-30 05:51:04","2","565","<p>I am new to android.I made string array.It has more elements starts with A to Z . I make list View for the array.When i scroll the screen i wish to display the starting letter.If i remove the hand at the letter 's' then i will display the items starts with the letter 's'</p><p>as like the following link</p><p><a href=""http://www.youtube.com/watch?v=rcPIvGRwrxA"" rel=""nofollow"">http://www.youtube.com/watch?v=rcPIvGRwrxA</a> </p>","482568","","","","","2010-10-30 12:20:34","Scroll slider in android?","<android>","1","0","1","",""
"4057463","1","4057477","","2010-10-30 05:58:36","0","6224","<p>I saw some topics here regarding facebook and twitter integration with Android Application.</p><p>I need help regarding, is twitter integration with Android App possible in real??[I need to tweet on user's wall and all]</p><p>If i wanted to integrate Facebook with my App then whether i go as per explained in following link(and if this is the recommended way then how to implement this SDK):</p><p><a href=""http://forum.developers.facebook.net/viewtopic.php?pid=146956"" rel=""nofollow"">http://forum.developers.facebook.net/viewtopic.php?pid=146956</a></p><p>or </p><p>else i use Android facebook SDK available here on code.google.com</p>","457146","","244296","","2010-10-30 06:01:34","2010-12-31 10:17:50","Facebook and twitter integration with my android application","<android><facebook><twitter>","1","0","2","",""
"4057502","1","4060951","","2010-10-30 06:15:06","1","584","<p>Hi i am dispalying some data by using sqlite .when i click on one button data come from database.  It takes some time.  At that time the screen is black .At that time I want to display the rotating spinner  before the data dispaly.For this purpose give me some suggestions.Thanks in advance</p>","479027","","379693","","2010-10-30 08:41:21","2010-10-30 22:27:37","display the rotating progress before display the data","<android><android-2.1-eclair>","4","0","1","",""
"4057534","1","","","2010-10-30 06:25:09","2","331","<p>I am using FBConnect  in my game to post score on facebook wall. Now login interface has changed, whenever I click on login button the connectToSession method is not executing because it didn't get <code>"" auth_token ""</code> from  url query. Just two days before it was executing properly and  delegate method sessionDidLogin also getting executed. Before in sessionDidLogin method I was switching to FeedActivity class for publishing game score to facebook wall.</p>","479059","","1108213","","2012-03-18 18:29:41","2012-04-12 15:51:59","not getting "" auth_token"" in url query when loging to facebook?","<android>","0","0","","",""
"4057537","1","4143738","","2010-10-30 06:25:46","1","746","<p>how can we get E-mail receiving notification in android</p>","432559","","","","","2010-11-10 11:00:12","how can we get E-mail receiving notification in android","<android>","2","1","1","",""
"4057648","1","4057787","","2010-10-30 07:03:12","0","1011","<p>After I either receive a phone call or make one, (and other undocumented interruptions) my application gets a <strong>NullPointerException</strong> when resuming my activity. Can any explain to me where it is and/or how to fix it?</p><p>I have written the code as shown below:</p><pre><code> @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.displayActivity);        new performBackgroundTask().execute();  }  @Override  public void onDestroy()  {    listview1.setAdapter(null);    super.onDestroy();  }  private class performBackgroundTask extends AsyncTask &lt;Void, Void, Void&gt;    {           private ProgressDialog Dialog = new ProgressDialog(displayActivity.this);           protected void onPreExecute()           {               Dialog.setMessage(getString(R.string.dialog_wait_message));               Dialog.show();           }           protected void onPostExecute(Void unused)               {               Dialog.dismiss();                   // displaying all the fetched data           }           @Override            protected Void doInBackground(Void... params)             {                 // fetching data from web using HTTPGet method                 return null;           }  }</code></pre><h2>Logcat output is:</h2><p>java.lang.RuntimeException: Unable to destroy activity {myApplication/MyApplication.displayActivity}: java.lang.NullPointerExceptionat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655)at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673)at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3789)at android.app.ActivityThread.access$2400(ActivityThread.java:125)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4627)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.NullPointerExceptionat MyApplication.displayActivity.onDestroy(displayActivity.java:74)at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642)</p><p><em><strong>now, pls help me to fix this problem, how do i handle phone call or SMS received or such kind of interruptions?</em></strong></p>","379693","","379693","","2010-10-30 07:08:29","2010-10-30 09:47:20","Application crashed after either receive a phone call or such interruptions","<android><android-progressbar><android-logcat>","2","0","1","",""
"4057659","1","","","2010-10-30 07:06:50","0","169","<p>everyone ,i have a peoblem here ,when i install a apk the system wiil show a install Dialog ,one is ""open"",the other one is ""done"",how can i set the ""open"" button unusableand when user click ""done"",it will show the activity that i want to show?thanks!</p>","492004","","492004","","2010-10-30 07:15:19","2010-10-30 07:15:19","how to set the button unusable ,after successful install a apk?","<android>","1","0","","",""
"4057713","1","4057814","","2010-10-30 07:27:42","0","954","<p>Does anyone know how to run the emulator within eclipse without using ADT. All I want to do is run the emulator with -partition-size  option of the emulator and you cant do this by default. Im sure there might be a tricky way of doing this but googling doesn't give me any clues. does any one know ?</p><p>I also thought about running the emulator as part of a script and call the script within eclipse.</p><p>running on a mac bdw.</p>","429199","","","","","2010-10-30 08:00:33","running android emulator in eclipse","<android><eclipse><osx><android-emulator>","1","0","","",""
"4057728","1","","","2010-10-30 07:32:48","2","412","<p>I am releasing two versions of an app--free and paid. The differences between the two are few, and I would like to release both using the same codebase (maybe a different constant defined for the other build?). Has anyone done this? Can someone point me in the right direction? Thanks!</p>","145279","","","","","2011-07-03 17:59:10","Is there a convention for maintaining both a free and pro app version from the same codebase in Eclipse?","<java><android><eclipse><google-play>","1","1","2","",""
"4057922","1","","","2010-10-30 08:39:27","0","2680","<p>I tried to resize an image inside a textview (using HTML layout and the image callback), but I could not get the correct width of the view. getWidth() always returns 0 for this view. I am calling the function inside onStart() in the application that contains the TextView.</p><p>Thanks for any hints!</p><p>RG</p>","447111","","","","","2010-12-09 23:39:21","How to get the width of a TextView?","<android>","2","0","","",""
"4058042","1","4058098","","2010-10-30 09:26:46","1","683","<p>I have a layout that contains several sub-views all which set height like:</p><pre><code>&lt;View android:layout_width=""fill_parent""    android:layout_height=""18dip""    android:background=""#ff000000"" /&gt;</code></pre><p>How can I retrieve the value stored in layout_height in code?</p><p>Ultimately, what I would like to do is being able to adjust the size defined in the layout so I can dynamically change the value defined by layout_height depending on the resolution of the screen resolution and the pixel density.Is the only way to do so during the onLayout callback?</p><p>It would be much easier to redefined the XML on onCreate.</p><p>Comments, advices would be much appreciated.</p><p>ThanksJY</p>","298699","","","","","2010-10-30 09:45:16","How to retrieve layout_height in code","<java><android><xml>","2","0","1","",""
"4058056","1","4058072","","2010-10-30 09:31:50","1","264","<p>Hi I am using the sqlite in my app. When I'm getting the values from db I'm getting below error. Please tell me when these type of errors are coming and suggest me for this one.</p><pre><code>10-30 15:06:07.584: ERROR/Database(817): Leak found10-30 15:06:07.584: ERROR/Database(817): java.lang.IllegalStateException: /data/data/com.fitzsoftware.grocessaryList/databases/example.db SQLiteDatabase created and never closed10-30 15:06:07.584: ERROR/Database(817):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1581)10-30 15:06:07.584: ERROR/Database(817):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)10-30 15:06:07.584: ERROR/Database(817):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:659)10-30 15:06:07.584: ERROR/Database(817):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:652)10-30 15:06:07.584: ERROR/Database(817):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:482)10-30 15:06:07.584: ERROR/Database(817):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)10-30 15:06:07.584: ERROR/Database(817):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)10-30 15:06:07.584: ERROR/Database(817):     at com.fitzsoftware.grocessaryList.DataHelper.&lt;init&gt;(DataHelper.java:46)10-30 15:06:07.584: ERROR/Database(817):     at com.fitzsoftware.grocessaryList.MyShoppingList.onCreate(MyShoppingList.java:63)10-30 15:06:07.584: ERROR/Database(817):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)10-30 15:06:07.584: ERROR/Database(817):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)10-30 15:06:07.584: ERROR/Database(817):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)10-30 15:06:07.584: ERROR/Database(817):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)10-30 15:06:07.584: ERROR/Database(817):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)10-30 15:06:07.584: ERROR/Database(817):     at android.os.Handler.dispatchMessage(Handler.java:99)10-30 15:06:07.584: ERROR/Database(817):     at android.os.Looper.loop(Looper.java:123)10-30 15:06:07.584: ERROR/Database(817):     at android.app.ActivityThread.main(ActivityThread.java:4203)10-30 15:06:07.584: ERROR/Database(817):     at java.lang.reflect.Method.invokeNative(Native Method)10-30 15:06:07.584: ERROR/Database(817):     at java.lang.reflect.Method.invoke(Method.java:521)10-30 15:06:07.584: ERROR/Database(817):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)10-30 15:06:07.584: ERROR/Database(817):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)10-30 15:06:07.584: ERROR/Database(817):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Because of this error, data which is coming from db takes so much time to display.</p>","479027","","1141275","","2013-07-11 08:58:29","2013-07-11 08:58:29","DataBase Error in android","<android><android-sqlite>","1","0","","",""
"4058099","1","","","2010-10-30 09:45:42","0","1670","<p>I am trying to store drawables in a static SoftReferenceMap for a ListView containing progress-bars in every row. Every row has a different progress, but when I set it through setProgress(int) all rows get affected.</p><p>I tried doing mDrawable.mutate().setLevel(progress*10000/max), but it still doesn't work.</p><pre><code>public void setProgres(int status, int progress, int max) {        Drawable d = getDrawable(status);        switch (status) {        case RED_INDETERMINATE:            setIndeterminateDrawable(d);            setIndeterminate(true);            break;        case YELLOW:            d.mutate().setLevel((int) (progress * 10000 / max));        case GREEN:        case BLUE:            setProgressDrawable(d);            break;        default:            throw new IllegalArgumentException(                    ""Invalid Status setting for ArtooProgressBar: "" + status);        }        getProgressDrawable().invalidateSelf();        super.invalidate();    }    private Drawable getDrawable(int status) {        SoftReference&lt;Drawable&gt; ref = sDrawableMaps.get("""" + status);        if (ref != null &amp;&amp; ref.get() != null)            return ref.get();        Drawable d;        switch (status) {        case RED_INDETERMINATE:            d = getResources().getDrawable(                    R.drawable.progress_bar_indeterminate);            d = tileifyIndeterminate(d);            break;        case YELLOW:            // d = yellow;            d = getResources().getDrawable(                    R.drawable.progress_bar_determinate_yellow);            break;        case GREEN:            d = getResources().getDrawable(                    R.drawable.progress_bar_determinate_green);            d.setLevel(10000);            break;        case BLUE:            d = getResources().getDrawable(                    R.drawable.progress_bar_determinate_blue);            d.setLevel(10000);            break;        default:            throw new IllegalArgumentException(                    ""Invalid Status setting for ArtooProgressBar: "" + status);        }        if (d != null)            sDrawableMaps.put("""" + status, new SoftReference&lt;Drawable&gt;(d));        d.invalidateSelf();        return d;    }</code></pre><p>What am I missing?</p><p>Thanks</p>","356580","","356580","","2010-10-30 13:46:58","2010-10-30 20:14:27","Android Drawable mutate() & setLevel()","<android><progress-bar><progress><drawable>","1","2","","",""
"4058212","1","","","2010-10-30 10:16:32","7","2724","<p>I have Downloaded an example ""MJAndorid"" from the O'reilly.But after importing the project into workspace, m getting the below error log:</p><pre><code>Failed to load properties file for project 'MJAndroid'</code></pre><p>I am not able to apply the build target, Google API version 3 , in this case.Also, by clicking on Android in the properties window of the project, I'm geting ""The currently displayed page contains invalid values"".</p><p>Can someone please suggest anything?</p><p>Thanks!</p>","492066","","834063","","2011-09-14 02:43:51","2012-07-20 18:46:22","Error ""Failed to load properties file for project 'MJAndroid'"" in eclipse","<android>","1","0","1","",""
"4058229","1","4058674","","2010-10-30 10:22:40","2","909","<p>I'm trying to find some simple way of queueing tasks on a thread that is NOT the UI-thread.</p><p>I have a BroadcastReceiver that responds to Intents each time an image is taken, and notifies my Service each time that happens. The Service will have to do some processing (scaling and rotating an image) and I would like to do this on a new thread (The service is running on the same thread as my main Activity). So I've been looking at AsyncTask for that. </p><p>My problem is that if the next image is taken BEFORE the previous has been fully processed, I will have two AsyncTasks running simultaneously, and I don't want that. I would like to queue the processing of the next one until the first one is done. </p><p>So basically I want two threads. One is the standard UI-thread, and another one that is my worker thread where i can have a queue of task to perform.</p><p>What would be the best approach?</p>","492067","","","","","2010-10-30 12:22:47","How to queue tasks on a worker thread in Android?","<android><multithreading><queue>","1","0","1","",""
"4058269","1","4060033","","2010-10-30 10:32:49","0","439","<p>I would like to do something like this. </p><p>If the user presses ""Pictures"" than i can choose either to pick a picture from ""Picture folder"" or take a new picture, </p><p>How can I do this and how can I use the cam? I have problems useing the cam, Does the cam work in the simulator?</p>","371301","","","","","2010-10-30 18:13:21","Android, How to use the camera","<android><camera><android-emulator>","2","0","","",""
"4058281","1","","","2010-10-30 10:34:38","1","1065","<p>I am using video view for playing video in android but volume of the video is very low, can I enhance the volume in the code?  </p><p>Thanks,Rv</p>","492072","","222159","","2010-10-30 10:37:15","2010-10-30 12:27:58","Can we enhance the volume in video view of android?","<android>","1","1","","",""
"4058360","1","4059560","","2010-10-30 10:56:04","12","17925","<p>I have a screen where the user has many items to input so screen space is at a premium.   </p><p>I want the look of the widget on the screen (before the user presses it) to be similar to an EditText or the left portion of the Spinner widget (without the normal down triangle) on the right side of the Spinner.  Then when the user presses the widget, he/she will get the normal Spinner selection dialog.   </p><p>Is there some Spinner style attribute I can change to accomplish this?</p><p>I have not been able to see code like this.</p><p>Thanks</p>","473347","","542701","","2011-05-08 15:04:07","2013-08-22 06:46:48","How to create android spinner without down triangle on the right side of the widget","<android><android-layout><spinner><nine-patch>","5","0","3","",""
"4058500","1","4058769","","2010-10-30 11:36:24","0","281","<p>I have an activity that starts a service like that:</p><pre><code>    Intent youtubeIntent = new Intent(this, YoutubeFeedService.class);    service = startService(youtubeIntent);</code></pre><p>and to detect when the service stops I use a broadcast receiver:</p><pre><code>@Overridepublic void onResume() {    IntentFilter filter;     filter = new IntentFilter(YoutubeFeedService.NEW_VIDEO_CELL);     receiver = new FeaturedReceiver();     registerReceiver(receiver, filter);    super.onResume();}@Override public void onPause() {    unregisterReceiver(receiver);     super.onPause();}public class FeaturedReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        String title = intent.getStringExtra(""title"");        if (title.equals(""-1"") || title.equals(""1"")){            //stopService(new Intent(FeaturedActivity.this, service.getClass()));            try {                Class serviceClass = Class.forName(service.getClassName());                stopService(new Intent(FeaturedActivity.this, serviceClass));            }             catch (ClassNotFoundException e) {}        }    }}</code></pre><p>I first tried to kill the service with</p><pre><code>stopService(new Intent(FeaturedActivity.this, service.getClass()));</code></pre><p>but this didn't work, so instead I used </p><pre><code>try {                Class serviceClass = Class.forName(service.getClassName());                stopService(new Intent(FeaturedActivity.this, serviceClass));            }             catch (ClassNotFoundException e) {}</code></pre><p>And it did work! Can anyone explain what's the difference? </p><p>Thanks</p>","171911","","","","","2010-10-30 12:51:04","Android: Weird issue in stopping a service","<android><service><broadcastreceiver>","1","0","","",""
"4058618","1","4062376","","2010-10-30 12:09:13","1","1997","<p>I would like to have a layout with 5 times 5 buttons. Each of them should have the same width and height (they should be square). And I want the whole matrix to use the screen width (or height, depending on rotation).</p><p>I currently do it ""by hand"" in the Java code:</p><pre><code>for (int y=0; y&lt;5; y++) {    TableRow tr = new TableRow(this);    for (int x=0; x&lt;5; x++) {        Button b = new Button (this);        ...        tr.addView(b, 60, 60);    }    layout.addView(tr);}</code></pre><p>This can be improved by obtaining screen width first and then dividing by 5 to get rid of this literal 60. But I'm wondering how I can do this in the res/layout XML file?</p><p>How can I specify for the height to be the same as the width? (I can set the width to match_parent.)</p><p>Thank you.</p>","472640","","9990","","2010-10-30 12:14:11","2010-11-21 20:24:51","How do I achieve square layout and buttons in main.xml?","<android><android-widget><android-layout>","4","1","1","",""
"4058630","1","4060692","","2010-10-30 12:13:21","1","606","<p>I am new to android i wish to create a button like a Equalizer Button. At the time of track the button i need to do some work.Can any one help me</p>","482568","","","","","2010-10-31 14:30:48","how to create Equalizer Button in Android?","<android>","1","1","","",""
"4058659","1","4059080","","2010-10-30 12:19:22","1","4417","<p>in my application i prompt for password in onResume(), and Before this i have already created view in onCreate()so it is compulsory for user to enter password But if user press the Back key password dialog get disappered and user easily use the application </p><p>when dialog is Being shown,if get key event for Back key then i can easily handle thisfor that purpose i implemented onBackPressed()/onKeyDown() methods of Activity But none get event for this key when dialog is on screen after dialog disappered these methods get event for Back keycan anyone tell me how can i handle this case</p><p>thanks in advance</p>","480420","","","","","2013-04-15 09:41:58","Handling Back key while showing a dialog in android","<android>","3","0","1","",""
"4058684","1","","","2010-10-30 12:25:29","0","901","<p>What's the easiest way to populate a SQLLite table with data off a URL?</p><p>I'm writing a Delphi web app that will generate a file on a server for my Android app to download.</p><p>In Delphi, I'll probably save it as a .csv file and use bulk import to import into MS SQL Server.</p><p>What's the easiest / best practice way to do this in Android? How would I download the file from the URL and then load it into SQLLite?</p><p>Many thanks for any pointers.</p>","181098","","236247","","2011-06-28 15:03:21","2011-06-28 15:03:21","Android: Loading data from a URL to SQLite","<android><sqlite>","1","2","","",""
"4058845","1","","","2010-10-30 13:15:24","0","330","<p>My app doesn't connect through HTC EV0-4G. How app can access network through CDMA 4G.</p>","405747","","","","","2010-10-30 21:05:30","CDMA 4G network connectivity","<android>","1","1","","",""
"4058865","1","4058899","","2010-10-30 13:21:54","4","4908","<p>Is there some possible way of picking images from picture folder? </p>","371301","","2571762","","2013-07-11 08:59:31","2013-07-11 08:59:31","Android, Pick Image","<android><android-image>","1","0","1","",""
"4058904","1","4059607","","2010-10-30 13:33:20","0","783","<p>I am writing a custom preference with a seek bar, so far it works, except for one problem the ID of my seek bar is defined in XML, so when I try to use 2 of my custom prefernces and then I update the Seek Bar I cannot distinguish between the two.</p><pre><code>SeekBar bar = (SeekBar)view.findViewById(R.id.PreferenceSeekBar);</code></pre><p>Is there a way to generate a custom Resource ID at runtime?Or perhaps another way to solve this? </p><p>Thanks,Jason</p>","407133","","","","","2012-04-24 21:35:17","Generte resource ID at runtime?","<android>","2","2","","",""
"4058954","1","4059456","","2010-10-30 13:45:32","1","1830","<p>Probably a simple question but I've developed an app that has always been using a build target of 1.5 without issue.  However, now I'm adding TextToSpeech which was introduced in 1.6.  I've created a TextToSpeech wrapper that encapsulates the TextToSpeech code and I have checks in the activity so that when it does run, it should only work for 1.6 devices and above.  But the trick is to get the code to run in Eclipse with a build target of 1.5.  When I try to do that, of course, I get the following errors tied to my TextToSpeech wrapper class:</p><p>""TextToSpeech cannot be resolved.""</p><p>I've played around with exporting as jar, creating a library project, etc. but I cannot seem to get those to work. For a library project, it says that dependent projects must have the same or higher API level so it won't work.  Some relevant code excerpts:</p><p>AndroidManifest.xml</p><pre><code> &lt;uses-sdk   android:minSdkVersion=""3""  android:targetSdkVersion=""8""  /&gt;</code></pre><p>activity class</p><pre><code>static {      try {        TextToSpeechWrapper.checkAvailable();        androidTextToSpeechAvailable = true;      } catch (Throwable t) {        androidTextToSpeechAvailable = false;      }    }</code></pre><p>wrapper class</p><pre><code>import java.util.HashMap;import java.util.Locale;import android.content.Context;import android.speech.tts.TextToSpeech;/* * A wrapper class for the newer Android text-to-speech library that is only found in * Android OS 1.6 and above (Donut and above).  This is useful so that the app can * be loaded on pre-Donut devices without breaking the app. */public class TextToSpeechWrapper {  private TextToSpeech mTextToSpeech;  // class initialization fails when this throws an exception  static {    try {      Class.forName(""android.speech.tts.TextToSpeech"");    } catch (Exception e) {      throw new RuntimeException(e);    }  }  // Some static vars from the text-to-speech class  public static int SUCCESS = TextToSpeech.SUCCESS;  public static int QUEUE_FLUSH = TextToSpeech.QUEUE_FLUSH;  &lt;--- Eclipse errors point here cause it does not exist in 1.5.</code></pre><p>So my question is how do I make the project use a build target of 1.5 again w/ the emulator so I can test and feel confident my app still works for 1.5 and above?</p>","492174","","492174","","2010-10-30 13:51:00","2010-10-30 15:58:27","Using Eclipse, how can I build & compile an Android project targeted for 1.5 that uses 1.6+ features?","<android><eclipse>","3","0","","",""
"4058980","1","4059010","","2010-10-30 13:54:17","20","31389","<p>I have a two column TableLayout as the only child of a scroll view. The first column contains TextViews ('labels') and the second column contains EditText/Spinner/DateWidget etc ('values'). Even though I have have specified android:layout_width=""fill_parent"" for TableLayout, TableRow &amp; all widgets (in 'values' column).</p><p>The screen looks perfect when the activity is created. However, when one types a really long value in the EditText, the 'values' column goes beyond the visible screen area.</p><p>How do I tackle this?</p><p>Thanks</p>","356580","","","","","2013-11-13 16:17:38","Android TableLayout Width","<android><layout><width><tablelayout>","6","0","10","",""
"4059013","1","","","2010-10-30 14:02:53","2","1611","<p>I want to design some mockup interfaces for some Android apps. I would like them to be able to nicely scale up and down depending on the resolution of the mobile device being used.</p><p>What would be the best image size to design these mockup interface in? </p><p>Thanks.</p>","484893","","","user142019","2010-10-30 14:42:30","2012-10-23 05:29:03","Size of Android UI mockups?","<android>","3","0","","",""
"4059016","1","4059040","","2010-10-30 14:03:24","0","2133","<p>I'm running a .net aspx application. I'll need my android app to access and modify/insert information into the ms sql database. is there any api ? thank you</p>","492182","","","","","2010-10-30 14:10:40","how to allow android to access/modify a remote database","<android><sql-server><database>","2","2","","",""
"4059059","1","4059130","","2010-10-30 14:15:20","0","1740","<p>I'm writing a task manager app that downloads a list of tasks and subtasks from a server and creates a new checkbox for each item and adds it to a linear layout (called ll below). The problem I'm having is that I cannot set the ""layout margin left"" using java like I can with XML (this is for the subtasks to indent them a bit on the screen). I can set most other xml properties, but cb.setMargins() doesn't work (says undefined for type checkbox). Setting the padding of course does not achieve the desired result.</p><pre><code>for(int i=0;i&lt;tasks.size();i++) {CheckBox cb = new CheckBox(this);cb.setText(tasks.get(i).subtask_desc);cb.setButtonDrawable(R.drawable.checkbox_xml);ll.addView(cb);    }</code></pre><p>Any ideas or how I would work through this?</p>","492180","","2571762","","2013-07-11 08:58:15","2013-07-11 08:58:15","Set a layoutmargin on a dynamically created checkbox","<android><android-layout><android-checkbox>","2","0","","",""
"4059131","1","4110522","","2010-10-30 14:31:56","0","782","<p>I'm currently working on a Synergy (http://sourceforge.net/projects/synergyandroid/, synergy-foss.org) port to the android phone. I have keystrokes working -- I'm writing the key events to /dev/uinput. However I have been unsuccessful in getting the mouse cursor to show up. I've tried writing a mouse move by writing an EV_REL input_event to /dev/uinput but I presume there's something else I must activate to display the cursor. I've seen videos of a Cyanogen modded phone &amp; a bluetooth mouse with cursor... so I presume it's possible. Does anyone have any information on this? </p>","232416","","","","","2011-11-21 15:35:28","Cyanogen cursor access","<android><mouse><cyanogenmod>","1","2","","",""
"4059298","1","4059470","","2010-10-30 15:15:46","0","95","<p>Why interface of program is fit in eclipse emulator but not fit in my N1 and Liquid? How to solve it?</p>","477821","","","","","2010-10-30 16:00:40","Why the interface of my program is fit in eclipse emulator but not fit in my N1?","<android>","1","2","","",""
"4059362","1","4059797","","2010-10-30 15:32:25","3","526","<p>Which Mobile Application platform do developers prefer for Bluetooth Based application development ? </p><p>What do developers think on the current available API's on these platforms ? Does it meet most of your needs ?What kinds of APIs / capabilities for applications would you like to see.</p>","379445","","","","","2010-11-04 16:29:32","Best platform for Bluetooth Applications","<iphone><android><ios><bluetooth><mobile-phones>","1","0","2","",""
"4059400","1","","","2010-10-30 15:44:07","0","720","<p>I have a square which I'm rendering using four vertices and GL_LINE_LOOP. It works fine.However, if I start to rotate this square on all axes and part of the square leaves the emulator screen, the loop appears to drop the vertex that has left the screen. I then get a triangle for a while until the fourth vertex returns to the screen and the loop draws the square again.I'm extremely new to OpenGL. Is this expected behaviour, a bug in the Android emulator, or something I've missed?</p><p>Thanks in advance for any thoughts.</p>","472428","","44729","","2010-10-30 16:36:23","2010-10-30 16:36:23","GL_LINE_LOOP not drawing correctly","<android><opengl-es>","1","0","","",""
"4059402","1","4059971","","2010-10-30 15:45:00","1","415","<p>I am trying to write a program in android that does a lot of string and xml parsing.</p><p>I need suggestion of which way to go :</p><ol><li><p>Use JNI and implement parsing in C++ and use C++ xml SAX parsing (Android - NDk)</p></li><li><p>Go with java and parse xml with SAX</p></li></ol>","383677","","343816","","2010-10-30 16:05:29","2010-10-30 18:01:21","Best method for text parsing androidK","<java><android><xml><android-ndk>","2","0","","",""
"4059419","1","","","2010-10-30 15:52:00","2","923","<p>HI Every One. I am new to android Developmemt . Actually my project requires to show Timepicker but i doesnot want to show AM or PM option and also not in the header of the picker, There is any way to do this ?Please reply ASAP</p>","492246","","491044","","2011-03-11 12:55:39","2011-03-11 12:55:39","Time picker in android","<android>","1","0","","",""
"4059526","1","5353169","","2010-10-30 16:16:51","13","13216","<p>I am using a SurfaceView and a rendering thread to develop a game based on structure like LunarLander. </p><p>However, I faced many problems, and here I want to point them all out. I wish anyone who want to develop a game won't need to struggle with them anymore. And anyone who have a better idea of the structure can share their experiences, because I am still new to android and is eager to learn :)</p><p>[1] The function <code>thread.start()</code> should not be called more than once.</p><p>Many articles mentioned to create a thread when surface is created, in order to render again after activity paused using the method :</p><pre><code>public void surfaceCreated(SurfaceHolder holder) {    // start the thread here so that we don't busy-wait in run()    // waiting for the surface to be created    if (thread.getState() == Thread.State.TERMINATED)    {        thread = new LunarThread(getHolder(), getContext(), getHandler());    }    thread.setRunning(true);    thread.start();}</code></pre><p>You can see that if the thread isn't terminated and the function is called, the activity crashes.</p><p>[2] If you pressed the ""power"" or the ""red phone"" button, or the phone is idle for a few minutes, the activity would be <code>onPause()</code> state, but the thread is still running. That is a really bad practice, so I need to find out a method to let the thread stop, and start again when <code>onResume()</code>.</p><p>[3] If the screen lock is portrait / landscape, and your game is sticked to the other orientation, the screen lock forced you to ""orient"" once. That means to start the activity once more. I still can not find a solution to it. (as I mentioned in <a href=""http://stackoverflow.com/questions/4050177/android-screen-orientation-bug"">http://stackoverflow.com/questions/4050177/android-screen-orientation-bug</a>)</p><p>Here are my code to fix those problems:</p><p>UIThread</p><pre><code>public class UIThread extends Activity{    private gameView gameview;    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        gameview = (gameView) findViewById(R.id.gameview);    }    protected void onPause()    {        super.onPause();        Log.v(""MY_ACTIVITY"", ""onPause"");        gameview.terminateThread();        System.gc();    }    protected void onResume()    {        super.onResume();        Log.v(""MY_ACTIVITY"", ""onResume"");        if (gameview.surfaceCreated == true)        {            gameview.createThread(gameview.getHolder());        }    }}</code></pre><p>GameView</p><pre><code>public class gameView extends SurfaceView implements SurfaceHolder.Callback{    boolean surfaceCreated;    class gameThread extends Thread{}    public gameView(Context context, AttributeSet attrs)    {        super(context, attrs);context.getResources();            Log.v(""MY_ACTIVITY"", ""gameView"");        surfaceCreated = false;    }    public void createThread (SurfaceHolder holder)    {            thread = new gameThread(holder);        thread.run = true;        thread.start();    }    public void terminateThread ()    {        thread.run = false;        try        {            thread.join();        }        catch (InterruptedException e)        {            Log.e(""FUNCTION"", ""terminateThread corrupts"");        }           }    public void surfaceCreated(SurfaceHolder holder)    {        Log.v(""MY_ACTIVITY"", ""surfaceCreated"");        if (surfaceCreated == false)        {            createThread(holder);            surfaceCreated = true;        }    }    public void surfaceDestroyed(SurfaceHolder holder)     {        Log.v(""MY_ACTIVITY"", ""surfaceDestroyed"");        surfaceCreated = false;    }}</code></pre><p>Manifest</p><pre><code>&lt;activity android:name="".UIThread""          android:screenOrientation=""landscape""          android:configChanges=""orientation""&gt;</code></pre><p>I use <code>onResume()</code> instead of <code>surfaceCreated()</code> to new thread. And I set a boolean <code>surfaceCreated</code> to know that <code>onResume()</code> comes from the first time application is created, or comes from the ""screen off"" situation.</p><p>So the thread die every time <code>onPause()</code> is called. Seems to be a good practice. Another way to let the thread stop then resume again is to synchronize an object and call wait / notify. But I don't know it is better or not.</p><p>Is there any better way to control the rendering thread?</p>","408278","","","","","2013-06-13 19:03:32","Programming with SurfaceView and thread strategy for game development","<android><multithreading><activity><surfaceview>","4","1","10","",""
"4059571","1","4061110","","2010-10-30 16:25:51","3","946","<p>For C2DM to work, a device clearly must be at API level 8. However, does this really require that the application be compiled at that level? None of the code to work with C2DM requires any APIs at level 8. So would it be possible to have an app at a lower level, maybe API level 4 or 6, and have it try to do the C2DM registration? Maybe the registration fails on devices that are at a lower API level, and hopefully this can be detected so that an alternate mechanism could be used. However, shouldn't registration succeed for a device at API level 8 or higher? What I'm trying to do here is take advantage of C2DM while still compiling at level 4, so that my app can reach the most number of users. Ideally this is possible, and I can detect when the device is not capable of C2DM, and react accordingly.</p>","108381","","","","","2012-03-09 23:20:04","C2DM with lower API level?","<android><android-c2dm>","2","1","2","",""
"4059715","1","","","2010-10-30 17:01:49","2","432","<p>I am developing an application that use the GPS and the geolocalion. So, during the application launch, I have to be sure that the user has activated the network and GPS. If he didn't tested 2 solutions : </p><ul><li><p>Ask the user to activate them himself (so the application quit, and the user has to reload it)</p></li><li><p>Redirect the user in the corresponding view in order to activate them ( via something like ""                      android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS "" )</p></li></ul><p>The second solution is better to my mind but can be very boring for the user if he has to activate the Network + the GPS + Nework localisation ...</p><p>That's why I ask if it is not possible to activate all that automatically if it is not possible ? I think it is possible because it exists widget that let the user activate network, gps etc... but how can we do that in the application ???</p><p>thanks for reading ;)</p>","464610","","247221","","2010-10-30 21:20:18","2010-10-30 21:20:18","How to activate the network in an Android application without leaving the application","<android><networking><geolocation><gps><smartphone>","1","2","","",""
"4059731","1","","","2010-10-30 17:06:27","0","1435","<pre><code>    private static final String DB_NAME = ""MyDebts.db""; private static final String CREATE_DB_QUERY =   ""CREATE TABLE "" + Dao.CONTACTS_TABLE_NAME + "" (ContactId varchar(64), Credit integer);\n"" +  ""CREATE TABLE "" + Dao.SETTINGS_TABLE_NAME + "" (Name varchar(64), Value varchar(64));""  ;    @Override     public void onCreate(SQLiteDatabase db) {      db.execSQL(CREATE_DB_QUERY);     }</code></pre><p>As i see in debug mode db.execSql proceeds w/o any exceptions, but then in this code:</p><pre><code>String lastStepIndexString = null;  try {   lastStepIndexString = SettingsDao.readSetting(""last-step-index"");  } catch (Exception ex) {   makeToast(ex.getMessage());  }</code></pre><p>catch()... is triggered by exception with message like 'There is no table with name ""Preferences""'anyone can tell me the problem? My head is bursts=)thanks in advance!</p>","344053","","71724","","2010-10-30 17:22:00","2010-10-30 20:32:39","No such table exception in android","<android><database><sqlite><table>","2","0","","",""
"4059739","1","4060001","","2010-10-30 17:08:35","1","412","<p>I have a working android app using TextView, some formatting (line breaks, rows of dashes) and Linkify to generate a primitive ""ListView-like"" display with clickable URLs in each ""row"".  I'd like to move up to a real ListView, but I'm just not finding the sample/explanation that I need to take that next step.</p><p>I have successfully reproduced the <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">HelloListView sample</a>, starting with the hardcoded string array, and moving to a string array defined in my <code>res/values/strings.xml</code>.  I've taken one small step toward my goal by adding my HttpClient code to retrieve a set of data from a service, parse the results into a String Array and feed that into setListAdapter() such that my text and links show up as text-only in ListView items.</p><p>I want to move to the next step which is to make each ""row"" in my ListView launch the browser to the URL contained in the data, either by (A) clicking anywhere in the row, or (B) clicking a hyperlink displayed within the row data</p><p>For option (A), it appears that I need to have my onItemClick() method issue an intent that launches the browser.  That's straightforward, but I don't get how to associate the URL with the item (currently its just one part of the string content for each ""row"" of text).  How do I separate my URL from the rest of the text, such that I can launch a browser to the corresponding URL?  Do I need to replace my String Array with an array of custom objects?</p><p>For option (B), can I use Linkify?  It seems that my string array elements get converted to individual TextViews (inferring from the way the Toast text is generated in the HelloListView sample).  Do I have access to that TextView to run Linkify against?  Do I need to replace my String Array with a TextView Array and run Linkify myself?  Am I completely off base?</p><p>Thanks to anyone who can help explain back to me what I'm trying to do, in a way that helps to find my way around the SDK, samples and other helps!</p>","492281","","","","","2010-10-30 18:07:09","Conceptual help with Android ListView","<android><listview>","1","2","","",""
"4059763","1","4062052","","2010-10-30 17:14:23","1","2466","<p>I can't manage to get my textSwitcher to be able to support superscript text.  No matter what I try it shows up as regular size text.</p><p>Here is what I've tried:</p><pre><code>        Spanned span = Html.fromHtml(""&lt;sup&gt;TM&lt;/sup&gt;"");        String subscript = span.toString();        mSwitcher.setText(getText(R.string.desc_about1) + subscript);</code></pre><p>Then I tried setting it in the XML string file:</p><pre><code>&lt;string name=""desc_about1""&gt;Android&lt;sup&gt;&lt;small&gt;TM&lt;/small&gt;&lt;/sup&gt;&lt;/string&gt;</code></pre><p>Neither one of these will work.  Is there another way?</p><p>My textSwitcher code for reference:</p><pre><code>    &lt;TextSwitcher android:id=""@+id/switcher""        android:layout_width=""match_parent""        android:layout_height=""wrap_content"" /&gt;@Overridepublic View makeView() {    TextView t = new TextView(this);    t.setGravity(Gravity.TOP | Gravity.LEFT);    t.setTextSize(18);    return t;}</code></pre><p>Thanks all!</p>","432209","","432209","","2010-10-30 19:17:06","2013-01-23 09:22:16","Using superscript in an Android textSwitcher","<java><android><xml><eclipse><superscript>","2","0","1","",""
"4059768","1","8964562","","2010-10-30 17:15:46","1","5157","<p>I'm attemping to add a new LinearLayout defined by xml on top of my opengl view.</p><p>I have this working by using pure java:</p><pre><code>public class VortexView extends GLSurfaceView { public boolean onTouchEvent(final MotionEvent event) {        show_something(); }void show_something(){  //context is the main activity object that gets passed into this  LinearLayout ll = new LinearLayout(context);  b = new Button(context);  b.setText(""hello world 1"");  ll.addView(b);  ll.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);  context.addContentView(ll, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));}}</code></pre><p>However I want to be able to do this:</p><pre><code>LinearLayout ll = (LinearLayout)findViewById(R.layout.main);context.addContentView(ll, new LayoutParams(LayoutParams.FILL_PARENT,  LayoutParams.FILL_PARENT));</code></pre><p>My xml 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:layout_width=""fill_parent""           android:layout_height=""fill_parent""           android:orientation=""vertical"" &gt;&lt;Button    android:id=""@+id/button1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:padding=""10dp""    android:text=""kill""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Everytime I do this though the app crashes. Any ideas?</p>","492274","","7724","","2010-10-30 17:17:53","2013-01-31 18:58:04","addContentView to GLSurfaceView problem","<android>","2","0","1","",""
"4059857","1","4059927","","2010-10-30 17:37:48","0","5453","<p>How to set tablelayout row background color programatically.</p>","341443","","918414","","2013-02-13 19:11:00","2013-02-13 19:11:00","how to set tablelayout row background color programmatically","<android>","1","0","","",""
"4059954","1","4059970","","2010-10-30 17:56:48","0","331","<p>Hi I have just finished debugging my first application and want to publish it.  I would like to know if you have a checklist that you use prior to distribution.</p><p>For instance I have lots of Log.d() commands, must I remove them?  I have rotated my screens as much as possible to cause stop/restart failures.  These are the types of test I  am looking for.</p><p>Being my first app I am sure there are items of concern I am missing and will greatly appreciate your help and insight.</p><p>If it makes a difference I am using Motodev in eclipse.</p><p>TIA</p>","465199","","","","","2010-10-30 18:00:23","Android application checklist prior to distribution ","<android><distribution>","1","0","","",""
"4060031","1","4060257","","2010-10-30 18:13:17","1","3961","<p>I've got a dialog which shows a list of checkBoxes. I'd like to set different boxes checked each time the dialog is showed. But that only works the first time.. I want it work every time the dialog is showed!  It would be great if anyone can help...</p><p>This is my code:</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {            case CHECKBOX_LIST_DIALOG:                final CharSequence[] weeks = new CharSequence[53];                for (int i=0; i&lt;=52; i++) {                    weeks[i] = String.valueOf(i+1);                }                return new AlertDialog.Builder(this).setTitle(                        R.string.txt_week_checkbox_list).setMultiChoiceItems(                        weeks, getCheckedBoxes(),                        new DialogInterface.OnMultiChoiceClickListener() {                            public void onClick(DialogInterface dialog, int whichButton, boolean isChecked) {                                checked[whichButton] = isChecked;                            }                        }).setPositiveButton(""OK"",                        new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int whichButton) {                                EditText editText = (EditText) findViewById(R.id.edittext_weeks);                                editText.setText(generateString());                            }                        }).setNegativeButton(""Cancel"",                        new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog,                                    int whichButton) {                            }                        }).create();}</code></pre>","474326","","","","","2010-10-30 19:42:47","Set checked boxes for a checkBox-list dialog","<android><dialog><checkbox><checkboxlist>","2","0","1","",""
"4060068","1","4060332","","2010-10-30 18:22:00","0","6008","<p>I am hoping you can help me:</p><p>I need to update my ui for an android app and I'm trying to use the Handler class to do it, using <a href=""http://developer.android.com/resources/articles/timed-ui-updates.html"" rel=""nofollow"">http://developer.android.com/resources/articles/timed-ui-updates.html</a> and the android developer resources ""Common Task"" for using Handlers as guides. </p><p>Basically, I need something between the two - a timed update of the user interface, but without a button. So here is the relevent code that I am working on. All help is greatly appreciated.</p><pre><code>public class Activity1 extends Activity {</code></pre><p>[… variables]</p><p>final Handler mHandler = new Handler();</p><pre><code>final Runnable mUpdateResults = new Runnable() {    public void run() {        UpdateDisplay();        mHandler.postDelayed(mUpdateResults, 200);    }};/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);</code></pre><p>[…]</p><p>startLongRunningOperation();</p><pre><code>}protected void startLongRunningOperation() {    Thread t = new Thread() {        public void run() {             if (mStartTime == 0L) {                 mStartTime = System.currentTimeMillis();                 mHandler.postDelayed(mUpdateResults, 200);}            mHandler.post(mUpdateResults);        }    };    t.start();}</code></pre><p>Thanks again!</p>","492313","","","","","2011-10-23 20:02:44","help with Handler class to update UI - Android","<android><gui><user-interface><handler>","1","1","","",""
"4060314","1","4060360","","2010-10-30 19:28:35","1","1112","<p>So say there's an app running (any app). I'd like to be able to get it's <code>Activity</code> from within a <code>Service</code> that will be triggered to run from a <code>android.intent.action.SEARCH_LONG_PRESS</code>.</p><p>Is this possible?</p>","149166","","","","","2010-10-30 19:41:18","Get current Activity reference from within Service","<android><service><activity>","1","0","","",""
"4060400","1","4061400","","2010-10-30 19:52:11","0","478","<p>First off I am a beginner in Android development; I have been doing a lot of research into how to get the various tasks I am trying to complete. I have yet to find any similar issue to this, which is why I am asking it.</p><p>This is a multipart question.</p><p>Overview of program and problems: I have a program (for Android 2.1 and higher) that has multiple fullscreen Activities. I am required to have a different animation for transitioning to each one. So I reconfigured a couple files and made a ViewFlipper to do the transitions. Unfortunately some of these activities use a title. At the same time the transitions that I have tried applying based on the tutorials I have found online are not working as expected. The transition begins, the second screen is shown (faded) and the background is black, as the second screen nears completion of the transition the first screen reappears before disappearing again.</p><p>Question 1: Is there a way to display some layouts with a title and some without? If not then is there a way to change the transition used when startActivity is used?</p><p>Question 2: Is there some method of doing a fade transition without it flashing the original screen? I looked up the ""flicker"" issue but the solutions are not working for my project.</p><p>Question 3: In a similar manner to the 2nd question, the first layout shown is a loading screen, then the main screen. This happens just fine but for some reason the loading screen is shown, then slides off (as if startActivity is called) and then it fades into existence again (this time with a title which isn't supposed to be there), then switches to the main screen correctly. What might be happening here?</p><p>If you have any questions, feel free to ask.</p>","492347","","492347","","2010-10-30 20:15:13","2010-10-31 01:05:47","Hidding the title bar on specific layouts that use ViewFlipper, and transitions not working properly","<android><layout><title><transition><viewflipper>","1","1","","",""
"4060760","1","4061210","","2010-10-30 21:29:15","1","5195","<p>Is there any way to receive the installation date of an Android app? Or any other suggestions on how to accomplish a 30 day free trial version?</p>","492415","","29995","","2012-05-08 12:52:00","2013-07-01 22:15:12","How to create a 30 day free trial Android app?","<android><trialware>","2","1","2","2013-07-02 06:16:05",""
"4060770","1","4060923","","2010-10-30 21:32:04","3","586","<p>So right now I'm using the zxing barcode scanner in my app. Here is example code(generic):</p><pre><code>if(position == 0){            Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");            intent.putExtra(""SCAN_MODE"", ""QR_CODE_MODE"");            startActivityForResult(intent, 0);        }public void onActivityResult(int requestCode, int resultCode, Intent intent) {        if (requestCode == 0) {            if (resultCode == RESULT_OK) {                contents = intent.getStringExtra(""SCAN_RESULT"");                format = intent.getStringExtra(""SCAN_RESULT_FORMAT"");                // Handle successful scan                Intent i = new Intent(Main.this, BarcodeScanner.class);                startActivity(i);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }    }</code></pre><p>So when launching the <code>BarcodeScanner.class</code>, I also want to pass <code>contents</code> into it. How would I go about doing that?</p>","325400","","","","","2010-10-30 22:19:56","How to I launch an activity with an Intent and pass a variable in the new activity?","<android><barcode-scanner><zxing>","2","0","2","",""
"4060919","1","4062348","","2010-10-30 22:17:15","2","2625","<p>I am working on an alarm app.  I followed the Android AlarmController tutorial word for word with only some minor changes.  For some reason my Broadcast Receiver's onReceive() method is not being called when the alarm goes off.  Here's the code:</p><pre><code>// the callback received when the user ""sets"" the time in the dialogprivate TimePickerDialog.OnTimeSetListener mTimeSetListener =    new TimePickerDialog.OnTimeSetListener() {        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {         time.set( Calendar.HOUR_OF_DAY, hourOfDay );         time.set( Calendar.MINUTE, minute );// Tell user alarm was setString timeSetTo = ""Alarm Set: "" + time.get( Calendar.HOUR_OF_DAY ) + "":"" + time.get( Calendar.MINUTE ) + "" "" + time.get( Calendar.AM_PM );if( toast != null )  toast.cancel();toast = Toast.makeText( AlarmUI.this, ""L"" + timeSetTo, Toast.LENGTH_LONG );toast.show();// When the alarm goes off we want to send an Intent to our Broadcast Receiver (AlarmAction), // so set an Intent between the AlarmUI and the AlarmActionIntent intent = new Intent( AlarmUI.this, AlarmAction.class );// Create an IntentSender to have the intent executed as a broadcast later when alarm goes off.PendingIntent sender = PendingIntent.getBroadcast( AlarmUI.this, 0, intent, 0 );/** Schedule the alarm */// To get any service we use getSystemService( Service Name )AlarmManager alarmManager = ( AlarmManager ) getSystemService( ALARM_SERVICE );/* Finally, we set the alarm to the desired time! WOOHOO! */alarmManager.set( AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), sender );        }    };</code></pre><p>Any ideas?  Thank you in advance.</p>","491741","","","","","2010-10-31 08:22:22","Basic Android alarm app, Broadcast Receiver's onReceive() method not being called","<java><android>","1","0","","",""
"4060954","1","","","2010-10-30 22:28:43","0","1281","<p>Tried to export working android project from eclipse. The screen is frozen at page ""Export Android Application"". ""Next"" button is grayed out. Same project runs fine on emulator and HTC as well. Please help. </p>","492439","","","","","2010-10-30 23:38:04","unable to export .apk from eclipse","<android><android-widget><android-manifest>","1","1","","",""
"4061047","1","4062424","","2010-10-30 22:58:03","4","1140","<p>When I install my application onto a device or emulator it appears multiple times in the apps menu, in my case I get 4 icons showing my application name.</p><p>It seems that each icon is representing an activity, and since my application contains 3 tabs(with activities) the first 3 icons on my menu go to a particular activity, and the 4th icon takes me to the app itself</p><p>This 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.jameselsey""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;      &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;        &lt;uses-permission android:name=""android.permission.GET_ACCOUNTS"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_CONTACTS"" /&gt;    &lt;application    android:icon=""@drawable/icon""                     android:label=""@string/app_name""                     android:name=""com.jameselsey.domain.GlobalState""                    android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;activity android:name="".DefaultActivity""                  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="".MyContactsActivity""                  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="".MyMapsActivity""                  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="".OptionsActivity""                  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;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;/application&gt;    &lt;/manifest&gt; </code></pre><p>What can I do to only have one icon for my app on my device and not 4?</p><p>Thanks</p>","155695","","302328","","2010-10-31 08:48:33","2010-10-31 08:48:33","Why does my application appear 4 times on my device?","<android><launcher><android-2.1-eclair>","3","0","","",""
"4061058","1","4061103","","2010-10-30 23:03:25","0","1628","<p>I am trying to comsume a self-hosted WCF service which simply returns a String in JSON format. It takes a very long time around 2-3 minutes to get the response on Android Device, where as on any other computer it works fine. Could anyone help me on this? Thanks in Advance.</p><p>Below is my code to access the service.</p><pre><code> try{ HttpClient httpclient = new DefaultHttpClient(); HttpGet request = new HttpGet(""http://192.168.1.83:8000/GetOffers""); ResponseHandler&lt;String&gt; handler = new BasicResponseHandler(); //you result will be String : result = httpclient.execute(request, handler);   } catch (ClientProtocolException e) {   // TODO Auto-generated catch block    e.printStackTrace();   } catch (IOException e) {    // TODO Auto-generated catch block     e.printStackTrace();   } catch (JSONException e) {    // TODO Auto-generated catch block   e.printStackTrace(); }</code></pre>","492458","","440502","","2010-10-30 23:22:48","2010-10-31 08:19:31","Consuming WCF Restful Service on Android","<android><wcf>","2","0","","",""
"4061118","1","4064163","","2010-10-30 23:28:44","6","2693","<p>I've been a couple of days trying to solve this thing but I can'f figure it out. The problem is, simple activity, with simple layout, ScrollView -> LinearLayout -> and a lot of buttons inside the layout (within the scroll content). Everything works just fine but one tricky thing. When I click a button let's say at the top of the scroll content and inmediatelly I scroll down to the bottom of the content and I click other button there, nothing happens until I click a second time and all come to normal again. This can be reproduced anytime and it's code independent (i've tried more than 20 scenarios). I've not much experience in android yet but looks like the scroll listener stops the onclick listener or something like that. Any help with this would be much apreciated. Thank you in advance.</p><p>PD. If i programatically do a scrollTo() instead of manual scroll with my fingers everything works just fine and click responds at first touch. It's simply overwhelming me.</p>","492472","","","","","2012-02-13 10:19:47","Problem in a ScrollView with Buttons inside, no response until second click on any button inside","<android><scrollview>","4","6","7","",""
"4061159","1","4105750","","2010-10-30 23:42:58","10","13537","<p>I am currently drawing a number of circles on a canvas in a custom view in code. the circles are static and do not change. I would like to draw them using a ShapeDrawable in xml to help clean up my code. I will have a number of different drawables which the user can select and therefore I don't want to do this in code. having 3 or 4 xml drawables seems a lot neater to me.</p><p>I have created one circle in xml using a ShapeDrawable but am unable to add more than one shape to the xml.</p><p>How do I add multiple shapes to an xml document using ShapeDrawable.</p>","128327","","","","","2013-07-23 10:10:55","Drawing multiple shapes with ShapeDrawable in xml with Android","<android><xml><drawable><shapes>","2","0","4","",""
"4061176","1","","","2010-10-30 23:45:34","2","2585","<p>I'm trying to pass data from notification to activity:</p><pre><code>btnShedule.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);            Intent notificationIntent = new Intent(Oconf.this, Oconf.class);            notificationIntent.putExtra(""test"", 122);            PendingIntent contentIntent = PendingIntent.getActivity(Oconf.this, 0, notificationIntent, 0);            Notification notification = new Notification(R.drawable.notify_deal, ""text"", System.currentTimeMillis());            notification.setLatestEventInfo(Oconf.this, getString(R.string.notify_events), ""text"", contentIntent);            notification.defaults |= Notification.DEFAULT_SOUND;            notification.flags |= Notification.FLAG_AUTO_CANCEL;            notificationManager.notify(0, notification);        }    });</code></pre><p>Then, onResume:</p><pre><code>public void onResume() {    String q = getIntent().getStringExtra(""test"");    if (q == null) {        Log.e(TAG, ""null!"");    }    else {        Log.e(TAG, q);    }    super.onResume();}</code></pre><p>I got ""null!"". Where is error?</p>","301249","","","","","2013-07-31 00:55:47","Notification: pass data","<android><notifications>","2","0","1","",""
"4061187","1","","","2010-10-30 23:49:21","0","1418","<p>I've got an app that accepts images from the image gallery (via share menu). My app starts, and I do this:</p><pre><code>    Bundle bundle = getIntent().getExtras();    Object obj = bundle.get(""android.intent.extra.STREAM"");</code></pre><p>While debugging, Eclipse is reporting the object obj is of type 'Uri@StringUri' (???) and inside it somewhere is the string 'content://media/external/images/media/992'. Anybody know what type of object obj is so I can typecast it? And what's the string about? IE, how do I get to the image data?</p>","492271","","","","","2011-09-12 22:17:02","Android: Image gallery share to app","<android><image><gallery><share>","1","0","","",""
"4061401","1","","","2010-10-31 01:05:52","0","457","<p>I am using an alertDialog to display data similar to a spinner.  Is there a way to move the active selection (like in setSingleChoice) using setItems ?</p><p>I want the displayed list to look like a spinner, without the radio buttons.</p>","411203","","","","","2011-10-26 19:28:55","AlertDialog setSingleChoice without radio buttons","<android><spinner><alertdialog>","1","0","","",""
"4061557","1","","","2010-10-31 02:17:19","1","1494","<p>I am new to android.I need to create ExpandableListView by using java code(without using xml design).This is my very first task.Can anyone help me?Thanks in Advance !!!</p>","492530","","71724","","2010-10-31 05:12:15","2011-05-14 14:49:48","How to create ExpandableListView in Android using java code?","<android><expandablelistview>","1","0","1","",""
"4061742","1","","","2010-10-31 03:36:25","0","966","<p>Using ACTION_SEND it's possible to post messages to various sharing services such as gmail, facebook, twitter, etc.  Most services have reasonably long message lengths, but twitter in particular is very short (140 characters).</p><p>Not knowing in advance which service a user is going to select once the Intent.createChooser() dialog appears, is there a way to construct an intent that will result in a short message for twitter but a longer message for other services?</p>","82156","","","","","2013-08-05 22:15:00","Posting short messages to twitter and long messages to gmail using ACTION_SEND","<android><facebook><twitter><gmail><android-intent>","1","1","","",""
"4061790","1","5748508","","2010-10-31 03:55:00","2","879","<p>I made an XML file under my newly created res/menu folder. Menu.xml contains my menu definition for use with MenuInflater. </p><p>The entire XML file looks like this:</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/settings""      android:title=""@string/settings_label""      android:alphabeticShortcut=""@string/settings_shortcut"" /&gt;&lt;/menu&gt;</code></pre><p>I'm trying to run the program and the console keeps returning two problems. </p><ol><li>Bad XML block: no root element node found</li><li>error: Error parsing XML: unbound prefix</li></ol><p>I can't seem to see what's wrong with my XML file. Any thoughts? Am I missing something basic here?</p><p>I know the android dev docs say that MenuInflater ""only works with an XmlPullParser returned from a compiled resource (R. something file.)"" Doesn't that just mean that I need to create an XML file under my res/ folder as I've done? Did I screw something up here? (I just created a new android xml file. put it under Res/menu and referenced it as ""R.menu"" when I called the inflate method. </p>","479180","","","","","2011-04-21 18:54:57","menu XML with MenuInflater","<java><android><eclipse><sdk>","1","2","1","",""
"4062049","1","","","2010-10-31 06:13:12","0","530","<p>I have seen this question answered but the answers do not apply to me. I am a beginner to Android and I am trying to run HelloWorld with the Eclipse Plug-in that I have downloaded Api's 7 (2.1) and 8 (2.2) and have created a virtual devices for each version. I am running eclipse in xp with  1.6.0_22-b04 (32bit) no 64 bit jre installed on the system. I get the following stack trace when the emulator is launched:</p><p>IllegalArgumentException: bad version: standalonecom.android.sdkstats.SdkStatsServer.normalizeVersion(SdkStatsService.java:467)com.android.sdkstats.SdkStatsServer.doPing(SdkStatsService.java:130)com.android.sdkstats.SdkStatsServer.ping(SdkStatsService.java:85)com.android.ddms.Main.main(Main.java:85)</p><p>Any help is greatly appreciated.thanks,francisco</p>","492597","","","","","2010-11-03 16:22:01","Android HelloWorld IllegalArgumentException","<android><android-emulator>","2","3","","",""
"4062088","1","4074712","","2010-10-31 06:30:28","1","590","<p>I am working on an Android app but I keep getting a Leak Found error.  Here's the Call Stack:</p><pre><code>11-01 11:26:47.087: ERROR/Database(7317): Leak found11-01 11:26:47.087: ERROR/Database(7317): java.lang.IllegalStateException: /data/data/com.noshufou.android.su/databases/permissions.sqlite SQLiteDatabase created and never closed11-01 11:26:47.087: ERROR/Database(7317):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1792)11-01 11:26:47.087: ERROR/Database(7317):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:798)11-01 11:26:47.087: ERROR/Database(7317):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:857)11-01 11:26:47.087: ERROR/Database(7317):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:850)11-01 11:26:47.087: ERROR/Database(7317):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:535)11-01 11:26:47.087: ERROR/Database(7317):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)11-01 11:26:47.087: ERROR/Database(7317):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)11-01 11:26:47.087: ERROR/Database(7317):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)11-01 11:26:47.087: ERROR/Database(7317):     at com.noshufou.android.su.DBHelper.&lt;init&gt;(DBHelper.java:28)11-01 11:26:47.087: ERROR/Database(7317):     at com.noshufou.android.su.UninstallReceiver.onReceive(UninstallReceiver.java:10)11-01 11:26:47.087: ERROR/Database(7317):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2637)11-01 11:26:47.087: ERROR/Database(7317):     at android.app.ActivityThread.access$3100(ActivityThread.java:119)11-01 11:26:47.087: ERROR/Database(7317):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)11-01 11:26:47.087: ERROR/Database(7317):     at android.os.Handler.dispatchMessage(Handler.java:99)11-01 11:26:47.087: ERROR/Database(7317):     at android.os.Looper.loop(Looper.java:123)11-01 11:26:47.087: ERROR/Database(7317):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-01 11:26:47.087: ERROR/Database(7317):     at java.lang.reflect.Method.invokeNative(Native Method)11-01 11:26:47.087: ERROR/Database(7317):     at java.lang.reflect.Method.invoke(Method.java:521)11-01 11:26:47.087: ERROR/Database(7317):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)11-01 11:26:47.087: ERROR/Database(7317):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)11-01 11:26:47.087: ERROR/Database(7317):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>The problem is I don't use a database anywhere in my code.</p><p><strong>EDIT:</strong></p><p>Here is the code snippet of the whole program.  Also I only get this error sometimes and sometimes I don't which is another weird thing.</p><p>Here is the main Activity:</p><pre><code>public class SetAlarmUI extends Activity {TextView mTimeDisplay;Button setAlarmButton;private Calendar time;private int alarmHour;private int alarmMin;static final int TIME_DIALOG_ID = 0;Toast toast;@Override/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.setalarm);    // Holder for the Time, user will set this value later    time = Calendar.getInstance();    // Show the selected time    mTimeDisplay = (TextView) findViewById( R.id.timeText );            // Allow user to select the time for alarm and set it    setAlarmButton = (Button) findViewById( R.id.pickTime );    /***************** LISTENERS ******************/    // add a click listener to the Set Time button    OnClickListener setTimeListener = new OnClickListener() {        // Do this when the Set-Time button is clicked;                     public void onClick(View v) {            // Display the Time Selector Dialog box so DEVELOPER can set the alarm            /** This will later be changed so that time is retrieved from a server */            showDialog( TIME_DIALOG_ID );  // TIME_DIALOG_ID = a unique ID for the Time Picker Dialog        }    };    Log.e( ""OUT"", ""Line 59: Continuing..."" );    //--------- Assign The Listeners ----------//    setAlarmButton.setOnClickListener( setTimeListener );    /**********************************************/    // get the current time    time.setTimeInMillis( System.currentTimeMillis() );    alarmHour = time.get( Calendar.HOUR_OF_DAY);    alarmMin = time.get( Calendar.MINUTE );    // Update the current display    updateDisplay();             }// updates the time we display in the TextViewprivate void updateDisplay() {    mTimeDisplay.setText(        new StringBuilder()                .append(pad(alarmHour)).append("":"")                .append(pad(alarmMin)));}// Fix up the string representation of the timeprivate static String pad(int c) {    if (c &gt;= 10)        return String.valueOf(c);    else        return ""0"" + String.valueOf(c);}// the callback received when the user ""sets"" the time in the dialogprivate TimePickerDialog.OnTimeSetListener mTimeSetListener =    new TimePickerDialog.OnTimeSetListener() {        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {            time.set( Calendar.HOUR_OF_DAY, hourOfDay );            time.set( Calendar.MINUTE, minute );            // Tell user alarm was set            String timeSetTo = ""Alarm Set: "" + time.get( Calendar.HOUR_OF_DAY ) + "":"" + time.get( Calendar.MINUTE ) + "" "" + time.get( Calendar.AM_PM );            if( toast != null )                 toast.cancel();            toast = Toast.makeText( SetAlarmUI.this, ""L"" + timeSetTo, Toast.LENGTH_LONG );            toast.show();                           // When the alarms goes off we want to send an Intent to our Broadcast Receiver (AlarmAction),             // so set an Intent between the AlarmUI and the AlarmAction            Intent intent = new Intent( SetAlarmUI.this, CallAlarm.class );            // Create an IntentSender to have the intent executed as a broadcast later when alarm goes off.            PendingIntent sender = PendingIntent.getBroadcast( SetAlarmUI.this, 0, intent, 0 );            /** Schedule the alarm */            // To get any service we use getSystemService( Service Name )            AlarmManager alarmManager = ( AlarmManager ) getSystemService( ALARM_SERVICE );            /* Finally, we set the alarm to the desired time! WOOHOO! */            alarmManager.set( AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), sender );        }    };@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case TIME_DIALOG_ID:            return new TimePickerDialog(this,                    mTimeSetListener, alarmHour, alarmMin, false);    }    return null;}}</code></pre><p>Here is my Broadcast Receiver:</p><pre><code>public class CallAlarm extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent callDismiss){    Toast.makeText( context, R.string.debug, Toast.LENGTH_LONG ).show();    Log.e( ""AlarmAction"", context.getResources().getStringArray( R.array.ahadith )[0] );    callDismiss = new Intent( context, DismissUI.class );    context.startActivity( callDismiss );}}</code></pre><p>And lastly here is my second Activity that gets called by the Broadcast receiver when the Alarm goes off:</p><pre><code>public class DismissUI extends Activity {@Override/** Called when the activity is first created. */public void onCreate( Bundle savedInstanceState ) {    // Display the Hadith    //super.onCreate( savedInstanceState );    setContentView( R.layout.dismiss );    Log.e( ""DismissUI"", ""MADE IT TO THE DISMISS!"" );    /* DEBUG */    // Get the Activity's Layout    LinearLayout mLayout = ( LinearLayout ) findViewById( R.layout.dismiss );    // Get a hadith from the String xml file and display it    TextView textView = new TextView( this );    textView.setText( getResources().getTextArray( R.array.ahadith )[0] );    // Set the layout for the Text (hadith)    LayoutParams p = new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT );        textView.setLayoutParams(p);    // Add the hadith text to the layout at the beginning hence the ZERO    mLayout.addView( textView, 0 );    // Get the Text box for user input    EditText textBox = ( EditText ) findViewById( R.id.userInput );    // Get the Snooze and Dismiss buttons    // Set listener for Snooze button    // Set listener for Dismiss Button}}</code></pre>","491741","","491741","","2010-11-01 15:43:16","2010-11-02 03:22:52","My Android app keeps giving me a Leak Found error","<java><android>","2","4","","",""
"4062161","1","4079692","","2010-10-31 07:04:36","20","20747","<p>My application requires graph library and I am using achartengine graph library. My app requires graph to be only 50% of the screen and other part is used to display some other information. </p><p>So is it possible have xml resource file for achartengine's graph APIs? If yes kindly let me know how to do it. </p><p>I tried to find example but did not find it. So I am wondering is it supported or not.</p>","492607","","56338","","2010-11-14 09:10:17","2013-07-30 16:10:49","Android: I am using AChartEngine library for graphs, but not able to integrate achartengine's graph view with android xml?","<android><achartengine>","4","4","8","",""
"4062235","1","4062331","","2010-10-31 07:37:28","1","329","<p>Is there a way to retrieve the height (in pixels) taken by the application title and the top bar (the one containing the clock, signal information etc...)</p><p>Thanks</p>","298699","","302328","","2010-10-31 08:18:25","2010-10-31 08:18:25","How to retrieve height of application header?","<java><android><titlebar>","1","0","","",""
"4062357","1","","","2010-10-31 08:25:37","10","8449","<p>When starting my android application, I need to create a directory on the sd card, for a small number of users this fails and I can't figure out the reason for it...</p><p>(I've found similar problems caused by the WRITE_EXTERNAL_STORAGE permission missing, it's there and it works for almost all users so I don't think this is reason)</p><p>I've simplified the previous situation to make it easier to explain, if creating a directoy fails, I run a test case where I try to make a .test directory on the sdcard:</p><pre><code>new File(Environment.getExternalStorageDirectory(), "".test"").mkdir() -&gt; falsenew File(Environment.getExternalStorageDirectory(), "".test"").mkdirs() -&gt; false</code></pre><p>File properties of the relevant directories:</p><blockquote>  <p>/sdcard/.test (exists=false canWrite=false canRead=false canExecute=err isDirectory=false isFile=false)</p>    <p>/sdcard (exists=true canWrite=true canRead=true canExecute=err isDirectory=true isFile=false)</p>    <p>/ (exists=true canWrite=false canRead=true canExecute=err isDirectory=true isFile=false)</p>    <p>getExternalStorageState=mounted</p></blockquote><p>(canExecute returns err because the test is run on sdk &lt; 9)</p><p>Suggestions and ideas are very welcome...</p>","488213","","488213","","2010-12-21 20:26:35","2013-12-10 14:00:26","mkdirs returns false for directory on sd card while the parent directory is writable","<android><mkdir><android-sdcard>","9","3","2","",""
"4062532","1","","","2010-10-31 09:21:14","3","1907","<p>I am writing a application and it should be protected with a password. Instead of building a new one, Is it possible to use the Android's Pattern lock screen from application with different patterns?</p>","423671","","","","","2011-02-09 06:22:41","Reusing Android Lock Pattern","<android>","0","1","1","",""
"4062559","1","4138451","","2010-10-31 09:27:59","3","6147","<p>I am creating a appwidget that consists of a single custom view called Foo.</p><p>xml/widget.xml:</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/widget_layout""&gt;&lt;/appwidget-provider&gt;</code></pre><p>layout/widget_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;package.name.Foo android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Foo:</p><pre><code>  public class Foo extends View   {..}</code></pre><p>I tested the <code>Foo</code> view in a normal android app, and it works perfectly. However, when I try to run the widget I get <code>""error while loading widget""</code>. When I remove the <code>Foo</code> view from the widget, everything is fine. So it has something to do with the <code>Foo</code> view.</p><p>Unfortunately I can't get any more specific errors in DDMS, cause I don't know of a way to debug widgets.</p><p>I would like to know if it is indeed possible to use your own custom views in a app-widget?Am I doing something wrong here?</p>","107029","","","","","2012-09-29 19:12:49","Android: AppWidget with custom view not working","<android><android-widget>","4","3","6","",""
"4062591","1","","","2010-10-31 09:38:35","1","1753","<p>Is it possible to stream video to an Android device by using <a href=""http://en.wikipedia.org/wiki/Windows_Media_Services"" rel=""nofollow"">Windows Media Services</a>? Which protocol should I use between RTSP and HTTP?  Actually, I have a video file (MP4 format) at a server and I want to stream video files to an Andriod device.</p>","492664","","63550","","2010-11-05 12:25:13","2010-12-16 19:06:43","Windows Media Services streaming (using RSTP or HTTP) to Android","<android><video-streaming><android-sdk-2.2>","1","0","","",""
"4062598","1","","","2010-10-31 09:41:06","0","327","<p>I get weird exception:</p><p>10-31 09:09:51.308: ERROR/ContentService(59): Content Service Crash10-31 09:09:51.308: ERROR/ContentService(59): java.lang.NullPointerException10-31 09:09:51.308: ERROR/ContentService(59):     at android.content.ContentService$ObserverNode.collectObserversLocked(ContentService.java:620)10-31 09:09:51.308: ERROR/ContentService(59):     at android.content.ContentService.notifyChange(ContentService.java:134)10-31 09:09:51.308: ERROR/ContentService(59):     at android.content.IContentService$Stub.onTransact(IContentService.java:91)10-31 09:09:51.308: ERROR/ContentService(59):     at android.content.ContentService.onTransact(ContentService.java:83)10-31 09:09:51.308: ERROR/ContentService(59):     at android.os.Binder.execTransact(Binder.java:288)10-31 09:09:51.308: ERROR/ContentService(59):     at dalvik.system.NativeStart.run(Native Method)</p><p>after that - only a restart of the emulator helps.anyone knows what is this?</p><p>Ori</p>","258429","","","","","2010-10-31 15:02:56","Content Service Crash","<android><android-contentresolver>","1","3","","",""
"4062717","1","4064361","","2010-10-31 10:17:23","0","6420","<p>To check does preferences exist I tried this way, but it shows null every time(maybe because I saved preferences in different view):</p><pre><code>String def = null; String test = getPreferences(MODE_PRIVATE).getString(PREF_GAME,def);if(test == null) Log.v(""main"", ""no saved data"");</code></pre><p>To delete preferences I tried editor.clear(), but it does't delete (however commit() every time return true):</p><pre><code>   SharedPreferences preferences = getSharedPreferences(PREF_GAME,MODE_PRIVATE);   SharedPreferences.Editor editor = preferences.edit();   editor.clear();   boolean tt = editor.commit();Log.v(""DELETE PREF"", String.valueOf(tt));</code></pre><p><strong>UPDATE:</strong> I found that if I check preferences exist in the same view, where i saved it, this checking works fine, but how can i do this in different view?</p><p><strong>Update:</strong> I guessed with myself, thanks everyone!</p>","278279","","278279","","2010-10-31 18:28:36","2012-01-19 00:11:18","Android: How to check does shared preferences exist, and how to delete them","<android>","2","0","","",""
"4062743","1","4609935","","2010-10-31 10:28:05","2","2723","<p>I am creating a <code>appwidget</code> which needs to update on a specific interval. I use <code>AlarmManager</code> for this.</p><p>I want to have the alarm run the <code>onUpdate()</code> method in the <code>AppWidgetProvider</code>.</p><pre><code>    //Create the intent    Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);    pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);                  //Schedule the alarm            AlarmManager manager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);    manager.setRepeating(AlarmManager.RTC, startAlarmCal.getTime().getTime(), 1000 * 60, pendingIntent);</code></pre><p>However, this intent causes all the widget's to update. I want to somehow only send this intent to my own appwidget. How would I do this?</p>","107029","","750987","","2011-06-17 00:04:06","2011-06-17 00:04:06","How to broadcast an intent to a specific appwidget?","<android><android-widget><android-intent>","3","0","2","",""
"4062813","1","4446943","","2010-10-31 10:53:29","0","2466","<p>Dear friends,              I have created one music app. It contains some collection of albums, when we click on a particular album the songs in that album will be loaded in to anther activity. These songs are displayed as rows of table layout and these rows are dynamically changed based on the songs.I have registered context menu for tablerow and this context menu is also displayed. But my problem is to find a particular row on which the context menu is displayed not possible in <code>onContextItemSelected()</code>. I tried <code>ContextMenuInfo info = item.getMenuInfo();</code> but info gets null. My questions are,1)Is context menu works only for ListView by using Adapters?2)Tablelayout is also works like ListView, then what is problem with my code?</p><p>Code snap</p><pre><code> public class AlbumActivity extends Activity{   private int DYNAMIC_ROW_ID = 1; public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.album);    LoadingAlbumThread t = new LoadingAlbumThread(dataHandler);    t.start();}public void onCreateContextMenu(ContextMenu menu,View v,ContextMenuInfo menuInfo){    super.onCreateContextMenu(menu, v, menuInfo);    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.album_contextmenu, menu);   }public boolean onContextItemSelected(MenuItem item){    ContextMenuInfo info = item.getMenuInfo();    // here 'info' gets null value,that is the main problem in my application    switch(item.getItemId()){    case R.id.playsong_contextmenuitem:        playSong(info.id); //This 'info.id' gives the id of selected table row        return true;    case R.id.add_to_playlist_contextmenuitem:        return true;    case R.id.emial_contextmenuitem:        return true;    case R.id.twitter_contextmenuitem:        return true;    case R.id.facebook_contextmenuitem:        return true;    default:        return super.onOptionsItemSelected(item);    }}final Handler dataHandler = new Handler(){    public void handleMessage(Message msg){        TableRow tr = new TableRow(getBaseContext());        registerForContextMenu(tr);            tr.setId(DYNAMIC_ROW_ID++);            .......            .......    }};private class LoadingAlbumThread extends Thread{Handler handler = null;public LoadingDataThread(Handler handler) {   this.handler = handler;}public void run(){      albumJSONObject = getJSONObject(intent.getStringExtra(""JSONAlbumData""));      if(albumJSONObject!=null)             albumJSONArray = albumJSONObject.getJSONArray(""album"");      if(albumJSONArray!=null){                       noOfSongs = albumJSONArray.length();      for(int i=0;i&lt;noOfSongs;i++){    songTitleStr = songsJSONArray.getJSONObject(i).getString(""song_title"");    handler.sendMessage(handler.obtainMessage());      }      }   }private JSONObject getJSONObject(String data){        JSONObject jsonObj = null;            if(data!=null){                jsonObj = new JSONObject(data)            }        return jsonObj;}</code></pre><p>I welcome your valuable suggestions. </p><p>Thanksvenu</p>","461975","","461975","","2010-11-01 08:51:41","2010-12-15 05:21:24","How to apply context menu on rows of tablelayout dynamically from program","<android>","2","0","","",""
"4062838","1","4063426","","2010-10-31 11:02:24","0","3551","<p>I have the following inside my manifest file:</p><pre><code>&lt;service android:name="".Rotate""     android:enabled=""true""    android:label=""@string/app_name""&gt;     &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.SEARCH_LONG_PRESS"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;&lt;/service&gt;</code></pre><p>However the holding down the search key doesn't activate <code>SEARCH_LONG_PRESS</code> anymore. Before I replaced <code>&lt;activity&gt;</code> with <code>&lt;service&gt;</code> it use to show two options when long pressing the search key, one was my app the other was Google Voice Search... now it's just Google Voice Search.</p>","149166","","","","","2010-10-31 14:13:06","Intent-Filter within a Service","<android><service><intentfilter>","1","0","1","",""
"4062861","1","4063825","","2010-10-31 11:08:16","0","1095","<p>I have a question about SocketChannels in Android. This is my code:</p><pre><code>SocketChannel socketChannel = SocketChannel.open();socketChannel.connect(new InetSocketAddress(""127.0.0.1"", 90));</code></pre><p>This code works in Java but not in Android. I always get an IOException My first problem was the first line. I had to add permissions to open sockets. The first line now works but the second line doesn't. I always get an IOException.</p><p>Any suggestions?</p>","492704","","492704","","2010-11-02 19:57:17","2012-12-25 16:12:30","SocketChannel in Android","<android><sockets><connect><ioexception><socketchannel>","2","0","1","",""
"4062877","1","4063143","","2010-10-31 11:14:48","1","329","<p>Why the last section is not displayed at all? AFAIK It should. It starts with :</p><pre><code>&lt;LinearLayout android:orientation=""vertical""android:layout_height=""match_parent""android:layout_width=""70dip""android:minWidth=""70dp""android:layout_weight=""1""&gt;</code></pre><p>Thanks in advance.</p><p>Full XML layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>        </p><pre><code>&lt;View    android:layout_width=""2dip""    android:layout_height=""match_parent""    android:background=""#FF909090"" /&gt;&lt;LinearLayout android:orientation=""vertical""     android:layout_width=""match_parent""     android:layout_height=""60dp""&gt;    &lt;LinearLayout         android:orientation=""horizontal""        android:layout_width=""match_parent""         android:layout_height=""30dp""&gt;        &lt;TextView            android:layout_width=""20dp""            android:layout_height=""30dp""            android:gravity=""center""            android:layout_weight=""0""            android:text=""---""/&gt;        &lt;TextView android:id=""@+id/trainingSegmentReps""             android:layout_width=""15dip""            android:layout_height=""30dip""            android:text=""3""             android:gravity=""center""            android:textSize=""6pt""            android:layout_weight=""1""   /&gt;        &lt;TextView             android:layout_width=""15dip""            android:layout_height=""30dip""            android:text=""x""             android:gravity=""center""            android:textSize=""6pt""              android:layout_weight=""1""/&gt;        &lt;TextView             android:id=""@+id/trainingSegmentLength""             android:layout_width=""wrap_content""            android:layout_height=""30dp""            android:gravity=""center""            android:text=""200""            android:paddingRight=""5dp""            android:layout_weight=""1"" /&gt;        &lt;TextView             android:id=""@+id/trainingSegmentLengthUnit""             android:layout_width=""wrap_content""            android:layout_height=""30dp""            android:gravity=""center""            android:text=""m.""            android:layout_weight=""1""/&gt;        &lt;TextView             android:id=""@+id/trainingSegmentActivity""             android:layout_width=""wrap_content""            android:layout_height=""30dp""            android:gravity=""center""            android:text=""Crawl""            android:paddingLeft=""10dp""            android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:orientation=""horizontal""        android:layout_height=""60dp""        android:layout_width=""match_parent""&gt;        &lt;TextView             android:id=""@+id/trainingSegmentRest""             android:layout_width=""wrap_content""            android:layout_height=""30dp""            android:textSize=""8pt""            android:paddingRight=""10dp""            android:paddingLeft=""40dp""            android:text=""12""/&gt;        &lt;TextView android:id=""@+id/trainingSegmentRestUnit""             android:layout_width=""wrap_content""            android:layout_height=""30dp""            android:textSize=""8pt""            android:text=""breathes""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;LinearLayout     android:orientation=""vertical""    android:layout_height=""match_parent""    android:layout_width=""70dip""    android:minWidth=""70dp""    android:layout_weight=""1""&gt;    &lt;TextView android:id=""@+id/trainingSegmentTotal""                 android:layout_height=""25dp""                android:layout_width=""match_parent""                android:textSize=""8pt""                android:text=""Total:""                android:gravity=""center""/&gt;    &lt;TextView android:id=""@+id/trainingSegmentTotal""                android:layout_height=""35dp""                android:layout_width=""match_parent""                android:textSize=""8pt""                android:text=""1000 m.""                android:gravity=""center""/&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","240736","","","","","2010-10-31 12:51:07","Android doesn't show part of layout","<android><android-layout>","1","3","","",""
"4062992","1","","","2010-10-31 12:00:18","0","1765","<p><p>I started to learn android and I'm making a simple game. In this game I need two scroll lists with the same width, so I set layout_weight parameter to ""1"" in both views. But when I run program scroll views have different size. Second problem is that i need EditText widget to be low, so I did the same thing with TableRows, but in the end I have to set weight to 0.1 to achieve needed size.</p><p>P.S. Sorry for my english if there are some mistakes</p><p><pre><code>   &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;   &lt;TableLayout   android:id=""@+id/widget28""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:orientation=""vertical""   xmlns:android=""http://schemas.android.com/apk/res/android""&gt;       &lt;TableRow       android:id=""@+id/widget29""       android:layout_width=""fill_parent""       android:layout_weight=""7""       android:orientation=""vertical""&gt;            &lt;ScrollView            android:id=""@+id/widget34""            android:layout_weight=""1""            android:layout_height=""150px""            android:background=""#ffff00ff""&gt;            &lt;/ScrollView&gt; &lt;ScrollView            android:id=""@+id/widget35""            android:layout_weight=""1""            android:layout_height=""150px""            android:background=""#ff00ffff""&gt;            &lt;/ScrollView&gt;&lt;/TableRow&gt;&lt;TableRow       android:id=""@+id/widget30""       android:layout_width=""fill_parent""       android:layout_weight=""0.1""       android:orientation=""vertical""&gt;&lt;EditText            android:id=""@+id/widget36""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""Not editable""            android:textSize=""18sp""&gt;&lt;/EditText&gt;</p><code>   &lt;/TableRow&gt;</code></pre><p></code></p>","492724","","1228","","2013-07-10 17:13:28","2013-07-10 17:13:28","Setting same width or height of views in XML","<android><xml><view><size>","2","0","","",""
"4063071","1","","","2010-10-31 12:24:48","2","825","<p>I'm developing a video player application for which the user has an option to seek to a particular location, but the problem is there is no <code>setOnSeekCompleteListener</code> for VideoView,</p><p>So I am not sure if the seek operation that was requested has completed or not, and whether to start playback if it is complete.</p><p>Is there a way to implement a <code>setOnSeekCompleteListener</code> with VideoView.</p><p>Thanks,Shrikant.</p>","492729","","141661","","2010-10-31 12:38:51","2010-10-31 14:09:36","setOnSeekCompleteListener for VideoView how can be achieved ","<android><video><player><videoview>","1","0","","",""
"4063296","1","4063340","","2010-10-31 13:34:51","1","2867","<p>I've just started Android development with Eclipse, so I've been going through all the ""Hello"" tutorials on the Android Developers site. I have come unstuck, however, on the List View tutorial. I have tried many times to correct the problems, but I am inexperienced and whatever I do doesn't seem to work. I have copied and pasted the code directly from the site, but it still contains errors I cannot fix, so can anyone help me? Here is the code:</p><pre><code>package com.hellolistview;import android.app.Activity;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;public class HelloListView extends ListActivity {/** 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, COUNTRIES));   ListView lv = getListView();   lv.setTextFilterEnabled(true);   lv.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; parent, View view,         int position, long id) {       // When clicked, show a toast with the TextView text       Toast.makeText(getApplicationContext(), ((TextView) view).getText(),           Toast.LENGTH_SHORT).show();     }   }); }    }    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"",    ""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>The XML files have all been copied straight from the tutorial at <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">this address</a> so they should be correct. The errors include: ""The method setOnItemClickListener(AdapterView.OnItemClickListener) in the type AdapterView is not applicable for the arguments (new OnItemClickListener(){})"". Any help at all would be appreciated. Thanks.</p>","492774","","379693","","2010-11-01 05:52:14","2010-11-01 06:44:12","Problem with Hello, Views: List View tutorial","<android><list><listview><adapter>","2","0","","",""
"4063309","1","","","2010-10-31 13:40:10","6","4773","<p>I'm looking for a way to escape the ""@"" symbol at the start of a string, in Android strings.xml resource. I'm continuously getting compilation errors and the layout builder in Eclipse refuses to work :(. Does anyone know how?</p>","459888","","","","","2012-06-06 08:41:39","Escape ""@"" character in Android","<android>","3","0","1","",""
"4063312","1","4063434","","2010-10-31 13:41:05","0","874","<p>im making an application on android that requires to capture the user´s voice and recognize it. I tryed to record the audio using this code: <a href=""http://xhampa.pastebin.com/Yr2hie6q"" rel=""nofollow"">http://xhampa.pastebin.com/Yr2hie6q</a> on android 2.1. I realized that the sound wasn't recorded in a good quality at all (like slow motion). Unfortunally, I don't have an android to test it out, so I'm using the emulator. Is there anyway to improve record quality using the emulator?</p>","469631","","469631","","2011-11-11 09:11:51","2011-11-13 15:28:09","Voice Recognition with android emulator","<android><android-emulator><voice-recognition>","1","0","","",""
"4063378","1","5212523","","2010-10-31 14:00:17","2","1452","<p>I'm developing an Android application and I need to use a render engine to show some objects that I made with Blend.</p><p>I'm wondering if there is a C++ game engine or render engine to show my models.</p><p>Is there anyone?</p><p>Thanks.</p>","68571","","68571","","2012-09-27 05:29:16","2012-09-27 05:29:16","C++ rendering or game engine for Android.","<c++><android><game-engine><rendering-engine>","1","0","0","2012-09-26 07:20:13",""
"4063402","1","4063466","","2010-10-31 14:08:22","2","656","<p>I can't seem to find any documentation saying this is possible, but Google turned up a few apps that claim to be able to accomplish it.</p><p>I'd like to, ideally, be able to play an audio track and have it sent as the caller's voice.</p>","177467","","","","","2010-10-31 14:23:40","Can the Android API be leveraged to modify the caller's voice during the call?","<java><android><audio><telephony>","1","1","","",""
"4063510","1","5899110","","2010-10-31 14:36:03","39","41223","<p>I was reading the Android SQLite NotePad tutorial that referenced creating a DB Adapter class to create and access a DB table.  When dealing with a multi-table SQLite Database, is it best practice to create a different Adapter Class for each table or create a single DB Adapter class for the entire Android Application?</p><p>My application uses multiple tables and I was hoping not to have to have a single massive adapter class.  the problem, however, is that I have a nested subclass of SQLiteOpenHelper per the NotePad Example within each adapter.  When the first table is accessed, everything works fine.  When I then try to access the second tble(from a different activity) my app crashes.</p><p>At first, I thought the crash was being caused by a versioning issue, but both adapters now have the same database version and it's still crashing.</p><p>Here's an example of one of the DB Adapters for the table.  The other adapters all follow the same format with varying implementations.</p><pre><code>public class InfoDBAdapter {    public static final String ROW_ID = ""_id"";    public static final String NAME = ""name"";    private static final String TAG = ""InfoDbAdapter"";    private static final String DATABASE_NAME = ""myappdb"";    private static final String DATABASE_TABLE = ""usersinfo"";    private static final int DATABASE_VERSION = 1;    private static final String DATABASE_CREATE = ""create table usersinfo (_id integer primary key autoincrement, ""            + NAME            + "" TEXT,"" + "");"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    private final Context mCtx;    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(DATABASE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to "" //$NON-NLS-1$//$NON-NLS-2$                    + newVersion + "", which will destroy all old data""); //$NON-NLS-1$            //db.execSQL(""DROP TABLE IF EXISTS usersinfo""); //$NON-NLS-1$            onCreate(db);        }    }    public InfoDBAdapter(Context ctx) {        this.mCtx = ctx;    }    public InfoDBAdapter open() throws SQLException {        this.mDbHelper = new DatabaseHelper(this.mCtx);        this.mDb = this.mDbHelper.getWritableDatabase();        return this;    }    /**     * close return type: void     */    public void close() {        this.mDbHelper.close();    }    public long createUser(String name) {        ContentValues initialValues = new ContentValues();        initialValues.put(NAME, name);        return this.mDb.insert(DATABASE_TABLE, null, initialValues);    }    public boolean deleteUser(long rowId) {        return this.mDb.delete(DATABASE_TABLE, ROW_ID + ""="" + rowId, null) &gt; 0; //$NON-NLS-1$    }    public Cursor fetchAllUsers() {        return this.mDb.query(DATABASE_TABLE, new String[] { ROW_ID,                NAME}, null, null, null, null, null);    }    public Cursor fetchUser(long rowId) throws SQLException {        Cursor mCursor =        this.mDb.query(true, DATABASE_TABLE, new String[] { ROW_ID, NAME}, ROW_ID + ""="" + rowId, null, //$NON-NLS-1$                null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public boolean updateUser(long rowId, String name) {        ContentValues args = new ContentValues();        args.put(NAME, name);        return this.mDb                .update(DATABASE_TABLE, args, ROW_ID + ""="" + rowId, null) &gt; 0; //$NON-NLS-1$    }}</code></pre><p>When the first adapter, in this case usersinfo, is accessed, everything works as expected.  Let's say I have another adapter for friend info that follows the same structure as above, when it is accessed by a different activity, it would seem to me that the nested subclass of SQLiteOpenHelper would attempt to create the database again.  Obviously something is wrong because in that scenario, my app crashes.</p><p>So is the standard practice within Android to create a single mammoth db adapter instead of individual adapters per table?</p>","411435","","135152","","2011-05-25 03:08:23","2013-09-16 06:48:41","Multiple Table SQLite DB Adapter(s) in Android?","<android><sqlite><sqlite3>","2","2","41","",""
"4063526","1","4136278","","2010-10-31 14:39:04","0","3171","<p>I have a service class in my Android app which uses a timer. The timer is set to run at a delay of 1min (60000ms). I want the user to be able to dynamically change this delay. Normally, in java I could just use timer.setDelay(); but Android does not have this function. </p><p>Service class so far:</p><pre><code>public class LocalService extends Service{    Timer timer = new Timer();     int newDelay;     public IBinder onBind(Intent arg0)     {        return null;    }    public void onCreate()     {        super.onCreate();         startService();    }    private void startService()    {             timer.scheduleAtFixedRate(new TimerTask()        {            public void run()             {                       mainTask();            }        }, 0, 60000);    }    private void mainTask()    {        //do something    }    private void shutdownService()    {        if (timer != null) timer.cancel();    }    public void onDestroy()     {             super.onDestroy();        shutdownService();    }    private void readNewDelay()    {        InputStream in = openFileInput(""updateDelay"");        if(in != null)        {            InputStreamReader input = new InputStreamReader(in);            BufferedReader buffreader = new BufferedReader(input);            newDelay = Integer.parseInt(buffreader.readLine()) * 60000; //value in file is saved in minutes        }               in.close();     }}</code></pre><p>The delay I want is saved to a text file by an activity. I then want the service to read this file and update its timer delay accordingly. </p>","444707","","444707","","2010-10-31 14:44:04","2010-11-09 16:55:28","Android timer set delay","<android>","1","0","1","",""
"4063535","1","4063627","","2010-10-31 14:42:12","2","4493","<p>I am trying to implement pinch zoom and it is working but when i zoom out and then zoom in again the resolution of the image(bitmap) decreases.I am aware that this is just normal behavior of my code and i want to know how to do this with right way .</p><p>here is the relevant code :</p><pre><code>Matrix matrix = new Matrix() ;float scale = newDist / oldDist;matrix.postScale(scale, scale, mid.x, mid.y);int width = mutable.getWidth() ;int height = mutable.getHeight() ;mutable = Bitmap.createBitmap(mutable, 0, 0, width, height, matrix, false);</code></pre>","458678","","","","","2011-06-21 09:31:25","How to zoom in and out to a bitmap without loosing resolution?","<android><resize><bitmap><zoom><resolution>","2","0","2","",""
"4063549","1","","","2010-10-31 14:46:31","3","1537","<p>How I can rotate an object in <code>Box2D</code>?  Tried..</p><pre><code>private static final double DEGREES_TO_RADIANS = (double)(Math.PI/180);float angle = (float) (45*DEGREES_TO_RADIANS);object.body.setTransform(object.body.getPosition(), angle);</code></pre><p>..but not working.</p>","472537","","418556","","2011-06-07 17:03:40","2014-03-15 15:39:30","Box2D rotate an object, how?","<java><android><rotation><box2d>","5","2","","",""
"4063676","1","4064141","","2010-10-31 15:17:17","1","193","<p>I'm writing a bitmap editor and I'm trying to write an autosave feature. When onPause is called, I write the application state to an autosave file. As this takes between 0.1s and 1.5s, I've been advised this IO operation be performed in a background thread. </p><p>In the onCreate method of my activity, I check to see if the autosave file exists and, if it does, I open it.</p><p>Are there any scenarios I have to consider where the user can somehow leave the activity, the autosave thread starts and the user can return to the activity before the thread has finished?  If so, how can I detect this and wait for the thread to finish before I check the state of the autosave file?</p><p>I was going to make it that, when the user backs out of my activity, they're asked to wait a second while the data is saved. This seems OK, but I can't do this when my activity is interrupted by something like a phone call.</p><p>Also, I'm a bit confused about how multiple versions of the same activity can be started as this makes dealing with autosaving more complex. Is there a way to make sure only one instance of my activity is allowed to run at a time?</p>","483701","","","","","2010-11-01 03:25:51","How to tell a thread from a previous instance of your activity has finished?","<java><android><mobile>","2","0","","",""
"4063834","1","4065200","","2010-10-31 16:01:27","0","280","<p>I'm working on a platform=app for games and I want the user to be able to choose games like some kind of an add on, then it will download some file (a game) which my app knows how to read and work with.</p><p>Basically, what I want is to build a market without apk files.Or to generate a new kind of apk files. </p><p>I hope you can understand my question..</p>","178016","","178016","","2010-10-31 16:39:57","2010-11-01 06:11:42","Android - Add more levels to game without the need to download or update a new app from the Market","<android><google-play><apk>","2","2","","",""
"4063972","1","4064246","","2010-10-31 16:35:20","0","1836","<p>Hierarchy Viewer tool is missing from my android-sdk-windows\tools directory.</p><p>Link to tool:<a href=""http://developer.android.com/guide/developing/tools/hierarchy-viewer.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/hierarchy-viewer.html</a></p><p>Should it be there is first place?</p><p>P.S. SDK Tools rev. 7, Platforms 7 &amp; 8 packages are installed.</p>","240736","","","","","2012-12-04 03:19:25","Android Hierarchy viewer is missing","<android><android-layout>","2","2","","",""
"4063974","1","","","2010-10-31 16:35:25","3","18186","<p>Is there any way to change this in the android SDK?It looks like some of the .bat files in the \tools\ folder sets some environment variables but cant tell exactly what they are doing.</p><p>I set my windows system profile settings in the registry to point to d:\users and everything else is pointing there but the android sdk keeps wanting to put things in c:\users...</p><p>My reasoning for this is I have a much faster drive as my d drive(5 disk raid0) and my system drive is a 5400 spin ide drive...</p>","492852","","492852","","2010-10-31 21:18:22","2013-11-28 11:18:07","change path for android sdk and avd manager to not point to c:\users","<android><manager><avd>","2","1","3","",""
"4064021","1","","","2010-10-31 16:49:06","2","2164","<p>How to rotate video in VideoView for 90 degree ?Thanks for advices</p>","281887","","","","","2013-05-10 20:07:45","how to rotate video in VideoView","<android><videoview>","2","0","1","",""
"4064043","1","4064398","","2010-10-31 16:53:29","1","535","<p>I've been trying to follow <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">this tutorial</a> on using Google Map View in Android. In the second part, they create an <code>mContext</code> member variable and then pass that into <code>AlertDialog.Builder(mContext)</code>, but the constructor that they call to create an instance of an <code>HelloItemizedOverlay</code> doesn't instantiate <code>mContext</code>, so it's just left <code>null</code> as far as I know.</p><p>The program doesn't work properly, and throws a <code>NullPointerException</code> as I suspected. How is this supposed to work?</p><p>Thanks,<br>Jengerer</p>","437261","","437261","","2010-10-31 16:59:21","2012-11-26 18:28:20","Default context for AlertDialog.Builder for map view?","<java><android><alertdialog>","3","0","","",""
"4064055","1","","","2010-10-31 16:55:28","1","2083","<p>I'm trying to send geo fixes to the Android Emulator in Eclipse. It has been working in some locations, but now it never works. I've tried targeting different platforms, setting the time zone in the correct emulator, changing the locale to English (US), wiping the user data in the emulator, used both telnet geo fix command and the DDMS.</p><p>How can I make this work?</p>","360674","","13295","","2011-05-16 16:59:04","2011-05-16 16:59:04","Can't get geo fixes to Android emulator","<android><gps><emulator>","3","3","2","",""
"4064126","1","4064244","","2010-10-31 17:14:46","2","3880","<p>I have a MainActivity class with an ""Add Item"" button and a listview and a AddItemActivity class with a textbox and a ""save"" button.  The user should click on the ""Add Item"", go to the AddItemActivity screen, enter an item, click 'save' and then go back to the updated MainActivity screen.</p><p>(BTW, I'm using MonoDroid, but I don't think this is necessary a MonoDroid specific problem).</p><p>My ""Add item"" click event (on main activity):</p><pre><code>    private void addItemButton_Click(object sender, EventArgs e)    {        var intent = new Intent();        intent.SetClassName(this, ""monoApp.AddItemClassName"");        StartActivityForResult(intent, 0);    }</code></pre><p>My ""Save"" click event (on add item activity):</p><pre><code>    private void saveButton_Click(object sender, EventArgs e)    {        var itemname = FindViewById&lt;EditText&gt;(Resource.id.itemName);        _repo.SaveItem(new Item() {Name = itemname.Text.ToString()});        Toast.MakeText(this, ""You saved: "" + itemname.Text, ToastLength.Short).Show();        var intent = new Intent();        SetResult(Result.Ok, intent);        Finish();    }</code></pre><p>And then back in main activity:</p><pre><code>    protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)    {        base.OnActivityResult(requestCode, resultCode, data);        RefreshTheList();    }</code></pre><p>This works like a charm, on the first time.  The screen slides over to 'add item', and then slides back to main when it's done.  The <em>second time</em>, it slides over, but then it slides back to <em>itself</em>, if that makes any sense.  And then if I hit save <em>again</em>, it goes back to working fine.</p><p>If video would help, I've posted a clip of what I'm seeing to TwitVid: <a href=""http://www.twitvid.com/W7XZC"" rel=""nofollow"">http://www.twitvid.com/W7XZC</a></p><p>Basically, I don't want it to ""slide back to itself"" ever, so what am I doing wrong?</p>","40015","","","","","2010-10-31 17:42:33","Android StartActivityForResult and Finish (with video)","<android><monodroid>","1","0","1","",""
"4064169","1","4065715","","2010-10-31 17:26:02","1","336","<p>I am explaining my issue straightaway. Please refer the following code snippet.</p><pre><code>@Overridepublic View getView(int index, View convertView, ViewGroup parent) {    Comments comment = comments.get(index);    if (convertView == null) {        LayoutInflater inflator = (LayoutInflater) context                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);        convertView = inflator.inflate(R.layout.comment_row, null);    }    TextView tvAuthor = (TextView) convertView.findViewById(R.id.commentAuthor);    System.out.println(""tvAuthor""+tvAuthor);    tvAuthor.setText(comment.getAuthor());    convertView.setTag(comment);    return convertView;}</code></pre><p>I get null for tvAuthor . As a result, in the immediate next line where I try to setText, I get null pointer exception.</p><p>I have declared commentAuthor in the xml correctly. I cannot trace, from where this error pops up. Experts, kindly help.</p><p>ny help in this regard is well appreciated.</p><p>Look forward,Regards,Rony</p>","264953","","","","","2010-11-01 05:46:15","Problem in Listview Custom adapter class","<android>","2","2","","",""
"4064211","1","4065537","","2010-10-31 17:35:11","3","6706","<p>I would like to know how to make a deep copy of an <code>InputStream</code>.</p><p>I know that it can be done with IOUtils packages, but I would like to avoid them if possible.Does anyone know an alternate way?</p>","290613","","122607","","2012-11-15 17:19:38","2012-11-15 17:19:38","How to make a deep copy of an InputStream in Java","<java><android><inputstream>","1","6","3","",""
"4064234","1","4065033","","2010-10-31 17:39:18","0","1440","<p>I have got a tech problem of implementing the reflection effect for TextView, in order to create a Clock/Timer. I have read many articles about this, but they are all about adding reflection effect for Images.</p><p>Would anyone please point me to the right direction to do so or simply show me some demo which are already there.</p><p>one of the articles I have read is <a href=""http://www.jappit.com/blog/2009/01/25/j2me-images-how-to-create-a-reflection-effect/"" rel=""nofollow"">here</a>. Others are basically the same.</p><p>Thanks so much!</p>","490808","","","","","2010-10-31 22:05:03","How to create reflection effect for TextView in android","<android><textview>","1","1","","",""
"4064279","1","4093289","","2010-10-31 17:49:00","0","3103","<p>I'm using the FontFitTextView that was posted in <a href=""http://stackoverflow.com/questions/2617266/how-to-adjust-text-font-size-to-fit-textview"" title=""How to adjust text font size to fit textview"">this other thread</a>, but it isn't working exactly right for me. The measureText() call is returning a number that is obviously too small to display the string. When it runs through to find a font size that will allow the text to fit, the font size it settles on is still too big. I feel like there is some other kind of padding or margin or some other invisible that is contributing the math that makes up the width which is causing the discrepancy.</p><p>For example... I want to set the text of my FontFitTextView to be ""10,000.25""</p><p>The width of my FontFitTextView is 96 pixels, with 8px padding on both sides, so my available width is 80 pixels. The call to measureText() says that the text ""10,000.25"" is 64 pixels wide. This means that the current font size should be small enough to display the entire string. However, when the string is actually drawn on the TextView the last 2 characters are chopped off and all I see is ""10,000."" instead of ""10,000.25""</p><p>Any ideas?</p>","416631","","","","","2010-11-04 02:03:19","Adjusting Font Size to Fit, Paint.measureText returns too small a value","<android><fonts><textview><font-size>","1","0","","",""
"4064407","1","4064667","","2010-10-31 18:16:11","1","371","<p>I know it is possible to use TelephonyManager to get information like: service state, device ID, Sim Operator, etc...Is it possible to edit some of this information?</p><p>Couldn't find .set() functions on Android.com documentation but I've found the <a href=""http://www.netmite.com/android/mydroid/frameworks/base/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java"" rel=""nofollow"">GSMPhone.java</a> source code which includes functions like .setNumber1Number() (used to set/edit the number?).</p><p>I basically want to know if it's possible to edit the phone number located on Sim card (Settings->About->Status->My Phone Number).</p><p>Appreciate any answer, even a simple ""NO"", if it's indeed impossible.</p><p>Thank you!</p>","444324","","","","","2010-10-31 19:14:45","Android: extending PhoneBase?","<android>","1","0","","",""
"4064492","1","4065826","","2010-10-31 18:33:11","0","651","<p>I'm having some troubles with displaying ItemizedOverlay(s) on a map.Here I extracted a simplified example of what I need to do.Here's my Map class:</p><pre><code>import java.util.Timer;import java.util.TimerTask;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.util.Log;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.OverlayItem;public class Map extends MapActivity {protected static final String TAG = ""Map"";private int test = 0;private TestItemized items = null;private Timer timer = new Timer();private MapView map = null;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    this.map = (MapView) this.findViewById(R.id.myMapView1);    this.map.setBuiltInZoomControls(true);    this.map.setSatellite(false);    this.map.setStreetView(true);    this.map.setClickable(true);    this.timer.scheduleAtFixedRate(new TimerTask(){        @Override        public void run() {            Log.d(TAG, ""refeshing: ""+ String.valueOf(test));            Drawable drawable = Map.this.getResources().getDrawable(R.drawable.androidmarker);            test++;            if (Map.this.items instanceof TestItemized &amp;&amp; Map.this.map.getOverlays().contains(Map.this.items))                Map.this.map.getOverlays().remove(Map.this.items);            //some code might go here to retrieve new coordinates but this isn't a problem            Map.this.items = new TestItemized(drawable, Map.this);            double lat = 46.491734;            Log.d(TAG,""Latitude : ""+ String.valueOf(lat));            double lng = 11.320365;            Log.d(TAG,""Longitude : ""+ String.valueOf(lng));            OverlayItem item = new OverlayItem(new GeoPoint((int)(lat * 1E6), (int)(lng * 1E6)), String.valueOf(Map.this.test), ""blah!"");            Map.this.items.addOverlay(item);            Map.this.map.getOverlays().add(Map.this.items);            Log.d(TAG,""refreshing ""+String.valueOf(test)+"" is over"");            }}, 1000,60000);        }@Overrideprotected boolean isRouteDisplayed() {    return false;}}</code></pre><p>I followed the guide provided by google to extends the ItemizedOverlay class</p><pre><code>import java.util.ArrayList;import java.util.List;import android.content.Context;import android.graphics.drawable.Drawable;import android.widget.Toast;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.OverlayItem;@SuppressWarnings(""rawtypes"")public class TestItemized extends ItemizedOverlay {private Context mCtx;private List&lt;OverlayItem&gt; mItems = new ArrayList&lt;OverlayItem&gt;();public TestItemized(Drawable arg0) {    super(arg0);}/** * @param defaultMarker * @param mCtx */public TestItemized(Drawable defaultMarker, Context mCtx) {    super(defaultMarker);    this.mCtx = mCtx;}public void addOverlay(OverlayItem overlay) {    this.mItems.add(overlay);    populate();}@Overrideprotected OverlayItem createItem(int i) {    return this.mItems.get(i);}@Overridepublic int size() {    return mItems.size();}/* (non-Javadoc) * @see com.google.android.maps.ItemizedOverlay#onTap(int) */@Overrideprotected boolean onTap(int index) {    OverlayItem item = this.mItems.get(index);    Toast.makeText(this.mCtx, item.getTitle() +"" : "" +item.getSnippet(), Toast.LENGTH_LONG).show();    return true;}} </code></pre><p>As it is clear from the code I need to update at fixed times a map UI with possibly new positions to do so I'm using a timer, but I think I might fall in some kind of thread issues I don't know how to handle, since when running a test I can see in the Log what happens but no marker is drawn on the map. Does anybody know how to solve this kind of problem?</p>","201058","","","","","2010-10-31 23:52:14","Timers and Maps Android","<android><google-maps-markers><itemizedoverlay>","1","0","0","",""
"4064543","1","4064587","","2010-10-31 18:45:52","0","733","<p>I have written a small android app that grabs some data and displays it in a ListView.</p><p>I want to have the list sorted in ascending order (no prob). But when I add a new item it stays at the bottom of the list even when the view/app is reloaded. It seems the only data that is being sorted is the entries that were created in the database OnCreate() method.</p><p>I'm not sure what code to provide but i'll start by showing you snippets of the DBAdapter class, then from the main app class.</p><p>Database construction query:</p><pre><code>    private static final String DATABASE_CREATE =    ""create table ""+ DATABASE_TABLE    + ""(""    + FIELD_ROWID+"" integer primary key autoincrement, ""    + FIELD_NAME +"" varchar(30) not null, "" + FIELD_TELEPHONE + "" varchar(20) not null, ""     + FIELD_ADDRESS + "" text not null,""
    + FIELD_URL + "" varchar(255) not null);"";</code></pre><p>Function to get list of data:</p><pre><code>    public Cursor getRestaurants() { Cursor result = null; try{  result = db.query(DATABASE_TABLE, new String[] {FIELD_ROWID, FIELD_NAME}, null, null, null, null, FIELD_NAME+"" ASC""); } catch (Exception e) {  Log.v(""applog"", e.getMessage()); } return result;}</code></pre><p>Here is a snippet of the main method. Here you can see that I am calling the getRestaurants() function shown above. I'm stumped as to why the data isn't being sorted.</p><p>Any advice greatly appreciated. Thanks in advance.</p><pre><code>public class Assignment2 extends ListActivity { // Set up some global variables.  private static final int ADD_NEW_ID = Menu.FIRST; private static final int CLOSE_APP_ID = ADD_NEW_ID+1; private final DBAdapter db = new DBAdapter(this); private static CursorAdapter curAdapter = null; private static Cursor rawData = null; @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        db.open(); // Open connection to restaurant db.     rawData = db.getRestaurants();     Log.v(""applog"", rawData.getCount()+"" Restaurants loaded from DB."");     if(rawData.getCount() == 0)     {      Toast.makeText(getApplicationContext(), ""No restaurants found."", Toast.LENGTH_SHORT).show();     }     try     {      /* The following two arrays are used to map DB fields to ListView items       * From a custom layout file.       */      // Array of db fields to be used when converting cursor to ListView            String[] strFields = { ""name"", BaseColumns._ID };            // Array of listview id's to be used when populating the ListView            int[] intFields = { R.id.first };            curAdapter = new SimpleCursorAdapter(this, R.layout.row, rawData, strFields, intFields);     }     catch (Exception e)     {       Log.v(""applog"", e.getMessage());      }       // Apply the converter cursor to the current ListView     setListAdapter(curAdapter);        db.close(); // Close connection to restaurant db.</code></pre>","225885","","244296","","2010-10-31 18:53:14","2010-10-31 18:56:55","Android SQL query not ordering data","<android><sqlite>","1","0","","",""
"4064627","1","4064639","","2010-10-31 19:06:01","0","492","<p>The default EditText widget has rounded corners. How do I change them to sharp / edged corners?</p>","421372","","","","","2010-10-31 19:09:54","Sharp corners for EditText","<android><edittext>","1","0","","",""
"4064690","1","","","2010-10-31 19:21:09","0","617","<p>I want to use/create a button that works like the one on the (HTC Desire) Soft Keyboard. So that when you make a long click, it will show a list of options, and by sliding your finger to the left or right, you select which option you want to choose.</p><p>Example: When I hold down the ""12#"" button on the keyboard, it presents the list: [: / @ _ - ! ? '], and by sliding left or right it highlights one of these characters and chooses the selected one when I release my finger. If I just click normally, it selects the default character.</p><p>Is there such a widget in the Android SDK, or can anyone give a hint on how to implement such a component.</p><p>See screenshot: Entering text, and just long pressed the ""12#"" button. ""!"" is currently selected.</p><p><img src=""http://i.stack.imgur.com/St2Io.png"" alt=""alt text""></p>","28625","","379693","","2010-11-01 05:40:54","2010-11-01 05:40:54","How to make button that shows a list of options on long click, like on the Soft Keyboard","<android><android-widget><android-sdk-2.1>","1","2","1","",""
"4064718","1","4064778","","2010-10-31 19:27:46","8","2872","<p>I noticed that a toast isn't displayed when it's used inside a catch block.Does anyone know how to show toasts when catching exceptions? An Example:</p><pre><code>try {    // try to open a file} catch (FileNotFoundException e) {    Toast.makeText(this, R.string.txt_file_not_found, Toast.LENGTH_LONG);    return; // cancel processing}</code></pre>","474326","","","","","2010-10-31 19:55:40","Toast does not display when used in catch block","<android><exception><show><toast><catch-block>","2","2","1","",""
"4064761","1","","","2010-10-31 19:36:48","0","395","<p>I want horizontal-vertical rate unchanged. How can i Do this?? my picture is rate is 320x70.</p><p>for example, in my phone(samsung galaxy-s GT-I9000) it looks like 320x100. originally I have a circle but it look ellipse... i have to fix it, but how can i do?? </p><p>its my code.`         </p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout android:background=""@drawable/main""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical"" xmlns:android=""http://schemas.android.com/apk/resandroid""&gt;  &lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical"" android:layout_weight=""5""&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical"" android:layout_weight=""3""&gt;&lt;ImageButton android:layout_weight=""1"" android:id=""@+id/menu_mycameras""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:background=""@drawable/menu_cameras"" android:cropToPadding=""true""&gt;&lt;/ImageButton&gt;&lt;ImageButton     android:paddingTop=""20px""    android:layout_weight=""1"" android:id=""@+id/menu_aboutus""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:background=""@drawable/menu_aboutus"" &gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_weight=""1"" android:id=""@+id/menu_help""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:background=""@drawable/menu_help""&gt;&lt;/ImageButton&gt;&lt;/LinearLayout&gt;</code></pre><p>`</p>","492803","","","","","2010-11-01 05:57:59","I dont want change vertical-horizontal rate...:) Circle becomes ellipse.... HELP!","<android><android-widget>","1","2","","",""
"4064806","1","","","2010-10-31 19:46:09","3","1651","<p>I am making and app on android that takes pictures using your camera, I then want to save this image to S3, but I am not sure how to do this. </p>","444021","","","","","2011-10-02 16:15:39","How do you save images to Amazon S3 from android camera?","<java><android><amazon-s3>","2","1","4","",""
"4064810","1","5951605","","2010-10-31 19:46:26","27","26531","<p>I'm working on an Android app that requires both client and server certificate authentication. I have an SSLClient class that I created that works beautifully on regular desktop Java SE 6. I've moved it into my Android project and I'm getting the following error: ""KeyStore JKS implementation not found"".</p><p>I've looked online a bit and it looks like there's a possibility that Java Keystores are not supported on Android (awesome!) but I have a feeling there's more to it than that because none of the sample code I've found resembles what I'm trying to do at all. Everything I found talks about using an http client rather than raw SSL sockets. I need SSL sockets for this application.</p><p>Below is the code in my SSLClient.java file. It reads the keystore and truststore, creates an SSL socket connection to the server, then runs a loop while waiting for input lines from the server then handles them as they come in by calling a method in a different class. I'm very interested to hear from anyone with any experience doing SSL sockets on the Android platform.</p><pre><code>import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.io.PrintWriter;import java.security.AccessControlException;import java.security.KeyManagementException;import java.security.KeyStore;import java.security.KeyStoreException;import java.security.NoSuchAlgorithmException;import java.security.UnrecoverableKeyException;import java.security.cert.CertificateException;import javax.net.ssl.KeyManagerFactory;import javax.net.ssl.SSLContext;import javax.net.ssl.SSLSocket;import javax.net.ssl.SSLSocketFactory;import javax.net.ssl.TrustManagerFactory;import otherpackege.OtherClass;import android.content.Context;import android.util.Log;public class SSLClient {    static SSLContext ssl_ctx;    public SSLClient(Context context)    {        try        {            // Setup truststore            KeyStore trustStore = KeyStore.getInstance(""BKS"");            TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());            InputStream trustStoreStream = context.getResources().openRawResource(R.raw.mysrvtruststore);            trustStore.load(trustStoreStream, ""testtest"".toCharArray());            trustManagerFactory.init(trustStore);            // Setup keystore            KeyStore keyStore = KeyStore.getInstance(""BKS"");            KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());            InputStream keyStoreStream = context.getResources().openRawResource(R.raw.clientkeystore);keyStore.load(keyStoreStream, ""testtest"".toCharArray());            keyManagerFactory.init(keyStore, ""testtest"".toCharArray());            Log.d(""SSL"", ""Key "" + keyStore.size());            Log.d(""SSL"", ""Trust "" + trustStore.size());            // Setup the SSL context to use the truststore and keystore            ssl_ctx = SSLContext.getInstance(""TLS"");            ssl_ctx.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);            Log.d(""SSL"", ""keyManagerFactory "" + keyManagerFactory.getKeyManagers().length);            Log.d(""SSL"", ""trustManagerFactory "" + trustManagerFactory.getTrustManagers().length);        }        catch (NoSuchAlgorithmException nsae)        {            Log.d(""SSL"", nsae.getMessage());        }        catch (KeyStoreException kse)        {            Log.d(""SSL"", kse.getMessage());        }        catch (IOException ioe)        {            Log.d(""SSL"", ioe.getMessage());        }        catch (CertificateException ce)        {            Log.d(""SSL"", ce.getMessage());        }        catch (KeyManagementException kme)        {            Log.d(""SSL"", kme.getMessage());        }        catch(AccessControlException ace)        {            Log.d(""SSL"", ace.getMessage());        }        catch(UnrecoverableKeyException uke)        {            Log.d(""SSL"", uke.getMessage());        }        try        {            Handler handler = new Handler();            handler.start();        }        catch (IOException ioException)         {            ioException.printStackTrace();        }     }  }//class Handler implements Runnable class Handler extends Thread{    private SSLSocket socket;    private BufferedReader input;    static public PrintWriter output;    private String serverUrl = ""174.61.103.206"";    private String serverPort = ""6000"";    Handler(SSLSocket socket) throws IOException    {    }    Handler() throws IOException    {    }    public void sendMessagameInfoge(String message)    {        Handler.output.println(message);    }    @Override    public void run()     {        String line;        try         {            SSLSocketFactory socketFactory = (SSLSocketFactory) SSLClient.ssl_ctx.getSocketFactory();            socket = (SSLSocket) socketFactory.createSocket(serverUrl, Integer.parseInt(serverPort));            this.input = new BufferedReader(new InputStreamReader(socket.getInputStream()));            Handler.output = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));            Log.d(""SSL"", ""Created the socket, input, and output!!"");            do            {                line = input.readLine();                while (line == null)                {                    line = input.readLine();                }                // Parse the message and do something with it                // Done in a different class                OtherClass.parseMessageString(line);            }            while ( !line.equals(""exit|"") );        }        catch (IOException ioe)        {            System.out.println(ioe);        }        finally         {            try             {                input.close();                output.close();                socket.close();            }             catch(IOException ioe)             {            }             finally             {            }        }    }}</code></pre><hr><p><strong>Update:</strong><br>Making some good progress on this problem. Found out that JKS is indeed not supported, neither is directly choosing the SunX509 type. I've updated my code above to reflect these changes. I'm still having an issue with it apparently not loading the keystore and truststore. I'll update as I figure out more.</p><hr><p><strong>Update2:</strong><br>I was doing my keystore and truststore file loading in a desktop Java way rather than the correct Android way. The files must be put in the res/raw folder and loaded using getResources(). I'm now getting a count of 1 and 1 for the keystore and truststore size which means they're loading. I'm still crashing on an exception, but getting closer! I'll update when I get this working.</p><hr><p><strong>Update3:</strong><br>Looks like everything is working now with the exception of my keystore being set up incorrectly. If I disable client side authentication on the server, it connects without issue. When I leave it enabled, I get a <code>handling exception: javax.net.ssl.SSLHandshakeException: null cert chain</code> error. So it looks like I'm not setting up the certificate chain correctly. I've posted another question asking how to create a client keystore in the BKS format with the proper certificate chain: <a href=""http://stackoverflow.com/questions/4065379/how-to-create-a-bks-bouncycastle-format-java-keystore-that-contains-a-client-ce"">How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain</a></p>","299262","","299262","","2010-11-18 21:06:03","2011-10-27 14:51:11","Using client/server certificates for two way authentication SSL socket on Android","<java><android><ssl>","1","0","29","",""
"4064848","1","4065073","","2010-10-31 19:58:13","11","1175","<p>The app has an intent filter to allow it to appear in the share menu in other applications via ACTION_SEND intents.  The app itself also has a share menu using ACTION_SEND and createChooser(), and my app appears in the list.  Since they are already in my app it seems strange to have them be able to share back to itself. </p><p>Is there a way for my app not to appear in the list if it's being called from my app?</p>","445348","","","","","2013-07-22 07:14:56","How to exclude your own app from the Share menu?","<android><menu><android-intent><share>","2","0","4","",""
"4064899","1","4528228","","2010-10-31 20:13:10","1","203","<p>i have an android application that can operate with or without a location. handling this case in an activity is straightforward: i set a location listener and wait with a progress dialog, but allow the wait to be aborted by the user (it so happens that if the location provider is disabled, there's no special error is just never returns the location ... nice).</p><p>however, i also have a service that requires the location. the service may run before the activity,so i can't depend on the activity to get the location (or not). </p><p>the question is how to handle this case in the service. i can wait for the location, but since i can't rely on a user abort, how do i know when to stop waiting, and assume that no location is available? it seems i could do something like,</p><ol><li>schedule service with action ""get location"", which sets the location listener, waits for updates, schedules the same service say 3 minutes later with action ""refresh""</li><li>in service action ""refresh"", get the last known location, and be happy with that. it was either obtained or not. if it's null, we know we have no location and we've done the best we can.</li></ol><p>it seems like this will work, but it's getting complicated as i can no longer use the simple intent service (i assume), because if the intent service stops itself after onHandleIntent(), then the on location changed event won't be received.</p><p>anyway, it's getting sort of complicated, so i'm wondering if there's a simpler way.</p>","337455","","337455","","2010-12-24 18:56:33","2010-12-24 20:31:52","android: handling optional location","<android><android-location>","1","0","","",""
"4064901","1","","","2010-10-31 20:13:52","9","4665","<p>Being new in Android world and advancing with joy day by day ;)I would like to share examples about common usage.</p><p>Here comes example about using SharedPreferences with generic LocalStore class.</p><p>create a common class to be used by your main activity or by any of sub-activity.</p><pre><code>    public class LocalStore {        private static final String TAG = ""LocalStore"";        private static final String PREF_FILE_NAME = ""userprefs"";        public static void clear(Context context) {            clear(context, ""unknown"");        }        public static void clear(Context context, String caller) {            Editor editor =                 context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE).edit();            editor.clear();            editor.commit();            Log.d(TAG, ""caller:""+caller + ""|clear LocalStore"");        }        public static boolean setCustomBooleanData(String key, boolean value, Context context) {        Editor editor =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE).edit();        editor.putBoolean(key, value);        return editor.commit();     }    public static boolean getCustomBooleanData(String key, Context context) {        SharedPreferences savedSession =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);        return (savedSession.getBoolean(key, false));    }    public static boolean setCustomStringData(String key, String value, Context context) {        Editor editor =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE).edit();        editor.putString(key, value);        return editor.commit();     }    public static String getCustomStringData(String key, Context context) {        SharedPreferences savedSession =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);        return (savedSession.getString(key, null));    }    public static boolean isCustomStringExistInLocal(String customKey, Context context) {        SharedPreferences savedSession =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);        return (savedSession.getString(customKey, null))==null?false:true;    }public static boolean saveObject(String objKey, Serializable dataObj, Context context) {        Editor editor =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE).edit();        editor.putString(objKey, ObjectSerializer.serialize(dataObj) );        Log.d(TAG, ""savedObject| objKey:""+objKey+""/"" + dataObj.toString());        return editor.commit();     }    public static Object getObject(String objKey, Context context) {        SharedPreferences savedSession =            context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);        Object dataObj = ObjectSerializer.deserialize(savedSession.getString(objKey, null));        return dataObj;    }    }</code></pre><p>Note: You can use ObjectSerializer from <a href=""http://github.com/apache/pig/blob/89c2e8e76c68d0d0abe6a36b4e08ddc56979796f/src/org/apache/pig/impl/util/ObjectSerializer.java"" rel=""nofollow"">here</a> </p><p>Enjoy!</p><p>Additional update: I implemented a library to use MEMDISKCACHE and SHAREDPREF as GENERIC_STOREanyone interested can use it from<br>-> <a href=""https://github.com/wareninja/generic-store-for-android"" rel=""nofollow"">https://github.com/wareninja/generic-store-for-android</a></p>","492918","","492918","","2011-02-14 20:28:49","2013-03-18 22:06:23","How to use SharedPreferences as LocalStore, in more generic way?","<android><sharedpreferences>","1","5","2","",""
"4064937","1","","","2010-10-31 20:24:05","4","8962","<p>I try to write my first widget application and i got a problem. So, i have 2 arrows: switch to left and switch to right. For both of them I want to use a single Service, which changes the view of my homescreen widget according direction of arrow. For distinguish the direction of arrow i put an extra data to each intent i use. This is my sample code:</p><pre><code>    RemoteViews remoteViews =     new RemoteViews(context.getPackageName(),      R.layout.presentation_layout); Intent updateServiceIntent1 = new Intent(context, UpdateService.class); updateServiceIntent1.putExtra(""com.mycompany.direction"", 1); PendingIntent updateServicePendingIntent1 =     PendingIntent.getService(context, 0, updateServiceIntent1,      PendingIntent.FLAG_UPDATE_CURRENT); //Action when we touch left arrow remoteViews.setOnClickPendingIntent(R.id.left,  updateServicePendingIntent1); Intent updateServiceIntent2 = new Intent(context, UpdateService.class); updateServiceIntent2.putExtra(""com.mycompany.direction"", 0); PendingIntent updateServicePendingIntent2 =     PendingIntent.getService(context, 0, updateServiceIntent2,      PendingIntent.FLAG_UPDATE_CURRENT); //Action when we touch right arrow remoteViews.setOnClickPendingIntent(R.id.right,  updateServicePendingIntent2); ComponentName thisWidget =     new ComponentName(context, HelperWidget.class); AppWidgetManager manager = AppWidgetManager.getInstance(context); manager.updateAppWidget(thisWidget, remoteViews);</code></pre><p>In Service I do the next:</p><pre><code>@Override    public void onStart(Intent intent, int startId) {   Log.i(TAG, ""direction "" + intent.getIntExtra(""com.mycompany.direction"", -1) + """");}</code></pre> <p>So, in debug i always got <strong>direction 0</strong>. But i want to get <strong>direction 1</strong> when i touch left arrow and <strong>direction 0</strong> when i touch right arrow.Could you help me in this problem? Thanks.</p>","474489","","474489","","2010-10-31 20:30:21","2010-11-21 20:45:18","RemoteViews and setOnClickPendingIntent","<android><android-widget><android-intent><android-pendingintent>","0","3","1","2014-03-24 15:53:25",""
"4064980","1","","","2010-10-31 20:37:16","0","397","<p>I have heard that the iPhone does not support dynamic linking.  I want to know whether any mobile platforms support dynamic linking, such as Android or BlackBerry?</p>","482379","","75204","","2010-11-01 02:06:50","2011-04-26 13:47:16","Dynamic linking on mobile platforms","<iphone><android><cocoa-touch><blackberry>","3","3","","",""
"4065036","1","","","2010-10-31 20:49:29","1","1296","<p>Does anyone know how I should layout my app for phones with the same screen as the Samsung. My app displays perfectly on small and normal densitys but for some reason the buttons are slightly higher on hdpi screens and I have to tap above them to get them to work... its very annoying.</p><p>Im trying to find out what the DPI size etc is so I can adjust it but im not having any luck... any ideas?</p><p>Thanks in advance</p>","492994","","171676","","2011-03-25 17:02:11","2011-03-25 17:02:11","Screen Layout for Samsung Galaxy S (480 x 854) Problem","<android><screen><dpi>","0","2","","",""
"4065132","1","4065384","","2010-10-31 21:08:14","1","4529","<p>I've been trying to create a RelativeLayout with a header, body (list) and footer.I want the header to be above everything (aligned to top), the body (list) to be under the header (when scrolling) and the footer (aligned to bottom) to be above the body (list) - only when it's visible.</p><p>I've managed to do so PERFECTLY when it comes to how things look but apparently the XML layout is the cause to the issues I've been having when clicking on listItems (<a href=""http://stackoverflow.com/questions/4010623/android-click-on-listitem-checks-wrong-checkbox"">see here</a>, <a href=""http://stackoverflow.com/questions/4019308/android-list-getcheckeditempositions-always-returns-null"">and here</a>).</p><p>In order to solve the issues, I had to wrap the ListView with LinearLayout and put it between the header and the footer (in the XML).This solves the listItems clicking issues BUT creates a new issue - the footer hides the last ListView item, even though the list does go under the header when scrolling it down.</p><p>I'm pretty much desperate here :\</p><p><strong>This is the XML which creates the perfect layout but causes the List Item clicking issues:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:background=""#ffffff""    &gt;    &lt;RelativeLayout        android:background=""@drawable/top_background""        android:layout_width=""fill_parent""        android:layout_height=""50dip""        android:id=""@+id/top_control_bar""        &gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""Droidmarks""            android:layout_alignParentLeft=""true""            android:layout_toLeftOf=""@+id/add_bookmark""            android:textSize=""20dip""            android:textColor=""#a0cb26""            android:shadowColor=""#7a9b1b""            android:shadowRadius=""5""            android:layout_marginLeft=""5dip""            android:gravity=""left|center"" /&gt;        &lt;Button            android:id=""@+id/add_bookmark""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""right|center""            android:layout_alignParentRight=""true""            android:text=""Add""        /&gt;    &lt;/RelativeLayout&gt;    &lt;LinearLayout        android:id=""@+id/bottom_control_bar""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:background=""@drawable/top_background""        android:visibility=""invisible""        &gt;        &lt;Button            android:id=""@+id/test""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""right|center""            android:layout_alignParentRight=""true""            android:text=""Add""        /&gt;    &lt;/LinearLayout&gt;    &lt;ListView        android:id=""@android:id/list""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/top_control_bar""        android:layout_above=""@id/bottom_control_bar""        android:drawSelectorOnTop=""false""        android:focusable=""false""        android:focusableInTouchMode=""false""        android:cacheColorHint=""#ffffff""        android:listSelector=""@drawable/selected_item""        /&gt;    &lt;TextView android:id=""@android:id/empty"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""No Bookmarks found. You can add one by clicking the star.""        android:layout_below=""@id/top_control_bar"" android:layout_above=""@id/bottom_control_bar"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p><strong>This is the XML which hide the last List Item but solves the clicking issues:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:background=""#ffffff""    &gt;    &lt;RelativeLayout        android:background=""@drawable/top_background""        android:layout_width=""fill_parent""        android:layout_height=""50dip""        android:id=""@+id/top_control_bar""        android:layout_alignParentTop=""true""        &gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""Droidmarks""            android:layout_alignParentLeft=""true""            android:layout_toLeftOf=""@+id/add_bookmark""            android:textSize=""20dip""            android:textColor=""#a0cb26""            android:shadowColor=""#7a9b1b""            android:shadowRadius=""5""            android:layout_marginLeft=""5dip""            android:gravity=""left|center"" /&gt;        &lt;Button            android:id=""@+id/add_bookmark""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""right|center""            android:layout_alignParentRight=""true""            android:text=""Add""        /&gt;    &lt;/RelativeLayout&gt;    &lt;LinearLayout        android:id=""@+id/listArea""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:layout_below=""@id/top_control_bar""        &gt;        &lt;ListView            android:id=""@android:id/list""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:drawSelectorOnTop=""false""            android:cacheColorHint=""#ffffff"" /&gt;        &lt;TextView android:id=""@android:id/empty"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""No Bookmarks found. You can add one by clicking the star."" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:id=""@+id/bottom_control_bar""        android:layout_above=""@id/listArea""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:background=""@drawable/top_background""        android:orientation=""horizontal""        android:visibility=""visible""        &gt;        &lt;Button        android:id=""@+id/test""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""right|center""        android:layout_alignParentRight=""true""        android:text=""Add""    /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I'd appreciate any help to somehow find a solution for both issues!</p><p>Thank you!</p>","444324","","","","","2010-11-01 19:57:15","Android: XML Layout problems","<android><android-listview><android-xml>","1","0","","",""
"4065134","1","14678910","","2010-10-31 21:08:16","15","16225","<p>Using WebViewClient and/or the WebChromeClient you can get a listener for when the page has loaded, however this is sometimes called before the WebView has any content in it, before it has displayed anything.</p><p>What would be a efficient method for determining when the WebView has displayed it's content?</p><p>Edit: (Trying to be more clear)</p><p>When I load a page in a WebView, I want to set the scroll to a specific position.  It seems that the scroll position cannot be set until the page is loaded and it has an actual content height.  So, I have tried two different approaches to determining when the page has finished loading, onPageFinished() from the WebViewClient and also onProgressChanged() from the WebChromeClient.  Both of these tell me when the page has finished loading.</p><p>However, the problem is that sometimes it is called before the page has been displayed and therefore the page has no height and the scroll call does nothing.</p><p>I am trying to find a solid way to determine when the page is ready to be scrolled, ie. when it has its content height.</p><p>I imagine I could setup a checking loop after it finished loading to keep looking for when the height is available but that seemed like quite the hack.  Hoping there is a cleaner way.</p>","445348","","445348","","2010-11-04 06:45:21","2013-12-15 07:26:04","Is there a listener for when the WebView displays it's content?","<android><events><webview><listener>","8","0","10","",""
"4065149","1","","","2010-10-31 21:10:23","1","2828","<p>I'm looking for a way to calculate the size of an installed Android application/package. I can't find this information in neither ApplicationInfo nor PackageInfo objects. From the ApplicationInfo I can get the path for the data and the app itself. Data is a directory structure, but when attempting to read it recursivly I get a nullpointer. Is there any better way of doing it? Any sample code?</p>","493010","","","","","2013-09-03 11:38:22","Android, get app size","<android>","1","0","","",""
"4065201","1","4065872","","2010-10-31 21:21:13","0","1721","<p>Is there a way to draw on or modify the key guard wallpaper programmatically?</p><p>It looks simple enough for the home wallpaper, you can use WallpaperManager. But how about for the lock screen wallpaper? I would like to draw some text there.</p>","493014","","","","","2011-02-18 16:28:13","Android: How can I programmatically draw text on key guard screen / lock screen?","<android><wallpaper>","1","0","","",""
"4065219","1","4065240","","2010-10-31 21:26:13","2","5425","<p>I've implemented a Service in my android app that starts a timer (using the standard java.util.Timer and java.util.TimerTask mechanism) to do some processing in the background on a pre-defined interval. </p><pre><code>public class BackgroundProcessingService extends Service {private int interval;private Timer timer = new Timer();public void onCreate() {    super.onCreate();    startTimer();}@Overridepublic void onDestroy() {    timer.cancel();    super.onDestroy();}public int getInterval() {    return interval;}public void setInterval(int interval) {    this.interval = interval;}private void startTimer() {    timer.scheduleAtFixedRate( new TimerTask() {        public void run() {            // perform background processing                }    }, 0, getInterval());    ; }@Overridepublic IBinder onBind(Intent intent) {    return null;}</code></pre><p>}</p><p>The service is started / stopped by my application like this.</p><pre><code>backgroundProcessingService = new Intent(getApplicationContext(), BackgroundProcessingService .class);startService(backgroundProcessingService);</code></pre><p>As long as the phone is active (no screen-timeout occured), the service is running fine, and the Timer is performing its job at the defined interval. Even when I quit the application (using the back button), the timer remains active. </p><p>However, as soon as the phone goes into timeout, the timer task is no longer running stable. If I leave the phone in timeout for several hours (at night), I would see that on random occasions (sometimes a several hours interval) the timer kicked in.</p><p>Also, when the phone is activated again, all timer runs that have been queued are suddenly executed in one shot before resuming back to the normal interval.</p><p>What would be the right way of implementing a timer that continues to run properly, even after the phone has gone into timeout. Should I resort to using the PowerManager and WAKE_LOCKS (as described here <a href=""http://code.google.com/android/reference/android/os/PowerManager.html"" rel=""nofollow"">http://code.google.com/android/reference/android/os/PowerManager.html</a>), or is there another mechanism ?</p>","492410","","","","","2011-11-22 10:21:28","Implementing a timer in Android that's active all the time (even during screen timeout)","<android><service><timer><timeout>","1","1","","",""
"4065312","1","4075955","","2010-10-31 21:48:04","5","15435","<p>I'm not highly familiar with javascript but I think this is the best way to accomplish my purpose. If not, please correct me.  </p><p>I have a licence text 2 buttons at the end. All of this is written in HTML in a <code>WebView</code> because there are some links in the licence. Now, I want that when the user clicks the ""ok"" button in the <code>WebView</code>, this triggers some javascript or listener that I can grab in Java to fire an <code>Intent</code> to go forward in the application. (The cancel button would do the opposite, but if I know how to do one, I can do the other. ;) )</p><p>Does this rings any bell to someone?Any explanation or sample code is welcome.</p>","263521","","92837","","2011-09-12 06:17:39","2014-03-09 18:46:25","Detect click on HTML button through javascript in Android WebView","<javascript><android><click><webview>","3","0","10","",""
"4065314","1","4065661","","2010-10-31 21:48:17","0","597","<p>I've created a simple application and put it onto my device.</p><p>I use a file browser to locate the APK, it installs successful and I can run it OK (when clicking ""run"" after install completes)</p><p>However, if I then exit the application, I'm unable to see a launcher for it on my apps menu (where I would expect it, like other apps I've created)</p><p>At the moment, every time I want to run the app, I first have to re-install it so I can access it, surely there must be a better way?</p><p>Manifest attached</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.jameselsey""      android:versionCode=""1""      android:versionName=""1.0""      &gt;    &lt;application android:icon=""@drawable/globe"" android:label=""@string/app_name""     android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;activity android:name="".GeoCodeTest""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre>","155695","","","","","2010-10-31 23:11:20","Android; App installs and runs OK, but when I exit I can't find its launcher icon in menu","<android><android-2.1-eclair><android-install-apk>","1","0","","",""
"4065379","1","10026598","","2010-10-31 22:05:46","17","35540","<p>I'm writing an Android app that requires SSL client authentication. I know how to create a JKS keystore for a desktop Java application, but Android only supports the BKS format. Every way I've tried to create the keystore results in the following error:<br><code>handling exception: javax.net.ssl.SSLHandshakeException: null cert chain</code></p><p>So it looks like the client is never sending a proper certificate chain, probably because I'm not creating the keystore properly. I'm unable to enable SSL debugging like I can on the dekstop, so that's making this much more difficult than it should be.</p><p>For reference the following is the command that IS working to create a BKS <strong>truststore</strong>:<br><code>keytool -importcert -v -trustcacerts -file ""cacert.pem"" -alias ca -keystore ""mySrvTruststore.bks"" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath ""bcprov-jdk16-145.jar"" -storetype BKS -storepass testtest</code></p><hr><p>Here is the command I've tried that is NOT working to create a BKS client <strong>keystore</strong>:</p><pre><code>cat clientkey.pem clientcert.pem cacert.pem &gt; client.pemkeytool -import -v -file &lt;(openssl x509 -in client.pem) -alias client -keystore ""clientkeystore"" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath ""bcprov-jdk16-145.jar"" -storetype BKS -storepass testtest</code></pre>","299262","","299262","","2010-11-17 02:09:09","2013-12-04 06:18:04","How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain","<java><android><ssl>","6","1","22","",""
"4065491","1","4065515","","2010-10-31 22:29:40","1","933","<p>I am building a android aplication which will be consuming a json file from the internet. This json file contains a list of news from a particular website. Each json object contains information such like title, summary, descripition and web links for the news thumbnail and the original image.</p><p>I will be displaying in a listview three information: the news thumbnail, the title and the summary. Here resides my problem. I dont want to load all thumbnails from the internet if they wont be displayed. What I am trying to say is that why download a thumbnail from the 30th news if the user wont scroll down the image. So, i will, initially only download the thumnails from those news that are being displayed in the screen and when the user scrolls down to see more news, as soon as the list item appers to the screen i want to download the image and then display.</p><p>Is there a way to achieve this? Is it possible to find out if the list item is on the screen? I have been searching all over the internet for a solution for this but i am running out of ideas.</p><p>ThanksT</p>","491604","","","","","2010-10-31 22:36:08","How to display images on demand inside a listview?","<android><android-sdk-2.1>","1","0","","",""
"4065502","1","8855827","","2010-10-31 22:32:40","7","1262","<p>Is there something similar to setting <code>-D javax.net.debug=ssl</code> at the command line for Java desktop applications, but for the Android? I've tried setting it in code via <code>System.setProperty(""javax.net.debug"", ""ssl"");</code> but that didn't work.</p><p>If there isn't a way to enable this property, is there at least another way to debug the client side of an SSL connection?</p><p><strong>EDIT:</strong> Just to clarify, this is referring to raw SSL sockets (SSLSocket and SSLSocketFactory), not the Apache library or any other network library.</p>","299262","","299262","","2011-03-17 18:45:09","2012-01-13 19:06:49","How to enable SSL debugging on the Android platform?","<java><android><ssl>","2","1","2","",""
"4065566","1","4570284","","2010-10-31 22:48:23","1","1829","<p>I'm using the below code to put an overlay on my MapView. For some reason after itterating through the location data it draws the point in the same place.</p><p>It seems to be happening on conversion from Location to GeoPoint to Projection:</p><pre><code>Location (lat : lon) 51.2651789188385  : -0.5398589372634888Projection (x : y)   239               : 361Location (lat : lon) 51.26375198364258 : -0.5417096614837646Projection (x : y)   239               : 361</code></pre><p>Locations are DoublesGeoPoints are IntegersProjections are screen coordinates.</p><p>Could someone please look over the below code and find if i am doing something wrong?</p><p>thanks</p><p><code></p><pre>import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Point;import android.graphics.RectF;import android.location.Location;import android.util.Log;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;import com.google.android.maps.Projection;public class ROverlay extends Overlay {  private Context context;  private HashMap&lt;String, Location&gt; friendLocations;  private ArrayList&lt;LocationData&gt; locD;  private Location location;  private GeoPoint locationPoint;  private Paint paint;  private Paint backPaint;  private static int markerRadius = 7;  /** Get your current location */    public Location getLocation() {        return location;}/** Set your current location */public void setLocation(Location location) {  this.location = location;  Double latitude = location.getLatitude()*1E6;  Double longitude = location.getLongitude()*1E6;  locationPoint = new GeoPoint(latitude.intValue(),longitude.intValue());      }  /** Refresh the locations of each of the contacts */ public void refreshLocation() {  locD = RMapView.getARR(); }   /** * Create a new FriendLocationOverlay to show your contact's locations on a map * @param _context Parent application context */public ROverlay(Context _context) {super();context = _context;friendLocations = new HashMap&lt;String, Location&gt;();locD = new ArrayList&lt;LocationData&gt;();//refreshFriendLocations();// Create the paint objectsbackPaint = new Paint();backPaint.setARGB(200, 200, 200, 200);backPaint.setAntiAlias(true);paint = new Paint();paint.setDither(true);paint.setColor(Color.RED);paint.setStyle(Paint.Style.STROKE);paint.setStrokeJoin(Paint.Join.ROUND);paint.setStrokeCap(Paint.Cap.ROUND);paint.setStrokeWidth(5);    }@Overridepublic void draw(Canvas canvas, MapView mapView, boolean shadow) {    // Get the map projection to convert lat/long to screen coordinatesProjection projection = mapView.getProjection();for (int q = 1; q &lt; locD.size(); q++){    Double latitude = locD.get(q-1).mLocation.getLatitude()*1e6;    Double longitude = locD.get(q-1).mLocation.getLongitude()*1e6;    GeoPoint geopoint = new GeoPoint(latitude.intValue(),longitude.intValue());    //Log.d(""Double"", """"+latitude+"" : ""+longitude);    //Log.d(""Geopoint"", """"+geopoint.getLatitudeE6()+"" : ""+geopoint.getLongitudeE6());    Point point = new Point();    projection.toPixels(geopoint, point);    Double latitude2 = locD.get(q).mLocation.getLatitude()*1e6;    Double longitude2 = locD.get(q).mLocation.getLongitude()*1e6;    GeoPoint geopoint2 = new GeoPoint(latitude2.intValue(),longitude2.intValue());    Point point2 = new Point();    projection.toPixels(geopoint2, point2);     canvas.drawLine(point.x, point.y, point2.x, point2.y, paint);    canvas.drawPoint(point.x, point.y, paint);    Log.d(""Point"", """"+point.x+"" : ""+point.y);}super.draw(canvas, mapView, shadow);}@Overridepublic boolean onTap(GeoPoint point, MapView mapView) {  // Do not react to screen taps.  return false;}}&lt;/code&gt;</code></pre>","381258","","","","","2012-06-27 09:11:37","Android MapView Projection returning negative numbers","<android><gps><overlay><android-mapview><projection>","2","0","","",""
"4065632","1","4299162","","2010-10-31 23:05:55","0","2299","<p>I have developed a compass based on this example: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html</a></p><p>Since my app only operates in landscape mode so will the compass. However, it seems as this code does not function correctly in landscape mode. North points more towards east. If i run the Android example code I get the same issue.</p><p>Has anyone else noticed this and even better does anyone have a solution?</p><p>By the way, I am testing this on a Nexus One. Not sure if this is a phone related issue.</p><p>Best regards</p><p>P</p>","274426","","","","","2010-11-28 21:24:44","Android compass example does not seem to work in landscape mode","<android><compass-geolocation>","1","0","1","",""
"4065638","1","7053365","","2010-10-31 23:07:10","2","2177","<p>I have hooked in a ScaleGestureDetector to an OnTouchListener as instructed in Android documentation. For some reason the ScaleGestureDetector does not always detect end of a pinch gesture. This happens mostly when pinching fast from large to small. </p><p>The effect is that after I have released both fingers the detector does not fire the gesture end event. If I touch the screen with one afterwards it still thinks I'm continuing the scale gesture (keeps firing onScale events). I have to do another gesture to get the detector to fire end event.</p><p>I have added logs to the OnTouchListener and when the scale gesture gets stuck I still get motion events normally when using one finger and event.getPointerCount() is 1. </p><p>I have made sure that I don't have any other listeners intervening. View that has the onTouchListener is not the only view on screen but this effect happens also when I'm very careful to begin and end the gesture inside this one view.</p><p>Is there any way to improve the end detection?</p><p>Or if there a way for me to manually set the ScaleGestureDetector to fire onScaleEnd and change scaleGestureDetector.isInProgress() to false?</p><p>Thank you! Help very much appreciated! </p><p>Juhani</p>","422863","","","","","2011-08-13 21:23:43","ScaleGestureDetector not detecting gesture end","<android><multi-touch><gesture-recognition>","2","2","1","",""
"4065648","1","5755052","","2010-10-31 23:09:24","2","302","<p>I have a query that does some magical sort-group-joining that works just fine on Android 2.2 (froyo) version of SQLite:</p><pre><code>SELECT channels.*, p.*FROM channels LEFT JOIN programs p ON channels._id = p.channel_idJOIN (select p2.channel_id, max(p2.airdate) max_air FROM programs p2       GROUP BY p2.channel_id) pjON pj.channel_id = p.channel_id AND pj.max_air = p.airdateORDER BY channels.channel_index asc;</code></pre><p>For some reason, the join doesn't work with Android 2.1 but fails with </p><pre><code>no such column: pj.channel_id</code></pre><p>I reckon this is because SQLite has been upgraded from 2.1 to 2.2, but what would be the proper SQL that works for both versions?</p>","258196","","","","","2011-04-22 11:41:59","How to use selects in join clauses in Android 2.1?","<android><sqlite><greatest-n-per-group>","1","0","1","",""
"4065818","1","4481595","","2010-10-31 23:49:25","7","3566","<p>The question is easy :)</p><p>I want to start a youtube video from a defined starting position.</p><p>In a regular browser, you can achieve this by appending a #t=1m20s at the end of the url like in:</p><p><a href=""http://www.youtube.com/watch?v=HKdsra1O20Y#t=30m10s"" rel=""nofollow"">http://www.youtube.com/watch?v=HKdsra1O20Y#t=30m10s</a></p><p>But If I use that URL in the Intent, the Android player is not putting the start at that point.</p><p>I'm using this to launch the activity:</p><pre><code>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.youtube.com/watch?v=HKdsra1O20Y#t=30m10s"")));</code></pre><p>But the video starts from the begining :(</p><p>Thanks</p>","110009","","65977","","2010-12-18 19:50:50","2010-12-19 04:28:32","Using Youtube Intent to launch a video from a defined starting point","<android><youtube><android-intent>","1","2","2","",""
"4065886","1","4066172","","2010-11-01 00:11:03","0","268","<p>Once again I've hit a brick wall when debugging my android application.</p><p>This problem usually manifests when you have errors in the startup code of your activity.</p><p>In this case, somewhere after the constructor of my custom SurfaceView class I get presented with this worthless text:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception RuntimeException))      ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2596      ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2621       ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 126     ActivityThread$H.handleMessage(Message) line: 1932      ActivityThread$H(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4603        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>Which of course doesn't have anything to do with my code.</p><p>I've even tried to stepping through each line of my code, but this error happens somewhere in between the method calls.</p><p>I'm sure this is a simple error, but the fact that the debugger acts like this is a major annoyance and I know for a fact I will hit more of these errors.</p><p>Thanks.</p><p>Edit:</p><p>I found the problem. A simple null reference. The question remain though, why couldn't the debugger show me this nullpointerexception?</p>","242348","","242348","","2010-11-01 00:18:04","2010-11-02 23:29:41","Why can't the android debugger provide useful info?","<android><debugging>","3","0","","",""
"4065954","1","4067214","","2010-11-01 00:41:18","1","681","<p>Is it possible to change the discrete zoom in android Mapview to continuous? At the moment, if you zoom in with gestures, you actually zoom in steps, as the zoom always bounces back to a certain zoom level.</p><p>In iPhone e.g. the zoom level is more continuous, because before loading the new tiles of the next zoom level, it just scales the current tiles, and you can stop zooming anywhere between zoom level n and n+1. Android bounces back to either n or n+1.</p><p>Thanks.</p><p>EDIT: maybe I can do it manually with scale gestures? Might be a pain though..</p>","479103","","479103","","2010-11-01 00:48:09","2010-11-01 07:23:27","Disable MapView discrete zoom, change to continuous","<android><zoom><android-mapview>","1","0","","",""
"4065973","1","4066043","","2010-11-01 00:45:36","0","395","<p>I am getting the following error when I try running my program in the emulator:</p><p>emulator: ERROR: the user data image is used by another emulator. aborting`</p><p>Any idea on how to fix this?</p><p>Thanks!</p>","479180","","","","","2010-11-01 01:07:53","Emulator error: user data image is used by another emulator","<java><android>","1","0","","",""
"4065982","1","4066207","","2010-11-01 00:47:42","0","142","<p>I am still trying to understand now android layouts work. I am developing an application for displaying soccers results for a brazilian championship. I will have a list view for displaying the last game scores, like the image in the url below (extracted from an iphone aplication).</p><p><a href=""http://grem.io/images/score.jpg"" rel=""nofollow"">http://grem.io/images/score.jpg</a></p><p>I cant see how i can do this. I also need to say that i am a trully beginner on this.</p><p>ThanksT</p>","491604","","","","","2010-11-01 01:56:16","Help with layouting game scores in android","<android>","1","0","","",""
"4066177","1","","","2010-11-01 01:47:35","0","233","<p>I'm trying to develop side scrolling game for android involving many many textures so I was thinking if I could create a separate layer, all a single unique color (very similar to a green screen effect) make a collidable and make it invisible to the player.</p><p>(foreground layer) visual Image </p><p>(2nd layer)collidable copy of foreground layer with main character</p><p>(3rd layer)Background image</p><p>I not sure if this is possible or how to implement it efficiently, the idea just came to me randomly one day.</p><p>Future regards, Thanks</p>","493136","","","","","2010-11-03 11:45:48","Collidable color Java/Android game","<java><android>","1","0","","",""
"4066244","1","4066354","","2010-11-01 02:05:39","2","5460","<p>I've been trying to use SoundPool to play the default ringtone without success. In the code below</p><pre><code>String ringtone = Settings.System.DEFAULT_RINGTONE_URI.getPath();SoundPool ringPhone = new SoundPool(2, AudioManager.STREAM_RING, 1);int soundID = ringPhone.load(Settings.System.DEFAULT_RINGTONE_URI.getPath(), 1);int soundID = ringPhone.load(ringtone, 1);ringPhone.play(soundID, 0.99f, 0.99f, 1, 0, 1);</code></pre><p>I get the message ""error loading content /system/ringtone sample 0 not READY"". Replacing the URI with a hard path to an existing mp3 file on the sd card yields similar results. </p><p>What am I doing wrong? Thanks,</p><p>kyle</p>","493144","","19750","","2010-11-01 02:17:21","2013-03-16 20:14:21","Playing default ringtone","<android><ringtone><soundpool>","1","0","1","",""
"4066438","1","4066497","","2010-11-01 03:13:05","33","23324","<p>So right now in my app the URL I'm accessing has a redirect, and when this happens the WebView will open a new browser, instead of staying in my app. Is there a way I can change the settings so the View will redirect to the URL like normal, but stay in my app instead of opening a new browser?</p><p>Edit:</p><p>I want the redirecting URL, I just don't know how to create it, so the only way to get to that URL is through one that will cause a redirect to the one I want. </p><p>For example: When you go here: <a href=""http://www.amazon.com/gp/aw/s/ref=is_box_/k=9780735622777"">http://www.amazon.com/gp/aw/s/ref=is_box_/k=9780735622777</a> notice how it will redirect the URL to the actual product. In my app, if I open it in a new browser, it will do that just fine, however if I keep it in my app with a WebView, it will show up as though it's doing a search for k=9780735622777, like this: <a href=""http://www.amazon.com/gp/aw/s/ref=is_s_?k=k%3D9780735622777&amp;x=0&amp;y=0"">http://www.amazon.com/gp/aw/s/ref=is_s_?k=k%3D9780735622777&amp;x=0&amp;y=0</a> . OR, it will open the view in the browser and show what is appropriate. However, I want to keep everything in my app.</p>","325400","","2571762","","2013-07-11 08:48:59","2013-11-29 15:58:15","Android WebView, how to handle redirects in app instead of opening a browser","<android><android-webview>","2","0","18","",""
"4066650","1","","","2010-11-01 04:32:03","0","758","<p>A number of images are ""built in"" to my app. They are stored in the drawable folder. I'd like to give the option of sending one of these images via mms (or even email) to someone in the user's address book. All the examples I've seen are sending images that are stored somewhere other then the default Eclipse drawable folders.</p><p>I've looked over the answers regarding MMS. It looks like this should be simple, but I don't understand how to do it. Is it that I first must copy an image from the default location to where other apps can see it? Any sample code would be appreciated. Thanks! </p>","471230","","471230","","2010-11-01 04:42:52","2010-11-01 04:42:52","Send an image (stored in drawable) via MMS","<android>","1","0","","",""
"4066658","1","4079431","","2010-11-01 04:34:20","0","529","<p>I want to have multiple launcher icons for my application.  I can get this to work fine on some phones simply by adding the following to the Activity definitions</p><pre><code>  &lt;intent-filter&gt;    &lt;action      android:name=""android.intent.action.MAIN"" /&gt;    &lt;category      android:name=""android.intent.category.LAUNCHER"" /&gt;  &lt;/intent-filter&gt;</code></pre><p>Unfortunately this doesn't appear to work for HTC Sense phones - I just get the first Activity declared like this.</p><p>Anyone know how to do this for HTC Sense too?</p><p>Phil</p>","405814","","","","","2010-11-02 15:48:57","One application, two launcher icons on HTC Sense phones","<android><launcher><htcsense>","1","0","","",""
"4066664","1","4066692","","2010-11-01 04:36:54","2","3824","<p>I want to move an image from 0,0 to 100,100 on android. I'm using translate animation to do so:</p><pre><code>public void moveImage() {    // move image from 0,0 to 100,100    mAnimationTranslate = new TranslateAnimation(0, 100, 0, 100);    mAnimationTranslate.setDuration(1000);    mAnimationTranslate.setAnimationListener(this);    this.startAnimation(mAnimationTranslate);}public void onDraw (Canvas canvas) {    super.onDraw(canvas);    canvas.drawBitmap(bmp, x, y, null);}public void onAnimationEnd(Animation animation) {    // stop animation and draw the image at 100,100    x = 100;    y = 100;}</code></pre><p>The problem is when the animation finishes at 100,100, the image will move to 200,200 for a short time and back to 100,100 in the end. Is there any problem in my code? How to let the image stop at 100,100 correctly?</p>","67391","","","","","2012-10-09 11:11:24","Problem on moving an image using translate animation on android","<android><animation>","2","0","2","",""
"4066747","1","","","2010-11-01 05:03:55","0","472","<p>I visited some forums and downloaded source code for Bluetooth,wifi,etc API's..I was interested in viewing source code for classes like ServiceManager.java and classes in java.nio.channels, java.security packages present in android.jar ..</p><p>I had used the following command to download the source (in windows) which i currently have :</p><p>git clone git://git.source.android.com/platform/frameworks/base</p><p>Can anyone please help me out ?</p><p>Thanks,Adithya</p>","493220","","184046","","2011-02-05 06:25:22","2011-02-05 06:28:50","Android source (complete)","<android><android-source>","1","0","","",""
"4066815","1","4066828","","2010-11-01 05:28:13","1","401","<p>I get an error at adapter.getFilter().filter(s) in the onTextChanged() function. I was following this - <a href=""http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android"">http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android</a> - to creater a filterable List inside a Dialog.</p><pre><code>public class CustomizeDialog extends Dialog implements OnClickListener {private final String[] cityList = {""Seattle"", ""London""}; private EditText filterText = null;ArrayAdapter&lt;String&gt; adapter = null;public CustomizeDialog(Context context) {    super(context);    /** Design the dialog in main.xml file */    setContentView(R.layout.main);    filterText = (EditText) findViewById(R.id.EditBox);    filterText.addTextChangedListener(filterTextWatcher);    this.setTitle(""Select"");    list = (ListView) findViewById(R.id.List);    list.setAdapter(new ArrayAdapter&lt;String&gt;(context, android.R.layout.simple_list_item_1, cityList));}@Overridepublic void onClick(View v) {    /** When OK Button is clicked, dismiss the dialog */}private TextWatcher filterTextWatcher = 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) {        adapter.getFilter().filter(s);    }};}</code></pre>","481239","","106224","","2010-11-01 05:31:53","2010-11-01 05:31:53","Can anyone please help me correct this code?","<java><android><listview><filter>","1","0","","",""
"4066877","1","4066955","","2010-11-01 05:46:40","5","5280","<p>Hey, I'm learning C# and just thought of a cool idea.  Considering that a game was simple enough.  Say, a remake of a classic text-entry style game, a C# game could theoretically be ported to all of the platforms I listed above, with little to no change of the original source code, correct?</p><p>Obviously the UI would have to be tweaked, and I highly doubt such a game would really survive on each of those platforms!</p><p>But, although C# is really MS heavy, through different methods, that could work, right?  Or, would I have to change the C# source to Objective-C?  Does Android even have an official language that they support like Apple and MS do?</p><p>This is kind of an odd question, but if this is true, then C# is really a nice all-purpose language even though it's largely based on and endorsed by MS.</p>","403965","","424723","","2010-11-01 23:02:18","2010-11-01 23:02:18","One C# game to rule them all(iOS, Android, WP7, W7, Mac OS X and XBOX)","<c#><android><windows><ios><windows-phone-7>","5","5","2","",""
"4066925","1","4068349","","2010-11-01 06:01:43","0","2312","<p>I need to create a app in which I have to show list of word files(.doc,.docx).Clicking on that file it should open up.</p><p>can anyone help ?</p><p>Like Dropbox in android.</p><p>I m new to android.</p>","396473","","94687","","2013-04-18 22:19:49","2013-04-29 11:05:39","How to create file chooser in Android?","<android><filechooser>","1","0","","",""
"4066980","1","4851270","","2010-11-01 06:18:46","1","668","<p>I developed j2me based application with LWUIT framework.Is it possible to change the this application to android based application?Or can i need to create new project?</p>","488433","","488433","","2011-01-22 04:53:09","2011-03-18 14:52:57","Is it possible to change j2me application to android application?","<android><java-me><lwuit>","3","0","","",""
"4067041","1","","","2010-11-01 06:34:48","0","198","<p>I have Integrated Facebook in my Application.Take a FACEBOOK API from GithubBut I don't want to display dialog box to Publish string on wall Post.</p><pre><code>facebook.dialog(this, ""stream.publish"", parameters,new WallPostDialogListener());</code></pre><p>What should I do in palce of this ...that dialog box will not come &amp; After login I can Post on a Wall of Facebook..</p><p>Pls help me in this regard.</p><p>Thanks</p>","493263","","","","","2010-11-01 06:51:55","FaceBook connect in Android","<android><facebook><api><for-loop>","1","0","","",""
"4067074","1","","","2010-11-01 06:43:48","7","12587","<p>Is there anything similar to getsharekit.com for Android? It allows to share URL's to social networking sites. Is there anything similar to this or do I need to code separately for facebook, Twitter and email?</p>","261566","","56285","","2014-04-10 19:56:15","2014-04-10 19:56:15","Sharing URL to Facebook, Twitter and email in Android?","<android><facebook><email><twitter><sharing>","3","1","4","",""
"4067287","1","","","2010-11-01 07:41:19","1","1910","<p>I create listView by use the following code.If i use lv.setTextFilterEnabled(true);i get the list View filter.If i set the filter text its not display the filtered listView.How to set the filter text;</p><pre><code> lv=new ListView(this);            lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_checked, items));     //lv.setTextFilterEnabled(true);    lv.setFilterText(""a"");</code></pre><p>Note :</p><p>I have the TextViews A to Z . When i touch letter 'a' i wish to list the elements starts with 'a' so that i need to set the list filter at run time.</p>","482568","","2571762","","2013-07-11 08:48:41","2013-07-11 08:48:41","listView Search in android?","<android><android-listview>","1","0","","",""
"4067339","1","4067375","","2010-11-01 07:51:56","3","3812","<p>I want to send some data to a server through POST method in android. I am using the following code</p><pre><code>DefaultHttpClient hc=new DefaultHttpClient();  ResponseHandler &lt;String&gt; res=new BasicResponseHandler();  HttpPost postMethod=new HttpPost(url); List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); nameValuePairs.add(new BasicNameValuePair(""name"", ""value""));     nameValuePairs.add(new BasicNameValuePair(""password"", ""value""));    postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));    String response=hc.execute(postMethod,res); </code></pre><p>But I am getting the error response in my response xml. The error message is cookies are disabled in client machine. How do I need to enable cookies in android ? </p>","404196","","741249","","2012-05-02 14:13:09","2012-05-02 14:13:09","Post data to server in android","<android><post><cookies>","1","1","2","",""
"4067350","1","4067389","","2010-11-01 07:54:49","8","19088","<p>Today, I want to measure the Wi-Fi signal quality. So I download the Wi-Fi Analyzer app, and I install it on the emulator,but it showed that the Wi-Fi has not been turned on. Thus I turn it on, but it still shows errors. </p><p>I tried several times but it is still not working.</p><p>Any ideas?</p>","493320","","2571762","","2013-07-11 08:50:35","2013-07-11 08:50:35","How to turn on the Wi-Fi on android emulator device?","<android><android-wifi>","2","0","","",""
"4067482","1","","","2010-11-01 08:30:49","1","909","<p>I'm learning to develop app on Android with eclipse and ADT plug-in.</p><p>Now I want my app to read Chinese text, according to this artical in android SDK document <a href=""http://androidappdocs.appspot.com/resources/articles/tts.html"" rel=""nofollow"">http://androidappdocs.appspot.com/resources/articles/tts.html</a></p><p>The TTS engine <strong>support speaking English, French, German, Italian and Spanish</strong>, so I want to know:</p><p>Does this TTS engine also support Chinese speaking? If not, is there any other way to add this function?</p><p>Thanks!</p>","493345","","1079354","","2012-05-06 17:03:24","2012-05-06 17:03:24","How to let android device ""speak"" Chinese?","<android><localization><text-to-speech><cjk>","0","0","0","",""
"4067502","1","","","2010-11-01 08:34:32","1","833","<p>I am new in Android and i am working to make an on-screen keyboard which can be visitable via arrow(direction) keys of my external keyboard. I mean i wanna move left, right, up and down in the on-screen keyboard's UI (keys) with pressing arrow keys from my external(hardware) keyboard. The key that cursor is on should be focused, when i press an arrow key from my external keyboard the focused key should change and when i press ""enter"" from my external keyboard it should be operated.(written to the screen etc.) How can i make this? Is there any idea? How can i make virtual keyboard's keys visitable? It doesn't look like moving around a matrix of buttons. Please, help me.</p>","493348","","","","","2012-04-17 15:14:50","How can i move cursor in on-screen keyboard with external keyboard?","<java><android><input><keyboard><on-screen-keyboard>","1","0","","",""
"4067563","1","","","2010-11-01 08:50:16","8","7366","<p>Is there any way to hide an application icon from Android applications list ? The application should be downloaded from Market and opened some GUI for configuring my application. I don't want to see any icon of my application in applications list. User should not be able to run it.</p><p>By the way I know some way:remove this line from manifest category <code>android:name=""android.intent.category.LAUNCHER""</code></p><p>But it is not worked for me, because the GUI is not shown.</p><p>Thanks very much ! </p>","493357","","379693","","2012-04-19 05:30:05","2013-08-17 15:53:54","Hide an application from Android application list","<android>","3","0","2","",""
"4067601","1","","","2010-11-01 08:55:53","1","705","<p>My task is to bring up the IPTV support in Android.<br>I would like to get some pointers and help on how to accomplish this task.<br>Whether some open source iptv support packages are available, so that i can compile the same for android. If yes, which is the best one to use??  </p><p>Thanks &amp; Regards,<br>Sen</p>","449378","","","","","2011-09-30 05:30:37","IPTV on Android","<android>","0","0","","",""
"4067703","1","4068314","","2010-11-01 09:19:02","1","1677","<p>I have some tabs based on layouts with their own xml description, but when i tried to set tab content i got such a result:</p><p><a href=""http://img266.imageshack.us/img266/1787/appnavihist.jpg"" rel=""nofollow"">http://img266.imageshack.us/img266/1787/appnavihist.jpg</a></p><p>(white field with text is a part of home.xml layout). Here's some code:</p><pre><code>    TabSpec spec = tabHost.newTabSpec(""home"").setIndicator(""Home"").setContent(R.id.LinearLayout_home);    tabHost.addTab(spec);</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  </code></pre><p></p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout_root"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;TabWidget android:id=""@android:id/tabs""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""&gt;    &lt;/TabWidget&gt;    &lt;FrameLayout android:id=""@android:id/tabcontent""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;        &lt;include layout=""@layout/home""/&gt;    &lt;/FrameLayout&gt;      &lt;/LinearLayout&gt;</code></pre><p></p>","485572","","485572","","2010-11-01 11:45:26","2010-11-01 11:51:29","Android: layout does not appear as tab content","<android><layout><tabs><content>","1","3","1","",""
"4067770","1","4069319","","2010-11-01 09:31:10","2","2268","<p>I'm trying to access a site hosted on IIS from my HTC Desire. The site uses integrated security / windows authentication and uses SSL (with a valid certificate) (It's a SharePoint site if you want to know)</p><p>The phone hits the server just fine but is immediately turned away with a 401.2 Unauthorized error. It does not ask for credentials.</p><p>I have tried with the default android browser and Opera Mini, but nothing works. It works on an iPhone, but not on HTC devices. We have tried a couple.</p><p>Any idea? Or is it just not supported on android devices? It works in all normal browsers on our pc's (IE, Firefox, Chrome etc.)</p><p>--<br>Christian</p>","489210","","","","","2011-08-23 10:40:50","Problem accessing IIS hosted site from HTC desire","<android><iis><https><windows-authentication>","1","0","","",""
"4067800","1","4068797","","2010-11-01 09:36:17","1","1664","<p>As the title says I want to hide a listview's scrollbar when the listview isn't scrolling and show it when scrolling. I know this can be done very easy by setting ""android:fadeScrollbars"" as an application style if the API is 5 or newer. But I want the feature to be available on all android devices. So I've implemented the ""setOnScrollListener"" method, and switched the scrollbar visibility using the setVerticalScrollBarEnabled method. This works great on G2. The problem is that on Motorola Milestone the  SCROLL_STATE_IDLE event isn't received when the scrolling stops, and so the scrollbar remains visible.</p><p>Thank you for reading!</p>","460611","","379693","","2010-11-01 12:29:36","2010-11-01 12:29:36","Listview hide scrollbar when not scrolling","<android><android-sdk-2.1><android-scrollbar>","2","0","1","",""
"4067951","1","4070275","","2010-11-01 10:05:08","1","791","<p>Hi I am using the below code for create a database </p><pre><code>public DataHelper(Context context) {             this.context = context;             OpenHelper openHelper = new OpenHelper(this.context);          this.db = openHelper.getWritableDatabase();             this.insertStmt = this.db.compileStatement(INSERT);          }  </code></pre><p>It is a constructor .But when i use this in my activity as <code>DataHelper dh = new DataHelper(this);</code>But i got the error is close the db.where i write the db close statemnet.I am follow the code which is provided in below limk.But i got error,Please give me some suggestions.Thanks in advance.<a href=""http://www.screaming-penguin.com/node/7742"" rel=""nofollow"">link text</a></p>","479027","","135152","","2011-05-25 03:08:04","2011-05-25 03:08:04","How we close the database when we open the db using getWritableDatabase();","<android><sqlite>","1","1","1","",""
"4067954","1","","","2010-11-01 10:05:23","2","1396","<p>is there an android api that would connect an android device to a printer?what are the possible ways to connect to a printer in android?</p><p>thank you in advance!</p>","476777","","379693","","2010-11-01 12:28:30","2012-04-19 01:06:08","how to connect an android device to a printer?","<api><printing><android>","2","0","3","",""
"4068074","1","4446908","","2010-11-01 10:23:49","1","1447","<p>I have created one songs album app. In this app, i have to play the songs by using URLs. These URLs gave me 2 types of songs.The first one is on-demand songs, which are our regular songs limited to 5 or 6 minutes. I dont have any problems to play/stop these songs with MediaPlayer object. The second one is live streaming, which is nothing but shout casting.With this shout-casting URLs, the MediaPlayer object is not working properly that means after playing say some 5 seconds of song the mediaplyer stops playing. I dont know what is the problem with live streaming data. if anyone knows about this, please guide me to rock the Mediaplayer.</p><p>ThanksVenu</p>","461975","","461975","","2010-11-01 10:35:51","2010-12-15 05:12:06","Problem with mediaplayer to play live streaming audio in android","<android><media-player>","1","1","","",""
"4068132","1","4068173","","2010-11-01 10:32:51","6","5816","<p>I am getting a date/time string from web in the format of ""yyyy/mm/dd'T'HH:MM:SS'Z'"" and it is in UTC.</p><p>Now i have to identify the current time zone of device and then convert this time to my local time..</p><p>How do i do it, pls suggest me !!</p><p>(FYI, Currently, UTC time is 10:25 AM, in india current time is 3:55 PM)</p>","379693","","21234","","2010-12-30 21:04:35","2010-12-30 21:04:35","Display UTC date/time into date/time according to the current time-zone","<java><android><datetime>","1","0","2","",""
"4068178","1","4766318","","2010-11-01 10:40:36","0","573","<p>Can i use KXML framework for android application?</p>","488433","","488433","","2011-07-05 06:38:43","2011-08-02 05:42:50","Can i use KXML framework?","<android><frameworks><kxml>","1","2","","",""
"4068261","1","","","2010-11-01 10:57:43","1","800","<p><br>I would like to create a time table like layout which has a dynamically adjustable lengths as shown in the picture <img src=""http://i.stack.imgur.com/BW44a.png"" alt=""alt text"">Please provide some pointers on how to implement this.  </p><p>Thanks &amp; Regards,<br>Sen</p>","449378","","","","","2010-11-01 11:21:03","How to Create a Time Table like layout","<android>","0","6","","",""
"4068306","1","","","2010-11-01 11:03:45","13","49584","<p>I am new in Android. I am using android os 2.2. I am trying to play streaming audio and video from url. I don't know what to do for that. after 3 days og googling i come to know that I have to use mediaPlayer and MediaController classes.</p><p>I had use different differend combination of codes found on internet but not succeed.</p><p>Can anybody guide me what to do for streaming audio/video playing. What about the UI if we use MediaPlayer or Controller class. is there any thing to related these in xml file of layout.</p><p>if not then even please tell me what may be the code for that.</p><p>please help me.</p>","493476","","493476","","2010-11-01 11:38:08","2013-03-18 06:03:22","How to Play Streaming Audio/Video from a url?","<android><streaming><media-player>","2","0","8","",""
"4068364","1","","","2010-11-01 11:14:43","1","257","<p>How to get Popup notifications? </p><p>As i have observed all the notifications are added in the status bar, but i want the notifications in popup, how can i do that? </p><p>I also want to add speech to text feature for the notifications. Please someone help me, if u have idea on this.</p>","466549","","21234","","2011-05-08 18:56:09","2011-05-08 18:56:09","Custom notifications in android","<android><notifications>","1","0","","",""
"4068390","1","4132324","","2010-11-01 11:19:16","4","4515","<p>I read a lot about signpost, and then went back to Twitter4J with which I have created my twitter applications when OAuth wasn't necessary.</p><p>I am now confused whether I should use signpost or Twitter4J's method of OAuth authentication.</p><p>I have read that Twitter4J itself uses signpost for OAuth, still am  not sure about the choice that I should  make.</p><p>Kindly assist.</p><p>Thanks a lot!</p>","243709","","243709","","2010-11-17 06:39:54","2011-02-15 05:38:11","SignPost or Twitter4j for Sign-in with Twitter (OAuth)?","<android><oauth><twitter4j><signpost>","2","0","5","",""
"4068393","1","","","2010-11-01 11:19:45","0","434","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3889882/svg-support-on-android"">Svg support on Android</a>  </p></blockquote><p>i want a sample program for displaying svg file in android? or i want to know wha are the classes used for it?</p>","493297","","","","","2011-11-22 06:05:32","svg file display","<android>","1","0","","2012-11-13 20:57:56",""
"4068395","1","","","2010-11-01 11:20:08","2","1806","<p>I have added an <code>AbsoluteLayout</code> on <code>ScrollView</code>. Up to this, it worked fine. After that, I added <code>ScrollView</code> on above mentioned <code>AbsoluteLayout</code>. Now I have</p><pre><code> ScrollView -&gt; AbsoluteLayout -&gt; ScrollView -&gt; AbsoluteLayout </code></pre><p>This structure also works fine. But when I try to scroll inner <code>ScrollView</code>, it scrolls slightly and after that outer scrollview starts scrolling.</p><p>How can I restrict scrolling outer <code>ScrollView</code> when I am scrolling inner <code>ScrollView</code>?</p>","493496","","119895","","2010-11-01 13:14:45","2012-04-25 06:53:23","android scrollview inside scrollview scrolling problem","<android><scrollview>","0","4","","",""
"4068437","1","4529962","","2010-11-01 11:25:58","1","2167","<p>I cant get x10 mini to show up in ""adb devices"", (only emulators show up). Phone is in usb-debugging-mode, thethering-applications are disabled and on OSX I shouldn't need to download any USB drivers for the phone, so whats wrong here?</p><p>/Developer/Utilities/usb probe reports phone as:</p><pre><code>    Descriptor Version Number:   0x0200    Device Class:   0   (Composite)    Device Subclass:   0    Device Protocol:   0    Device MaxPacketSize:   64    Device VendorID/ProductID:   0x0FCE/0x2138   (Sony Ericsson Mobile Communications AB)    Device Version Number:   0x0224    Number of Configurations:   1    Manufacturer String:   1 ""SEMC""    Product String:   2 ""SEMC HSUSB Device""    Serial Number String:   3 ""4342xxxx314A5151xxxx""</code></pre><p>Thankful for any help</p>","247245","","247245","","2010-11-03 09:39:51","2010-12-26 19:22:44","How do I get x10 mini to show up in adb devices on osx?","<android><debugging><adb><sony><x10>","2","1","2","",""
"4068487","1","","","2010-11-01 11:33:30","0","712","<p>I have a need to force my application to the front under special circumstances. I know its against the good coding philosophy but I am working on a turnkey solution where I control the complete device. The app is used internally as a business tool and supplied to the users on a stripped down device. I have searched but cannot see a way but know that it can be done as in the Application Protection app. This can react to the launching of an application and kill it / allow it by entering a password.</p>","420207","","","","","2010-11-01 11:40:20","Android application focus","<android><focus>","1","0","","",""
"4068547","1","4070166","","2010-11-01 11:41:53","0","795","<p>I have array of web view.I am implementing touch event in web view .my requirment is i want to pass the value to other activity in ontouch listener</p><p>can anybody give example</p><pre><code>for(int i=0;i&lt;articleParsedValue.size();i++)        {                ArticleDataSet articleDataset=(ArticleDataSet)articleParsedValue.get(i);                HashMap&lt;String, String&gt; mapValue=new HashMap&lt;String, String&gt;();              WebView webviewcontent=new WebView(this);           String html =""&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;label style=\""font:bold 17.5px verdana; color:#C1002B\""&gt;""+articleDataset.getArticle_title()+""&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+""|""+""&lt;/label&gt;""+""&lt;label style=\""font:bold 13px verdana; color:#000000\""&gt;""+articleDataset.getArticle_type()+""&lt;/label&gt;&lt;br&gt;&lt;label style=\""font:13px verdana; color:#AAAAAA\""&gt;""+articleDataset.getArticle_date()+"" &lt;/label&gt; &lt;/div&gt;"";           html=html+""&lt;div&gt;&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+articleDataset.getArticle_summary()+""&lt;/label&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;"" ;           webviewcontent.getSettings().setJavaScriptEnabled(true);           webviewcontent.clearCache(true);           webviewcontent.loadData(html, ""text/html"", ""utf-8"");           webviewcontent.setOnTouchListener(new OnTouchListener()                      {                        //@Override                        public boolean onTouch(View v, MotionEvent event) {                            // TODO Auto-generated method stub                            Intent newIntent=new Intent(this,MyCompaniesActivity.class);                            newIntent.putExtra(""articleid"", articleDataset.getArticle_id());                             startActivity(newIntent);                            return false;                        }           }        ) ; }</code></pre>","426344","","426344","","2010-11-02 06:17:42","2010-11-02 06:17:42","passing value to another activity in ontouch listener","<android>","1","0","","",""
"4068559","1","4203871","","2010-11-01 11:43:55","33","56211","<p>Does anyone know how I can remove the address bar from the Android browser to better view my web app and make it look more like a native app?</p>","454834","","707111","","2012-01-10 21:11:19","2013-10-17 12:50:48","Removing address bar from browser (to view on Android)","<javascript><android><mobile>","10","0","22","",""
"4068707","1","4068748","","2010-11-01 12:08:49","3","4700","<p>I have written code for <code>onClick</code> method for Custom Dialog top of the another view. It gives me <code>nullpointer exception</code>. I've also tried using Layout inflater. It gives me error on <code>ok.setOnclickListener</code>. What's wrong in my code?</p><pre><code> ImageButton search =(ImageButton) findViewById(R.id.search);            search.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    Dialog searchDialog = new Dialog(Page.this);                    /*LayoutInflater inflater = (LayoutInflater) getApplicationContext()                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);                     View layout = inflater.inflate(R.layout.search, null);                     searchDialog.addContentView(layout, new LayoutParams(                                LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));                     searchDialog.setContentView(layout);*/                    searchDialog.setContentView(R.layout.search);                    searchDialog.setTitle(""Search Dialog"");                    searchDialog.setCancelable(true);                    Button ok = (Button)findViewById(R.id.OkButton);                    ok.setOnClickListener(new OnClickListener() {                        @Override                        public void onClick(View v) {                            String searchString = null;                            EditText searchText = (EditText)findViewById(R.id.searchText);                            if(searchText.getText()!=null){                                searchString = searchText.getText().toString();                            }                            Log.i(""TAG"",""Search word :""+searchString);                        }                    });                    searchDialog.show();                }            });</code></pre>","486216","","1076164","","2012-06-19 23:58:34","2012-06-19 23:58:34","android setOnClickListener gives null pointer exception?","<android><dialog>","1","0","1","",""
"4068742","1","","","2010-11-01 12:12:33","2","3558","<p>I am implementing an application to search for nearest local venues from a gps coordinates database.</p><p>i am using the Location class <code>distanceTo()</code> function to calculate distance between two location the current one and the one from the database.</p><pre><code>currentloc.setLatitude(loc.getLatitude());currentloc.setLongitude(loc.getLongitude());dbcurrent.setLatitude(C.getDouble(latindex));dbcurrent.setLongitude(C.getDouble(lonindex));distance = currentloc.distanceTo(dbcurrent);</code></pre><p>this work fine and i am able to use this distance to calculate proximity in the rest of my app, but the distance it self is not apparently in meters i am getting result like 4134801.4 i am sure that the distance is 3200meters in this case.</p><p>Is there any explanation or solution for this issue.</p><p>thank you all.</p>","487015","","","","","2013-07-12 17:03:57","distanceTo() return distance not in meters !","<android><gps><location><coordinates><distance>","1","3","","",""
"4068759","1","","","2010-11-01 12:15:28","0","1613","<p>Could you help me? How could I check if user denyed bluetooth pairing request?</p>","448147","","","","","2012-12-14 23:49:24","android Bluetooth Pairing request","<android><bluetooth>","2","0","","",""
"4068796","1","","","2010-11-01 12:21:55","0","1104","<p>I have few queries regarding Android app submission.</p><p>1) I have an account and want to make my application available for US.(I have seen the options which allows to select the countries in submission process document). So is it possible to show my application to US users with my india account.</p><p>2) I want to show the different names for Seller(developer) and copyrights. In future If I submit another app, I should be able to show the same seller name but copy rights name will be changed. So is it possible to show in this way.</p><p>Thanks in advance.</p><p>Regards, Malleswar</p>","304804","","750987","","2011-05-29 06:32:58","2012-05-18 11:43:45","App submission to Android Market","<android><google-play>","1","0","","",""
"4068842","1","","","2010-11-01 12:28:58","0","169","<p>I am currently trying to parse the results returned from a webservice. Is there a way to do this in a simple manner. The response is returned in XML format. Currently, the code is as follows:</p><pre><code>Uri uri = Uri.parse(""http://www.pizza-rat.com/restaurant/sanfrancisco?search=pizza"");      Intent intent = new Intent(Intent.ACTION_VIEW, uri);</code></pre><p>The results returned from this code is a single chunk of data. I would like to take this result and display them in a decent format, preferably a list format.Is there a straight forward way to do this?</p><p>Regards,NJ</p>","493562","","133802","","2010-11-01 12:46:58","2010-11-01 16:18:02","Android: Question regarding parsing results from web service","<android><parsing><uri><results>","1","0","","",""
"4068910","1","4288158","","2010-11-01 12:38:16","11","12796","<p>I am trying to register my Activity so that it can be used by the Activity chooser/picker allowing a user to choose whether or not to select my application/Activity to complete what they are trying to do.</p><p>I want to provide the option for the user to be able to select my application when they want to send an SMS message and when they want to place an outgoing call, to try to achieve this I added the following pieces of code within my Activity tags in my manifest:</p><pre><code>&lt;intent-filter&gt;&lt;action android:name=""android.intent.action.SENDTO"" /&gt;&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;data android:mimeType=""text/plain"" /&gt;&lt;/intent-filter&gt;</code></pre><hr><pre><code>&lt;intent-filter&gt;&lt;action android:name=""android.intent.action.NEW_OUTGOING_CALL"" /&gt;&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;/intent-filter&gt;</code></pre><p>However the Activity chooser never appears and the native apps are used without providing a choice to the user. Can anyone see where I am going wrong?</p><p><strong>EDIT:</strong></p><p>I have figured out I need to add </p><pre><code>&lt;data android:scheme=""sms"" /&gt;&lt;data android:scheme=""smsto"" /&gt;</code></pre><p>for the SMS message but what do I use for the outgoing call?</p><p><strong>EDIT 2:</strong></p><p>I have tried the following for the outgoing call:</p><pre><code> &lt;intent-filter&gt; &lt;action android:name=""android.intent.action.VIEW"" /&gt; &lt;action android:name=""android.intent.action.DIAL"" /&gt; &lt;category android:name=""android.intent.category.DEFAULT"" /&gt; &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt; &lt;data android:scheme=""tel"" /&gt; &lt;/intent-filter&gt;</code></pre><p>But again with no luck, has this been blocked from 1.6 on?</p><p><strong>Edit 3:</strong></p><p>This is what happens when I click Text Mobile:</p><p><img src=""http://i.stack.imgur.com/cif2V.png"" alt=""alt text""></p><p>So i want the same thing when I click Call mobile</p>","243999","","2571762","","2013-07-11 08:48:55","2013-07-11 08:48:55","Android - Intent Filter?","<android><android-intent><intentfilter>","4","0","6","",""
"4068984","1","4072832","","2010-11-01 12:48:17","70","36959","<p>I'm trying to run two AsyncTasks at the same time. (Platform is Android 1.5, HTC Hero.)However, only the first gets executed. Here's a simple snippet to describe my problem:</p><pre><code>public class AndroidJunk extends Activity { class PrinterTask extends AsyncTask&lt;String, Void, Void&gt; {     protected Void doInBackground(String ... x) {      while (true) {       System.out.println(x[0]);       try {        Thread.sleep(1000);       } catch (InterruptedException ie) {        ie.printStackTrace();       }      }        }    };    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new PrinterTask().execute(""bar bar bar"");        new PrinterTask().execute(""foo foo foo"");        System.out.println(""onCreate() is done."");    }}</code></pre><p>The output I expect is:</p><pre><code>onCreate() is done.bar bar barfoo foo foobar bar barfoo foo foo</code></pre><p>And so on. However, what I get is:</p><pre><code>onCreate() is done.bar bar barbar bar barbar bar bar</code></pre><p>The second AsyncTask never gets executed. If I change the order of the execute() statements, only the foo task will produce output.</p><p>Am I missing something obvious here and/or doing something stupid? Is it not possible to run two AsyncTasks at the same time?</p><p>Edit: I realized the phone in question runs Android 1.5, I updated the problem descr. accordingly. I don't have this problem with an HTC Hero running Android 2.1. Hmmm ...</p>","112308","","112308","","2010-11-01 13:35:59","2014-02-13 07:17:32","Running multiple AsyncTasks at the same time -- not possible?","<android><android-asynctask>","6","4","59","",""
"4069037","1","4069077","","2010-11-01 12:55:31","26","7897","<p>I've always been using RelativeLayout everytime I needed a View container, because of it's flexibility, even if I just wanted to display something really simple.</p><p>Is it ok to do so, or should I try using a LinearLayout when I can, from a performance/good practices standpoint?</p><p>Thanks!</p>","488054","","","","","2014-03-21 14:34:15","Android: Is a RelativeLayout more expensive than a LinearLayout?","<android><performance><android-linearlayout><relativelayout>","4","0","3","",""
"4069085","1","4075153","","2010-11-01 13:02:27","1","5224","<p>While reading from file under Assets/sb/example/simple.html/It is giving filenotfound exception.</p><pre><code>11-01 18:30:13.562: WARN/System.err(912): java.io.FileNotFoundException: file:///android_asset/sb/example/simple.html</code></pre><p>Code Snippet is</p><pre><code>try {    final AssetManager assetMgr = ctx.getResources().getAssets();     is = assetMgr.open(path, AssetManager.ACCESS_STREAMING);    // is = getAssets().open(file.getAbsolutePath());} catch (IOException e1) {    // TODO Auto-generated catch block    e1.printStackTrace();}</code></pre>","486216","","559850","","2011-08-05 20:51:00","2011-08-17 09:45:32","Filenotfound exception from assets folder android?","<android>","1","1","","",""
"4069089","1","","","2010-11-01 13:03:30","0","984","<p>I have a gallery widget with a about fitfy (almost) full screen images. Images are loaded from SD Card, and only one image is visible at a time (accept for overlap when scrolling). The problem is that after scrolling throught about 35 images I get OutOfMemoryError: bitmap exceeds VM budget. I thought a gallery widget disposed of views as required, but I guess I'm either mistaken or doing something wrong.</p><p>I use a CursorAdapter to load data, and I notice that whenever I scroll to new image, both newView() and bindView() is called. I would assume this means that the original view had been disposed of, but the out of memory issue seems to indicate the opposite. I'm using a ViewHolder with quite a few fields.</p><p>So my questions are:</p><ol><li>Does a gallery widget behave differently than a listview when used with a CursorAdapter?</li><li>Is there a way to force recycling and/or desposing of views? (Or what could I be doing wrong).</li><li>Other suggestions for dealing with out of memory issues for this scenario? Downscaling is not really an option, and the gallery should be able to deal with unlimited number of images (or at least twice as many).</li></ol>","184844","","","","","2012-05-24 03:30:16","Android gallery widget with out of memory issue","<android><memory><gallery>","1","2","","",""
"4069115","1","4069777","","2010-11-01 13:06:38","0","1567","<p>I am currently trying to integrate a live search functionality in android. I use a customized Autocomplete widget. The widget itself provides me with a threshold to only start a query after a certain amount of characters have been typed in. But what I also want is that a query only starts, say if a user has stopped typing for 2 seconds. </p><p>As I load my contents with a <code>AsyncTask</code> I tried blocking the <code>doInBackground</code> function by calling Thread.sleep() right at the beginning. If the user would then continue typing the program would look after an existing task, cancel it and start a new one. This was my idea. But it doesn't quite work the way I expected. Sometimes it sends out queries even if the user is still typing, sometimes queries are canceled after the users stopped typing. </p><p>Do you have any ideas on this or maybe a better way to solve this?</p><p>Here are the code snippets:</p><p><strong>1. The function that is called on text changes:</strong></p><pre><code>public void afterTextChanged(Editable s) {    if(mWidget.enoughToFilter()) {        if(mTask != null &amp;&amp; mTask.getStatus() != Status.FINISHED) {            mTask.cancel(true);        }        mTask = new KeywordSearchLoader(mActivity,                 mItems);        mTask.execute(s.toString());    }}</code></pre><p><strong>2. doInBrackground</strong></p><pre><code>try {    Thread.sleep(Properties.ASYNC_SEARCH_DELAY);} catch (InterruptedException e) {    Log.e(TAG, ""the process was interrupted while sleeping"");    Log.w(TAG, e);}</code></pre><p>ThanksPhil</p>","463910","","","","","2010-11-01 14:31:02","How to implement the javascript setTimeout function in Java","<android><search><asynchronous><settimeout>","1","0","","",""
"4069164","1","4069384","","2010-11-01 13:13:23","0","205","<p>Am developed one application .The UI get varying differently in emulator and device.the correct ui displayed in emulator but in device the button size, spinner size,text view all changing deterrently in device.So i have to change some modification in xml file according to the device visibility. any one help me How can i fixed the same xml for device and emulator which  both UI display  cannot change.what are the things i have to include in my project  to fix the same display for emulator and device.  </p><p>Thanks,</p>","450596","","","","","2010-11-01 13:41:06","how to set the same UI display in device and emulator?In my application UI varying device and emulator","<android>","1","1","","",""
"4069167","1","4368219","","2010-11-01 13:13:52","1","1608","<p>What I do with my application is allowing users to discover POI on Google Maps.That's really easy and I use</p><pre><code>final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(""geo:+""    + lat+ "",""
    + lon));startActivity(myIntent);</code></pre><p>I have 2 big issues with this</p><p>1) When Latitude is activated, Google Maps open and show my location instead of my POI location!I have to quit Google Maps and come back again to focus on my POI location.</p><p>2) There are no marker on my POI location! such a shame, if I move a little bit the Map, My POI is lost.</p><p>So my question are: do you have the same feeling than me with this intent? Is there some workaround to fix that? (maybe an other intent)?</p><p>Thank a lot for any help, I think I will have to create my own MapActivity and I think that's a waste of time for such a little feature.</p>","327402","","","","","2010-12-06 15:54:48","Is android.content.Intent.ACTION_VIEW for maps unusable or am I wrong?","<android><google-maps><android-intent><marker>","1","0","","",""
"4069194","1","","","2010-11-01 13:17:53","0","595","<p>this is my layout for audio player the problem is when resolution is high there is balck space vacant under the play and delete button which  located at the bottom of the ui. what i do? <pre><code>&gt;&lt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""840dp""android:background=""#333134""    &gt;  &lt;LinearLayout    android:layout_marginTop=""20dp""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_horizontal""    &gt;    &lt;TextView     android:paddingTop=""10dp""    android:id=""@+id/Rec_Timer_ID""    android:text=""00:00""     android:textSize=""70sp""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;    &lt;/LinearLayout&gt; &lt;LinearLayout                                 android:layout_marginTop=""40dp""                                android:orientation=""horizontal""                                android:layout_width=""wrap_content""                                 android:layout_gravity=""center_horizontal""                                android:layout_height=""wrap_content""&gt;                                                        &lt;Button                                                             android:id =""@+id/Button_record_sound""                                                            android:background=""@drawable/rec_btn""                                                            android:layout_width=""wrap_content""                                                            android:layout_height=""wrap_content""                                                             /&gt;                              &lt;/LinearLayout&gt; &lt;LinearLayout                                android:layout_height=""wrap_content""                                android:layout_width=""fill_parent""                                android:orientation=""vertical""                                &gt;                                &lt;LinearLayout                                android:layout_height=""wrap_content""                                android:layout_width=""fill_parent""                                android:orientation=""horizontal""                                android:layout_marginTop=""30dp""                                &gt;                                 &lt;LinearLayout  android:layout_height=""20dp""                                                android:layout_width=""30dp""                                                android:gravity=""center_horizontal""&gt;                                 &lt;View                                    android:id=""@+id/View1""                                    android:background= ""#ffffff""                                    android:layout_width=""5dp""                                    android:layout_height=""5dp""                                    android:layout_marginTop=""5dp""                                                        /&gt;                                 &lt;/LinearLayout&gt;                                                &lt;TextView                                        android:id=""@+id/Description""                                        android:textColor=""#ffffff""                                        android:textStyle=""bold""                                        android:textSize=""13sp""                                        android:paddingLeft=""6dip""                                        android:layout_height=""wrap_content""                                         android:layout_width=""wrap_content""                                         android:gravity=""top""                                        android:minLines=""2""                                        android:maxLines=""2""                                        /&gt;                      &lt;/LinearLayout&gt;                        &lt;LinearLayout                                android:layout_height=""wrap_content""                                android:layout_width=""fill_parent""                                android:orientation=""horizontal""                                android:layout_marginTop=""5dip""                                &gt;                                 &lt;LinearLayout  android:layout_height=""20dp""                                                android:layout_width=""30dp""                                                android:gravity=""center_horizontal""&gt;                                 &lt;View                                    android:id=""@+id/View22""                                    android:background= ""#ffffff""                                    android:layout_width=""5dp""                                    android:layout_height=""5dp""                                    android:layout_marginTop=""5dp""                                                        /&gt;                                 &lt;/LinearLayout&gt;                            &lt;TextView                    android:id=""@+id/Description2""                    android:textColor=""#ffffff""                    android:textStyle=""bold""                    android:textSize=""13sp""                    android:paddingLeft=""6dip""                    android:layout_height=""wrap_content""                     android:layout_width=""wrap_content""                     android:minLines=""2""                    android:maxLines=""2""                    /&gt;                      &lt;/LinearLayout&gt;                    &lt;/LinearLayout&gt;&lt;ImageViewandroid:layout_marginTop=""2dp""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:src=""@drawable/bar1""/&gt;&lt;LinearLayout                                 android:layout_marginTop=""10dp""                                 android:layout_width=""fill_parent""                                 android:layout_height=""wrap_content""                                 android:gravity=""center_horizontal""                                 android:clickable=""false""                                 android:orientation=""horizontal""&gt;                                                                    &lt;TextView                                                              android:id=""@+id/TimerStart""                                                              android:text=""00:00""                                                              android:textSize=""11sp""                                                              android:layout_width=""wrap_content""                                                              android:layout_height=""wrap_content""/&gt;                                                                                                &lt;SeekBar                                                              android:padding=""7dp""                                                              android:id=""@+id/SeekBar01""                                                               android:layout_width=""245dip""                                                               android:layout_height=""wrap_content""                                                              android:clickable=""false""                                                              android:focusable=""false""                                                              android:longClickable=""false""                                                              /&gt;                                                               &lt;TextView                                                              android:id=""@+id/TimerStop""                                                              android:text=""00:00""                                                              android:textSize=""11sp""                                                              android:layout_width=""wrap_content""                                                              android:layout_height=""wrap_content""/&gt;                              &lt;/LinearLayout&gt;     &lt;LinearLayout                                        android:background=""@drawable/br_12""                                        android:orientation=""horizontal""                                        android:layout_width=""fill_parent""                                        android:layout_height=""wrap_content""                                        android:gravity=""center_horizontal""                                        android:layout_marginBottom=""1dp""                                        &gt;                                                           &lt;Button                                                             android:gravity=""center_horizontal""                                                            android:id =""@+id/Button_Play_Sound""                                                            android:background=""@drawable/play1""                                                            android:layout_width=""wrap_content""                                                            android:layout_height=""wrap_content""                                                             /&gt;                                                             &lt;Button                                                             android:gravity=""center_horizontal""                                                            android:visibility=""invisible""                                                            android:layout_width=""8dp""                                                            android:layout_height=""wrap_content""                                                             /&gt;                                                              &lt;Button                                                             android:gravity=""center_horizontal""                                                            android:id =""@+id/Button_Delete_Sound""                                                            android:background=""@drawable/trash""                                                            android:layout_width=""wrap_content""                                                            android:layout_height=""wrap_content""                                                             /&gt;                 &lt;/LinearLayout&gt;                 &lt;/LinearLayout&gt;                 &lt;/ScrollView&gt;</code></pre>","487219","","","","","2010-11-01 13:22:32","Android audio player ui","<android>","1","0","","",""
"4069284","1","","","2010-11-01 13:30:50","0","980","<p>i have a problem with the spinner in a tab host:</p><p>in fact i successed  to make dynamically using</p><pre><code>Spinner spinner = new Spinner(isChild() ? getParent() : this);</code></pre><p>but i want it defined by the XML file. like this</p><pre><code>Spinner spinner =  (Spinner) this.findViewById(R.id.widget10);</code></pre><p>I got the problem when i use (OnItemSelectedListener())</p><p>when opening the the dialogue of selection??</p><p>please i need a help,</p><p>think u.</p>","462023","","41071","","2012-02-12 14:15:55","2013-07-25 21:20:22","Spinner within a tab","<android><tabs><spinner>","2","0","","",""
"4069345","1","4070515","","2010-11-01 13:38:17","0","169","<p>I am working on a custom ListView for purchasing items in a store front. You can scroll the list and read product descriptions as well as see product images. For items the user already owns I've pragmatically changed the color of the title (of the product on the list) to a different color so the user can easily identify, ""I already own that"". </p><p>The error I am seeing appears when I scroll to the bottom of the list, and then back to the top. After the UI has been built the titles all color properly, after a complete scroll and return to the top however, the currently owned products are still red and the item under it on the list turns to the ""owned"" status as well. This will continue happening each time you scroll down the list and back up until the whole list turns into the owned state. </p><p>I am not editing my List of products, and this happens on all adapters in my project. Each is unique in the way it populates the product list.</p><p>Is there some way I can persist a list of items and tell the View that once its built no more UI changes need be scheduled? </p><p>Thanks,</p><p>Robert</p>","454336","","","","","2010-11-01 16:15:29","Android ListView is not behaving properly","<android><listview>","2","2","","",""
"4069357","1","","","2010-11-01 13:38:58","1","886","<p>I am implementing java code for MYGlucoHealth monitor. I have to catch the bluetooth  data through my application and parse it to the readable format. (Later I store that in SQLite database.) But according to the protocol specification they provided, I cant understand how to read and parse it.  I know how to pair the device with my application.  But I don't know how to parse the data bytes as per the device specification protocol.</p><p>Can anyone tell me how to do that?  Anybody done with this kind of coding ? </p>","462493","","1288","","2011-07-23 12:24:01","2011-11-20 18:28:20","how to write code implement in java for parsing bluetooth data coming from myglucohealth device?","<java><android><parsing><bluetooth>","1","0","1","",""
"4069644","1","4069675","","2010-11-01 14:15:39","2","5447","<p>Is there a way to open a translucent or transparent activity so that you can still see the old activity behind it on the screen?</p><p>[Edit] To make the question more clear, I know how to create a transparent activity. The problem is when I start it using an intent, it clears the screen and you cannot see the previous activity.</p><p>Here is how I start the activity.</p><pre><code>    Intent intent = new Intent(MainActivity.this, DialogActivity.class); startActivity(intent);</code></pre><p>Thank you</p>","395359","","395359","","2010-11-01 14:28:40","2010-11-01 14:28:40","Opening an translucent/dialog activity on top of another activity","<android><android-widget>","1","4","","",""
"4069649","1","","","2010-11-01 14:16:11","5","560","<p>I am trying to adapt my application from a confirmation model to an undo model.  For those of you who don't know, this is where you can delete something with one click but if it was a mistake you can undo it just as easily, as opposed to interrupting the user every time he/she wants to do something to ask the annoying ""Are you sure you want to...?"" question via dialog.</p><p>My app is backed by the Android SQLite DB and I want to be able to undo a limited set of delete and update operations.  Also, I only need to be able to undo one sequential change and the information does not have to stick arround for very long.</p><p>Everything I read on undo/redo says to use a command model to store the data.  My question is how can I store the database changes in a lightweight restorable way?</p>","131871","","","","","2010-11-01 14:41:16","How to implement single step undo for SQLite DB changes?","<android><database><sqlite>","1","2","","",""
"4069746","1","","","2010-11-01 14:27:05","1","976","<p>I want to create an Android application, which blocks (disables) SMS text messaging while driving. My question is, how can I block android SMS MESSAGING application to start ?</p><p>Something like this: <a href=""http://www.textecution.com/"" rel=""nofollow"">http://www.textecution.com/</a></p><p>Thank you</p>","493675","","","","","2011-10-19 08:45:16","Android : block text messaging while driving","<android><sms><block>","0","3","1","",""
"4069750","1","","","2010-11-01 14:27:58","1","572","<p>Does anyone know if it is possible to limit the distribution of an Android app to a specific telecom operator in a specific country? for example if I want to sell my app to Verizon customers only?Thanks!</p><p>Frederic</p>","493676","","","","","2010-11-01 15:48:05","Restrict Android app to an operator","<android><app-store>","3","0","","",""
"4069771","1","4069819","","2010-11-01 14:30:15","2","1233","<p>I wonder how is it possible to send a picture.I am using json to send data and store to database. </p><p>But how do I handle a picture? How do I send it using json?</p>","371301","","114664","","2010-11-01 15:19:06","2012-04-02 01:01:45","Android: How to send a picture through a service","<android><web-services><json><wcf>","2","0","1","",""
"4069855","1","","","2010-11-01 14:39:27","1","590","<p>The first time i focus an edittext view i notice a lag of one or two seconds before i can write anything in the textbox.</p><p>I notice this behavior even on an app without any code more than what's nessecary to initialize the application.</p><p>What am i doing wrong?</p>","493691","","2571762","","2013-07-11 08:50:14","2013-07-11 08:50:14","Edittext ""lag"" android","<android><android-edittext>","3","2","","",""
"4069864","1","4070071","","2010-11-01 14:40:08","5","1352","<p>I have an app which is linked to (via an Android Market URL) on several different websites. What I need to implement is a way to determine where my users came from. Is there a way to determine the referring URL that the user followed to download my app via the Android Market?</p><p>For example, user A browses site xyz.com and clicks the link to view my app on the Android Market and then proceeds to download it. Once installed can I ""programmaticaly"" see where the user came from (xyz.com)?</p><p>I need to implement this myself (within the app) and not rely on external tools or services.</p>","493692","","114066","","2010-11-01 15:04:22","2011-04-22 15:57:27","Determine whether a user installed our app via Market link","<android><install><tracking>","2","0","1","",""
"4070116","1","","","2010-11-01 15:08:57","3","687","<p>i have a method in my app that i want to be called repeatedly depending on what the user chooses. like if every hour is chosen by the user, the activity fires a method that is being called every hour. i would like to know the best way to schedule this repeated task. </p><p>i have been experimenting with Timers and Timer task, but for some reason it doesn't not seem to work when i use the java calendar class with it, like this:</p><pre><code>    Calendar c1 = Calendar.getInstance();          c1.add(Calendar.SECOND, 30);      updateTimer.scheduleAtFixedRate(cleanCompletedCache, c1.getTimeInMillis(),hour );</code></pre><p>and from what i have been reading, Handlers are not suitable for this multi-repeating task. would i have to use an alarm manager for this and why won't the above code execute correctly? thanks</p>","316843","","2571762","","2013-07-11 08:53:11","2013-07-11 08:53:11","Best way to set repeating task","<android><android-asynctask><android-alarms>","1","2","1","",""
"4070213","1","4071220","","2010-11-01 15:17:37","0","494","<p>I think I have a pretty easy problem to solve, but I have been beating my head against the wall for hours trying to get past it!  </p><p>I have an adapter that loads a list of URLS:</p><pre><code>adapter=new MyAdapter(this, lStrings);list.setAdapter(adapter);</code></pre><p>The list of URLS looks like this:</p><pre><code>private String[] lStrings={""http://www.domain.com/file1.jpg"",""http://www.domain.com/file2.jpg"",""http://www.domain.com/file3.jpg"",};</code></pre><p>What I want instead is to load these values from a text file that lies on the SD card.  For that matter, I would be okay with loading the values from a text file into a String, and then load the String into the list as I imagine that would be the ""cleaner approach"".  However, all attempts to do this have failed.</p><p>For instance, I replaced the above snippet with this:</p><pre><code>private String[] lStrings={               MainActivity.this.getString(R.string.myurllist)};</code></pre><p>... but then I get a Forced Close on loading.</p><p>I'm a bit new to Java, Android, and development in general.  So if this is something really stupid, please excuse my ignorance.  </p><p>Thanks in advance for any advice you can offer me.</p>","493706","","","","","2010-11-01 17:06:51","Loading string values from a String or file instead of a ""list"" in the class file","<android>","1","2","","",""
"4070260","1","6377566","","2010-11-01 15:22:59","6","8126","<p>I have a very simple app for Android that displays a Google Maps view and uses the GPS to track the position (essentially like so): </p><pre><code>public void onCreate(Bundle savedInstanceState) {    // ...    mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);    // ...}public void onResume() {    super.onResume();    mLocationManager.requestLocationUpdates(mProvider, 20000, 1, this);}public void onPause() {    super.onPause();    mLocationManager.removeUpdates(this);}public void onLocationChanged(Location location) {    mPosition = getGeoPointForLocation(location);    mMapController.setCenter(mPosition);}</code></pre><p>And when I use the following command to exit the application (e.g. through a menu), <strong>the GPS keeps on tracking</strong> - it seems that the Activity is still running:</p><pre><code>// ...case R.id.menu_exit:    finish();// ...</code></pre><p>How do I stop the GPS tracking if it does not work by removing the location manager in <code>onPause()</code> and calling <code>finish()</code>? As far as I have read tutorials or other questions, this should be the solution..</p>","435093","","435093","","2011-10-03 07:24:03","2011-10-03 07:24:03","How do I stop GPS/location tracking when my Activity finishes?","<android><activity><gps>","2","5","","",""
"4070313","1","4312429","","2010-11-01 15:28:11","0","806","<p>I'm trying to simply get contacts from the Device phone book and display them on a Spinner, the code:</p><pre><code>    // Form an array specifying which columns to return.     String[] PROJECTION = new String[] {        People._ID, People.NAME    };    // Get the base URI for the People table in the Contacts content provider.    Uri contacts =  People.CONTENT_URI;    Spinner contactsSpinner = (Spinner) findViewById(R.id.recipient_names);    // Make the query.    Cursor contactsCursor = managedQuery(contacts,                             PROJECTION, // Which columns to return                              null,       // Which rows to return (all rows)                             null,       // Selection arguments (none)                             // Put the results in ascending order by name                             People.NAME + "" ASC"");    Log.e(""EE"", String.valueOf(contactsCursor.getCount()));    SimpleCursorAdapter sca = new SimpleCursorAdapter(        this, android.R.layout.simple_spinner_item,        contactsCursor, new String[] {People.NAME}, new int[] {android.R.id.text1}    );    Log.e(""EE"", String.valueOf(sca.getCount()));    sca.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    contactsSpinner.setAdapter(sca);</code></pre><p>Compiles and runs fine, just that... The logs is showing 1 for both Log.e() call, which I think imply that contacts were actually retrieved successfully, however the Spinner is empty... Could anyone tell me I am doing wrong? </p>","135448","","","","","2010-11-30 10:01:39","Android: Displaying contact names in a Spinner","<android><android-emulator>","1","0","","",""
"4070339","1","4070486","","2010-11-01 15:32:17","2","5567","<p>In Android Spinner, I can set selection to a particular Item in the code (using setSelection(int)). This will end up calling OnItemSelectedListener, which is fine.</p><p>But when the user selects an item from the screen, by clicking the spinner and the item, I want to handle this as a different event, because the logic in my application should do different things.</p><p>How to achieve this?To summarize, My Spinner should do this</p><pre><code>If Value set from the code {//do this..}else if user select a value {//do that..}</code></pre>","284606","","284606","","2010-11-01 15:42:15","2010-11-05 17:25:44","Android Spinner OnItemChange Vs OnItemSelect events","<android><event-handling><spinner>","3","3","2","",""
"4070348","1","4070428","","2010-11-01 15:33:19","1","944","<p>I am writing an Android app and I need to download a csv file for a graph.  I am not sure if I need to either put the two columns to two array strings or import them to the DB then just query.  I am leaning towards just putting them to strings since the csv file will change constantly.  </p><p>My two issues are:</p><ol><li><p>I need to log into a specific URL to populate the CSV with the correct data such as <a href=""http://myurl.net/protect/module_graph.htm?log=02"" rel=""nofollow"">http://myurl.net/protect/module_graph.htm?log=02</a>.  That will populate the file <a href=""http://myurl.net/protect/data1.csv"" rel=""nofollow"">http://myurl.net/protect/data1.csv</a> with the data for the correct item.  Changing the log=02 to log=03 or any other number changes the content of the data1.csv file.  When I pull up the first URL in a web browser it pops up a window asking for basic authentication.  How do I need to call the URL to send the username and password with the request?</p></li><li><p>I need to get the CSV file downloaded and have the two columns output as strings so the graphing code can just read the data from the strings.  I think I know how to download it but should I store it to the SD card and then output the data or just open the file from the web and then output the data?  Also how do you tell it to put each column to an arraystring?</p></li></ol><p>Any help is appreciated.  Code examples or links to tutorials or other options are much much appreciated :)</p><p>Thanks!</p>","447560","","447560","","2010-11-01 16:50:12","2010-11-01 16:50:12","Android log in and download csv file","<android><file-download><login-script><autologin>","1","0","","",""
"4070423","1","","","2010-11-01 15:42:07","0","1991","<p>my application is contact list and i want to store my contact data in sd cardbut how can i store data in sd card, or if i will use database then how i want to store it or using simple file than how i want to store it</p><p>thanx in advance</p>","446298","","187606","","2010-11-01 15:43:11","2012-08-21 04:32:48","how to write data in SD Card","<android><android-sdcard>","3","0","","",""
"4070627","1","4070678","","2010-11-01 16:03:21","7","11001","<p>I started writing my first Android app, and chose SDK 2.0.1, before I had an android phone.I wantto test the app on a phone that is Android 1.6. The app itself uses pretty simple stuff, so I'm sure its 1.6 compatible, but I want to change the SDK level from Eclipse.</p><p>The ""default.properties"" file in my project tree and naively tried to change from Android 6, but it isn't changeable, but if I try to change it it tells me to change the build.properties of the project. I don't know what that means. I'm not used to eclipse and am still fumbling around it.</p><p>I went to the project properties and clicked on ""Java Build Path"", but from there I don't know how to add,remove or edit the libraries. </p><p>Basically, I'm asking how to downgrade my project from inside eclipse, so I can export it to a compatible phone.</p>","485498","","","","","2010-12-14 17:57:16","Changing Android Project SDK level","<android><eclipse><sdk><downgrade>","2","0","1","",""
"4070683","1","","","2010-11-01 16:08:33","0","1759","<p>I'm building a tab activity and but I don't want the tab text to appear below the icon. Is there any XML property to define this behavior?On the other hand, how can I place tabs in the bottom of the screen instead of the top?</p>","478025","","944657","","2012-12-22 15:21:24","2012-12-22 15:21:24","Tab widget with icon on left of text. Place tabs on bottom instead of top of screen.","<android><tabs>","1","0","","",""
"4070912","1","4071017","","2010-11-01 16:30:14","0","454","<p>i created a method called insertTable in a class called Table but i can't use it in my onClick method in the main class :</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    DatabaseHelper helper = new DatabaseHelper(this);    SQLiteDatabase db = helper.getWritableDatabase();    Table expense = new Table(db,helper.TABLE_1);    Table income = new Table(db,helper.TABLE_2);    Button add_btn = (Button)findViewById(R.id.add_btn);    EditText add = (EditText)findViewById(R.id.add);    add_btn.setOnClickListener(this);}public void onClick(View v) {}</code></pre><p>i want to do a income.insertTable in the onClick method but eclipse say that i need to create a local variable.Can someone help me plz ? </p>","439058","","","","","2010-11-01 18:05:43","i created a method in another class but i can't use it in my onClick method from the main class","<sql><android><class><onclick>","3","0","1","",""
"4071027","1","4071389","","2010-11-01 16:44:26","1","4337","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2677698/android-iphone-style-tabhost"">Android - iphone style tabhost</a>  </p></blockquote><p>I am trying to figure out how to achieve a tab bar look and feel like the one provided in the iOS for android applications? I am using the normal one but it makes my application to look old school. I would like to achieve the same visual experience as  the image below:</p><p><a href=""http://www.android.com/market/data/screenshots/com.i2.android.brasileirao.activity0.png"" rel=""nofollow"">http://www.android.com/market/data/screenshots/com.i2.android.brasileirao.activity0.png</a></p><p>I have also looked at mobyfactory-uiwidgets-android bu they are far from being equal to the one in the image.</p><p>Thanks T</p>","491604","","","","","2010-11-01 17:28:56","How to create a custom tabbar in android to look like an iphone tabbar?","<android>","1","1","2","2011-09-28 10:42:19",""
"4071059","1","4071251","","2010-11-01 16:48:43","0","241","<p>My JSON response contains characters in decimal format such as </p><pre><code>My Friend&amp;#39;s Story</code></pre><p>instead of</p><pre><code>My Friend's  Story</code></pre><p>How do I convert them properly?</p>","421372","","421372","","2010-11-01 16:55:24","2010-11-01 17:16:36","JSON response contains characters represented as decimals","<java><android><json><httpresponse>","2","2","","",""
"4071100","1","","","2010-11-01 16:54:11","0","378","<p>I dont drawer type notification.. i only want only an icon as notification..plzz help guyss</p>","478535","","","","","2010-11-01 19:51:59","how to create ""ONLY STATUS BAR NOTIFICATION like Alarm clock, battery,3g in android without expandable drawer","<android>","1","0","","2012-08-21 10:42:12",""
"4071116","1","4071262","","2010-11-01 16:56:37","0","2459","<p>I have a listView using a custom adapter. Each row contains a button and some other Views. I want to be able to click either on the button, or on the row itself (to edit the item of the list that is clicked).</p><p>Setting an onItemClickListener in the activity won't work because of <a href=""http://stackoverflow.com/questions/2734892/setonitemclicklistener-not-responding-for-custom-listview"">this problem</a></p><p>I think I have to set an onClickListener in the getView() method of my adapter for it to work properly.I would like to use my activity's onClickListener, in order to use a startActivityForResult() when the row is clicked, in order to have something returned to my activity when the item edition activity is over.How can I do that?</p><p>Thanks!</p>","488054","","","","","2012-01-15 13:13:50","Android ListView: How to use the activity onClickListener from a custom Adapter?","<android><listview><adapter>","1","0","1","",""
"4071149","1","","","2010-11-01 17:00:06","0","2564","<p>I want to override the silent mode and/or media volume to make the phone broadcast a loud noise. I know the alarm clock can override silent mode. How do you do this through your app?</p>","413926","","251173","","2010-11-01 18:10:41","2012-03-17 13:27:15","Override silent mode and/or media volume","<android><volume>","3","0","2","",""
"4071201","1","20599924","","2010-11-01 17:05:03","2","284","<p>I am starting an MSc thesis and I investigating in the field of context-aware mashups.  Do you guys know if there are any standard which have already been set on the way the context or point of interests are sent to the server?  Like location, social information, language and other information about the mobile being sent in a particular format like a DOM or tree like structure or maybe xml.</p><p>Thank you. </p>","327505","","","","","2013-12-15 21:17:11","Context-aware web services","<android><semantics>","2","0","1","",""
"4071322","1","4071851","","2010-11-01 17:19:42","2","1273","<p>I need to have an android device act as a wifi server/hub that will accept raw data from custom built devices So first off, I need the android device to act as a wifi hub that can accept raw data from my devices. How do I do set that up? I overviewed the code to the tether application, but I don't think that will work. I'll be glad to be wrong, but I don't think It is able to broadcast wifi.</p><p>Secondly, do you have any suggestions on how to set up the server. I was looking at Datagram Channels but I didn't see anywhere how to bind them to a port so I'm considering just using a standard server, but I am not sure how to attach it the wifi. </p><p>If you have any pointers on either that would be appreciated.</p><p>~Aedon</p>","480691","","","","","2010-11-01 18:29:59","Android acting as a wifi server-hub?","<android><sockets><networking><wifi>","1","0","","",""
"4071327","1","4071361","","2010-11-01 17:19:57","2","2098","<p>I'm working on an RSS reader app for Android.  I have it to where I snag the RSS feed and parse the messages.  When the user touches a title, I pass off the contents of the post to another activity, which displays the contents of the post in a standard text layout.  However, the posts come back with images that are in the form of an <code>&lt;img&gt;</code> tag, which is expected since that's what it is in the post.  However, with the text layout, it of course prints out the html, which I don't want.  Really, I want to render that HTML in something like a WebView.  </p><p>Going to the original post in a WebView is out of the question, as the page takes too long to load on a mobile browser and is slow.  How can I render my custom HTML snippet in a WebView?  If WebViews don't allow that, then what other options do I have for rendering the post's HTML without parsing out all <code>&lt;img&gt;</code> (and other) tags and try to download/display them individually?  I'd rather not reinvent a browser control if I can help it.</p><p>Here's an example of a post for clarity:</p><pre><code>&lt;img src=""http://myhost.com/myimages/image.jpg""/&gt;&lt;/br&gt;Here is the content of my article.  Yada Yada.  Etc. Etc.</code></pre>","403661","","","","","2010-11-01 17:25:03","Rendering HTML in an Android Activity offline","<html><android><activity><android-sdk-2.2>","1","0","","",""
"4071380","1","4071511","","2010-11-01 17:28:08","1","111","<p>So i used a editText called ""add"", when i click on the button he have to insert into a table a title (string) and amount(int) and comments (string) .the title is like this : String title = add.getText().toString();But it does not appear in the table .Plus when i had forgotten the ""getText()"" it displayed : android.widget.EditText@43e41168 .I dont know why ...(Sorry for my bad english, i'm french ^^).</p>","439058","","","","","2011-03-03 08:20:15","my string doesn't appear in my database","<android><database><string><edittext>","1","4","","",""
"4071459","1","4071510","","2010-11-01 17:36:09","3","351","<p>I know rule #1 of optimization is: don't do it! But I figured this was an easy question, and if I start using the faster method now I can save a lot of cpu time when I'm finished.</p><p>I'm making an RPG, and let's say this is part of a custom class:</p><pre><code>public class Baddie{    int health;    int magic;    public Baddie(int health, int magic){        this.health = health;        this.magic = magic;    }    public int getHealth(){        return health;    }</code></pre><p>Now, the answer to my question may be ""there's no difference"" and that's fine with me.. I just want to know. Is it quicker to get the Baddie's health using field access:</p><pre><code>//Somewhere in the main thread, I get an instance of Baddie..Baddie b = getScaryBadGuy();int baddieHealth = b.health;</code></pre><p>Or is it quicker to use a return method?</p><pre><code>int baddieHealth = b.getHealth();</code></pre>","408178","","","","","2010-11-01 20:10:41","Optimization: Accessing fields vs. methods","<android><optimization><class-design>","4","0","1","",""
"4071495","1","4074625","","2010-11-01 17:39:10","4","9261","<p>I'm developing an Android application for Android 2.1.</p><p>I'm trying to code OpenGL's stuff with C++ only.</p><p>Do you know a tutorial or an article showing an example about how to do that?</p><p><strong>UPDATE</strong>:<br/></p><p>Sorry, I've forget to say that I will use a Java home application to launch main activity.</p><p>I'm trying to say if I have to code on Java glSurfaceView or this statement must be on C++ code.</p><p>Ok, better explained: If I have a complete openGl on C++, may I have to modify C++ code? </p><p>Thanks.</p>","68571","","68571","","2010-11-01 18:12:02","2014-04-08 11:03:56","OpenGL on Android using C++ only","<c++><android><opengl-es>","2","2","1","",""
"4071513","1","4072284","","2010-11-01 17:41:05","1","354","<p>let's say i want to build a smartphone app that tells a user when/where to get off a subway station.  i can think of two ways of doing this:</p><p>1) using GPS and map of the subway routes, track the location of the user and notifies him when the destination is reached2) have him press start when he gets on a train as the train starts (which may not be realistic because the user could simply forget to do this), use the known travel time from starting station to end station, and simply notifies him when the time is up.</p><p>can someone tell me if there are any other good approaches?  thanks.</p>","270811","","","","","2010-11-02 21:49:42","tracking a subway map","<android><google-maps><gps>","4","2","","",""
"4071621","1","","","2010-11-01 17:53:11","6","1031","<p>I know that android automatically uses sliding animations if you open and close activities. Then they slide from left to right and fill the screen (or from right to left).The thing is that the animation is quite fast... it is visible on the emulator but it is barely noticeable on the phone itself. I am wondering if there is any way to slow down this animation so it would definitely be seen that the view is sliding.</p>","476427","","683261","","2012-04-27 06:41:40","2013-12-28 01:26:58","Slow down sliding animation between android activities?","<android><animation><android-activity>","2","2","1","",""
"4071656","1","4072004","","2010-11-01 17:57:18","2","2798","<p>I'd like to get the height of a <code>linearlayout</code>. I found more information in <a href=""http://stackoverflow.com/questions/1956838/cant-get-height-of-widgets"">this answer</a></p><blockquote>  <p><code>View.getWidth()/View.getHeight()</code> won't  give you a meaningful answer until the view has been measured. </p></blockquote><p>How will I know that view has been measured? Is there some event for it?</p><p><strong>UPD:</strong></p><p>Solution for me is to get layout's height in overriden onWindowFocusChanged()</p>","408780","","408780","","2010-11-02 09:52:13","2010-11-02 09:52:13","get height of a linearlayout","<android><layout><android-linearlayout>","1","1","1","",""
"4071706","1","4108647","","2010-11-01 18:04:15","0","529","<p>when I load the touch Facebook login page in the webview, I want that the email field to be set to a value and it can't be modified and to accomplish that I have inserted a JavaScript code in the webview disabling that element. All works fine until I want to click the login button because the page refreshes instead of submit the login info. I've noticed that if I don't disable the item, the login button works fine but I don't know why occurs that.</p><p>What can be the problem? I've thought another way to make it works: Whenever the user try to modify the email field ignore whatever he do, but I think this is a less proffesional way to fix that.</p><p>Regards.</p>","383628","","","","","2010-11-05 17:56:07","How to avoid user input in a field of a form in a WebView?","<javascript><android><input><webview>","2","0","","",""
"4071717","1","4077536","","2010-11-01 18:05:38","1","550","<p>I want to change the screen orientation from portrait to landscape and vice versa when the user rotates his Android mobile phone clockwise/anticlockwise. Can anyone help me how to achieve this? I do not know what event is fired when the user rotates his Android mobile phone.</p><p>For instance, when the user touches the button in UI, touch event is fired. So, when the user shakes his Android mobile phone, what is the event that is fired? Please help me on this.</p>","424413","","2571762","","2013-07-11 08:43:02","2013-07-11 08:43:02","Need Help in Changing Screen Orientation in Android","<android><android-orientation>","3","0","","",""
"4071795","1","","","2010-11-01 18:17:01","1","266","<p>I'm parsing an xml content from web service,it creates a problem when parsing the content with <strong>Brown Men&#x2019;sHockey “Grows for Movember”</strong>,when I parse like this by using DOM parses it results <strong>Brown Men</strong> after the hexadecimal code,the parse is not accepting remaining characters,here the code to parse </p><pre><code>NodeList items = elt.getElementsByTagName(ITEM);            for (int i = 0; i &lt; items.getLength(); i++) {                Message_desc message = new Message_desc();                Node item = items.item(i);                NodeList properties = item.getChildNodes();                for (int j = 0; j &lt; properties.getLength(); j++) {                    Node property = properties.item(j);                    String name = property.getNodeName();                    if (name.equalsIgnoreCase(DESCRIPTION)) {                        message.setDescription(property.getFirstChild().getNodeValue());.....}</code></pre><p>what I need to do here,please help me.</p>","393953","","437301","","2010-11-03 21:25:49","2012-04-09 11:47:56","Problem in XML parsing using DOM","<android><dom>","1","0","","",""
"4071855","1","4072098","","2010-11-01 18:25:14","0","974","<p>I am writing my first Android application, and I have been struggling with this for over a week. It seems like the basis of all android applications yet I cannot understand how to do it. For example, if you are in the Android Settings Menu, you have a list and you click on ""About"", it takes you to the ""About"" Actvitiy etc.</p><p>I need my app to do that as well, I have 5 menu items that I want to be able to select and go to the Activity for the selected item.</p><p>Currently I have my items in a string_array, but I have nothing that corresponds the string name with the activity name I want to goto.</p><p>Can somebody please give me some tips? I am really struggling over here, kind of overwhelmed with the documentation. Thank you in advance!</p>","484707","","484707","","2010-11-01 19:19:37","2010-11-01 19:19:37","Android: How do you use ListView to start an Activity?","<android><listview><activity>","2","0","","",""
"4071973","1","4072032","","2010-11-01 18:41:02","1","406","<p>So my Android app uses a SQLite database. I need to ""replicate"" two or more tables with a central server. The remote server will merge the data from remote client devices (my app), along with a few extra fields to make each record unique, since multiple client devices will be participating. </p><p>This must be a common need for developers using SQL replication so I'm hoping someone can point me to an existing (turn-key) solution. </p><p>If not, I would like to consider methods that doesn't require me to code a lot of specifics about the table schema. Perhaps I could just specify the table and specify the server and that's it. I guess I could even sqlite dump to file then pass the file? </p><p>Thoughts? </p><p>Thanks!</p>","268803","","","","","2010-11-01 18:47:13","JAVA turn-key SQL replication?","<android><xml><json><sqlite><replication>","1","0","","",""
"4071985","1","","","2010-11-01 18:42:31","0","1353","<p>In Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.</p><p>I followed this code to create the textures:<a href=""http://blog.poweredbytoast.com/loading-opengl-textures-in-android"" rel=""nofollow"">link text</a></p><p>and they render fine, but then I don't know how to tell the given rect to use another texture. Do I do something like ""setTexture"" with the ID that is generated in loadTextures() ? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..</p>","493933","","","","","2010-11-01 20:27:50","Android OpenGL ES Multiple Textures for one rect","<android><opengl-es>","1","0","","",""
"4072057","1","4072639","","2010-11-01 18:49:16","2","3478","<p>I've looked in many places, but I cant find a decent tutorial on how to make a SlidingDrawer for my application.</p><p>Say i already have an XML file, and i want to add a sliding drawer to it..i also want to add a textview and listview object, and some buttons in it...how would i go about doing that?</p><p>Any help will be greatly appreciated!</p>","1520919","","","","","2010-11-01 20:05:33","Android SlidingDrawer how-to","<android><listview><slidingdrawer>","1","0","","",""
"4072117","1","4072849","","2010-11-01 18:55:03","5","5650","<p>I have an AsyncTask in which I show a ProgressDialog in the onPreExecute, and hide it again in onPostExecute, something like</p><pre><code>final class UploadTask extends AsyncTask {   ProgressDialog dialog = new ProgressDialog(...);   protected onPreExecute() {      dialog.show();   }   protected onPostExecute() {      dialog.hide();   }};</code></pre><p>The dialog is cancellable and indeed goes away when I press the cancel button during execution of the AsyncTask.</p><p>When this happens, I would like to run some code to cancel the AsyncTask as well (right now, even thought he ProgressDialog goes away, the AsyncTask keeps running and eventually completes). I tried deriving my own class from ProgressDialog and then do</p><pre><code>setOnDismissListener(new OnDismissListener() {@Override public void onDismiss(DialogInterface d) {   /* do something */   }};</code></pre><p>(or something similar with an OnCancelListener), but this simply never gets called.</p><p>Any ideas? I just need some mechanism for the user to cancel a running AsyncTask while a ProgressDialog is showing.</p>","120751","","","","","2010-11-01 20:42:51","Cancel AsyncTask when user presses back button","<android><android-asynctask><progressdialog><cancel-button>","2","0","4","",""
"4072132","1","4090847","","2010-11-01 18:56:26","1","1506","<p>Is there a way to define/customize a border around the currently selected <code>Gallery</code> item? I know, i can create a <code>Drawable</code> and draw four lines into that but there must be a simpler way.</p>","450741","","119895","","2010-11-03 19:27:23","2010-11-03 19:27:23","custom border frame for Gallery widget","<android><selection><border><gallery>","1","0","1","",""
"4072203","1","","","2010-11-01 19:05:48","1","1405","<p>I am using a list view containing check boxes. Could you please help me how to identify which check box has the user selected? Basically I want different functions to be performed when a checkbox is clicked or a list item is selected similar to Android alarm clock.</p>","478535","","1128737","","2012-01-15 08:13:58","2012-01-15 08:13:58","Capturing checkbox event in a listview","<android><listview><checkbox>","1","1","1","",""
"4072239","1","","","2010-11-01 19:10:07","5","8612","<p>I want to build a mobile/tablet application whose core feature will be taking pictures with the camera , viewing pictures and receiving notifications. Also I want to target iphone, ipad and android platforms.</p><p>Titanium appcelerator piqued my interest because of its cross platform appeal. However I am concerned because I've read mixed reviews on SO and other sites. The things that worry me are:</p><ul><li>Subpar android support</li><li>Camera support not fully capable (e.g ios 4.1 HDR capability)</li><li>Camera support buggy</li></ul><p>The nightmare scenario for me would be to invest time in titanium only to discover later on that its a major PITA and drop it and go ""native""</p><p>Please share your thoughts and experiences.</p>","","user308808","","","","2012-09-06 08:31:43","Is Titanium appcelerator worth it for developing camera based application on ipad, iphone and android?","<iphone><android><mobile><titanium><appcelerator>","8","0","2","2013-12-07 05:09:51",""
"4072313","1","4073171","","2010-11-01 19:20:44","3","5281","<p>I want to set the Rounding Mode to HALF_UP on my DecimalFormat, but eclipse is telling me that setRoundingMode() is not available on the DecimalFormat class. My project properties (and the overall Eclipse properties) are using the 1.6 compiler. The developer.android.com site says that I can use either Java 5 or 6 so I'm not sure what the problem is.</p><p><pre><code>import java.math.RoundingMode;import java.text.DecimalFormat;</p><p>completedValueFormatter = NumberFormat.getNumberInstance();DecimalFormat completedDecimalFormat = (DecimalFormat)completedValueFormatter;completedDecimalFormat.setRoundingMode(RoundingMode.HALF_UP);</pre></code></p><p>I've also tried using the android tools to generate an ant-based project, tried this code in the project and also got the same compile error. So it doesn't appear to be related to Eclipse. It seems related to the Android API.</p><p>Any suggestions?</p>","416631","","416631","","2010-11-01 20:43:02","2011-06-09 20:04:38","Rounding Half Up with Decimal Format in Android","<java><android><eclipse><rounding><java-6>","3","3","2","",""
"4072706","1","4094080","","2010-11-01 20:16:29","153","125109","<p>I've spent days trying to launch any Android program. Even ""Hello World"" gives me the same error: </p><blockquote>  <p>""The connection to adb is down, and a severe error has occured"".</p></blockquote><p>I'm running Eclipse Galileo, Google APIs 2.2 8, on a Windows XP machine. </p><p>I've used all the tricks I can find on the web: the command line ""adb kill-server"", the DDMS ""reset ADB"", I started the emulator both before and after Eclipse, and searched for ports being used by other programs. </p><p>What is going on here? Is there a magic combo of versions of Eclipse, Java, adb, emulator, and whatever else that works?</p>","493998","","1608072","","2014-03-08 04:03:03","2014-03-08 04:03:03","""The connection to adb is down, and a severe error has occured.""","<android><android-emulator><adb>","33","6","56","","2013-03-07 22:31:39"
"4072759","1","4072852","","2010-11-01 20:23:32","0","535","<p>I have application, which downloads data from internet and is supposed to write it to DB using content provider.</p><pre><code>private void addCurrency(Currency _currency){    ContentResolver cr=getContentResolver();    ContentValues values = new ContentValues();        values.put(CurrencyProvider.KEY_DATE, _currency.getDate().getTime());    values.put(CurrencyProvider.KEY_NAME, _currency.getName());    values.put(CurrencyProvider.KEY_NOMINAL, _currency.getNominal());    values.put(CurrencyProvider.KEY_VALUE, _currency.getValue());    String w=CurrencyProvider.KEY_NAME+"" = ""+_currency.getName();    if (cr.query(CurrencyProvider.CONTENT_URI, null, w,null , null).getCount()==0){        cr.insert(CurrencyProvider.CONTENT_URI, values);    }else        cr.update(CurrencyProvider.CONTENT_URI, values, w, null);}</code></pre><p>So, I'm trying either to update record if it exists, or to add new.But I'm getting SQLite exception:near ""??????"": syntax error: , while compiling: SELECT * FROM currency WHERE (name = ????????????? ??????)</p>","468311","","","","","2010-11-01 20:38:45","Android Database query","<android><sqlite>","1","0","","",""
"4072781","1","4073262","","2010-11-01 20:26:22","2","6767","<p>I have android source code in my system and it works fine. But when i make some changes in android source files and run ""make"" it doesn't generate/update any filesPlease correct me if i am wrong, </p><p>i) system should generate a new system.img file if changes have been made to its source code </p><p>ii) android kernel file-zImage file doesn't change with any change even if we make any changes to the source code</p><p>Another question if i create a new library folder inside /libcore it gets automatically picked up when compiling. For creating a new library folder outside /libcore i added its path in /build/core/main.mk and .classpath file. Still its not getting picked up during compilation. Can someone please confirm where all we have to make changes for adding a new library file outside /libcore</p><p>Regards,Yogesh</p>","482419","","648313","","2011-07-13 21:00:35","2013-09-29 08:14:38","How to rebuild android source code after making changes in android source files","<android><android-source>","2","2","2","",""
"4072805","1","4072941","","2010-11-01 20:29:14","3","3347","<p>I was exploring various methods for implementing communication between a home made TCP/IP server and a Android client application.</p><p>Some ideas:- TCP/IP Server bases on JSON- Service with WCF library- Some sort of REST server</p><p>What is the beast strategy and libraries to approach this problem? </p>","242450","","","","","2012-03-05 21:35:08","Best communication strategy between Android client and .Net C# server","<c#><android><client><tcp>","3","3","3","",""
"4072882","1","4073127","","2010-11-01 20:44:45","2","1034","<p>I'd like to set focus to an EditText and automatically bring up the virtual keyboard in certain situations.  However, if a phone's hardware keyboard is slid out, I wouldn't want to.  Is there any way to detect whether or not a phone's hardware keyboard (if one exists) is slid out?  Or is there some functionality of the EditText that will handle all this for me?</p>","406790","","","","","2010-11-02 18:25:33","Detect if phone's keyboard is slid out","<android><keyboard><hardware>","1","0","2","",""
"4072910","1","","","2010-11-01 20:48:41","0","419","<p>I'm going through the tutorial <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"" rel=""nofollow"">HelloFormStuff</a>. I started having problems adding the RadioGroup widget. After moving some brackets around I finally got it to work. </p><p>When I tried to add the final (2) widgets, I found if I tried to add them in main.xml below the RadioGroup they wouldn't appear in the app. I guess I could just call it finished and move on, but I took the time to enter all the code (not ctrl C, ctrl P) and damn it, the widgets should show up where I tell them to! Why can't I add widgets below the RadioGroup? </p><pre><code>public class HelloFormStuff extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final EditText edittext = (EditText) findViewById(R.id.edittext);    edittext.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              Toast.makeText(HelloFormStuff.this, edittext.getText(), Toast.LENGTH_SHORT).show();              return true;            }            return false;        }    });    final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox);    checkbox.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks, depending on whether it's now checked            if (((CheckBox) v).isChecked()) {                Toast.makeText(HelloFormStuff.this, ""Selected"", Toast.LENGTH_SHORT).show();            } else {                Toast.makeText(HelloFormStuff.this, ""Not selected"", Toast.LENGTH_SHORT).show();            }        }    });    final RadioButton radio_red = (RadioButton) findViewById(R.id.radio_red);    final RadioButton radio_blue = (RadioButton) findViewById(R.id.radio_blue);    radio_red.setOnClickListener(radio_listener);    radio_blue.setOnClickListener(radio_listener);    final Button button = (Button) findViewById(R.id.button);    button.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks            Toast.makeText(HelloFormStuff.this, ""Beep Bop"", Toast.LENGTH_SHORT).show();        }    });    final ToggleButton togglebutton = (ToggleButton) findViewById(R.id.togglebutton);    togglebutton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks            if (togglebutton.isChecked()) {                Toast.makeText(HelloFormStuff.this, ""Checked"", Toast.LENGTH_SHORT).show();            } else {                Toast.makeText(HelloFormStuff.this, ""Not checked"", Toast.LENGTH_SHORT).show();            }        }    });    final RatingBar ratingbar = (RatingBar) findViewById(R.id.ratingbar);    ratingbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {        public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {            Toast.makeText(HelloFormStuff.this, ""New Rating: "" + rating, Toast.LENGTH_SHORT).show();        }    });    }       private OnClickListener radio_listener = new OnClickListener() {        public void onClick(View v) {            // Perform action on clicks            RadioButton rb = (RadioButton) v;            Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show();        }    };</code></pre><p>}</p>","494000","","","","","2012-11-27 10:24:31","How can I change the order of the RadioGroup widget appears in HelloFormStuff from Android Dev?","<java><android><widget><radio-group>","2","0","","",""
"4073001","1","4073065","","2010-11-01 21:01:07","0","383","<p>Right now I've finished an application that I want to distribute on Android Market.It will have a payed version and a free version with some limited features.While developing it, I was doing obviously just the main project of fully featured release. And now after finished I've included a ""boolean"" DEMO_VERSION=true that restrict those features.</p><p>My question is if it's possible to generate both apk from the same project? Or should I create new project with the same source but changing the java package to tell android market that they're two different applications.</p><p>Thank you very much</p>","474684","","","","","2013-01-25 06:12:11","Compiling demo/final versions of android application for Android Market","<android><google-play>","1","0","","",""
"4073113","1","","","2010-11-01 21:16:10","1","1004","<p>i've 2 android applications. </p><p>The first one ""A"" will be signed with 2 certificates:</p><ul><li>C_1 </li><li>C_2 </li></ul><p>""A"" have broadcastreceiver with the permission setted to android:protectionLevel=""signature"" and it has a shared User id with a system process which has been signed with C_1.</p><p>The second Application ""B"" wants to use this broadcast receiver.</p><p>Now, i've the complete control on the C_2 certificate and a third party agency would sign the ""A"" application with the C_1 certificate. For now i'm using the android debug certificate instead of C_1</p><p>I've done some kind of tests in order to see what happens in the following scenarios:</p><ul><li>If i sign ""A"" with C_1 and ""B"" with C_1 everything works</li><li>If i sign ""A"" with both (in order) C_1 and C_2 , and i sign ""B"" with C_2 it does not work</li><li>If i sign ""A"" with both (in order) C_2 and C_1 , and i sign ""B"" with C_2 it does not work</li><li>If i sign ""A"" with both ( no matter what order ) C_1 and C_2, and i sign ""B"" with C_1 <strong>it does work!</strong></li></ul><p>I think that the sharedUid things in the manifest is causing problems. </p><p>I'm working with an android 2.1-update1 device.</p><p>Any little help would be appreciate. Thanks</p>","314407","","314407","","2010-11-01 21:34:43","2010-11-01 21:34:43","android:protectionLevel ""signature"" with multiple certificates","<android>","0","4","","",""
"4073154","1","4073331","","2010-11-01 21:20:51","1","740","<p>Today, the focus of a cell phone's capabilities is drifting away from plain making a phone call.</p><p>And somehow, this shows in the API's too.  Therefor I'm wondering: if I want to write an app that e.g. pitches up, records, scrambles... an incoming call - you know, the voice on the other side -, what aspect of the API should I use?</p><p>I looked into Android, into Windows Phone, iPhone... (briefly), but had no luck.  Is this just unintended usage?</p>","6610","","","","","2010-11-01 21:48:55","Phone development: interact with the call?","<iphone><android><windows-phone-7><phonecalls>","4","0","1","",""
"4073224","1","4084401","","2010-11-01 21:30:43","1","2727","<p>I have created a startcam from my app.. and this is how the cam activity looks like.. I don't know how to klick to take a picture, where is the button? </p><p>What I want to do is also that when he has taken the picture and he is statiesfied, he click on a ""finished button"" so the picture will be shown on my app. </p><p><img src=""http://i.stack.imgur.com/pEErB.jpg"" alt=""alt text""></p>","371301","","","","","2012-11-04 21:06:24","Android: using camera help, take a picture and use it on my app","<android><camera><android-emulator>","4","0","1","",""
"4073243","1","","","2010-11-01 21:34:12","0","594","<p>Is there way to run programs like spotify when my phone connects spesific bt device. I have bt stereo on my car and I want my phone start play music from spotify.</p>","494087","","","","","2010-11-01 21:41:55","Android - Running applications programmatically","<android><bluetooth><device><spotify>","1","0","","",""
"4073260","1","","","2010-11-01 21:36:14","1","684","<p>I created an app for android (only versions 2.2+) that makes use of the MediaPlayer to stream audio from the internet. It works flawlessly on the emulator. However, when running it on my device (Droid X), it won't play the music. Any ideas of what could be wrong?</p><p>Here's the gist of the code. Note: this code runs in a service.</p><pre><code>MediaPlayer mp = new MediaPlayer();mp.setOnPreparedListener(this)mp.setDataSource(PATH_TO_STREAM);mp.prepareAsync();</code></pre><p>The in onPrepared:</p><pre><code>mp.start();</code></pre>","494099","","494099","","2010-11-01 21:49:34","2011-05-29 14:46:38","Android MediaPlayer Different on Device","<android><media-player>","2","5","","",""
"4073278","1","4073435","","2010-11-01 21:38:43","1","1865","<p>I have a basic handler set up to call the email application in the emulator and send an email. I've set up the email app in the emulator with my info so it's ready to go. However, when I click the button in my app to bring up a compose window I get the prompt that says:""No applications can perform this action""</p><p>Is this just something you can't do with the emulator?</p><pre><code>private OnClickListener submitBtn = new OnClickListener(){    public void onClick(View v){        Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);        String emailTo = ""test@test.com"";        String emailSubject = ""Subject"";        String emailBody = ""Some HTML goes here."";        emailIntent.setType(""text/html"");        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,emailTo);        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,emailSubject);        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailBody));        startActivity(Intent.createChooser(emailIntent, ""Send email in:""));    }};</code></pre>","469219","","469219","","2010-11-01 21:49:00","2011-09-21 12:26:07","Android: Send email through basic email app from another application in emulator?","<android><email-integration>","3","4","1","",""
"4073334","1","","","2010-11-01 21:45:17","0","117","<p>I need to do an internet access to update a field on my UI.  I do the internet access in a background thread by extending AsyncTask.  </p><p>Since I need to update my UI every time the screen is refreshed I am executing the AsyncTask in my onResume method:</p><p>@Overrideprotected void onResume(){ super.onResume();</p><p>showDialog(REFRESH_DIALOG); new UpdateAgentStatusTask().execute();}</p><p>I dismiss the REFRESH_DIALOG dialog in the onPostExecute() method in the AsyncTask.</p><p>For testing I rotate the screen to landscape.  Things work well.  The problem is when I try to rotate again to portrait.  I get 'java.lang.IllegalArgumentException: no dialog with id 1 was ever shown ...'.  id 1 is for the REFRESH_DIALOG.</p><p>How do I get rid of this error?  Is there a better way to do an internet access to update my UI every time the screen is refreshed?</p><p>Thanks,Prasanna</p>","494103","","","","","2010-11-01 21:51:07","Updating UI With An Internet Access Every Time The Screen is Refreshed","<android>","1","0","","",""
"4073515","1","4073593","","2010-11-01 22:07:21","4","2681","<p>In my Android App I have a listview containing 30 rows, and each row consists of several textviews of which one is spannable and sometimes contains a lot of formatted text and images.</p><p>Those images are loaded from the web asynchroneously: A placeholder is displayed until the image has been downloaded is then replaced by the image.</p><p>Unfortunately, the rows of the listview are loaded when I scroll over them. This makes the whole thing very slow. Also, those images are loaded from the web again and again, whenever I scroll over the row.  </p><p>How can I turn it off, that the ListView rows are loaded when I scroll over them? They should be loaded once when I start the activity and never again.</p><p>Best regards and thanks in advance,Jan Oliver</p>","169748","","","","","2010-11-01 22:28:54","Android: Turn off lazy loading of listview","<android><listview>","3","0","1","",""
"4073671","1","","","2010-11-01 22:37:51","2","913","<p>I'm writing a basic application.  One of the features I'm interested in trying to do is to launch another app, INSIDE the app already running.</p><p>Eg. I have an app with 3 menu options, 1 and 2 do certain tasks as part of this parent app, menu option 3 launches another app that's installed on the phone.I'm not sure if this is possible?  </p>","494132","","1108213","","2012-03-07 13:07:08","2012-03-07 13:07:08","Launching Android app, within an app?","<android>","1","0","","",""
"4073673","1","","","2010-11-01 22:37:56","1","739","<p>Aren't these competitors?  I'm thinkin they're not, but don't see it.</p><p>How about within the context of an Activity needing to learn when a Service has new xyz?</p><p>Thanks!</p>","294973","","","","","2010-11-01 22:37:56","Android: looper/handler vs. Java Observer?","<java><android><handler><observer-pattern><looper>","0","3","1","",""
"4073681","1","4083779","","2010-11-01 22:38:42","5","3221","<p>I know of </p><pre><code>ant coverage</code></pre><p>However that does a few things, it compiles with emma instrumentation, installs, and runs the test apk. I don't want it to run the test suite through ant with coverage because I need to run it with some extra hooks, and I don't want to run the large test suite twice. So far I have tried this</p><p><strong>Target_Project/build.properties</strong></p><pre><code>emma.enabled=true</code></pre><p><strong>Test_Project/build.properties</strong></p><pre><code>emma.enabled=true</code></pre><p>Then in in a shell I execute this.</p><pre><code>Target_Project$ ant debugTarget_Project$ adb install bin/Target_Project-debug.apkTarget_Project$ cd ../Test_Project/Test_Project$ ant debugTest_Project$ adb install bin/Test_Project-debug.apkTest_Project$ adb shell am instrument -e coverage true -e coverageFile /sdcard/myFile.ec -w com.my_app.testproject/android.test.InstrumentationTestRunner</code></pre><p>The response is </p><pre><code>Error: Failed to generate emma coverage. Is emma jar on classpath?</code></pre><p>So is there a trick to getting the apk to build with the emma libs? I tried invoking the targets created in the sdk xml templates but they are ""private."" Is there something I am missing?</p>","307990","","","","","2011-11-29 10:59:26","Is it possible to simply compile an Emma instrumented APK using Android build.xml and not run any tests","<android>","2","0","","",""
"4073749","1","4087813","","2010-11-01 22:52:56","1","7281","<p>I opened my NotepadCodeLab, NotepadAdv1 project, and got this as soon as I built and ran:</p><pre><code>[2010-11-01 14:42:48 - DeviceMonitor]Sending jdwp tracking request failed![2010-11-01 14:42:48 - Logcat]device not foundcom.android.ddmlib.AdbCommandRejectedException: device not foundat com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)at com.android.ddmlib.Device.executeShellCommand(Device.java:285)at com.android.ddmuilib.logcat.LogPanel$3.run(LogPanel.java:516)</code></pre><p>What am I missing?</p>","172232","","","","","2011-01-08 06:31:42","Android: Logcat]device not found on running Google's sample Notepad app","<android><android-emulator><logcat>","3","1","","",""
"4073763","1","8791908","","2010-11-01 22:54:38","1","404","<p>I am creating a <code>AppWidget</code> that consists of a <code>ImageView</code> that gets filled with a custom rendered bitmap. This widget is refreshed every minute (using the <code>AlarmManager</code>).</p><p>All the rendering and storage is done in the <code>AppWidgetProvider</code>.</p><p>Being a good citizen I wanted to minimize CPU usage etc, so I had my <code>Paint</code> objects and other pre-calculated values stored in static fields in the <code>AppWidgetProvider</code>.</p><p>However, it turns out that my <code>AppWidget</code> process is very eager to die on me when it's hanging around with the cool kids doing nothing.  I understand this is standard behaviour. However, with it's tragic death, it also takes my precious statically stored objects with it into the grave, never to be seen again, which is a lot less convenient.</p><p>My mourning doesn't solve anything, so I wonder: is there a way to deal with this? Or is there just no way to do that, and should I fall back to reinitializing everything on every redraw?</p>","107029","","","","","2012-02-29 18:36:51","AppWidget: How to retain static objects between updates?","<android><android-widget>","3","2","1","",""
"4073907","1","4074665","","2010-11-01 23:18:37","10","11651","<p>I have a widget, its setup so that when I click on it, it opens some settings in an activity. </p><pre><code>views.setOnClickPendingIntent(R.id.btnActivate, pendingIntent);</code></pre><p>This configures some settings for the application. What I want to achieve is to have the widget update its view to reflect the changed settings when the Activity I launch closes. Using the update interval or any other type of polling isn't appropriate for this. </p><p>I've seen a couple places here and in the android docs this code used:</p><pre><code>appWidgetManager.updateAppWidget(mAppWidgetId, views);</code></pre><p>But I don't know how to get the mAppWidgetId value. I tried following the example for a widget configuration activity here <a href=""http://developer.android.com/guide/topics/appwidgets/index.html"">http://developer.android.com/guide/topics/appwidgets/index.html</a>, but in the following code, </p><pre><code>    Intent intent = getIntent();Bundle extras = intent.getExtras();if (extras != null) {    mAppWidgetId = extras.getInt(            AppWidgetManager.EXTRA_APPWIDGET_ID,             AppWidgetManager.INVALID_APPWIDGET_ID);}</code></pre><p>extras is always null, so I never get the AppWidgetID.</p><p>Ok, now I'm just rambling. What do you think I can do?</p>","178014","","213269","","2010-12-21 16:43:37","2011-10-12 10:27:21","Update Android Widget From Activity","<android><activity><widget>","2","0","3","",""
"4073957","1","4074321","","2010-11-01 23:27:24","0","1244","<p>Thanks in advanced!</p><pre><code> package com.ewebapps;import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.view.View;public class Dot extends View {     private final float x;     private final float y;     private final int r;     private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);     private final Paint mWhite = new Paint(Paint.ANTI_ALIAS_FLAG);     public Dot(Context context, float x, float y, int r) {         super(context);         mPaint.setColor(0xFF000000); //Black         mWhite.setColor(0xFFFFFFFF); //White         this.x = x;         this.y = y;         this.r = r;     }     @Override     protected void onDraw(Canvas canvas) {         super.onDraw(canvas);         canvas.drawCircle(x, y, r+2, mWhite); //White stroke.         canvas.drawCircle(x, y, r, mPaint); //Black circle.     }}</code></pre>","494151","","","","","2010-11-02 01:26:45","Anyone know how to attach a touch listener to this class?","<android><class><view><extend><ontouchlistener>","3","2","1","",""
"4073982","1","5181010","","2010-11-01 23:34:19","6","1959","<p>Maybe I'm missing something. I want to write test cases for a BroadcastReceiver; specifically, it is for receiving the BOOT_COMPLETED event and setting an alarm for another receiver to handle later; it doesn't seem to be setting it properly, but the point is that I have no obvious way to test it. I can't exactly attach a debugger and wait for BOOT_COMPLETED, and I can't send a fake BOOT_COMPLETED broadcast.</p><p>Why are there instrumentation classes for Activity, Service, and Provider, but not BroadcastReceiver? Any advice for testing this?</p>","262768","","","","","2012-12-05 14:55:11","Why is there no test instrumentation for BroadcastReceiver?","<android><testing><tdd><broadcastreceiver><instrumentation>","2","0","6","",""
"4074025","1","","","2010-11-01 23:45:51","0","282","<p>I am currently looking into ways of generating one way hashes to share sensitive information like passwords to a web application backend.</p><p>Based on the documentation I cannot find any hashing algorithms that are supported by android OS that are larger than 512.</p><p>Are there any 1024 bit hashing algorithms for android? </p>","494160","","2571762","","2013-07-11 08:43:59","2013-07-11 08:43:59","generate 1024 bit hashes on android","<android><hash>","1","1","","",""
"4074072","1","4074164","","2010-11-01 23:58:44","1","4818","<p>I have a PreferenceActivity that loads its preferences from an XML file which looks like this</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen    xmlns:android=""http://schemas.android.com/apk/res/android""    android:key=""first_preferencescreen""&gt;   &lt;ListPreference android:key=""currlist""    android:title=""Change Currency""    android:summary=""Selecting a new currency will reset your jar!""    android:entries=""@array/currencies""    android:entryValues=""@array/currency_vals"" /&gt;    &lt;EditTextPreference    android:key=""goaltxt""    android:title=""Set Goal""    android:inputType=""numberDecimal""    android:text=""0.00""    /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>I want to pass both the currency type and the goal back to the main class, and all the explanations I've found are very vague. In my onStart() method in my main class I have this so far:</p><pre><code>public void onStart() {  SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);  SharedPreferences myPrefs = this.getSharedPreferences(""myPrefs"", MODE_WORLD_READABLE);  final SharedPreferences.Editor prefsEditor = myPrefs.edit();  prefs.getInt(""currlist"", 0);  prefs.getFloat(""goaltxt"", 0); }</code></pre><p>This is really frustrating, and I'd love some insight on how SharedPreferences works. Thanks!</p>","468498","","","","","2010-11-02 00:29:02","Android SharedPreferences from PreferenceActivity","<android><preferences>","1","1","3","",""
"4074097","1","4074582","","2010-11-02 00:04:28","0","1565","<p>I have a tabhost that contains three tabs showing three separate activities. One of those activities needs to show the indeterminate progress bar on the title bar.</p><p>If I set that activity as the MAIN, everything works fine. </p><p>As soon as I use a tabhost to show the activity, I cannot show an indeterminate progress on the title bar for the tabhost activity.</p><p>One way could be to have methods on the tabhost class that show the progress on it's title bar, but I do not know how to access those methods from outside the tabhost (for example, from another activity).</p><p>Does anyone know of a solution?</p>","392178","","","","","2010-11-02 02:46:23","How do I show indeterminate progress in the title bar on a tabhost?","<android><activity><progress><android-tabhost>","1","0","","",""
"4074098","1","","","2010-11-02 00:04:46","-3","9094","<p>test.class type is right? How to? What should I do?</p><pre><code>&lt;Preference     android:key=""test""     android:title=""test""     android:summary=""test""&gt;    &lt;intent android:action=""test.class"" &gt;  &lt;=== **ERROR/AndroidRuntime(2384): android.content.ActivityNotFoundException: No Activity found to handle Intent**     &lt;/intent&gt;  &lt;/Preference&gt; </code></pre>","493363","","808940","","2011-09-10 14:44:23","2011-09-10 14:44:23","ActivityNotFoundException when launching intent from preferences","<android><android-intent><action><preferences>","2","1","1","",""
"4074181","1","","","2010-11-02 00:34:49","0","803","<p>I have problem with width of ImageButtons, it isn't the same size. I have experimented with all attributes for two hours and nothing. I create buttons at runtime and put inside row (also created at runtime). Does anybody know any solution for this ?<img src=""http://i.stack.imgur.com/pVlO5.png"" alt=""alt text""></p><pre><code>public static TableRow[] Create(List&lt;Apartment&gt; list){        TableRow[] rows=null;        try{            rows=new TableRow[list.size()*3];            int i=0;            for(final Apartment ap : list){                rows[3*i]=new TableRow(activity);                rows[3*i+1]=new TableRow(activity);                rows[3*i+2]=new TableRow(activity);                rows[3*i].setLayoutParams(new LayoutParams(                         LayoutParams.WRAP_CONTENT,                         LayoutParams.FILL_PARENT));                rows[3*i+1].setLayoutParams(new LayoutParams(                         LayoutParams.WRAP_CONTENT,                         LayoutParams.FILL_PARENT));                rows[3*i+2].setLayoutParams(new LayoutParams(                         LayoutParams.WRAP_CONTENT,                         LayoutParams.FILL_PARENT));                rows[3*i].setBackgroundColor(color_background[(i%2)]);                rows[3*i+1].setBackgroundColor(color_background[(i%2)]);                rows[3*i+2].setBackgroundColor(color_background[(i%2)]);                TextView txtMainInform=new TextView(activity);                txtMainInform.setText(ap.GetMainInformation());                txtMainInform.setLayoutParams(new LayoutParams(                         LayoutParams.WRAP_CONTENT,                         LayoutParams.WRAP_CONTENT));                rows[3*i].addView(txtMainInform);                rows[3*i].setVisibility(1);                TextView txtMoreInform=new TextView(activity);                txtMoreInform.setText(ap.GetMoreInformation());                txtMoreInform.setLayoutParams(new LayoutParams(                         LayoutParams.WRAP_CONTENT,                         LayoutParams.WRAP_CONTENT));                rows[3*i+1].addView(txtMoreInform);                ImageButton imbCall=new ImageButton(activity);                imbCall.setImageResource(R.drawable.phone);                imbCall.setOnClickListener(new OnClickListener() {                      public void onClick(View v) {                         if(ap.GetContact()!=null){                          try {                            activity.startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(""tel:"" + ap.GetContact())));                          } catch (Exception e) {                            e.printStackTrace();                          }                        }                    }                });                imbCall.setMaxWidth(24);                imbCall.setMinimumWidth(22);                ImageButton imbGallery=new ImageButton(activity);                imbGallery.setMaxWidth(24);                imbGallery.setMinimumWidth(22);                imbGallery.setImageResource(R.drawable.gallery_icon);                ImageButton imbMap=new ImageButton(activity);                imbMap.setImageResource(R.drawable.map);                imbMap.setMaxWidth(24);                  imbMap.setMinimumWidth(22);                imbMap.setOnClickListener(new OnClickListener() {                      public void onClick(View v) {                           Intent i = new Intent(activity,ResultMap.class);                           activity.startActivity(i);                    }                  });                ImageButton imbWay=new ImageButton(activity);                imbWay.setMaxWidth(24);                imbWay.setMinimumWidth(22);                imbWay.setImageResource(R.drawable.walker);                rows[3*i+2].addView(imbCall);                rows[3*i+2].addView(imbGallery);                rows[3*i+2].addView(imbMap);                rows[3*i+2].addView(imbWay);                i++;            }        }        catch(Exception e){        }        return rows;    }</code></pre>","486578","","2571762","","2013-07-11 08:46:12","2013-07-11 08:46:12","ImageButton isn't the same size","<android><android-button><android-image>","1","3","","",""
"4074189","1","4074251","","2010-11-02 00:36:15","0","1253","<p>I wounder if there is some possible to know from which parent Iam coming from in the child so I can do different stuff depending on who the parent is of the activity.. </p><p>This is how Iam going over to the child. But I don't know how to handle this in the child to check who is the parent. </p><pre><code>    public void chooseLocation(View v){    Intent i = new Intent();    i.setClass(InsertAd.this, Location.class);    startActivityForResult(i, REQ_CODE_SELECT_LOCATION);}</code></pre><p>The above code is used on one of the parents,, is there somehow I can use ""EQ_CODE_SELECT_LOCATION""?</p><p>Also I wounder how is possible to send data to a child activity?</p>","371301","","","","","2010-11-02 01:06:57","Android: Pass data to a child activity, Detect who is the parent","<android><activity>","1","0","","",""
"4074260","1","4076120","","2010-11-02 01:04:31","4","473","<p>I know that we have 10 seconds to handle an intent; otherwise, watch dog timer will kick in.  And its suppose be a light-weight function.  So my question is, does the BroadcastReceiver run in the same process as your root activity?  Or does it run on Zygote system process?</p>","486927","","","","","2010-11-02 08:50:39","When your BroadcastReceiver is invoked via an Intent, what process does it run on?","<android><process><android-intent><broadcastreceiver>","1","2","","",""
"4074355","1","4074377","","2010-11-02 01:39:16","0","476","<p>I'm going to be using</p><pre><code>setBackgroundResource(R.drawable.background)</code></pre><p>in my onCreate() method. </p><p>When I create the XML file with the  and its colors, what type of resource am I creating? ""values"", ""layout""?</p><p>Thanks!</p>","479180","","","","","2010-11-02 01:45:30","drawable for background view - what type of resource?","<java><android>","1","0","","",""
"4074366","1","","","2010-11-02 01:42:06","0","665","<p>everyone,in my app i try to write a message to sms inbox like this way <code>ContentValues cv = new ContentValues();<br>             cv.put(""thread_id"", ""111"");<br>             cv.put(""address"", ""100000"");              cv.put(""protocol"", ""0"");             cv.put(""body"", serverData);             cv.put(""read"", ""0"");             context.getContentResolver().insert(Uri.parse(""content://sms/inbox""), cv);</code>but then the message inbox is empty it will no records in message inbox,if i use the other emulator send a message to this one,all the message will appear include  that i write by that code. any help? thanks!</p>","492004","","","","","2013-12-21 22:16:35","write sms problems!","<android><sms>","3","0","","",""
"4074405","1","","","2010-11-02 01:55:57","0","90","<p>Sorry if question is stupid but I am new to android, I need to put map in my android app. I looked at net and I run keytool.exe and get key, but when I run app it crushed and</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainlayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.google.android.maps.MapView                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:apiKey=""0WR3Cl0evv0U6G2xH9ZnvEFYbDiSDUu_GRovTUQ""                 /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I don't know what is wrong. I put in manifest in application tag , like I saw on net. Is that all I need to do or I make something wrong ? Did I escape some step ? </p>","486578","","","","","2011-12-20 18:17:30","Google maps problem - not start","<android>","1","1","","",""
"4074450","1","4074478","","2010-11-02 02:10:57","2","164","<p>In my Android app, I have a Bitmap object and an int[]. One algorithm in my app copies the Bitmap pixel values to the int[] and then modifies the values in the latter.</p><p><em>I want to save the contents of the raw int[] to disk as quickly as possible. What is a fast and memory efficient way to do this? (i.e. calling a .writeInt function on each int[] item would be a very slow way to do this in Android as there is no JIT on most devices)</em> </p><p>I found that if I create a byte[] of the same size as the int[] and copy the int[] to the byte[], I can then use one of many file io methods to write the byte[] to disk in one API call. However, this uses a lot of extra memory as I now have two versions of the int[].</p><p>Failing this, perhaps there is some method that will directly write the int values of a Bitmap into a file? If so, I could copy the int[] back into the Bitmap object and use this.</p><p>By the way, I don't want to use "".png"" compression and just want to save the raw values as the latter is much quicker. </p>","483701","","","","","2010-11-02 17:01:31","Writing an int[] to disk quickly?","<java><android><mobile>","3","0","","",""
"4074558","1","4081853","","2010-11-02 02:40:23","2","2639","<p>I have some binary data (pixel values) in a int[] (or a byte[] if you prefer) that I want to write to disk in an Android app. I only want to use a small amount of processing time but want as much compression as I can for this. What are my options?</p><p>In many cases the array will contain lots of consecutive zeros so something simple and fast like RLE compression would probably work well. I can't see any Android API functions for this though. If I have to loop over the array in Java, this will be very slow as there is no JIT on most Android devices. I could use the NDK but I'd rather avoid this if I can.</p>","483701","","","","","2011-03-01 15:47:27","Fast way to compress binary data?","<java><android><mobile>","5","4","0","",""
"4074574","1","4133791","","2010-11-02 02:44:30","2","789","<p>I have a imageview that I want to change the color based on a user choice</p><p>From examples on the internet I see the only way to really do this is by going through and modifying each pixel... however it seems to be EXTREMELY slow</p><p>if I add this into my code, it takes long enough that it prompts the user to force close or wait</p><pre><code> for(int i =0 ; i &lt; mBitmap.getHeight(); ++i)         {             for(int g = 0; g &lt; mBitmap.getWidth(); ++g)             {             }         }</code></pre><p>What is the best way to change the color of the image?</p><p>The Image is a small image 320x100 and is mostly transparent with a small image in the inside, the small image I want to change the color of</p>","478183","","","","","2010-11-09 12:46:59","Android Bitmap Color Modify in Real Time","<android><android-widget>","2","1","","",""
"4074655","1","4074692","","2010-11-02 03:06:40","1","109","<p>I have an app out that involves keeping track of information over time.  Part of the app is a reset button.  In order to avoid accidental resets, I made that button respond only to long-clicks.  However, that approach confused about 20% of my new users, who thought that the reset button must not be working.</p><p>Is there a more intuitive (and standard) way to protect a button from accidental presses?  (If not, I can add some sort of custom message to the button I have . . . )</p>","456878","","","","","2010-11-02 04:14:23","What do you do to protect the user from a dangerous button in Android?","<android><button>","2","3","","",""
"4074691","1","","","2010-11-02 03:16:38","1","4840","<p>I'm attempting to make a soap call using ksoap2-android the server is expecting a soap request to look like this below.</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8"" ?&gt; &lt;soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""&gt;&lt;soapenv:Body&gt;&lt;hilo:getHLPredAndMetadata xmlns:hilo=""http://opendap.co-ops.nos.noaa.gov/axis/webservices/highlowtidepred/wsdl""&gt;  &lt;stationId xmlns=""""&gt;8454000&lt;/stationId&gt;   &lt;beginDate xmlns=""""&gt;20060920 00:00&lt;/beginDate&gt;   &lt;endDate xmlns=""""&gt;20060922 23:59&lt;/endDate&gt;   &lt;datum xmlns=""""&gt;0&lt;/datum&gt;   &lt;unit xmlns=""""&gt;0&lt;/unit&gt;   &lt;timeZone xmlns=""""&gt;0&lt;/timeZone&gt;   &lt;/hilo:getHLPredAndMetadata&gt;  &lt;/soapenv:Body&gt;  &lt;/soapenv:Envelope&gt;</code></pre><p>But after adding properties I get the following output:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8"" ?&gt; &lt;v:Envelope xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:d=""http://www.w3.org/2001/XMLSchema"" xmlns:c=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:v=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;v:Header /&gt; &lt;v:Body&gt;&lt;n0:getHLPredAndMetadata id=""o0"" c:root=""1"" xmlns:n0=""http://opendap.co-ops.nos.noaa.gov/axis/webservices/highlowtidepred/wsdl""&gt;  &lt;stationId i:type=""d:string""&gt;8722669&lt;/stationId&gt;   &lt;beginDate i:type=""d:string""&gt;20101101 00:00&lt;/beginDate&gt;   &lt;endDate i:type=""d:string""&gt;20101101 23:00&lt;/endDate&gt;   &lt;datum i:type=""d:int""&gt;0&lt;/datum&gt;   &lt;unit i:type=""d:int""&gt;0&lt;/unit&gt;   &lt;timeZone i:type=""d:int""&gt;0&lt;/timeZone&gt;   &lt;/n0:getHLPredAndMetadata&gt;  &lt;/v:Body&gt;  &lt;/v:Envelope&gt;</code></pre><p>The Source is pretty straight foward.  After making the call I get an error below:<strong>11-02 03:01:01.151: ERROR/NoaaTideSoap(389): unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@44eff1b8) 11-02 03:01:01.151: ERROR/NoaaTideSoap(389): org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@44eff1b8)</strong> 11-02 03:01:01.151: ERROR/NoaaTideSoap(389):     at org.kxml2.io.KXmlParser.exception(KXmlParser.java:245)11-02 03:01:01.151: ERROR/NoaaTideSoap(389):     at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1365)11-02 03:01:01.151: ERROR/NoaaTideSoap(389):     at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)11-02 03:01:01.151: ERROR/NoaaTideSoap(389):     at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)11-02 03:01:01.151: ERROR/NoaaTideSoap(389):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)</p><p>I'm not sure weather I am getting this error because of a KSOAP issue.  I cannot see a response coming back from the service i am calling.</p><p>My thought is that the service is expecing a prefix ""hilo"" like they specify here:</p><p>and and where my call looks like:</p><p>Additionally in the properties they expect:  </p><p>8454000</p><p>and again the attibutes are different</p><p>8722669</p><p>Does anyone know how to set these values using KSOAP?  </p><p>Below is a code snip:</p><pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);  request.addProperty(""stationId"",""8722669"");  request.addProperty(""beginDate"",""20101101 00:00"");  request.addProperty(""endDate"",""20101101 23:00"");  request.addProperty(""datum"",0);  request.addProperty(""unit"",0);  request.addProperty(""timeZone"",0);  SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);  //soapEnvelope.dotNet = true;  soapEnvelope.setOutputSoapObject(request);  AndroidHttpTransport aht = new AndroidHttpTransport(URL);  aht.setXmlVersionTag(""&lt;?xml version=\""1.0\"" encoding= \""UTF-8\"" ?&gt;"");  aht.debug = true;</code></pre><p>Thanks in advance</p>","429530","","","","","2014-03-21 13:45:32","KSOAP2-Android SoapEnvelope Errors / Questions","<android><soap><ksoap2>","2","0","","",""
"4074711","1","4081871","","2010-11-02 03:22:32","19","11712","<p>I would prefer to just use <code>openjdk-6-jdk</code> (version 6b20-1.9.1-1ubuntu3). But I'm just starting the Android SDK installation, so if Sun (Oracle) Java is really needed, I suppose now is the time to install it. Any advice?</p>","463994","","56285","","2013-10-15 07:27:11","2013-10-15 07:27:11","Is Sun Java really necessary for using Android SDK on Ubuntu 10.10? I prefer OpenJDK","<java><android><openjdk>","4","2","5","",""
"4074721","1","4088454","","2010-11-02 03:24:33","2","713","<p>I have a few iphone and andriod apps and would like to collect better and more targeted user feedback for them. The feedback from the App stores is pretty generic and doesn't add much value at most times. </p><p>Any framework or website that I could use to help here? Kind of like Get Satisfaction for Mobile Apps. </p>","494268","","494268","","2010-11-02 03:32:41","2011-11-03 22:15:26","Collecting custom end user feedback for Mobile Apps?","<iphone><android><feedback>","2","0","3","2011-11-08 17:31:51",""
"4074808","1","4074842","","2010-11-02 03:53:43","19","25122","<p>i am trying to connect to a server on my network running a tcp listener using the following java code. I am getting am IOException - Permission Denied. It is from an android 2.2 emulator.</p><p>Does anyone know why?</p><pre><code>Socket socket = new Socket(""1.1.1.1"", 1111);PrintWriter out = new PrintWriter(socket.getOutputStream(), true);out.println(""test"");socket.close();</code></pre>","96854","","","","","2013-02-24 09:42:40","Java socket IOException - permission denied","<java><android><sockets><permissions>","2","2","4","",""
"4074840","1","4075785","","2010-11-02 04:04:08","11","4131","<p>I have a ListActivity and a MapActivity.  I would like to launch either one of these activities on application startup that has been chosen by the user in a preferences window.</p><p>So far the only way I see to launch an activity on application startup is to specify it in the application manifest file using...</p><pre><code>  &lt;activity android:name="".MyActiivty""        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>I am thinking I might have to start an activity that does nothing but looks at the user preferences and then launches either the ListActivity or MapActivity.  Seems like a waste to have an activity do nothing but launch another activity.  In my research I have not found any solution to this problem. Any suggestions would be greatly appreciated.</p><p>Thanks &amp; Regards,Dave</p>","494287","","","","","2010-11-11 03:31:25","Can I launch different Activities on startup depending on user preferences?","<android>","2","1","5","",""
"4074937","1","4075082","","2010-11-02 04:35:22","26","51739","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2159320/how-to-size-an-android-view-based-on-its-parents-dimensions"">How to size an Android view based on its parent’s dimensions</a>  </p></blockquote><p>how do I use <code>getMeasuredWidth()</code> and <code>getMeasuredHeight</code>? It always returns 0. what is the diffrence between this and <code>getHeight()</code> and <code>getWidth()</code>? </p>","481239","","","","","2014-02-19 16:37:21","Android: How to get a custom View's height and width?","<android><views>","7","1","7","2013-01-31 20:03:14",""
"4074979","1","","","2010-11-02 04:48:40","0","5505","<p>I have just overide my back button in my code like this</p><pre><code>        @Override        public boolean onKeyDown(int keyCode, KeyEvent event) {            if (keyCode == KeyEvent.KEYCODE_BACK) {                return true;            }            return super.onKeyDown(keyCode, event);        }        @Override        public boolean onKeyUp(int keyCode, KeyEvent event)          {                 {                       startActivity(new  Intent(context, MainDialog.class));                       finish();                return true;            }            return super.onKeyUp(keyCode, event);        }</code></pre><p>Now I am facing a weird problem,I have a edit text on the current Activity.At the time of editing when I am trying to close the virtual keyboard by pressing the backbutton .My Application finishes...But I just want to close the keyboard not the Avtivity..Any suggestion to solve my issue..?</p><p>Thanks in advance,Tanmay </p><hr><pre><code>I have tried both        @Override    public boolean onKeyUp(int keyCode, KeyEvent event)         {        if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {               startActivity(new  Intent(context, MainDialog.class));               finish();               return true;        }        return super.onKeyUp(keyCode, event);    }</code></pre><p>and</p><pre><code>        @Override    public boolean onKeyUp(int keyCode, KeyEvent event)         {        if (keyCode == KeyEvent.KEYCODE_BACK ) {               startActivity(new  Intent(context, MainDialog.class));               finish();               return true;        }        return super.onKeyUp(keyCode, event);    }</code></pre><p>But no result.Any suggestion!!</p>","463721","","54680","","2011-09-22 03:17:54","2011-12-17 07:57:36","Overriding Back Button Action in Activity","<android><override><back-button>","2","1","","",""
"4074995","1","","","2010-11-02 04:52:47","0","804","<p>I am using min3d for importing 3D model in *.obj format to android 1.6. However, I need to detect which face I am touching. So I intend to use color picking using the following code. </p><pre><code>FloatBuffer pixel = FloatBuffer.allocate(4);                IntBuffer viewport = IntBuffer.allocate(4);                gl.glGetIntegerv(GL11.GL_VIEWPORT, viewport);                gl.glFlush();                viewport.position(0);                gl.glReadPixels((int) x, (int) (viewport.get(3) - y), 1, 1,                        GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixel);                Log.d(""Pixel Values:"", pixel.get(0) + "" "" + pixel.get(1) + "" ""                        + pixel.get(2) + "" "" + pixel.get(3));</code></pre><p>where x and y are co-ordinates received from onTouch listener. When this code is executed I always get 0 0 0 0 in logs. How to solve this ?</p>","368084","","368084","","2010-11-02 05:00:47","2010-11-02 05:08:47","glReadPixel returns 0 in android 1.6","<android><opengl-es>","1","2","","",""
"4075066","1","4075114","","2010-11-02 05:13:21","0","1595","<p>In my android application i am using a loading screen,processed by Async task.In do in background of this task i would like to display a alert whenever an upgraded version exist in the server.Could you please let me know if there is any way that i can do it in android.</p><p>The code is </p><blockquote>  <p>public class Task extends AsyncTask {</p></blockquote><pre><code>    // can use UI thread here    protected void onPreExecute() {        // this.dialog.setMessage(""Loading..."");        prgbar.setVisibility(View.VISIBLE);        // this.dialog.show();    }    @Override    protected Void doInBackground(Void... params) {        try {                final UpGradation upgrade=(UpGradation) ParserServiceImpl.getUpgrade(); //check this method name correctly.                if(upgrade != null)                {                    try {                        pInfo = getPackageManager().getPackageInfo(""com.docomo.aptv"", PackageManager.GET_META_DATA);                        String temp = pInfo.versionName;                       int pversion= pInfo.versionCode;                       int upversion=Integer.parseInt(upgrade.getVersion());                       Log.i(""VALUE RETURNED"",""""+pversion);                        Log.i(""jayantha"",""version name""+pInfo.versionName);                        Log.i(""jayanth"",""version code""+pInfo.versionCode);                       if(pversion!=upversion)                        {                            final AlertDialog alert = new AlertDialog.Builder(context).create();                            alert.setTitle(""Updates"");                            alert.setMessage(""An updated version of the application is present.Do you wish to download."");                             alert.setButton(""OK"", new DialogInterface.OnClickListener() {                                      public void onClick(DialogInterface dialog, int which) {                                    alert.dismiss();                                        Intent i = new Intent(Intent.ACTION_VIEW);                                         i.setData(Uri.parse(upgrade.getURL().trim()));                                         startActivity(i);                                         finish();                                   } });                              alert.setButton2(""Cancel"",                                        new DialogInterface.OnClickListener() {                                            public void onClick(                                                    DialogInterface dialog,                                                    int which) {                                                return;                                            }                                        });                            alert.setIcon(R.drawable.application_icon_50x50);                            alert.setCancelable(false);                            alert.show();                           }                      }                      catch (NameNotFoundException e1) {                        // TODO Auto-generated catch block                        e1.printStackTrace();                    }                }</code></pre><p>Please forward your suggestions.</p><p>Thanks in advance :)</p>","420261","","420261","","2010-11-02 05:21:03","2010-11-02 05:25:41","display alert inside Async doinbackground in android","<android>","2","0","0","",""
"4075152","1","4075173","","2010-11-02 05:36:05","1","1268","<p>I'm getting a FileNotFoundException when I'm trying to download the file <a href=""http://tfob.azstarnet.com/images/authors/Alcal%C3%A1_Kathleen_small.jpg"" rel=""nofollow"">http://tfob.azstarnet.com/images/authors/Alcal%C3%A1_Kathleen_small.jpg</a>. The problem is almost certainly the fact that the url has an accented character in the string. How can I deal with that? This is how I'm downloading it.</p><pre><code>Log.d(TFOB.TAG, ""Image src: "" + desc.getString(""image""));productURL = new URL (desc.getString(""image"").trim());prod = productURL.openConnection();is = prod.getInputStream(); // Exception gets thrown herebis = new BufferedInputStream(is); bit = BitmapFactory.decodeStream(bis);</code></pre><p>This is the stacktrace.: </p><pre>Image src: http://tfob.azstarnet.com/images/authors/Alcalá_Kathleen_small.jpgjava.io.FileNotFoundException: http://tfob.azstarnet.com/images/authors/Alcalá_Kathleen_small.jpgorg.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)</pre><p>Do I have to escape the accent or something?</p>","375874","","","","","2012-05-11 07:50:48","FileNotFound except when getting URL resource with an accent java","<java><android><url><bitmap>","2","0","","",""
"4075171","1","4075192","","2010-11-02 05:40:44","2","2053","<p>i am trying to get an android app to send tcp data to a server on my network. The server was written in c#.</p><p>When i use the code below to transmit data, the server only receives a whole series of \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0.</p><p>Does anyone know why?</p><pre><code>Socket socket = new Socket(host, port);PrintWriter pw = new PrintWriter(socket.getOutputStream(), true);pw.print(""test"");socket.close();</code></pre>","96854","","","","","2010-11-02 08:46:00","Unable to send data over TCP from java socket to .net tcp server","<android><sockets><tcp><client>","3","1","","",""
"4075178","1","4075368","","2010-11-02 05:42:55","2","2548","<p>i am implementing  puzzle game application in this application create one button in click the button  display  original image of the puzzle .original image display in dialog box  then click ok  return in to actual page  how can implemented </p><pre><code>bitmapOrg = BitmapFactory.decodeResource(getResources(),mThumbIds[GameActivity.level]);</code></pre><p>please  forward some solution  its urgent this issue pending more days  thanks in advance</p>","254790","","1649309","","2013-01-31 09:20:18","2013-01-31 09:20:18","in dialog box set view insert drawable image how can set in android","<android><android-alertdialog><android-dialog>","2","0","2","",""
"4075180","1","4075857","","2010-11-02 05:43:28","10","8912","<p>In my application there are three activities A -> B -> C -> A. I want to detect application's idle time, so that after 15 mins it will pop up a message irrespective of activity. what is the best method to implement this.  </p>","405747","","","","","2012-05-22 06:19:58","Application idle time","<android>","2","0","10","",""
"4075195","1","4075351","","2010-11-02 05:45:48","4","1318","<p>I'm developing a small Android database app.  Associated with the records in the database is a number of images (the image resolution will probably same as the screen on the device), there could be up to 20 images per record.  Where would be the best place to store the images.  I'm thinking either in the database itself or on the SD card.  I'm pretty new to Android and as yet not really sure what I'm doing.</p>","48445","","","","","2010-11-03 06:32:46","storing images on android","<android><database><image>","2","0","1","",""
"4075239","1","4075670","","2010-11-02 05:54:57","0","1606","<p>I have two classes as Splash.java and Activity2.java!! I have tried simple code for splash as:</p><pre><code>public class Splash extends Activity {    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.splash);        Thread thread= new Thread()        {            @Override            public void run()             {                    super.run();                    startActivity(new Intent(Splash.this,Trial.class));                    finish();            }        };        thread.start();    }}</code></pre><p>In my manifest I have given entry also. My code is running without error. Code of <code>R.layout.splash</code> 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center_horizontal""    &gt;&lt;ImageView  android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/d""android:layout_gravity=""center""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks!!</p>","490953","","469983","","2011-04-04 15:26:36","2012-06-21 12:05:59","splash screen not displayig in android","<android>","3","1","","",""
"4075324","1","","","2010-11-02 06:13:39","0","504","<p>I'm new to the Android platform and I'm developing an app that where the main activityis using the dialog theme.</p><p>I have the ui setup pretty much the way I want but gradients don't seem to be working for me.I've tried a gradient title bar, view, layout, textView etc and in every case the gradient does not display. (I've only tested it on the simulator so far). </p><p>My drawable xml looks like this:</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=""#00000000""      android:centerColor=""#FFFFFFFF""      android:endColor=""#00000000""      android:angle=""90"" /&gt;&lt;/shape&gt;</code></pre><p>and I use the following to set the background to several elements but it never shows up:</p><pre><code>android:background=""@drawable/gradient_bg""</code></pre><p>I've tried different colors and angles etc etc but to no avail.</p><p>If I do the following it works however I prefer to do this in xml.</p><pre><code>GradientDrawable grad = new GradientDrawable(      Orientation.TOP_BOTTOM,      new int[] {Color.RED, Color.YELLOW}    );    this.getWindow().setBackgroundDrawable(grad);</code></pre><p>Can anyone help?Thanks.</p>","494379","","494379","","2010-11-02 06:48:28","2010-11-04 02:47:42","My gradients don't show up in my Android project","<android><dialog><gradient>","3","0","","",""
"4075325","1","4075722","","2010-11-02 06:13:44","0","173","<p>I have created an application where I had extended an Activity and got the response from the Web Service Successfully using the Asynctask, Now I want to do the Json Parsing of that received Response in the another class other than in the main activity.</p><p>How can do that? How do I use the received Response of the Main Activity in a separate Class because in the next class I just want to do the Parsing using the Response achieved from the Main Class. </p><p>Can anybody please give me an answer of this!</p><p>Thanks,david</p>","422859","","","","","2010-11-02 07:37:35","Using the response of one Class into another","<android><json><parsing><class><android-asynctask>","2","0","","",""
"4075356","1","","","2010-11-02 06:18:07","13","13361","<p>As my project requirement i have to highlight the table row on onClick. There is  any way to do this? Or please suggest me the alternative? </p>","492246","","56285","","2013-12-23 15:14:17","2013-12-23 15:14:17","How can I highlight the table row on click ?","<android><highlight><android-tablelayout>","3","2","4","",""
"4075357","1","","","2010-11-02 06:18:11","0","1941","<p>I have been programming Android apps for quite some time, and my client asked if we could hide the telephone number on dialing screen when phone.apk is making a call.  </p><p>I'd appreciate if anyone could tell me what is the best approach for doing this.  Should I make the changes in the phone.apk or any easy to update the phone layout so to hide the phone number when dialing.</p><p>Thanks in advance &amp; I'd appreciate your help</p><p>Kelvin</p>","494383","","","","","2012-01-31 04:30:08","Customize Android Phone.apk","<android>","2","0","","",""
"4075417","1","4075461","","2010-11-02 06:33:00","1","1344","<p>My HTC Wildfire does not support Arabic and Hindi Unicode characters, however it supports Chinese. Arabic and Hindi characters are displayed as boxes. I have written an application that uses Google's translation service.</p>","421372","","","","","2010-11-02 06:41:39","EditText language support?","<android><unicode><edittext>","1","0","","",""
"4075485","1","4079688","","2010-11-02 06:48:31","0","2093","<p>I just realized that my emulator can't access the web.My computer runs on WiFi and perhaps the emulator isn't able to detect it.</p><p>how to get it working?emulator isn't running on Airplane mode.Please help.</p>","243709","","","","","2012-06-12 12:10:10","How to make Android Emulator access web when my PC is on WiFi","<android><android-emulator>","3","12","1","",""
"4075501","1","4075591","","2010-11-02 06:53:03","0","182","<p>i have two classes as Splash.java and Activity2.java!!i have tried simple code for splash as:</p><p>:`public class Splash extends Activity { @Override public void onCreate(Bundle savedInstanceState)  {  super.onCreate(savedInstanceState);  setContentView(R.layout.splash);  Thread thread= new Thread()  {   @Override   public void run()    {</p><pre><code> super.run(); startActivity(new Intent(Splash.this,Trial.class)); finish();</code></pre><p>}  };  thread.start();</p><p>}}`</p><p>in my manifest i have given entry also. My code is running without error.Code of R.layout.splash is as:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/d""android:layout_gravity=""center""/></p><p></p><p>Thanks!!</p>","490953","","","","","2010-11-02 07:11:20","splash screen not displayig in android","<android>","1","1","","",""
"4075540","1","","","2010-11-02 07:00:47","3","14051","<p>When I change orientation application restarts and I lost my current data.. I am using activity group which contain lots of activities when i change orientation application restarts from main activity.</p><p>is it possible to avoid this application restart on orientation change?</p><p>Anybody knows please let me know..</p>","289597","","683261","","2013-01-10 04:37:11","2013-07-26 18:20:17","Android application restarts on orientation change","<android>","5","0","3","",""
"4075694","1","4242649","","2010-11-02 07:31:21","18","11807","<p>I am trying to insert new <code>RawContact</code> contacts, but the <code>RawContact</code> added doesn't get displayed when I view the contacts through Contacts or phonebook. As I understand if we create a <code>RawContact</code> and there is no contact associated with it then the contact will be automatically inserted. I get a valid value of <code>rawContactId</code> and no exceptions are thrown, so I assume the insertion is successful. Am I doing anything wrong or am I missing something? I am using the code example from developer site, just pasting it here:  </p><pre><code> ContentValues values = new ContentValues(); values.put(RawContacts.ACCOUNT_TYPE, accountType);  values.put(RawContacts.ACCOUNT_NAME, accountName); Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);  long rawContactId = ContentUris.parseId(rawContactUri);  values.clear();  values.put(Data.RAW_CONTACT_ID, rawContactId);  values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);  values.put(StructuredName.DISPLAY_NAME, ""Mike Sullivan"");  getContentResolver().insert(Data.CONTENT_URI, values); </code></pre>","452307","","1267661","","2012-05-12 20:47:35","2014-03-28 06:59:15","Inserting contacts in Android 2.2","<android><android-contacts>","3","0","10","",""
"4075822","1","4075867","","2010-11-02 07:59:25","1","2297","<p>I have created a app that displays all the content from res/raw folder.</p><p>I need that when i click on .doc file it should open and I can view its content.</p><p>please help me.</p><p>I have ThinkFree.</p><pre><code>enter code herepublic class FileList extends ListActivity {public static final Field[] fields = R.raw.class.getFields();/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new ArrayAdapter&lt;Field&gt;(this, R.layout.row, R.id.weekofday, fields));}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    // TODO Auto-generated method stub    //super.onListItemClick(l, v, position, id);    String selection = l.getItemAtPosition(position).toString();    Toast.makeText(this, selection, Toast.LENGTH_SHORT).show();    Intent i = new Intent();    i.setAction(android.content.Intent.ACTION_VIEW);    startActivity(i);}</code></pre><p>}</p>","396473","","396473","","2010-11-02 08:42:56","2010-11-02 08:42:56","Is there any way to open .doc file in Android?","<android>","1","0","1","",""
"4075834","1","","","2010-11-02 08:01:09","5","1409","<p>I want to show picasa album in a grid view in my android app. I have the username/password + album id of the album from which i want to load the album.</p><p>i tried implementing this via gdata library but eclipse is giving an error on line2 in following syntax:</p><pre><code>PicasawebService myService = new PicasawebService(""exampleCo-exampleApp-1"");myService.setUserCredentials(""liz@gmail.com"", ""mypassword"");</code></pre><p>I have also added gdata libraries in my code. Following are the names:</p><pre><code>gdata-photos-2.0gdata-client-1.0</code></pre><p>Any idea what i am doing wrong? OR Please suggest any tutorials who has implemented this.</p><p>Please help!!</p>","152867","","198707","","2010-11-02 08:06:32","2010-11-15 08:03:22","show picasa album in android app","<android><picasa>","0","4","1","",""
"4075901","1","4076529","","2010-11-02 08:12:33","1","1077","<p>I am try to get the android environment setup for phone gap and I keep getting this error when I try and create the phonegap project. </p><pre><code>ruby bin/droidgap create MyTestAppc:/phonegap-android/lid/create.rb:24:in ``: no such file or dirctory - androidsdk-path.bat android.bat (Errno::ENOENT) from c:/phonegap-android/lib/create.rb:24:in `guess_paths` from c:/phonegap-android/lib/create.rb:7:in `initialize` from bin/droidgap:24:in `new' from bin/droidgap:24:in `&lt;main&gt;'</code></pre><p>I have got through the setup for the last could of days. I have also check the PATH for the android sdks and built the test android app in eclipse.</p><p>there are the path in the environment vars</p><p>C:\Ruby192\bin;C:\apache-ant-1.8.1\bin;C:\Program Files\Java\jdk1.6.0_20\bin;C:\android-sdk-windows\tools;</p><p>any help you can give me would be greatly appreciated.</p><p>Thanks </p><p>Mac</p>","463130","","379693","","2010-11-02 08:48:35","2010-11-02 09:54:38","phone gap android environment setup","<android><jdk><phonegap><android-sdk-2.1>","1","0","","",""
"4075975","1","9987616","","2010-11-02 08:26:23","27","11246","<p>Is it possible to redraw a single row in a listview? I have a listview with rows that are linearlayouts. I listen to a preference change and sometimes I need to change just one view inside the linear layout of a single row. Is there a way to make it redraw that row without calling listview.notifydatasetchanged()?</p><p>I've tried calling view.invalidate() on the view (inside the linearlayout) but it doesn't redraw the row. </p>","375874","","","","","2014-03-10 11:27:41","Redraw a single row in a listview","<android><listview><view><redraw>","7","2","21","",""
"4076035","1","4076291","","2010-11-02 08:37:43","0","888","<p>i have a problem with a json response of an HttpPost , the resposnse contains character like &amp; hellip; and this cause to generate an exception while creating the jsonobject or a jsonarray.</p><p>Anyone knows how decode it? i have to add an header in the request?</p><p>thanks a lot.</p><p>edit:</p><p>i already used log cat and this is the exception</p><pre><code>11-02 09:17:54.472: WARN/System.err(1382): org.json.JSONException: Value XXXXXX&amp; hellip; at authors of type java.lang.String cannot be converted to JSONArray11-02 09:17:54.492: WARN/System.err(1382):     at org.json.JSON.typeMismatch(JSON.java:96)11-02 09:17:54.492: WARN/System.err(1382):     at org.json.JSONObject.getJSONArray(JSONObject.java:548)11-02 09:17:54.492: WARN/System.err(1382):     at org.liquidjournal.httpProxy.ResourceManager.getAuthors(ResourceManager.java:127)11-02 09:17:54.492: WARN/System.err(1382):     at org.liquidjournal.MyJournalGroup$PostResource.doInBackground(MyJournalGroup.java:291)11-02 09:17:54.492: WARN/System.err(1382):     at org.liquidjournal.MyJournalGroup$PostResource.doInBackground(MyJournalGroup.java:1)11-02 09:17:54.492: WARN/System.err(1382):     at android.os.AsyncTask$2.call(AsyncTask.java:185)11-02 09:17:54.492: WARN/System.err(1382):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)11-02 09:17:54.492: WARN/System.err(1382):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)11-02 09:17:54.492: WARN/System.err(1382):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)11-02 09:17:54.492: WARN/System.err(1382):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)11-02 09:17:54.492: WARN/System.err(1382):     at java.lang.Thread.run(Thread.java:1102)</code></pre><p><code>&amp; hellip ;</code> is converted directly by stack overflow</p>","486319","","105224","","2010-11-02 09:09:32","2010-11-02 09:18:41","problem with special character","<java><android><json><httpclient>","1","2","","",""
"4076074","1","7172671","","2010-11-02 08:44:50","8","7309","<p>I'm trying to draw a text on Canvas like this (kinda pseudocode below):</p><pre><code>Paint p = new Paint(ANTI_ALIAS_FLAG);p.setTextSize(18);...mCanvas.drawText(""Hello StackOverflow!"", 50, 50, p);</code></pre><p>My problem is that the result looks really ""weird"". It uses some bold-like font, which is badly aliased, looks not pretty and ""squarish"".</p><p>I tried to play with p.setTextSize(), by setting various sizes, also I tried to set different default Typefaces by using p.setTypeface(Typeface) and setting DEFAULT, NORMAL, SERIF, SANS_SERIF etc, but it still looks ugly.</p><p>On the contrary the font used throughout the rest of the system looks really nice, and I'd like to use it.</p><p>How? :)</p>","258848","","","","","2011-08-24 08:40:22","How to draw with a default Android font on a Canvas?","<android><text><fonts><canvas>","1","1","1","",""
"4076101","1","4199877","","2010-11-02 08:48:26","1","893","<p>I have a C library which I access through NDK. Some operations are time consuming so UI thread freezes on them. As I now the common practice is to use Runnable like that:</p><pre><code>myFixedThreadPool.execute(new Runnable() {  public void run()   {    NativeClass.callToNDKLibrary();  };});</code></pre><p>or threads like that:</p><pre><code>Thread t = new Thread() {  public void run()   {    NativeClass.callToNDKLibrary();  }};t.start();  </code></pre><p>but the problem is that C library is not thread safe: it starts to crash when I wrap it like this. So the question is how to detach from UI thread still enforcing NDK calls to run one at a time. May be some trick with synchronized will help? I also want to mention that this library is a core underlying layer for my application, not just a helper function. So it's called from nearly every part of my code. And only a few functions consume time, most a quick to keep them in main thread.</p>","488489","","","","","2010-11-16 22:52:08","How to solve the problem of NDK library calls freezing UI thread","<android><multithreading><android-ndk>","3","0","","",""
"4076281","1","4076284","","2010-11-02 09:16:46","2","607","<p><strong>ActivityA</strong> is main visible activity. I want to start <strong>activityB</strong> inside <strong>activityA</strong>. And build <strong>activityB</strong> in <em>FrameLayout</em> (or something like that) of <strong>activityA</strong>. Is it posible? And how?</p>","479211","","","","","2011-07-25 13:51:59","Is it posible to start activityB inside activityA? And how?","<android><activity>","2","0","","",""
"4076309","1","","","2010-11-02 09:21:55","1","1551","<p>I am developing a website which used W3C GeoLocation API to obtain users' position. I try to run the website in Android Emulator and use DDMS / geo fix to send the coordinate to the device. However the coordinate received is inaccurate. For example, (22.377127, 114.095535) will become (22.370335, 114.08523353). I try to run some Android GPS example from Internet, and the results is just the same. I can certainly say that this is not my program bug. From my observation, it seems like some rounding problem. Can anybody help? Thanks.</p><p>My Environment:Windows 7 Professional 64bitAndroid 2.2 with Google API (API level 8)</p>","494537","","","","","2010-12-12 20:25:11","GPS accuracy of Android Emulator","<android><geolocation><gps><android-emulator>","3","1","","",""
"4076325","1","","","2010-11-02 09:25:59","0","1387","<p>i Have implemented concept of lazy loading in my project. and I'm showing an image through URL in List view through lazy loading. All are working absolutly fine.</p><p>But now problem is I want to pass the image from one screen to another which is downloaded from URL.</p><p>m not able to do that. for ur reference I'm pasting the code:</p><pre><code>package com.android.istock;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStream;import java.net.URL;import java.util.HashMap;import java.util.Stack;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.widget.ImageView;public class ImageLoader {    //the simplest in-memory cache implementation. This should be replaced with something like SoftReference or BitmapOptions.inPurgeable(since 1.6)    private HashMap&lt;String, Bitmap&gt; cache=new HashMap&lt;String, Bitmap&gt;();    private File cacheDir;    public ImageLoader(Context context){        //Make the background thead low priority. This way it will not affect the UI performance        photoLoaderThread.setPriority(Thread.NORM_PRIORITY-1);        //Find the dir to save cached images        if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))            cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),""LazyList"");        else            cacheDir=context.getCacheDir();        if(!cacheDir.exists())            cacheDir.mkdirs();    }    final int stub_id=R.drawable.stub;    public void DisplayImage(String url, Activity activity, ImageView imageView)    {        if(cache.containsKey(url))            imageView.setImageBitmap(cache.get(url));        else        {            queuePhoto(url, activity, imageView);            imageView.setImageResource(stub_id);        }        }    private void queuePhoto(String url, Activity activity, ImageView imageView)    {        //This ImageView may be used for other images before. So there may be some old tasks in the queue. We need to discard them.         photosQueue.Clean(imageView);        PhotoToLoad p=new PhotoToLoad(url, imageView);        synchronized(photosQueue.photosToLoad){            photosQueue.photosToLoad.push(p);            photosQueue.photosToLoad.notifyAll();        }        //start thread if it's not started yet        if(photoLoaderThread.getState()==Thread.State.NEW)            photoLoaderThread.start();    }    private Bitmap getBitmap(String url)     {        //I identify images by hashcode. Not a perfect solution, good for the demo.        String filename=String.valueOf(url.hashCode());        File f=new File(cacheDir, filename);        //from SD cache        Bitmap b = decodeFile(f);        if(b!=null)            return b;        //from web        try {            Bitmap bitmap=null;            InputStream is=new URL(url).openStream();            OutputStream os = new FileOutputStream(f);            Utils.CopyStream(is, os);            os.close();            bitmap = decodeFile(f);            return bitmap;        } catch (Exception ex){           ex.printStackTrace();           return null;        }    }    //decodes image and scales it to reduce memory consumption    private Bitmap decodeFile(File f){        try {            //decode image size            BitmapFactory.Options o = new BitmapFactory.Options();            o.inJustDecodeBounds = true;            BitmapFactory.decodeStream(new FileInputStream(f),null,o);            //Find the correct scale value. It should be the power of 2.            final int REQUIRED_SIZE=70;            int width_tmp=o.outWidth, height_tmp=o.outHeight;            int scale=1;            while(true){                if(width_tmp/2&lt;REQUIRED_SIZE || height_tmp/2&lt;REQUIRED_SIZE)                    break;                width_tmp/=2;                height_tmp/=2;                scale++;            }            //decode with inSampleSize            BitmapFactory.Options o2 = new BitmapFactory.Options();            o2.inSampleSize=scale;            return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);        } catch (FileNotFoundException e) {}        return null;    }    //Task for the queue    private class PhotoToLoad    {        public String url;        public ImageView imageView;        public PhotoToLoad(String u, ImageView i){            url=u;             imageView=i;        }    }    PhotosQueue photosQueue=new PhotosQueue();    public void stopThread()    {        photoLoaderThread.interrupt();    }    //stores list of photos to download    class PhotosQueue    {        private Stack&lt;PhotoToLoad&gt; photosToLoad=new Stack&lt;PhotoToLoad&gt;();        //removes all instances of this ImageView        public void Clean(ImageView image)        {            for(int j=0 ;j&lt;photosToLoad.size();){                if(photosToLoad.get(j).imageView==image)                    photosToLoad.remove(j);                else                    ++j;            }        }    }    class PhotosLoader extends Thread {        public void run() {            try {                while(true)                {                    //thread waits until there are any images to load in the queue                    if(photosQueue.photosToLoad.size()==0)                        synchronized(photosQueue.photosToLoad){                            photosQueue.photosToLoad.wait();                        }                    if(photosQueue.photosToLoad.size()!=0)                    {                        PhotoToLoad photoToLoad;                        synchronized(photosQueue.photosToLoad){                            photoToLoad=photosQueue.photosToLoad.pop();                        }                        Bitmap bmp=getBitmap(photoToLoad.url);                        cache.put(photoToLoad.url, bmp);                        if(((String)photoToLoad.imageView.getTag()).equals(photoToLoad.url)){                            BitmapDisplayer bd=new BitmapDisplayer(bmp, photoToLoad.imageView);                            Activity a=(Activity)photoToLoad.imageView.getContext();                            a.runOnUiThread(bd);                        }                    }                    if(Thread.interrupted())                        break;                }            } catch (InterruptedException e) {                //allow thread to exit            }        }    }    PhotosLoader photoLoaderThread=new PhotosLoader();    //Used to display bitmap in the UI thread    class BitmapDisplayer implements Runnable    {        Bitmap bitmap;        ImageView imageView;        public BitmapDisplayer(Bitmap b, ImageView i){bitmap=b;imageView=i;}        public void run()        {            if(bitmap!=null)                imageView.setImageBitmap(bitmap);            else                imageView.setImageResource(stub_id);        }    }    public void clearCache() {        //clear memory cache        cache.clear();        //clear SD cache        File[] files=cacheDir.listFiles();        for(File f:files)            f.delete();    }}</code></pre><p>Now I want to use the image in next screen. How can I do that?pls help me anyone its very urgent.</p>","383597","","180784","","2010-11-02 11:45:10","2010-11-02 11:45:10","Android Lazy Loading","<android>","1","1","","",""
"4076381","1","4076400","","2010-11-02 09:33:46","8","5010","<p>I reinstalled my computer and tried now to import my Android project into the workspace.(File -> Import -> General -> Existing Project into Workspace)</p><p>But now I have got a strange error. </p><pre><code>    bNormal.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            gotoNextQuestion();        }    });</code></pre><p>In the second line (@Override) eclipse always tells me there is an error:</p><pre><code>/* Multiple markers at this line- implements android.view.View.OnClickListener.onClick- The method onClick(View) of type new View.OnClickListener(){} must override a superclass Method */</code></pre><p>This happens everywhere, where @Override is used. I already tried to <code>Android-Tools -&gt; Fix Project Settings</code> and <code>Project -&gt; Clean</code>.</p><p>I hope somebody can help me with this strange problem.</p><p>Thanks, Mark</p>","247002","","","","","2010-11-02 09:36:06","Problems importing an Android project into Eclipse","<android><eclipse><import><workspace>","2","0","5","",""
"4076396","1","","","2010-11-02 09:35:38","1","252","<p>I wanna fetch my blogger data through google data api</p><p>I wrote this code:</p><pre><code>public class blogger extends Activity {    private GoogleService myService;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        myService = new GoogleService(""blogger"", ""test-blogger-0"");        try {            myService.setUserCredentials(""mitpig@gmail.com"", ""112233"");        } catch (AuthenticationException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }  }</code></pre><p>but it always crashed at : myService = new GoogleService(""blogger"", ""test-blogger-0"");</p><p>and threw a ?java.lang.ExceptionInInitializerError?</p><p>could somebody tell me why ?</p>","422405","","437301","","2010-11-02 12:11:59","2011-06-16 22:36:59","android google data api for blogger crashed","<android>","1","1","","",""
"4076436","1","","","2010-11-02 09:41:01","0","1217","<p>I have a layout with lots of different imagebuttons on it.<br>Application is developed in full-touch, so there should be no response to keyboard or keypad on all activities except one, where user can input his name.<br>Is there a way to achieve that?  </p><p>I've checked on debug, keypress and keypad press result in onKeyDown event.<br>I've set it to return 'false' for all keys.<br>But, for some reason, android keeps selecting my imagebuttons when keypad is pressed.<br>And pressing Enter key result in View.onClick event.</p><p>How to totally disable all keyboard input for activity?<br>I use Motorola Milestone for tests - a slider with a keyboard<br>Thanks</p>","453991","","","","","2010-11-02 09:53:36","Disable keypad or whole keyboard support on android activity?","<android>","1","4","","",""
"4076442","1","","","2010-11-02 09:42:13","0","1695","<p>I used a spinner and a button inside a tab of my application</p><p>but, when I assigned a onClicklistner for my button</p><p>the application crashes.</p><p>i used</p><hr><p>myspinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {@Overridepublic void onItemSelected(AdapterView adapter, View v, int i,long lng) {}});</p><hr><p>for my spinner and </p><hr><p>btn.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                //do some work            }        });</p><hr><p>for my Button. the application works fine once I use only on listner!!!!</p><p>please help,thanx</p>","462023","","437301","","2010-11-02 12:11:11","2012-01-11 14:32:46","Button+Spinner [android]","<android><spinner>","1","0","","",""
"4076474","1","4076537","","2010-11-02 09:46:39","0","2211","<p>I want to create a scrollable map and trigger different actions when the user touches a different areas.</p><p>With iPhone, it was easy by putting buttons on top of the image. How do I do it in Android?</p><p>I used a custom view to enable scrolling in both directions. Now how do I make different parts of the image trigger different events on click?</p>","481239","","","","","2010-11-02 09:55:51","Android: How to set clickable areas of a single image?","<android><image>","1","0","","",""
"4076499","1","","","2010-11-02 09:51:08","0","151","<p>my android application works well but it's performance(speed) is slow. In my logcat i saw frequent garbage collection operation  like</p><p>11-02 15:07:20.647: DEBUG/dalvikvm(12571): GC freed 295 objects / 38448 bytes in 93ms</p><p>Is this the reason for low performance?? How can i improve my applications performance???anybody please help</p>","462695","","","","","2010-11-02 09:59:03","android performance issue","<android>","1","1","","",""
"4076530","1","4077911","","2010-11-02 09:54:47","0","703","<p>I am developing an Android app in which a type of browser will be included. As the user tries to open a URL, an intent resolver asks the user whether they want to complete the action using  the default browser or a custom browser. This part of my app is completed. Now I want to ask, if the user chooses to open the link in my custom browser, how can I access that URL?</p><p>Currently, if the user chooses my browser they got blank web view, as I am unable to get the URL which I have to open in my webview.</p>","450601","","209139","","2013-08-23 10:02:47","2013-08-23 18:34:07","How can I get the URL from the default browser to use in my custom browser?","<android><web-browser>","2","0","","",""
"4076604","1","4669856","","2010-11-02 10:05:26","1","6863","<p>Does anybody know how to do a Like of a facebook page/personn by code ? Is it possible with the graph api ? how ? Can you give code example ?</p>","429222","","764846","","2011-08-26 12:04:23","2011-08-26 12:04:23","Android facebook SDK - how to do a like?","<android><facebook><facebook-like>","3","0","","",""
"4076624","1","4076675","","2010-11-02 10:07:56","1","683","<p>I am creating an Android Widget containg some contact info</p><p>I discovered that the getContentResolver()-method only exists in the Activity-class, and not in the AppWidgetProvider-class.</p><p>How do I query content from a widget?</p><p>Like so:</p><p>Cursor people = getContentResolver().query(SOME QUERY);</p><p>UPDATE:<code></p><pre>@Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)    {        String people = getContacts(context);        // Do something with people...    }    private String getContacts(Context context)    {        String peopleStr = """";        String[] projection = new String[] { ContactsContract.Contacts._ID,ContactsContract.Contacts.DISPLAY_NAME };                String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";                String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '"" + (""1"") + ""'"";        Cursor people = context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, projection, selection, null, sortOrder);        while(people.moveToNext())        {            int nameFieldColumnIndex = people.getColumnIndex(ContactsContract.Data.DISPLAY_NAME);            peopleStr += people.getString(nameFieldColumnIndex) + ""\n"";        }        people.close();        return peopleStr;    }</pre><p></code></p>","336150","","336150","","2010-11-02 12:51:16","2010-11-02 12:51:16","Querying content from Android widget","<android><android-widget>","1","0","1","",""
"4076724","1","4076759","","2010-11-02 10:20:48","1","48","<p>what types of the changes i have to do if i m going to make app for android tablets from existing app of android mob??</p>","432559","","","","","2010-11-02 10:25:14","what types of the changes i have to do if i m going to make app for android tablets from existing app of android mob?","<android>","1","0","0","",""
"4076744","1","4077091","","2010-11-02 10:23:33","3","993","<p>Is there any way to restrict that only 2 digits can enter in the <code>EditText</code> at the Runtime.</p><p>For Example:</p><p>If i set my <code>android:inputType=""numberDecimal""</code> and i am entering the value in it. It accepts the value 123.000000000000. But i want to restrict it like 123.00 </p><p>Is there any Possible way to do this?</p>","267269","","213269","","2010-11-19 23:26:59","2010-11-19 23:26:59","EditText in Android?","<android><edittext>","2","0","1","",""
"4076919","1","","","2010-11-02 10:50:12","-1","188","<p>I am implementing twitter app in my application. For that i used:</p><ul><li>signpost_common.jar</li><li>signpost-core.jars</li></ul><p>My application was working successfully.</p><p>I upload my app in the Android Market. Here i got an issue regarding download the app. For some users able to see my app in market and some of the users not able to see the app. Regarding this i got mail from google people, because of these signpost_common.jar,signpost-core.jars got an issue.</p><p>I coudnt able to find the solution for this. Still i am trying for solution. Kindly help us for solve to this issue.</p>","494622","","302328","","2010-11-02 11:21:29","2011-07-03 14:17:30","My Application didnt show in the Android Market, for some users","<android><google-play>","1","2","","",""
"4076946","1","4914799","","2010-11-02 10:53:00","25","4665","<p>Does anyone know where/when this method of a Parcelable is called?</p><pre><code> @Override public int describeContents() {    return 0; }</code></pre><p>It has to be overriden. But should I consider doing something useful with it?</p>","474326","","1849664","","2013-06-02 19:45:45","2013-06-02 19:45:45","Parcelable where/when is describeContents() used?","<android><parcelable><parcel>","3","1","11","",""
"4077065","1","","","2010-11-02 11:13:09","1","5117","<p>on the ui i am having a back button displayed. there are three activities say A,B,C. Activity A is splash screen. Activity B is home screen. Activity C is edit screen. on edit screen only i am having a back button. when the user press that i open the activity B which also contains some sort of http request and response. i want that the previous activity from stack should get displayed? how can i achieve that? i am able to open previous activity on pressing the back button of device?</p><p>when i press back button on device there doesnt goes any http request? i want to achieve this behaviour when i press the ui back button.</p>","494639","","","","","2013-03-07 10:26:36","activity and back button","<android><button><back>","3","0","","",""
"4077086","1","","","2010-11-02 11:16:34","0","1185","<p>I need to create a listView. Every row of the list contains textView and EditText  .How to make it?Thanks in advance !!</p><p>Note: I need to design this by using java only(Without using xml)</p>","482568","","482568","","2010-11-02 13:28:15","2010-11-02 13:28:15","listView with textBox in android?","<android><android-listview>","2","1","1","",""
"4077175","1","","","2010-11-02 11:29:33","2","491","<p>I'm looking for a way to dynamically change an elements properties. </p><p>For example I want the user of my app to be able to enter a value within my program that will change android:layout_marginTop=""blabla"" to whatever I want. It doesn't specifically have to be that property, I want to be able to change any property of any element. Is there a way to do this?</p>","494661","","","","","2010-11-02 12:56:00","How can I dynamically change element properties?","<android>","2","0","","",""
"4077224","1","4077999","","2010-11-02 11:38:02","1","3682","<p>I am making an application that has Activity which communicates with a single service, and is used to start, stop or change settings of that service. I used a singleton approach from <a href=""http://stackoverflow.com/questions/2463175/how-to-have-android-service-communicate-with-activity"">this</a> tip.</p><p>My problem is that busy-waiting is not working for me and I can't attach a listener to the service because activity gets blocked. I want the service to start or get it's current instance at application start so I put the busy-waiting in onCreate. I'm guessing I'm doing this very wrong, so how do I do this appropriately?</p><p>Also if there is a better approach to this, please post any links or guides, cuz I'm getn confused on android developer site :P</p><p>thanks!</p>","491320","","","","","2010-11-02 13:16:55","How to wait for service on activity start","<android><service><activity><oncreate>","2","0","","",""
"4077295","1","4838478","","2010-11-02 11:47:53","2","601","<p>I’m looking for some information regarding how I would create a demo period in my Android application.  Essentially, I would like a user to be able to use my app for say 5 days.  What sort of methods are available to be able to determine how long the user has had the application?</p><p>The only solution I can think of is to try saving something to shared preferences based on a date/time stamp from when the user started the app for the first time.  Then each time they start the app, I grab this data from Shared Prefs and either enable/disable functionality accordingly.  I’m not sure how exactly to get a time stamp into shared prefs though.</p><p>Unfortunately, there doesn’t seem to be much on Google…or I’m just using the wrong keywords.</p><p>Help! Thanks!</p>","432209","","","","","2011-12-19 15:41:19","Creating a demo period in an Android application","<java><android><timestamp><smartphone><demo>","2","2","1","",""
"4077348","1","","","2010-11-02 11:54:45","1","991","<p>I am working on building an android app but I'm nothing that my SQL operations are taking forever to complete</p><p>I have profiled the app to narrow it down to the act of moving the Cursor to the first row of the result set for a simple select query (only returning 1 row where I'm testing it to eliminate the size of the result set as a problem.</p><p>Are there any better options for moving to the start of the result set?</p><p>edit:</p><p>some code:</p><pre><code>public Cursor sqlQuery(String Sql){    Cursor c = database.rawQuery(Sql, null);    //start at the first spot    c.moveToFirst();    return c;}</code></pre><p>and the calling code</p><pre><code>    Cursor Slots = evedb.sqlQuery(""SELECT attrib.value, ""            +""attribtypes.attributename ""            +""FROM dgmTypeAttribs AS attrib ""            +""INNER JOIN invTypes AS type ""            +""ON attrib.typeID = type._ID ""            +""INNER JOIN dgmAttribs AS attribtypes ""            +""ON attrib.attributeID = attribtypes._ID ""            +""AND attribtypes.attributename = 'hiSlots'  ""            +""AND type.typeName = '"" + shipname + ""'"");</code></pre><p>this runs 3 times and i have time it to approximately 2 secs for all the rest of the code or over a minute with this in.</p><p>i have also run just the rawQuery statement with out the move to first and its takes bout 18 secs so im looking at the worst part of the code first.</p>","272710","","236247","","2011-06-28 16:07:39","2011-07-11 20:24:53","Android SQLite taking a long time to complete","<android><sql><performance>","2","7","","",""
"4077414","1","4077531","","2010-11-02 12:03:07","2","816","<p>I have created one list view.. it is having 5 items...</p><p>Now I want split the list items...</p><p>when user clickon the first listitem or focus on first item then immediately it has to show  followed some text views or other things..but it has to show same list..</p><p>and agian same when he clickon or focus on the second item that first item has to be close and second item has to act some thing....</p>","396643","","379693","","2010-11-02 12:33:41","2010-11-02 12:33:41","android listview","<android><listview>","3","0","","",""
"4077438","1","","","2010-11-02 12:07:29","0","225","<p>all, i want to create multiple handlers that gets triggered based on users selection, but this handlers implement the same runnable method. the only difference is that they call different postDelayed() method. how do i go about achieving this without rewriting the same code for the runnable? </p><p>i am still not clear about how the handleMessages() works and if it can be used for this?.. thank you</p>","316843","","302328","","2010-11-02 15:17:50","2010-11-02 15:17:50","sorting out different handlers android","<android><handler><postdelayed>","1","0","","",""
"4077440","1","","","2010-11-02 12:07:39","2","7150","<p>HelloI have a TabHost activity with two child activities. What would be the best solution to add a ""left - right"" animation for the child activities?</p><p>Best regards!</p>","460611","","","","","2013-03-11 20:36:09","Add animation when changing tabs","<android>","2","0","4","",""
"4077452","1","","","2010-11-02 12:09:01","0","1137","<p>I am loading one shared library from another. Lets say foo2.so from foo1.so</p><p>I am using dlopen followed by dlsym</p><p>dlopen succeed with proper handle but dlsym returns with ""symbol not found"" error .I have used dlerror to print the error.</p><p>These are the things i tried. In foo2.so .mk file I added LOCAL_LDFLAGS += -Wl,--export-dynamic.</p><p>I checked the symbol in foo2.so using nm and it is there.</p><p>Both the modules are in C except one wrapper file in foo1.so which is in C++, Calling file is in C.</p><p>Can any one suggest whether i missed any thing . I am running this on android emulator on froyo.</p>","494706","","","","","2011-03-28 04:31:17","dlsym returning symbol not found in android after succesful return of dlopen","<android><linux>","1","0","","",""
"4077454","1","4210378","","2010-11-02 12:09:13","1","773","<p>I am trying to use <a href=""http://code.google.com/p/odata4j/"" rel=""nofollow"">OData4J</a> to retrieve a list of Users from the StackOverflow OData service (onto an Android 2.1 device), but it isn't working.</p><pre><code>public static Enumerable&lt;OEntity&gt; getUserInfo() { ODataConsumer c = ODataConsumer.create(""https://odata.sqlazurelabs.com/OData.svc/v0.1/rp1uiewita/StackOverflow/""); return c.getEntities(""Users"").execute(); </code></pre><p>I think it is unable to retrieve data from the URL.</p><p>Any ideas why this would be? Is there anything wrong with my code?</p><p>Thanks.</p>","2699","","220726","","2011-07-05 20:07:55","2011-07-05 20:07:55","Error when retrieving OData data when using OData4J","<java><android><odata><odata4j>","1","3","","",""
"4077466","1","","","2010-11-02 12:10:31","0","412","<p>I have an activity group say mainActivity which contain 4 activity groups. say one, two, three and four.All activities except fourth one has orientation portrait. The fourth activity group's orientation varies it may be portrait or landscape.</p><p>when i change fourth once orientation from portrait to landscape whole application restarts.</p><p>Is it possible to do such kind of things. that mainActivity group has orientation portrait and its child orientation is landscape. And also to allow to change child's orientation without restarting application.</p><p>thanks</p>","289597","","","","","2010-11-02 12:17:54","android application containing activities with different orientation","<android>","1","0","","",""
"4077477","1","","","2010-11-02 12:12:01","5","7260","<p>How can i change custom SurfaceView width and height.is this possible?</p>","309990","","","","","2011-02-24 15:56:06","how to change custom surfaceView width and height","<android>","2","0","1","",""
"4077487","1","7154598","","2010-11-02 12:13:22","19","12697","<p>i've used the following code to repeat the image in the background but its not working can any one help?</p><p>Layout.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""    android:background=""@drawable/grass_bg""    &gt;</code></pre><p>grass_bg.xml in drawable looks like this</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/grass_small""        android:tileMode=""repeat""/&gt;</code></pre><p>its showing the same small image. its not repeating...</p>","421309","","180784","","2010-11-02 12:24:50","2012-12-31 22:44:47","background image not repeating in android layout","<android>","3","1","9","",""
"4077867","1","4078156","","2010-11-02 13:01:40","0","781","<p>I want to display a progressbar, and during this time it's get items and when it's finished geting all the items, it will show the list. </p><p>How is this possible? </p>","371301","","","","","2011-06-05 15:18:40","Android: Progressbar displayed","<android><progress-bar>","3","0","1","",""
"4078003","1","4079469","","2010-11-02 13:17:16","1","802","<p>I am developing an application. In this I am using the <code>sqlite</code> database. </p><p>First time I am taking the data from assets and then inserting into database. From second time onwards I am taking data from the Database. </p><p>But first time my application is very slow. Finally my application is too slow. My question is, will the application become slow when we use <code>sqlite</code> in our app? and what we can do for this type of issue.</p><p>Please give me some suggestions.</p>","479027","","1105376","","2012-10-17 13:49:31","2012-10-17 13:49:31","Application become too slow when i use sqlite in my application","<android>","2","2","2","2012-10-18 00:07:28",""
"4078009","1","4078780","","2010-11-02 13:17:46","0","4067","<p>For the life of me I cannot figure out why I can’t get this method to enter the if statement.</p><pre><code>protected void foo() {    Date d = new Date();    long now = d.getTime();    long start;    SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);    start = settings.getLong(FIRST_USE_DATE, 0);    Log.w(this.getClass().getName(), Long.toString(start));         if (start == 0) {        SharedPreferences.Editor editor = settings.edit();        editor.putLong(FIRST_USE_DATE, now);            }</code></pre><p>return true;    }</p><p>Note that the log and debug mode shows that “start = 0”</p><p>I also tried</p><pre><code>if (start == 0l) {if (start == 0L) {</code></pre><p>What the heck am I missing here?  Does 0 != 0?</p><p>I’m developing in Eclipse with Java for Android.  Thanks.</p><p>Edits:</p><p>@methodin - no sorry, that does not work.</p><p>@Aioobe - I have a breakpoint under the IF statement, that never gets made.</p><p>Edit2: Here is the actual code I'm running since you've asked.</p><pre><code>protected boolean isDemoExpired() {    Date d = new Date();    long now = d.getTime();    long demoStart;    SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);       demoStart = settings.getLong(FIRST_USE_DATE, 0);        if (demoStart == 0) {    SharedPreferences.Editor editor = settings.edit();    editor.putLong(FIRST_USE_DATE, now);    System.out.println(Long.toString(demoStart));     return false;}return true;    }</code></pre>","432209","","432209","","2010-11-02 14:09:28","2010-11-02 15:56:17","Testing a Java Long value in an if statement. Does 0 != 0","<java><android><eclipse><long-integer>","4","9","0","",""
"4078018","1","4078382","","2010-11-02 13:18:31","6","3742","<p>I'm trying to catch the mouse click location so I wrote an <code>onClick</code> in the <code>body</code> tag, but every time I click on the page the whole page turn orange for a little while.  Is there any setting can disable this effet?</p>","218275","","218275","","2010-11-02 14:09:58","2013-03-12 11:46:39","How to disable the orange circle effect when clicking on a link, in a WebView","<javascript><android><webview>","3","0","3","",""
"4078039","1","4233930","","2010-11-02 13:20:45","8","6494","<p>I have an app widget and I'd like to add Views (<code>TextView</code>, etc.,) to the <code>RemoteView</code> but it never shows up.<br>Here goes the code:  </p><pre><code>RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);RemoteViews newView = new RemoteViews(context.getPackageName(), R.layout.widget_row_layout);    newView.setTextViewText(R.id.textUser, ""1234"");    views.addView(views.getLayoutId(), newView);// Tell the AppWidgetManager to perform an update on the current App WidgetappWidgetManager.updateAppWidget(appWidgetId, views);</code></pre><p>Any ideas?</p><hr><p><strong>This is what I ended up doing:</strong></p><pre><code>RemoteViews newView = new RemoteViews(context.getPackageName(), R.layout.widget_row_layout);    newView.setTextViewText(R.id.textUser, ""1234"");ComponentName thisWidget = new ComponentName(this,WidgetProvider.class);AppWidgetManager manager = AppWidgetManager.getInstance(this);    manager.updateAppWidget(thisWidget, newView);</code></pre>","480658","","492624","","2013-01-18 21:02:18","2013-01-18 21:02:18","RemoteView addView not working","<android><android-widget>","1","2","2","",""
"4078103","1","","","2010-11-02 13:27:43","0","1507","<p>I am working on video player in android.when i created surface holder in on create method ,it did not create.but when i created the surface holder in button onclick method,its created</p><p>My coding is,</p><pre><code>preview=(VideoView)findViewById(R.id.surface);    preview.setEnabled(true);    preview.bringToFront();    holder=preview.getHolder();    holder.setFixedSize(400, 400);    mp=new MediaPlayer();     mp.setDataSource(""path"");    mp.setDisplay(holder);    mp.setAudioStreamType(AudioManager.STREAM_MUSIC);    mp.setOnBufferingUpdateListener(playerActivity.this);    mp.setOnPreparedListener(playerActivity.this);    mp.prepare();    mp.start();</code></pre>","461972","","302328","","2010-11-02 13:33:25","2011-10-28 16:46:31","VideoVIew issue on android","<android><videoview>","1","0","","",""
"4078322","1","","","2010-11-02 13:51:28","0","397","<p>I have created a projects called rtva to use the media player.I have taken all files from the APIdemos/media MediaPlayerDemo_Audio.java (renamed to rtva_Audio.java)MediaPlayerDemo_Video.java (renamed to rtva_Video.java)MediaPlayerDemo_Video.java (renamed to rtva.java)Corresponding layouts have also been copied.</p><p>When i Launch the application in my virtual device or samsung galaxy s phone  i got a crash (see log below).The problem is that i get the first layout and whatever button i press after that the application crashes. I'm using android 2.2 under linux with eclipse</p><p>It seems that for example if i press the localaudio button (note that i havn't added any path at this stage so i should at least get the message that i should set the  path as stated in the rtva_video.java file. Well it crashes after pressing the button.</p><p>The debugger pinponts to  the startactivity(intent) line below:</p><pre><code>private OnClickListener mLocalAudioListener = new OnClickListener() {        public void onClick(View v) {            Intent intent =                    new Intent(rtva.this.getApplication(),                            rtva_Audio.class);                    intent.putExtra(MEDIA, LOCAL_AUDIO);                    startActivity(intent); &lt;---- debugger highlights this line        }</code></pre><p>Here is the log file:</p><pre><code>starting activity com.rtva.player.rtva on device emulator-5554[2010-11-02 14:30:28 - rtva] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.rtva.player/.rtva }[2010-11-02 14:30:29 - rtva] Attempting to connect debugger to 'com.rtva.player' on port 8634</code></pre><p>Debug info:</p><pre><code>// Compiled from Instrumentation.java (version 1.5 : 49.0, super bit)public class android.app.Instrumentation {  // Field descriptor #13 Ljava/lang/String;  public static final java.lang.String REPORT_KEY_IDENTIFIER = ""id"";  // Field descriptor #13 Ljava/lang/String;  public static final java.lang.String REPORT_KEY_STREAMRESULT = ""stream"";  // Method descriptor #19 ()V  // Stack: 3, Locals: 1  public Instrumentation();     0  aload_0 [this]     1  invokespecial java.lang.Object() [1]     4  new java.lang.RuntimeException [2]     7  dup     8  ldc &lt;String ""Stub!""&gt; [3]    10  invokespecial java.lang.RuntimeException(java.lang.String) [4]    13  athrow      Line numbers:        [pc: 0, line: 22]      Local variable table:        [pc: 0, pc: 14] local: this index: 0 type: android.app.Instrumentation  // Method descriptor #26 (Landroid/os/Bundle;)V  // Stack: 3, Locals: 2  public void onCreate(android.os.Bundle arguments);     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 23]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: android.app.Instrumentation        [pc: 0, pc: 10] local: arguments index: 1 type: android.os.Bundle  // Method descriptor #19 ()V  // Stack: 3, Locals: 1  public void start();     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 24]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: android.app.Instrumentation  // Method descriptor #19 ()V  // Stack: 3, Locals: 1  public void onStart();     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 25]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: android.app.Instrumentation  ............</code></pre>","494621","","244296","","2010-11-02 14:00:38","2010-11-02 14:38:46","Can't make the Apidemo mediaplayer work newbie","<android><media-player>","1","0","","",""
"4078349","1","","","2010-11-02 13:54:40","0","940","<p>For example, I've checked out the froyo-release branch of Gallery. I imported it as a new project targeting Android 2.2 SDK.</p><p>I'm getting the following compile errors (among others):</p><p>The import android.provider.DrmStore cannot be resolved</p><p>The import import android.media.MediaMetadataRetriever cannot be resolved</p><p>From what I can tell, neither of these classes are in the SDK? Where are they? Should I be including other jars?</p>","473753","","119963","","2010-11-02 14:37:03","2011-02-11 15:05:01","Why do I get so many unresolved symbol compile errors when trying to build from git?","<android><build>","1","1","","",""
"4078435","1","","","2010-11-02 14:02:29","1","881","<p>how can I set the scaling in a web view (or any view at all)? I have a box of 200 and 200, for example. If I apply a web view to it, a web view bigger than the box, it will give me scrollbars. I am seeking for a way to scale the content in order for the webView to fit the box. </p><p>Assume that I know the dimesions of the box, and ALSO the dimensions of the WebView.</p>","346583","","","","","2011-01-26 12:58:25","Android::how can I scale a web View?","<android><view><scaling>","1","0","","",""
"4078452","1","4078702","","2010-11-02 14:05:14","1","2624","<p>I am trying to use Bluetooth Chat example to connect to an embedded device. I do not have much information of the device bluetooth architecture. I am able to discover that device but while connecting it gives an error as Unable to connect. I am not able to pair with the device if I try pairing from within the Bluetooth Chat example.</p><p>The pairing was successful when I tried pairing from Bluetooth settings. The icon that is shown next to the Bluetooth device name in Bluetooth Settings is of ""Headset"". So, I guess the device falls in that category. I have tried with different UUID i.e. UUID used in Bluetooth chat example, SPP profile UUID, but still no success. </p><p>The error that I get is <strong>stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)</strong>. </p><p>It will be of great help if someone can point me to right direction.</p>","261566","","","","","2010-11-02 14:34:55","Connecting with embedded device over bluetooth?","<android><bluetooth><connect>","1","0","","",""
"4078640","1","","","2010-11-02 14:27:35","2","2398","<p>I'm creating an application that needs to draw multiple line segments, each one starting in one colour and ending in another.At the moment I have the code below within my calculating loop but this seems like overkill to achieve what I want especially if the line could be hundreds of segments long.</p><p>I'm realtively new to OpenGL so would appreciate some thoughts on how best to approach this.</p><p>Thanks.</p><pre><code>    vertexBuffer.position(0);    vertexBuffer.put(xyz[0]);    vertexBuffer.put(xyz[1]);    vertexBuffer.put(xyz[2]/);    vertexBuffer.put(nextxyz[0]);    vertexBuffer.put(nextxyz[1]/;    vertexBuffer.put(nextxyz[2]);    vertexBuffer.position(0);    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);    gl.glColorPointer(4, GL10.GL_FLOAT, 0, colorBuffer);    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glEnableClientState(GL10.GL_COLOR_ARRAY);    gl.glDrawArrays(GL10.GL_LINES, 0, 2);    gl.glDisableClientState(GL10.GL_COLOR_ARRAY);    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);</code></pre>","472428","","","","","2011-08-28 14:31:25","How to draw multiple line segments of different colours in OpenGL-ES on Android","<android><opengl-es>","2","0","0","",""
"4078715","1","","","2010-11-02 14:35:56","3","964","<p>I would like to add a small window (Popup) on call screen activity. <strong>Google voice</strong> and <a href=""http://areacellphone.com/2010/04/android-worldcallplaceandtime-apps-know-place-and-time-of-inoutgoing-call/"" rel=""nofollow"">worldcallplaceandtime</a> are both adding the same window during a call.</p><p>The problem is that when I open a new activity on the top part of the screen, the rest of the buttons are disabled (End call, Mute etc). The only option to click the end call button is only when I close the new activity that was added. </p><p>Can anyone please tell me how can I add a small window one the screen and still be able to use the call standard buttons?</p>","178016","","","","","2012-10-26 04:48:49","Activity window on standard call screen - to Enable buttons","<android><google-voice>","2","1","","",""
"4078745","1","4078779","","2010-11-02 14:39:31","3","1275","<p>I want to insert some tables by default to our <code>sqllite</code> db. </p><p>I want to display different items according to different categories. In the application, a user can also add items and new categories, for that purpose I want to add some data to db by default. How can we add data to <code>sqlite</code> by default. Please give me some suggestions.</p><p>Thanks in advance </p>","479027","","592025","","2012-10-17 13:03:21","2012-10-17 13:03:21","By Default load some data into our database sqlite","<android><sqlite>","2","0","2","",""
"4078767","1","","","2010-11-02 14:42:23","8","1608","<p>An activity can use AsyncTask or Handler framework for background work. Both will continue to work even after user has moved away from the activity that started them and the onDestroy for the activity has been called. In other words, an activity is fully capable of doing background work even after its GUI has been shutdown.</p><p>In this scenario, use of Service for background work seems like redundancy. What does Service bring to the table that an activity can not do? Thanks.</p>","494863","","","","","2010-11-02 16:57:38","Why use Service for background tasks?","<android>","3","0","2","",""
"4078916","1","4531046","","2010-11-02 14:59:43","1","2161","<p>I want to create a contact group, give it a particular name and then add contacts to it.</p><p>I can make contacts <em>by using <code>RawContacts</code> class</em> but I do not know how to </p><ol><li>create a contact group </li><li>and then add contacts to that particular group. </li></ol><p>Can someone please help me out with some sample code?</p>","452307","","805252","","2011-09-21 11:13:54","2014-02-22 10:26:03","How can I create a contact group programmatically in Android?","<android>","2","0","1","",""
"4079015","1","4079069","","2010-11-02 15:08:39","0","941","<p>I have tab bar in my application .In this I have three tab .it will call three activity .in activity i have the list view .if i click the list view it will call different activity other than tab activity.can anybody tell how to display tab bar for other activity give example?</p><p>Thanks in advance  </p>","426344","","426344","","2010-11-03 07:09:48","2012-07-14 11:49:59","How to display tab bar in different activity in android","<android>","2","0","","",""
"4079065","1","4125901","","2010-11-02 15:13:48","0","296","<p>I want to create a TabActivity that works like a browser.When the activity is created, it has two tabs: ""Tab1"" and ""Add Tab"". When the ""Add Tab"" is clicked, it should Add a new tab.</p><pre><code>Tab 1 | Add Tab==&gt; Add Tab is clickedTab 1 | Tab 2 | Add Tab==&gt; Add Tab is clickedTab 1 | Tab 2 | Tab 3 | Add Tab</code></pre><p>...</p><p>All my tabs contents are instances of the same Activity.</p><p>What is the best way to do that?</p>","488054","","","","","2010-11-08 16:38:52","Android: Browser-like TabActivity","<android><tabactivity>","2","0","","",""
"4079117","1","4079150","","2010-11-02 15:20:44","5","955","<p>What are advantages of using custom content provider? Why such content provider is superior of plain class that wraps SQL queries?</p>","296427","","","","","2010-11-02 15:24:50","Why should I use custom content provider in Android?","<android><android-contentprovider>","2","0","1","",""
"4079164","1","4079322","","2010-11-02 15:24:47","0","3031","<p>I'm trying to print the value of the TextViews which are inside TableRows, using <code>TableLayout#getChildAt(i).getChildAt(j)</code>.</p><p>When I try to log it using the above, logcat complains, saying that it's a View object and that it doesn't have the method I'm trying to use (<code>getText()</code>).</p><p>The only Views in the TableRows are TextViews.</p><pre><code>// List&lt;TextView&gt; textViewBoxes...private void createViews() {    ...    tblLayout = new TableLayout(this);    tblRow01 = new TableRow(this);    ...    for (int i = 0; i &lt; 99; i++) {        TextView text = new TextView(this);        text.setText(""Player "" + i);        textViewBoxes.add(text);    }    tblRow01.addView(textViewBoxes.get(0));    ...    tblLayout.addView(tblRow01);    ...    // Print the contents of the first row's first TextView    Log.d(TAG, (""row1_tv1: "" +            tblLayout.getChildAt(0).getChildAt(0).getText().toString));    ...}</code></pre>","494879","","494879","","2013-08-22 20:13:01","2013-08-22 20:13:01","Unable to select children (textview) of tableRow programmatically","<android><casting><android-textview><android-tablelayout>","1","0","0","",""
"4079279","1","4079881","","2010-11-02 15:36:19","0","2025","<p>I want to port my application on all android devices, and I want to have the right/left animation on the activities transition on all android platform versions. I know that this feature is implemented in the 2.0 version. How can I implement this feature for the lower versions? </p><p>Thanks in advance!</p>","460611","","","","","2010-11-02 16:35:19","Simulating the left/right sliding animation transition","<android>","1","0","1","",""
"4079410","1","4079504","","2010-11-02 15:47:04","1","3905","<p>I am using relative layout to superimpose one smaller image on top of a larger one.I want the bottom-right corner of the smaller image to coincide with B-R corner of the larger image. Im using margin parameters in my layout xml (specifying measurement in dips) but this doesnt seem to work for all devices and resolutions - in some cases the small image is shifted by 4-5px from the border.</p><p>Is it possible to specify the position of the smaller image without pixel values?? Ie with gravity or something??</p>","450741","","","","","2010-11-02 15:56:11","relative layout aligning images about right bottom corner","<android><layout><relative>","1","0","1","",""
"4079556","1","4080257","","2010-11-02 16:00:59","1","315","<p>I have a project that uses <code>AsyncTask</code> to get work done in background.<br>This project also uses a class as a generic holder for static values like database keys, but also for one or two useful objects for the whole project. Let's say this class is called <code>public class Constants</code>.</p><p>I want to access one of these objects from an <code>AsyncTask</code>, and I don't know if I need to copy it or not.<br>I am not actually getting errors or crashes, but I get some user feedback reporting crashes that I cannot reproduce, so I'm gessing I am doing something wrong with this.</p><p>My current processing is this:</p><pre><code>onStart() {// somewhere in the UI thread  new MyTask(Constants.theObject).execute(); // (1)  }  // ...  class MyTask extends AsyncTask&lt;...&gt; {  MyObjectType object;  MyTask(MyObjectType theObjectInstance) {  object = theObjectInstance; // (2)  // ...  doInBackground() { // (3)  //  ...  } </code></pre><p>In <code>(1)</code>, <code>Constants.theObject</code> is a static object created at application startup</p><p>In <code>(2)</code>, I get a reference to the existing static object <code>Constants.theObject</code></p><p>In <code>(3)</code>, we are no longer in the UI thread, and I want to access <code>Constants.theObject</code> (which may also be being used in the main thread)</p><p>.</p><p>I think there are three possible cases.</p><ul><li>this code is ugly, I should do otherwise</li><li>this code is OK, the user feedback is not about this</li><li>this code is quite OK, but I should make a copy of <code>Constants.theObject</code> if I want to use it in <code>doInBackground</code>; otherwise it can fail</li></ul><p>I hope you can help me! Thanks a lot for reading.</p>","334493","","414972","","2011-09-19 10:45:16","2011-09-19 10:45:16","Do I need to copy static objects if I want to access them from an AsyncTask?","<java><android><android-asynctask>","2","5","","",""
"4079723","1","4079756","","2010-11-02 16:19:14","0","369","<p>I want to create layout where I have two images at left and at right and text in center.</p><p>I have tried to do it with relative layout but unfortunetly it was unsuccessfully. Could anybody provide me an example?</p>","390323","","","","","2010-11-02 16:40:32","How to place a text between two images in Android","<java><android>","1","0","","",""
"4079742","1","","","2010-11-02 16:21:01","0","1056","<p>I have some Java code which pulls JSON data (fetched via a URL) into my Android App.</p><p>I'm having some issues parsing this JSON data and putting it into an array for display on an overlay for a map generated using the Google Maps library.</p><p>Here is the code for parsing the JSON data:</p><pre><code>String result = serverLink.getServerData();    try {        JSONArray jArray = new JSONArray(result);        for(int i=0;i&lt;jArray.length();i++){            JSONObject json_data = jArray.getJSONObject(i);            GeoPoint point = new GeoPoint(json_data.getInt(""lat""), json_data.getInt(""lng""));            OverlayItem overlayitem = new OverlayItem(point, ""test"", ""test"");            mapOverlay.addOverlay(overlayitem);        }    } catch(JSONException e) {}</code></pre><p>Can anybody help me see as to why this code doesn't populate my map correctly? Any help would be much appreciated!</p>","494971","","","","","2010-11-02 16:21:01","Putting JSON data into array for display on Android map","<java><android><json><google-maps>","0","4","1","",""
"4079871","1","","","2010-11-02 16:34:07","0","84","<p>I wounder, What are states used for in android? do they have any big purpose in android?</p>","371301","","","","","2010-11-02 16:34:07","States in Android, How do they work","<android>","0","5","","",""
"4079975","1","","","2010-11-02 16:43:52","2","1750","<p>I have this code on my android:</p><pre><code>try {    http = (HttpConnection) Connector.open(""http://35.9.22.102:8080/Services/SubmitMedia/"");    http.setRequestMethod(HttpConnection.POST);    http.setRequestProperty(""Connection"", ""keep-alive"");    http.setRequestProperty(""Content-Type"", ""multipart/form-data"");    http.setRequestProperty(""Content-Length"", file.length + """");    dos = http.openDataOutputStream();    dos.write(file);    int response = ((HttpConnection) http).getResponseCode();    if (response == HttpConnection.HTTP_OK) System.out.println(""Success"");} catch (Exception e) {    e.printStackTrace();} finally   {    try {        if (http != null) http.close();        if (dos != null) dos.close();    } catch (Exception e)   {        e.printStackTrace();    }}</code></pre><p>This code for the servlet side:</p><pre><code>DataInputStream din = new DataInputStream(request.getInputStream());  byte[] data = new byte[0];  byte[] buffer = new byte[512];  int bytesRead;  while ((bytesRead = din.read(buffer)) &gt; 0 ) {      // construct large enough array for all the data we now have      byte[] newData = new byte[data.length + bytesRead];      // copy data previously read      System.arraycopy(data, 0, newData, 0, data.length);      // append data newly read      System.arraycopy(buffer, 0, newData, data.length, bytesRead);      // discard the old array in favour of the new one      data = newData;  } </code></pre><p>The problem is the code broke when it reaches <code>Connector.open(""http://35.9.22.102:8080/Services/SubmitMedia/"")</code> on the Android part. The program skips whole thing and goes to <code>finally</code>. I am not sure what would be the main problem in here. I need some help.</p>","448732","","157882","","2010-11-02 22:54:27","2010-11-02 22:54:27","Send file from Android to Servlet via HttpConnection POST","<android><servlets><post><send><httpconnection>","0","1","","",""
"4080061","1","","","2010-11-02 16:53:24","1","2072","<p>Today i met with the serious problem. Actually i have 5 activities in my activity group.</p><p>from 1st activity i go to 2nd and from 2nd i go to 3rd and so on....and on the 5th screen when i press back key i came to 4th and so on....</p><p>When i again go to the same process it displays me the previous displayed data as well on the screen. m not able to find the sollution for the same.</p><p>i need that every time i follow the process it will show me the new data not with the previous one data.</p><p>pls help me.</p><p>i cant paste the whole code. its 5 activities.</p>","383597","","","","","2012-10-27 03:38:51","android Activity Group","<android>","2","1","","",""
"4080133","1","","","2010-11-02 17:00:08","2","3046","<p>My app creates a puzzle grid using table layout, tablerows and textviews.  I want a user to be able to save this grid to the SD card so that it can be printed or copied or loaded onto another device.  </p><p>How do you save a view so that when it's printed it will look like it does on the android screen?</p>","495016","","23199","","2010-11-02 17:16:45","2010-11-02 18:12:09","how to save view as an image to the SD card","<android><image><printing><save><sd-card>","1","2","3","",""
"4080165","1","4080229","","2010-11-02 17:04:22","11","22847","<p>Previous time I asked a question here I learned a lot so I guess it's worth a shot to try it again.</p><p>I am using the lazy list by Fedor from this link:<a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview</a></p><p>It's working like a charm. BUT, Fedor is making his main class extend Activity instead of ListActivity. Because of this, I am no longer able to use a listItemClick listener. Eclipse declares some errors around onListItemClick. It works when I turn </p><pre><code>    @Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);     // Intent launcher here}</code></pre><p>into</p><pre><code>   protected void onListItemClick(ListView l, View v, int position, long id) {     // Intent launcher here   }</code></pre><p>But the intent launcher doesn't work. Neither does a toast notification.</p><p>When I turn the Activity in a ListActivity, Eclipse doesn't stagger, but my emulator gives me a force close.</p><h2>How do I get</h2><ul><li>Either onListItemClick click in the activity (preferable) </li><li>Or do I transform the code into a ListActivity without force close?</li></ul><p>Thanks a lot in advance.</p>","484475","","484475","","2010-11-02 17:09:34","2013-07-24 08:27:38","Android: onListItemClick in Activity","<java><android><eclipse><lazylist>","7","0","7","",""
"4080202","1","4080332","","2010-11-02 17:08:14","0","3484","<p>I'm trying to implement a Select All menu item for a ListView in a ListViewActivity. The relevant parts of my ListViewActivity:</p><pre><code>public class MyListViewActivity extends ListActivity{   @Override   protected void onCreate(Bundle savedInstanceState)   {      super.onCreate(savedInstanceState);      ArrayList&lt;String&gt; data = createDataList();            setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_multiple_choice, data));      getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);      getListView().setItemsCanFocus(false);   }   @Override   public boolean onMenuItemSelected(int featureId, MenuItem item)   {      if (item.getItemId() == R.id.delete)      {         //TODO: delete the checked items         return true;      }      if (item.getItemId() == R.id.select_all)      {         for (int i = 0; i &lt; getListView().getCount(); i++)            getListView().setSelection(i);         return true;      }      return super.onMenuItemSelected(featureId, item);   }</code></pre><p>I've browsed around stackoverflow.com and the google; the above is something that should work. But it doesn't. <code>setSelection(i)</code> appears to be the method I want to call on ListView but it's not working as advertised.</p><p>What am I doing wrong? Is this even possible on Android in code?</p>","631","","631","","2013-03-27 19:08:38","2013-03-27 19:08:38","Implement Select All with multiple select ListView in Android","<android><listview>","2","0","","",""
"4080218","1","16268583","","2010-11-02 17:09:50","1","493","<p>I have an Activity that implements LocationListener.</p><pre><code>public class MyActivity extends MapActivity  implements LocationListener</code></pre><p>In my activity, I register a locationlistener in the onCreate()</p><pre><code>lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime, distance, this);</code></pre><p>In the onDestroy method, I'm removing the registration for my locationlistener.</p><pre><code>@Overrideprotected void onDestroy() {    Utils.addDebugMsg(this,""onDestroy"");    lm.removeUpdates(this);    super.onDestroy();}</code></pre><p>In my application, I can change the minTime and distance, so I re-initialize my listener like this :</p><pre><code>private void initializeGpsListener() {    lm.removeUpdates(this);    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime, distance, this);}</code></pre><p>For debugging purposes, I write something to the screen whenever a provider is enabled (in this case GPS).</p><pre><code>    @Override    public void onProviderEnabled(String provider) {        Utils.addDebugMsg(this,""onProviderEnabled : "" + provider);    }</code></pre><p>What I noticed is that sometimes, multiple instances of my activity (or locationlistener) are ""kept around"". Each time I turn the GPS provider on, instead of seeing 1 statement ""onProviderEnabled : GPS"", I see several different instances of my Activity printing this line (all at the same time).</p><p>How do I clean up these listeners ( = my activities), and make sure that only 1 remains active throughout the application.</p>","492410","","","","","2013-04-28 22:17:00","Howto cleanup location listeners in activities properly","<android><instances><locationlistener>","1","2","1","",""
"4080386","1","4082967","","2010-11-02 17:27:40","1","1576","<p>I have a TabActivity, and each Tab corresponds to its own Activity.  In one of them, in the onCreate method, I use startActivityForResult to show a dialog (specifically, Bump's BumpAPI activity).  </p><pre><code>    protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    bump = new Intent(this, BumpAPI.class);    bump.putExtra(BumpAPI.EXTRA_API_KEY, API_KEY);    startActivityForResult(bump, BUMP_API_REQUEST_CODE);}</code></pre><p>The problem is that when the screen orientation changes, it tries to create the tab's activity again which makes another BumpAPI dialog, resulting in multiple stacked on top of each other.  Do I have a hook into the started activity to cancel the previous one when the orientation changes?</p><p>A workaround seems to be to add a button that when clicked, starts the second activity, but that adds an unnecessary step.</p><p>Also, I can't fix the screen orientation for the entire tabActivity because some of them require typing and users may want to use their physical keyboards. </p>","324518","","213269","","2010-12-21 16:47:40","2010-12-21 16:47:40","How do I handle screen orientation changes with an activity started within a tab's activity","<android><activity>","1","0","","",""
"4080392","1","4080440","","2010-11-02 17:28:12","0","670","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1882883/how-to-retrieve-the-android-sdk-version"">How to retrieve the android sdk version?</a>  </p></blockquote><p>I'm developing an Android app that needs to provide notifications. For operating systems prior to 2.2 I'm going to use polling, but for new operating systems I want to utilize the new C2DM method. Is there a way to detect which operating system the application is installed on via code? Or is there a better way to go about this altogether?</p>","490642","","","","","2010-11-02 17:40:46","How to determine Android operating system via code","<android><operating-system><notifications><android-c2dm>","1","0","","2012-07-30 12:31:03",""
"4080448","1","4080509","","2010-11-02 17:34:31","3","336","<p>I need my app to trigger an alert a specified amount of time after a user presses a button. The documentation makes it look like Handler is what I need, and usage appears to be brain dead. </p><p>However, I'm finding that despite using postDelayed, my routine is running immediately. I know I'm missing something obvious, but I just can't see it. Why does the code below make the phone vibrate the immediately rather than waiting a minute?</p><pre><code> ...   final Button button = (Button) findViewById(R.id.btnRun);   final Handler handler = new Handler();   button.setOnClickListener(new OnClickListener() {   public void onClick(View v) {                     ...        handler.postDelayed(Vibrate(), 60000);        }             });...    private Runnable Vibrate() {    Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);     v.vibrate(300);    return null;   }</code></pre>","493144","","319618","","2010-11-02 17:38:42","2013-10-24 07:20:38","Why doesn't Handler trigger alert as expected?","<android><handler><alerts><postdelayed>","3","0","","",""
"4080475","1","4080512","","2010-11-02 17:38:05","8","4528","<p>Is it possible to broadcast an Intent from native code? If so, is there documentation and/or sample code pertaining to the relevant APIs?</p>","440093","","","","","2012-01-12 13:21:44","Android: How to broadcast intent from native code?","<android>","3","0","2","",""
"4080517","1","","","2010-11-02 17:43:47","4","4250","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4119827/how-can-i-open-android-browser-with-specified-post-parameters"">How can I open android browser with specified POST parameters?</a>  </p></blockquote><p>I would like to do somethinglike this:</p><p>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.somepage.com?par1=val1&amp;par2=val2""));</p><p>But I dont want to send the parameters with get but with post.How can I do this as described above?</p><p>Many thanks in advance,navajo</p>","495059","","","","","2012-03-28 14:27:51","Launch default browser with intent and post parameters","<android><android-intent><http-post>","2","1","3","2012-03-28 15:02:07",""
"4080808","1","4085140","","2010-11-02 18:17:47","26","20746","<p>I'm having a problem with the AsyncTask class. It seems like my task stops working after  creating 4 or 5 tasks. </p><p>Im having 2 activities. MainActivity which only holds a button that starts a second activity called ImageActivity.</p><p>ImageActivity is very simple. it got an onCreate that sets the layout, and then it starts a new AsyncTask that loads an image from the internet. This works fine the first few times. But than it suddenly stops working. The onPreExecute method is run every time, but not the doInBackground method. I have tried to simplify the doInBackground with a sleeping loop, and the same thing happens. I cant understand this behavour since the asynctask is both canceled and set to null in the onDestroy method. So every time i start a new ImageActivity, i also create a fresh AsyncTask.</p><p>I recreate the ImageActivity and the task by hitting the back button, and than clicking the button on the MainActivity.</p><p>Any ideas anyone? I'm really struggling with this one.</p><p>UPDATE: Code that starts the ImageActivity (inside a button onClickListener)</p><pre><code>Intent intent = new Intent();intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);intent.setClassName(this, ImageActivity.class.getName());startActivity(intent);</code></pre><p>The code above starts this activity</p><pre><code>    public class ImageActivity extends Activity {    private AsyncTask&lt;Void, Void, Void&gt; task;    public void onCreate(Bundle bundle) {        super.onCreate(bundle);        setContentView(R.layout.main);        task = new AsyncTask&lt;Void, Void, Void&gt;() {            @Override            protected void onPreExecute()            {                Log.d(TAG, ""onPreExecute()"");            }            @Override            protected Void doInBackground(Void... params)            {                Log.d(TAG, ""doInBackground() -- Here is the download"");                // downloadBitmap(""http://mydomain.com/image.jpg"")                return null;            }            @Override            protected void onPostExecute(Void res)            {                Log.d(TAG, ""onPostExecute()"");                if(isCancelled()){                    return;                }            }        }.execute();    }    @Override    protected void onDestroy()    {        super.onDestroy();        task.cancel(true);    }}</code></pre><p>UPDATE:</p><p>I have tested using a combination of traditional Threads and runOnUiThread method, and it seems to work better. Now the thread runs every time.</p>","133858","","133858","","2010-11-03 08:09:23","2013-12-16 20:49:56","AsyncTask doInBackground does not run","<android><android-asynctask>","7","4","8","2013-12-17 07:31:56",""
"4080844","1","","","2010-11-02 18:21:00","1","1883","<p>Is it possible to write custom metadata to an JPG image using Android SDK or some 3rd party lib , and extracting it afterwards? If it is, is there any simple solution?</p><p>Thank you very much in advance</p>","426547","","","","","2010-11-02 18:26:25","Can a custom metadata be added to an image in Android?","<android><metadata><jpeg><exif>","1","0","","",""
"4080868","1","4080921","","2010-11-02 18:23:24","47","8927","<p>I am doing Android programming and was learning about Intents, when I saw a constructor that, to my C# trained mind, seemed funky.  The call was: </p><pre><code>Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);</code></pre><p>Both of the parameters are new to me.  How is there a static "".this"" off of a Class Name?  Is this a Java thing or an Android thing?  I am assuming that it is the same as just saying ""this"", since I am in the context of CurrentActivity, but I don't get how the ""this"" can be called off of the Class name itself.  Also.  The "".class"" looks like it is used for reflection, which I am familiar with in C#, but any insight into this would be welcomed as well.</p><p>Thanks.</p>","469106","","469106","","2010-11-03 20:06:03","2013-06-04 18:33:08","Java: ClassName.this","<java><android>","6","0","14","",""
"4080942","1","4081775","","2010-11-02 18:30:44","2","2292","<p>Hey,I just wrote a horizontal progress bar. The progressbar gets this background resource:</p><pre><code>&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:id=""@android:id/background""&gt;    &lt;inset xmlns:android=""http://schemas.android.com/apk/res/android""        android:drawable=""@drawable/progress_bg"" /&gt;&lt;/item&gt;&lt;item android:id=""@android:id/progress"" android:gravity=""center""&gt;    &lt;clip&gt;        &lt;shape&gt;            &lt;corners android:radius=""5dip"" /&gt;            &lt;solid android:color=""#FFF"" /&gt;        &lt;/shape&gt;    &lt;/clip&gt;&lt;/item&gt;</code></pre><p></p><p>This works fine, but the white progress has the same height as the background. But I want the progress to be smaller than the background of the progress bar, since thre background has a boarder that should not overlap.</p><p>Any ideas?Thanks</p>","472355","","932225","","2012-10-05 12:25:00","2012-10-05 12:25:00","Custom horizontal progressbar","<android>","3","0","","",""
"4080962","1","4081164","","2010-11-02 18:33:04","0","1051","<p>I don't know if it is possible, but actually I wouldn't see why not.</p><p>Can we do a grid view not just with ImageView but with a custom view.</p><p>I am trying to make a grid view of a view composed of an ImageView and a TextView.</p><p>I know that everything happens in my Adapter getView's function but I can't figure out how to do it.</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    View cases = findViewById(R.id.fileUnitLayout);    if (convertView == null) {       convertView = new View(mContext);    } else {       cases = convertView;    }       return cases;    }</code></pre><p>My view has an id of R.id.fileUnitLayout. Let's say my inner TextView has an id of A and my inner ImageView has an id of B. How can I fill them ?</p><p>Thank you,</p>","290613","","","","","2010-11-02 18:57:25","GridView with customs view","<android><gridview><adapter>","1","0","","",""
"4081167","1","","","2010-11-02 18:57:52","0","1926","<p>For an EditText view i can use setInputType(InputType.NULL), but an web view doesn't have it. I tried the rest of the solutions posted on stackoverflow but none of them worked for a web view.</p>","495145","","13793","","2012-05-01 01:25:29","2012-05-01 01:25:29","How can I hide the soft keyboard in WebView?","<android><webview><android-softkeyboard>","1","0","","",""
"4081250","1","","","2010-11-02 19:09:56","10","11781","<p>In my app, I am loading a list of external url's in webview and allow user to flip through them.  Webviews are loaded on to a view flipper.  I find the performance is really bad in webview load url.  I have tried everything from using the frame layout to limiting the number of webviews to load.  Still the performance is not satisfactory.</p><p>How do I optimize the performance of webview?  This should be a common usage.  Am I missing something obvious.</p><p>My Webview settings are - </p><pre><code>    webView.setInitialScale(WEBVIEW_SCALE);    webView.getSettings().setJavaScriptEnabled(true);    webView.getSettings().setBuiltInZoomControls(false);    webView.setWebViewClient(new MyWebViewClient());        webView.setOnTouchListener( new OnTouchListener());</code></pre>","495158","","","","","2014-02-27 13:29:26","Android WebView performance","<android><webview>","2","4","5","",""
"4081264","1","4081423","","2010-11-02 19:12:21","3","2610","<p>Is it possible to configure the Android OS to run only a single app?</p><p>Basically what I want to do is customize an Android device so that it boots up and runs one application only, and for that application to be switched to the front of the screen automatically. Also, when it gets closed, to be started up and switched to again. Any ideas?</p><p>Thanks,-David</p>","495156","","","","","2010-11-02 19:34:14","Is it possible to configure an Android install to run a single app?","<android>","2","3","4","",""
"4081317","1","","","2010-11-02 19:19:50","1","227","<p>I was using AsyncTask to display data on a List, But the loading is visible, but it dosen't show the list.. </p><pre><code>  public void getLocations(){    Connect client = new Connect(SERVICE_URI + ""/GetLocations"");    client.AddHeader(""Accept"", ""application/json"");    client.AddHeader(""Content-Type"", ""application/json"");    try {        client.Execute(RequestMethod.GET);        JSONObject rootJson = new JSONObject(client.getResponse());        JSONArray jsonArray = rootJson.getJSONArray(""GetLocationsResult"");        String[] names = null;        if (jsonArray != null) {            names = new String[jsonArray.length()];            for (int i = 0; i &lt; jsonArray.length(); i++) {                JSONObject json = jsonArray.getJSONObject(i);                names[i] = json.getString(""Name"");            }        }        setListAdapter(new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, names));    } catch (JSONException e) {        e.printStackTrace();    } catch (Exception e) {        e.printStackTrace();    }}  public void getLocations(){ Connect client = new Connect(SERVICE_URI + ""/GetLocations"");    client.AddHeader(""Accept"", ""application/json"");    client.AddHeader(""Content-Type"", ""application/json"");    try {     client.Execute(RequestMethod.GET);     JSONObject rootJson = new JSONObject(client.getResponse());     JSONArray jsonArray = rootJson.getJSONArray(""GetLocationsResult"");     String[] names = null;     if (jsonArray != null) {         names = new String[jsonArray.length()];         for (int i = 0; i &lt; jsonArray.length(); i++) {             JSONObject json = jsonArray.getJSONObject(i);             names[i] = json.getString(""Name"");         }     }        setListAdapter(new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, names));    } catch (JSONException e) {        e.printStackTrace();    } catch (Exception e) {        e.printStackTrace();    }}</code></pre>","371301","","","","","2012-12-13 16:49:06","Android, synctask not showing the list after progressDialog","<android>","1","2","","",""
"4081360","1","4081890","","2010-11-02 19:26:04","1","1114","<p>When I have a status bar notification with a number inside, <strong>it shows the number fine</strong>. But later if I show another notification to <strong>replace</strong> this one, with <strong>no number</strong>, it shows an <strong>empty red circle</strong>. This circle shouldn't be there. How do I remove the red circle? See image here: <a href=""http://jump.fm/UYHGV"" rel=""nofollow"">http://jump.fm/UYHGV</a></p><p>I've already tried:</p><pre><code>notification.number = 0;</code></pre><p>and</p><pre><code>notification.number = -1;</code></pre><p>And forget about canceling notifications first. Since there's no way to query the notification service for existing notifications, I can't detect if the previous one needs to be updated. If I would cancel every time I notify, the user will see the status bar flashing once in a while, which is annoying.</p><p>Please advise.</p><p>Emmanuel</p>","442512","","","","","2010-11-02 20:39:08","Empty red circle in Android notification status bar!","<java><android><notifications><statusbar>","1","0","","",""
"4081389","1","","","2010-11-02 19:30:13","2","1626","<p>Had a read through the android documentation on WifiManager and thought I understood it but when I tried to code an example I keep running into problems.</p><p>I had the following code</p><pre><code>        wifiOffButton.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            Context mContext = getApplicationContext();            WifiManager mWifi = (WifiManager)mContext.getSystemService(Context.WIFI_SERVICE);            mWifi.setWifiEnabled(false);        }    });</code></pre><p>I had tried something similar to turn off sound</p><pre><code>muteButton.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            Context mContext = getApplicationContext();            AudioManager mAudio = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);            mAudio.setRingerMode(0);        }    });</code></pre><p>this works fine, but the wifi part always gives an error, was just wondering if I'm missing something obvious as I can't seem to work it out?</p>","495168","","","","","2011-03-29 04:13:12","Trying to program how to turn wifi off on android device","<android><android-wifi>","3","2","","",""
"4081533","1","4088893","","2010-11-02 19:48:59","11","6674","<p>I'm trying to remove a preference from the screen so it isn't visible if the user is using an SDK greater than 2.2.  I've found several answers saying that getPreferenceScreen().removePreference(thePreference) will work, but I'm getting FALSE returned every time I try it. Am I using it in the wrong place? Any clue from my code?</p><pre><code>public class Preferences extends PreferenceActivity implements OnSharedPreferenceChangeListener {private static final String POLLING_PREFERENCE = ""update_frequency_list"";@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Load the preferences from an XML resource    addPreferencesFromResource(R.xml.preferences);    // Get a reference to the preferences    mPollPref = getPreferenceScreen().findPreference(POLLING_PREFERENCE);    //If the SDK is 2.2 or greater do not display polling preferences (using C2DM instead)    if(Build.VERSION.SDK_INT &gt; 7) {        getPreferenceScreen().removePreference(mPollPref);    }}....}</code></pre>","490642","","","","","2013-03-20 19:50:29","How to remove Android preferences from the screen","<android><android-preferences>","3","0","5","",""
"4081594","1","4082674","","2010-11-02 19:56:35","1","1167","<p>again i have got a problem with socket programming in Android. My Problem is Selector.select() returns zero that there are no SocketChannels ready for writing. And again the same code works in normal Java but does not work in Android. Here is my code:</p><pre><code>package com.test;import java.io.IOException;import java.net.InetSocketAddress;import java.net.SocketAddress;import java.nio.channels.ClosedChannelException;import java.nio.channels.Selector;import java.nio.channels.SocketChannel;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class WebSocketTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);  SocketChannel channel = null;        SocketAddress socketAdress = new InetSocketAddress(""10.0.0.1"", 8787);  try {   channel = SocketChannel.open();  } catch (IOException e) {   Log.e(""ERROR"", ""channel open"");  }  try {   channel.configureBlocking(false);  } catch (IOException e1) {   Log.e(""ERROR"", ""channel blocking"");  }  try {   channel.connect(socketAdress);  } catch (IOException e) {   Log.e(""ERROR"", ""channel connect"");  }  try {   while(!channel.finishConnect())   {   }  } catch (IOException e1) {   Log.e(""ERROR"", ""channel finishConnect"");  }  Selector selector = null;  try {   selector = Selector.open();  } catch (IOException e) {   Log.e(""ERROR"", ""selector open"");  }  try {   channel.register(selector, channel.validOps());  } catch (ClosedChannelException e) {   Log.e(""ERROR"", ""channel register"");  }  boolean i = true;  while(i)  {   int readyChannels = 0;   try {    readyChannels = selector.select();   } catch (IOException e) {    Log.e(""ERROR"", ""selector select"");   }   if(readyChannels &gt; 0)   {    i = false;   }  }    }}</code></pre><p>In Java readyChannels = 1. In Android it is 0.Can anyone help me?</p>","492704","","","","","2010-11-02 23:22:10","SocketChannel is not ready","<java><android><sockets><nio>","2","1","1","",""
"4081625","1","","","2010-11-02 19:59:44","0","49","<p>I want to make an http server on one android application and get its contents from another emulator. Please tell me if there is a sample code for making this.</p><p>Also other than http protocol, is there any other networking API + sample code that someone give me to connect and get content from one emulator to another?</p>","418965","","","","","2010-11-02 22:23:23","Comunicate Multiple Emulators","<java><android><networking>","1","1","1","",""
"4081660","1","","","2010-11-02 20:05:39","13","3749","<p>Is there a good site for tracking what your app's ranking is per category on Android market. A long time ago androidstats.com seemed to work, but its long history. </p>","495200","","1437962","","2013-01-16 02:44:04","2013-01-16 02:44:04","Is there a good site for tracking your ranking on Android Market?","<android><google-play>","3","0","5","2013-01-16 03:50:36",""
"4081686","1","4187174","","2010-11-02 20:10:03","8","396","<p>I want to implement a gateway for handling outgoing calls.</p><p>In the latest Android versions 2.x I can do this easily with the hidden ACTION_CALL extra string:""com.android.phone.extra.GATEWAY_URI""</p><p>But in earlier versions, like 1.6, I don't know how to do it. It must be possible because Google Voice is doing it. Can someone please help me?</p><p>Thanks,Emmanuel</p>","442512","","","","","2010-11-18 17:18:07","Android 1.6 equivalent of EXTRA_GATEWAY_URI","<android><google-voice>","2","4","3","",""
"4081763","1","4082182","","2010-11-02 20:22:08","14","34958","<p>I have a resource file in my /res/raw/ folder (/res/raw/textfile.txt) which I am trying to read from my android app for processing.</p><pre><code>public static void main(String[] args) {    File file = new File(""res/raw/textfile.txt"");    FileInputStream fis = null;    BufferedInputStream bis = null;    DataInputStream dis = null;    try {      fis = new FileInputStream(file);      bis = new BufferedInputStream(fis);      dis = new DataInputStream(bis);      while (dis.available() != 0) {              // Do something with file          Log.d(""GAME"", dis.readLine());       }      fis.close();      bis.close();      dis.close();    } catch (FileNotFoundException e) {      e.printStackTrace();    } catch (IOException e) {      e.printStackTrace();    }  }</code></pre><p>I have tried different path syntax but always get a <strong>java.io.FileNotFoundException</strong> error. How can I access /res/raw/textfile.txt for processing? Is <strong>File file = new File(""res/raw/textfile.txt"");</strong> the wrong method in Android?</p><hr><p><em><strong></em>* Answer: <em>*</em></strong></p><pre><code>// Call the LoadText method and pass it the resourceIdLoadText(R.raw.textfile);public void LoadText(int resourceId) {    // The InputStream opens the resourceId and sends it to the buffer    InputStream is = this.getResources().openRawResource(resourceId);    BufferedReader br = new BufferedReader(new InputStreamReader(is));    String readLine = null;    try {        // While the BufferedReader readLine is not null         while ((readLine = br.readLine()) != null) {        Log.d(""TEXT"", readLine);    }    // Close the InputStream and BufferedReader    is.close();    br.close();    } catch (IOException e) {        e.printStackTrace();    }}</code></pre>","442743","","442743","","2010-11-03 19:57:27","2010-11-03 19:57:27","Access resource files in Android","<java><android><file><resources>","2","1","2","",""
"4081855","1","4082186","","2010-11-02 20:35:29","1","403","<p>The information on the Marketplace website and Google Checkout isn't completely clear to me. Is google going to make a deposit to my bank account from Google Checkout for every app I sell, or will it all sit in my Google Checkout account until I decide to move it to my bank? It would seem silly to do the first because most banks put a limit on the number of free transactions you get per month. So if you have an app that sells at all well for $1 and google takes $0.30 that leaves you $0.70. Then after your accounts transaction limit your bank make take up to $0.50 per transaction leaving you with just $0.20 per sale.</p>","469219","","","","","2010-11-02 21:23:40","Android: Question on Payouts for apps","<android>","4","0","","",""
"4081946","1","4179135","","2010-11-02 20:46:42","5","3691","<p>I have installed my app in a real phone, and even though in the emulator all the texts of thepreferences summaries seem to be in the same color, in the real phone the color is different (some kind of blue... but I guess it depends on the phone's model).</p><p>How can I set this color to my custom preference component? (I have implemented my own seek bar, and its summary text color is different from all the other components text color...).</p><p>Thanks!</p>","480978","","480978","","2010-11-09 16:52:55","2012-01-02 21:39:38","Android preferences summary default color?","<android><colors><preferences><summary>","5","4","3","",""
"4081996","1","9623765","","2010-11-02 20:53:22","1","1398","<p>I'm using the following to draw rounded-corner rectangles in my Android application and it seems to be working alright but with one minor problem:</p><pre><code>//  Draw the control buttonspaint.setColor      (Color.DKGRAY);paint.setStyle      (Style.FILL);canvas.drawRoundRect    (zPlusRectF,  12, 12, paint);canvas.drawRoundRect    (zMinusRectF, 12, 12, paint);paint.setColor      (Color.LTGRAY);paint.setStyle      (Style.STROKE);canvas.drawRoundRect    (zPlusRectF,  12, 12, paint);canvas.drawRoundRect    (zMinusRectF, 12, 12, paint);paint.setColor      (Color.WHITE);paint.setStyle      (Style.FILL);paint.setTextSize   (BUTTON_TEXT_SIZE);... (Adding labels to the rectF's defined above follows) ...</code></pre><p>The strange thing is that the two ends of the rectangle aren't rounded over the same.  The left-side quarter circles are noticeably smaller than the ones on the right.</p><p>Anybody experienced anything similar?  It's weird enough that I might change my mind about the round corners if I can't do anything about it....  And if I knew how to do a screen capture from my Android, I would.</p><p>Thanks,R.</p><p>Edit:  The rectangles in question are 78 pixels wide and 48 tall, if that helps (and since ykatchou may be onto something).</p>","453989","","453989","","2012-03-08 19:38:33","2012-03-08 19:41:02","Strange Looking Rounded Rectangles in Android","<android><drawing>","2","0","","",""
"4082070","1","4082508","","2010-11-02 21:02:21","1","315","<p>I have a bitmap that I want to display in my Android app. This works fine for platforms with version number greater than 1.5 but not for 1.5. When executing the line below an exception is thrown stating that the resource couldn't be found.</p><pre><code>Bitmap bmp = BitmapFactory.decodeResource(mApplicationContext.getResources(), R.drawable.arrow);</code></pre><p>I have put the bitmap in all density-folders (hdpi, mdpi, ldpi) and scaled them according to the documentation (the mdpi-bitmap is 25x25 pixels and the ldpi-bitmap size 75% of the mdpi-bitmap size and the hdpi-bitmap size 150% of the mdpi-bitmap size).Any idea what is wrong here?Thanks,Christian</p>","360674","","","","","2010-11-02 22:11:51","Bitmap resource not found on Android 1.5 platform AVD","<android>","2","0","0","",""
"4082092","1","4083097","","2010-11-02 21:05:06","0","2356","<p>I'm inching my way to doing an Ant build on my Eclipse sources. The ultimate objective is to have the Eclipse sources as the input and the output go into a folder entirely outside the Eclipse file structure.</p><p>It's a while since I've used Ant, so I'm gradually commenting out, then uncommenting bits from the standard build.xml that gets generated when you build a sample project from the command line. I'm going to put lots of 'echos' in to make sure it gets the directories right before I let it actually DO something. I started off with a simple junk target at the top of the build.xml that just echoed 'junk' - this worked OK.</p><p>I then uncommented this bit :</p><pre><code>   &lt;!-- Custom Android task to deal with the project target, and import the         proper rules.         This requires ant 1.6.0 or above. --&gt;    &lt;path id=""android.antlibs""&gt;        &lt;pathelement path=""${sdk.dir}/tools/lib/anttasks.jar"" /&gt;        &lt;pathelement path=""${sdk.dir}/tools/lib/sdklib.jar"" /&gt;        &lt;pathelement path=""${sdk.dir}/tools/lib/androidprefs.jar"" /&gt;    &lt;/path&gt;    &lt;taskdef name=""setup""        classname=""com.android.ant.SetupTask""        classpathref=""android.antlibs"" /&gt;    &lt;!-- Lots of commented out stuff --&gt;    &lt;setup /&gt;</code></pre><p>Once I let this run, then the echo I did have disappears and I get the following output</p><pre><code>[setup] Android SDK Tools Revision 7[setup] Project Target: Google APIs[setup] Vendor: Google Inc.[setup] Platform Version: 2.1-update1[setup] API level: 7[setup][setup] ------------------[setup] Resolving library dependencies:[setup] ------------------[setup] Ordered libraries:[setup] ------------------[setup]</code></pre><p>I'm expecting it to fail of course, because I haven't set up any input/output/lib directories in the .properties files. I am curious to know why the taskdef itself runs when I only invoke the 'junk' target. I'd also like to know what the SetupTask and all the others in the anttasks.jar actually do and where I can find some documentation for them.</p>","440010","","440010","","2010-11-02 22:20:27","2010-11-02 23:46:10","Android and Ant - specifically taskdef and anttasks.jar","<android><ant>","2","0","","",""
"4082351","1","","","2010-11-02 21:42:02","0","824","<pre><code>private static String requestToken; private static String requestSecret; public static void loginTwitter(Context mycontext) {  if (savedToken==null) {   try {    consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);    provider = new CommonsHttpOAuthProvider(""https://api.twitter.com/oauth/request_token"",              ""https://api.twitter.com/oauth/access_token"",              ""https://api.twitter.com/oauth/authorize"");    String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);    Toast.makeText(mycontext, ""login to twitter"", Toast.LENGTH_LONG).show();    mycontext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));   } catch (Exception e) {    Log.e(APP, e.getMessage());   }  } else {   tweetShareURL();  } } private static void tweetShareURL() {  twitter = new TwitterFactory().getInstance();  twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);  twitter.setOAuthAccessToken(savedToken);  // create a tweet  String tweet = title+"" "" + url;  try {   twitter.updateStatus(tweet);  } catch (TwitterException e) {   Log.e(APP, ""2 ""+e.getMessage());  } finally {   utils.hint(""tweet sent!"");  } } static AccessToken savedToken=null; @Override protected void onNewIntent(Intent intent) {  super.onNewIntent(intent);  Uri uri = intent.getData();  Log.e(""URI"", """"+uri.toString());  if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK_URL)) {   String verifier = uri.getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);   Log.e(""verifier"", """"+verifier);   try {    requestToken  = consumer.getToken();    requestSecret = consumer.getConsumerSecret();    consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);    consumer.setTokenWithSecret(requestToken, requestSecret);    provider = new CommonsHttpOAuthProvider(""https://api.twitter.com/oauth/request_token"",              ""https://api.twitter.com/oauth/access_token"",              ""https://api.twitter.com/oauth/authorize"");    provider.setOAuth10a(true);    // TODO: you might want to store token and token_secret in you app settings!!!!!!!!    savedToken = new AccessToken(requestToken, requestSecret);    provider.retrieveAccessToken(consumer, verifier);    Log.e(APP, ""2"");    tweetShareURL();   } catch (Exception e) {    Log.e(APP, ""1 ""+e.getMessage());   }  } }</code></pre><p>always get this lines:</p><p>11-02 22:36:39.526: ERROR/OAUTH(424): 2 401:Authentication credentials were missing or incorrect.11-02 22:36:39.526: ERROR/OAUTH(424): {""error"":""Invalid \/ expired Token"",""request"":""\/1\/statuses\/update.json""}</p><p>why? </p>","472537","","","","","2012-11-24 18:20:26","Android twitter oauth error - expires token request","<android><twitter><oauth>","1","0","","",""
"4082406","1","","","2010-11-02 21:48:28","1","289","<p>There are a number of network types defined in TelephonyManager:</p><pre><code>NETWORK_TYPE_GPRSNETWORK_TYPE_EDGENETWORK_TYPE_UMTSNETWORK_TYPE_CDMANETWORK_TYPE_EVDO_0NETWORK_TYPE_EVDO_ANETWORK_TYPE_1xRTTNETWORK_TYPE_HSDPANETWORK_TYPE_HSUPANETWORK_TYPE_HSPA</code></pre><p>Is there any info out there that describes what range of speeds you can expect on each of these?  If that isn't available, it would be nice to be able to order them based on speed.</p>","23524","","42769","","2010-11-03 11:33:29","2010-12-25 23:57:58","Relative speeds of TelephonyManager's types?","<android><network-programming><telephonymanager>","2","0","","",""
"4082441","1","","","2010-11-02 21:53:48","3","1163","<p>Folks,</p><p>I have GWT-RPC services (on Appengine) supporting a GWT Web client. All is well.</p><p>Now, when I am developing an Android Client for this, do I need a stripped down Servlet to serve this client? Meaning, Now instead of Serialized Java objects sent back and forth (as in GWT), I will need to send XML using Android's packaged HttpClient to a new Servlet (which can possibly reuse the GWT-RPC services within the AppEngine).</p><p>Am I on track here? Does Android allow for GWT-RPC service backends directly?</p><p>I am trying to be succinct from a code perspective.. </p>","495310","","110707","","2010-11-19 03:31:12","2011-06-11 00:21:16","AppEngine GWT-RPC service serving for Web as well as Android","<android><google-app-engine><gwt-rpc>","1","0","1","",""
"4082512","1","4082723","","2010-11-02 22:05:32","6","5270","<p>Does anyone know the difference between the orientation sensor and magnetic field sensor on Android?</p><p>My understanding:  </p><ul><li>orientation => digital compass  </li><li>magnetic field => magnetometer</li></ul><p>Since I've read that magnetometer is synonymous with digital compass I'm a little bit confused. What are they really?</p>","495301","","80572","","2010-11-03 00:18:39","2013-03-16 04:55:08","Difference between orientation sensor and magnetic field sensor on Android?","<android><orientation><magnetometer><digital-compass>","1","1","","",""
"4082619","1","","","2010-11-02 22:21:54","0","803","<p>I've installed Ant. From an existing Eclipse project I am able to generate the build.xml file from the command line using ant -update project. When I now try ant release I get this error: <code>build.xml:65: java.lang.NullPointerException.</code></p><p>This project builds fine under Eclipse. I have no idea where to even begin to figure this out. I wouldn't bother with this except that I need to use ProGuard later on (which I have not done yet). Any ideas?</p>","495330","","30225","","2010-11-02 22:22:50","2011-09-28 08:57:35","Building with Ant","<android>","1","1","","",""
"4082721","1","4083729","","2010-11-02 22:37:09","3","3365","<p>I want to develop a replacement keyboard, but I am afraid that Android assumes the general keyboard 'area' will be a single rectangular shape that sits at the bottom of the screen.  </p><p>What if I want my keyboard to consist of multiple shapes that don't just sit at the bottom of the screen?   Am I doomed from the start, or is it possible to do what I want to do?</p><p>On a related note, what if I only want my keyboard to appear when the phone is in a certain orientation but when the phone is held at a different orientation, the normal soft keyboard is used?  Again, out of luck or possible?</p><p>cheers!</p>","","steve","14606","","2010-11-02 22:39:50","2010-11-03 02:14:33","How to create an on-screen android keyboard that isnt a rectangle at the bottom portion of the screen?","<android><keyboard><replacement><shape>","2","2","1","",""
"4082743","1","4082797","","2010-11-02 22:40:18","8","2070","<p>I'm using the android emulator without the UI and the keyboard command for ""Home"" is the Home key but my macbook doesn't have a home key. Does anybody know what the command is?</p><p>Thanks!</p>","129705","","","","","2014-02-15 03:25:30","What's the home key on osx? Trying to use android emulator","<android><emulator>","2","0","1","",""
"4082757","1","7501600","","2010-11-02 22:42:36","5","326","<p>I'm writing a social networking app that has contacts sync functionality.  I have working code (from an example I found <a href=""http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/"" rel=""nofollow"">here</a>) that inserts contacts on v2.x in a sync adapter.  </p><p>However, the Motorola Blur software doesn't recognize 2.x contacts (I'm using a 2.2 Moto build on a Droid X).  Blur uses the contacts 1.x API, but I'm having trouble finding/understanding examples of how to use it.  <a href=""http://developer.motorola.com/docstools/library/MOTOBLUR_Contacts_1.x_Release_Notes/"" rel=""nofollow"">This page</a> shows how to query by name, but I want to a) add and b) query by a custom account (or potentially MIME) type.  </p><p>The v2 code I'm using creates a new raw contact, creates a ""StructuredName"" data record, and then a data record of custom MIME type.  </p><p>How do I do the equivalent on the 1.x API (level 3)?  I think that this is what the Contacts.Extensions class is for, but the documentation is unclear at best.  </p>","429108","","429108","","2012-08-07 14:54:22","2012-08-07 15:02:19","Android 1.x Contacts.Extensions for a custom account type?","<android><contacts><sync><android-contentprovider><motorola>","2","0","1","",""
"4082799","1","4090566","","2010-11-02 22:49:06","16","19813","<p>In my Android app, each activity is filled with data from an xml file which is somewhere on the web. The website providing these files has a login mechanism, that works with cookies.</p><p>I know how to make a HTTP Request to the login page and receive a cookie. What I don't know is, how I can store it to re-use it in both other activities AND when the app is started the next time. The cookie is valid for a year, so the user of my app should log in once and then never again for a whole year.</p><p>How do I do that? I googled a lot, but either I used the wrong keywords or there are no simple solutions on the internet. I hope somebody here can help me.</p><p>Best regards and thanks in advance, Jan Oliver</p>","169748","","","","","2014-04-10 13:24:38","Android: How to store cookies?","<android><cookies>","5","2","13","",""
"4083093","1","","","2010-11-02 23:45:32","1","773","<p>I'm working on an app that will use MediaPlayer to play music. I'm interested in adding background functionality, so that the music continues playing indefinitely (or as long as the user wishes). The Android docs seem to be pointing me to using a Service for this sort of thing.</p><p>So my question is: Should I define a process for the service (in the manifest, by using <code>android:process</code>), or is it okay if the service will run in the same process as the UI?</p><p>On a similar note: Are there any other things I should be worrying about when implementing something like this?</p>","495376","","","","","2010-11-03 00:08:50","Android Service Process for MediaPlayer","<android><service><media-player>","1","0","1","",""
"4083310","1","4083321","","2010-11-03 00:33:21","0","356","<p>I'm nearing the end of a small project to develop an android app. As a first time developer, and a one-man band, I am anticipating selling it at a low price point. I have followed some of the discussions on the Android blog and elsewhere about licensing and obfuscation, and I am in two minds.</p><p>Part of me thinks that I have spent a long time on the development, so why should I make it easy for people to pirate the app? The other part thinks that it could be fairly time consuming to implement licensing and obfuscation, stop people using the app from non-google supported countries, is likely to p*** people off, and wondering how much of an issue it is anyway for a small app. However, if you google even a small app and add .apk at the end the number of ""warez"" downloads is fairly shocking if it's true.</p><p>Just wondering whether anyone has any opinions either way, about the impact of piracy on a small developer. I'm not expecting to make my fortune with this app, and would aim for I guess 1000 downloads or so. I may even release an ad-supported version some way down the line depending on how sales held up, which would solve most of the problem I guess.</p><p>All advice appreciated</p>","278638","","","","","2010-11-03 00:36:18","do I need to obfuscate my code for small scale paid app","<android><licensing><obfuscation>","1","0","1","",""
"4083342","1","4083370","","2010-11-03 00:43:33","3","1098","<p>I'm trying to find out of there is any Speech(or Voice) API(for Android) which can be used for recognition of the speaker. My aim is creating application which is going to recognize the speaker and differentiate it from another person, which can serve like authentication.</p><p>Thanks in advance,Serhiy.</p>","168233","","","","","2010-12-21 09:57:51","Android speaker recognition","<java><android>","2","2","1","",""
"4083531","1","4083557","","2010-11-03 01:26:23","0","780","<p>I'm writing a game for Android. When the user completes a level, they can restart from the next level if they lose (i.e. I need to store an integer to remember which level they got to). If the app is interrupted during play, I save the world state to disk (this is complex state storing a map and game entities).</p><p>I'd like to keep my options open in the future for changing my game code and the way the world state is saved/stored. However, I must consider the scenario when a user has an old version of the world state on their phone because they were in the middle of a game, they upgrade the app and now the app cannot load the world state.</p><p>Having to write code to migrate the old version of the data to the new version of the data would be a pain if there's some way I can avoid this. It would be nice if I could somehow ask the user to finish their current game in progress before updating. Can this be done? Are there any other options?</p><p>I don't intend to do this often. I'd like to iteratively develop my game while getting some early feedback, but this is difficult if I must fix how the world state is saved and restored now.</p><p>I hope this doesn't seem a silly question, but on a PC or a console it's perfectly OK to have games that you cannot save during a game or you can only save between levels. I'm just finding Android a bit of a pain here as you must have a save game strategy for all games.</p>","483701","","","","","2010-11-03 01:33:21","Warning Android user that app update could lead to losing data from old app version?","<java><android><mobile>","1","0","1","",""
"4083756","1","6281156","","2010-11-03 02:20:27","12","5833","<p>What are the practical differences between putting a service in a separate process or keeping it in the app's main process? What would each scenario be used for?</p>","495376","","","","","2013-02-23 10:35:58","Android Service: Process vs. Not","<android><process><service>","5","1","4","",""
"4083787","1","10457064","","2010-11-03 02:25:49","9","5651","<p>In an existing Android project I've encountered the following piece of code (where I inserted the debugging litter)</p><pre><code>ImageView img = null;public void onCreate(...) {    img = (ImageView)findViewById(R.id.image);    new Thread() {        public void run() {            final Bitmap bmp = BitmapFactory.decodeFile(""/sdcard/someImage.jpg"");            System.out.println(""bitmap: ""+bmp.toString()+"" img: ""+img.toString());            if ( !img.post(new Runnable() {                public void run() {                    System.out.println(""setting bitmap..."");                    img.setImageBitmap(bmp);                    System.out.println(""bitmap set."");                }            }) ) System.out.println(""Runnable won't run!"");            System.out.println(""runnable posted"");        }    }.start();</code></pre><p>New to Android development, and having googled around, I understand that this is the way to do stuff without blocking the main (UI) thread, while still setting the image on the UI thread after decoding. <a href=""http://developer.android.com/resources/articles/painless-threading.html"">(at least according to android-developers)</a> (which I have verified by logging <code>Thread.currentThread().getName()</code> at various places)</p><p>Now <i>sometimes</i> the image just doesn't show up, and stdout only says</p><pre><code>I/System.out( 8066): bitmap: android.graphics.Bitmap@432f3ee8 img: android.widget.ImageView@4339d698I/System.out( 8066): runnable posted</code></pre><p>with not a trace of the messages from the Runnable. So appearantly the Runnable doesn't <code>run()</code>, although <code>img.post()</code> returns <code>true</code>. Pulling the ImageView in <code>onCreate()</code> and declaring it <code>final</code> doesn't help.</p><p>I'm clueless. Simply setting the bitmap directly, while blocking the UI thread, does fix things, but I want to get things right. Does anybody understand what's going on here?</p><p>(ps. this was all observed on an Android 1.6 phone and android-3 sdk)</p>","371793","","","","","2013-08-22 10:08:46","Runnable is posted successfully but not run","<java><android><multithreading><runnable>","5","1","6","",""
"4083872","1","4083890","","2010-11-03 02:47:34","1","1634","<p>Is there any way i can update 4 activity UI from a background service?I have 4 activity with 4 image view, i want to update the image every 30 seconds.All the activity should be update together.Anyone can show me how to do that?</p>","430926","","","","","2010-11-03 02:54:50","How can I update UI in several Android Activity from a background Service","<android><android-ui><android-service>","1","2","0","",""
"4083902","1","5543583","","2010-11-03 02:57:46","1","656","<p>With the release of AIR 2.5 for Android Flex-developers gain access various system API of the operating system. Are there any official (or unofficial) APIs Google Voice for ActionScript? </p>","27563","","","","","2012-04-05 14:17:52","Google Voice API for AIR|Flex","<android><flex><actionscript-3><air><google-voice>","2","0","1","",""
"4083965","1","4084075","","2010-11-03 03:18:50","0","812","<p>I would like to distribute my app for free, and then sell extra features that can be added-on later. Is it possible to do this?</p>","469219","","","","","2010-11-10 23:14:37","android: Is it possible to sell add-ons for apps in the Market?","<android><google-play>","3","1","2","",""
"4084127","1","","","2010-11-03 04:02:21","0","924","<p>I have been trying to set a new xml layout, when a particular item on this list is clicked. Am I missing something, because the emulator crashes when clicked?! setContentViewById(R.id.newxml file)</p><pre><code>public class intentProject extends ListActivity { ListView list; ArrayAdapter&lt;String&gt; aa; List&lt;String&gt; data = new ArrayList&lt;String&gt;(); public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  data.add(""France"");  data.add(""Japan"");  data.add(""Russia "");  data.add(""Poland"");  data.add("" USA"");  ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,data  );  setListAdapter(aa); } protected void onListItemClick(ListView l, View v, int position, long id)  {  // TODO Auto-generated method stub   super.onListItemClick(l, v, position, id);  this.setContentView(R.layout.main2); }}</code></pre>","495508","","56338","","2010-11-03 04:13:41","2010-11-03 17:58:28","ListView onListItemClick setcontentview crash?","<android>","1","3","","",""
"4084230","1","","","2010-11-03 04:26:46","1","4209","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android"">How to block calls in android</a>  </p></blockquote><p>How can we reject incoming phone call in android if the incoming number is already stored in phonebook. </p><p>What method is used to reject incoming calls? I know how to detect incoming calls but don't know how to reject.</p>","363503","","","","","2011-01-12 09:18:48","Reject Incoming calls in android","<android><phonecalls><incoming>","1","1","1","2011-08-25 13:40:28",""
"4084269","1","","","2010-11-03 04:38:51","9","3133","<p>I am trying to create a Notification using Android's Notification Manager, however, the trick is that I want the notification to show up 30 days in the future. In my code I'm doing this:</p><pre><code>Intent notificationIntent = new Intent(this, MyClass.class);PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);long when = System.currentTimeMillis() + (30 * 24 * 3600 * 1000);Notification notification = new Notification(R.drawable.some_image, ""A title"", when);notification.setLatestEventInfo(getApplicationContext(), ""You're late"", ""Some description"", contentIntent);NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);nm.notify(NOTIFY_ATTEND_ID, notification);</code></pre><p>However, the notification is still showing up instantaneously. From what I read, the ""when"" parameter to the Notification constructor is only used to sort the notifications in the StatusBar. Is there anyway to make the notification show up in at a future date/time? Thanks in advance. </p>","340352","","","","","2010-11-03 08:38:31","Android Delayed Notification","<android>","1","1","1","",""
"4084282","1","","","2010-11-03 04:43:23","1","333","<p>Hi i did not understand the notepad sample in android.when i import this to my workspace it shows there are no projects.Its having sqlite code i want to see how this application running,Please explain it once</p>","479027","","302328","","2010-11-03 05:43:49","2010-11-03 05:43:49","I did not understand the notepad sample in samples","<android><eclipse>","1","0","1","",""
"4084349","1","5106452","","2010-11-03 04:58:28","4","4220","<p>I need to set same UI in both device and emulator (In my application the UI changing in emulator and device)for that i need to know the screen resolution and density of the device . I don't know how to find out that .Let me know how to find out that in device.</p><p>Thanks,</p><p>Lakshmanan</p>","450596","","","","","2011-02-24 15:08:09","How to find out the device screen resolution and density to set same UI display on the emulator and device?","<android>","1","0","2","",""
"4084433","1","4085272","","2010-11-03 05:27:38","0","1012","<p>i created application in that it will call preference from main activity based on  menu optionit is done using  Explicit intent  but it not working . when clicking the menu itemcalling activity</p><pre><code>public boolean onCreateOptionsMenu(Menu menu){    super.onCreateOptionsMenu(menu);    menu.add(0,  Menu.FIRST+1, Menu.NONE, ""Refresh"");    menu.add(0, Menu.FIRST+3, Menu.NONE, ""Set Preferences"");    return true;}public boolean onOptionItemSelected(MenuItem item){    switch(item.getItemId())     {        case Menu.FIRST+1:            Intent intent =new Intent(this,userpreferences.class);            startActivityForResult(intent,this.USER_PREFERENCES);            return true;        case Menu.FIRST+3:            return true;        }    return false;}</code></pre><p>preference 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;CheckBoxPreference        android:key=""AUTO_UPDATE"" android:title=""update automatically""        android:summary=""update automatically"" android:defaultValue=""true"" /&gt;    &lt;ListPreference android:key=""MINIMUM_MARK"" android:title=""minimum mark""             android:summary=""enter the minimum mark of the student""         android:defaultValue=""30"" android:entries = ""@array/minimumMarks""           android:entryValues=""@array/minimum_mark_values""         android:dialogTitle=""Check the minimum mark required"" /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>Preference activity</p><pre><code>package com.xml.parse;import android.os.Bundle;import android.preference.PreferenceActivity;public class userpreferences extends PreferenceActivity{    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preferences);    }}</code></pre><p>some body plz tell me to do better or correct way</p><p>Regards,</p><p>Kariyachan</p>","482604","","482604","","2010-11-03 07:06:04","2010-11-03 08:36:02","Problem with passing control to Preference activity","<android>","1","2","","",""
"4084460","1","4085259","","2010-11-03 05:36:01","4","472","<p>I have encountered a strange problem where if I call <code>getString(R.string.somestringname)</code>, from time to time, even after deleting the R file and recompiling, the incorrect string appears. The emulator is not crashing and a valid string is appearing - it's just the wrong one.</p><p>A sample of my strings.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;!-- Activity Names --&gt;    &lt;string name=""app_name""&gt;an app name&lt;/string&gt;    &lt;string name=""selector_name""&gt;app name | Select&lt;/string&gt;    &lt;string name=""create""&gt;Create&lt;/string&gt;    &lt;string name=""overview_name""&gt;appname | Overview&lt;/string&gt;    &lt;string name=""another_name""&gt;appname | Another View&lt;/string&gt; .....    &lt;!-- Edit Note --&gt;    &lt;string name=""placeholder""&gt;Foo bar&lt;/string&gt; &lt;-- here is a problem    &lt;string name=""created""&gt;Created:&lt;/string&gt;&lt;/resources&gt;</code></pre><p>Here is a sample of code where one of the problems is encountered:</p><pre><code>if (note.created != null) {     createdtext.setText(getString(R.string.created) + "" "" + Util.longDateFormat(note.created));}</code></pre><p>The text that is output (<em>some of the time</em>) is <code>Foo bar November 03, 2010</code> (i.e. belonging to R.string.placeholder). What is going on? This is unnervingly making me tempted to hardcode the strings ;-)</p><p>Thanks for your help!</p>","210920","","","","","2010-11-03 08:33:50","Android resource IDs are being incorrectly assigned","<android><string><resources>","1","1","1","",""
"4084476","1","","","2010-11-03 05:42:24","0","1240","<p>I try to write a xml like below xml,but always get an exception saythat""Caused by: java.lang.UnsupportedOperationException:addView(View,LayoutParams) is not supported in Adapterview"".It is say that in layout xml can not use <code>&lt;ListView&gt; &lt;/ListView&gt;</code>,andit should be <code>&lt;ListView /&gt;</code>and be manipulated using java code,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:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:paddingLeft=""8dp""        android:paddingRight=""8dp""&gt;    &lt;ListView android:id=""@+id/listview""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:background=""#00FF00""              android:layout_weight=""1""              android:drawSelectorOnTop=""false""&gt;    &lt;TextView              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:background=""#000000""              android:text=""No data""/&gt;  &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","495505","","","","","2010-11-03 13:37:49","Android Listview question:can not use <ListView> </ListView> in layout xml?","<android><xml><listview><layout>","2","0","","",""
"4084480","1","4141817","","2010-11-03 05:43:09","4","2203","<p>I can track the overall bandwidth usage of Android device. I wanted to know if there is any method or way, maybe an API or class, that can help me track my bandwidth usage per application or process?</p><p>Reason for this question? I want to stop all those processes or applications that are using way too much bandwidth usage and draining the battery.  </p>","435597","","15168","","2013-10-02 04:04:05","2013-10-02 04:04:05","Android — How to track bandwidth usage by application or process?","<android><bandwidth><usage>","1","0","2","",""
"4084488","1","4086408","","2010-11-03 05:44:13","0","2960","<p>my android application performance is low. from logcat i found that the time consuming factor is garbage collection. it consumes atleast 110ms in every gc. gc is showing frequently. Is there anyway to determine the collected objects?? </p>","462695","","302328","","2010-11-03 05:50:01","2010-11-03 23:51:34","android determine GC freed object","<android><garbage-collection>","3","5","2","",""
"4084542","1","","","2010-11-03 05:58:38","1","194","<p>So I give in. I approached this problem as an oh hey that's not too bad, I can write a bunch of unit tests, and I have been keeping my suite green. However as things get more involved continuous integration and testing is a great great thing to have. And then I saw oh Android has emma integration as well awesome ... and then that's where it get's iffy.</p><p>So I setup Hudson and have it call the coverage target of the ant build.xml that the android executable in the sdk can generate. And then it hits me. </p><pre><code>adb -s &lt;emulator&gt; shell am instrument -w ... </code></pre><p>will never return a result code that is not 0 ... because adb technically exited cleanly and usually will regardless of how the shell command that executed did. </p><p>So again I say, Oh that's not too bad, I can just wrap adb with a parser that parses output for errors and return a non 0 resultcode to fail my build if a test fails. Problem is then I also want to see what tests fail. I know eclipse is doing something smarter so I dig deeper and find the extra switches you can pass am instrument including the -r flag. </p><pre><code>adb -s &lt;emulator&gt; shell am instrument -r -w ... </code></pre><p>Now this is starting to get complicated as the output gets more complex and this originally thought simple task is getting more intense. As this SDK is maturing more I have to think, someone has endured this pain. However I have only been able to find blackbox testing frameworks and not anything along the lines of regression test suite automation of the whitebox sort.</p><p>Any suggestions welcome.</p>","307990","","","","","2010-11-03 05:58:38","What are some good Automated Unit And System Test Tools for Android?","<android><android-emulator>","0","0","","",""
"4084602","1","4262298","","2010-11-03 06:12:09","4","333","<p>I am familiar with JUnit testing in android..My Question is if we are using calculator and we want to test addition operation..To test the addition operation if we are using more number of test cases(for example 30). instead of rewriting the test cases for 30 times, is there any generic way to do this or is there any way to take the test cases form excel sheet or xml file..?</p><p>Please let me know is there any better way ...</p><p>Thanks in advace</p>","399046","","399046","","2010-11-08 04:19:43","2010-11-24 00:01:19","JUnit in android","<android><unit-testing><junit><test-data>","1","0","2","",""
"4084605","1","","","2010-11-03 06:12:22","1","856","<p>My android application is running good on emulators form 1.5v to 2.2v</p><p>when i installed .apk file on SAMSUNG GALAXY-3 v2.1 screen sizes are not matching.Butthe same  .apk file supporting the UI on SAMSUNG v1.5</p><p>I want to run my application on any screen sizes.</p><p>please help me and sory for my english.</p><p>Thanks in advance.</p>","523046","","","","","2011-04-04 21:13:36","Running android application on all screen sizes","<android>","2","1","","",""
"4084726","1","4085513","","2010-11-03 06:40:03","0","369","<p>is there any class or method for getting cdma signalstrength I got for gsm but not for cdma in android??</p>","432559","","432559","","2010-11-03 06:47:55","2010-11-03 09:12:37","is there any class or method for getting cdma signalstrength can get for gsm but not for cdma in android?","<android>","1","0","","",""
"4084753","1","","","2010-11-03 06:45:09","2","993","<p>My application is programmed to be installed in SDCARD, i.e, following the information here: <a href=""http://android-developers.blogspot.com/2010/07/apps-on-sd-card-details.html"" rel=""nofollow"">http://android-developers.blogspot.com/2010/07/apps-on-sd-card-details.html</a></p><p>I set ""android:installLocation"" to ""preferExternal"" inside the manifest tag. My build target is API 8, and my minSdkVersion=3. It works when I directly install the application into my HTC Desire (Android 2.2) with Eclipse. The application is saved into the SDCARD, and I can move to and from the internal memory.</p><p>However, when I download it from Android Market, the application is saved in the internal memory and I can't move it into the SDCARD. I am using the same device. Why is that? Thanks in advance.</p>","495575","","","","","2012-07-25 22:27:12","Installing to SDCARD from Android Market","<android><sd-card>","1","0","2","",""
"4084804","1","","","2010-11-03 06:56:48","0","252","<p>today is not my day i am stuck with this problem</p><p>how can i access other application preference screen from my application by specifying in the preference screen layout using intent or something</p><p>what is the better or correct way to do so??????</p><p>thanks in advance</p><p>regards,kariyachan</p>","482604","","","","","2010-11-03 07:03:15","how can i get other application preference screen for ours","<android>","1","0","","",""
"4084826","1","","","2010-11-03 07:00:51","0","90","<p>I am using the Lazylist example provided by Fedor in this <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">link</a>.</p><p>I get Classcast exception in the ImageLoader.java file in the line given . -- </p><p>Activity a=(Activity)photoToLoad.imageView.getContext();</p><p>Experts, can you kindly guide as to where I am going wrong.</p><p>Kindly let me know, if I need to specify anything more.</p><p>Any help in this regard is well appreciated.</p><p>Looking forward,Regards,Rony</p>","264953","","","","","2010-11-03 07:00:51","Classcast exception when trying to fetch Android Context","<android><android-widget>","0","9","","",""
"4084862","1","","","2010-11-03 07:07:28","0","1608","<p>I have main activity window in my app, which displays three icons on it, also there are 3 home screen widgets in this application.</p><p>is there a possibility for long press on one of the icons in the main activity, to do the same behavior as when you install the program shortcuts from the application menu when dragging shortcuts on the desktop?(for example this video: <a href=""http://www.youtube.com/watch?v=DQ37cASti4k"" rel=""nofollow"">http://www.youtube.com/watch?v=DQ37cASti4k</a>)or the user to have to go to home screen \ menu \ add \ widget??</p>","309955","","","","","2010-11-03 08:28:29","Install home screen widgets progrommaticly","<android><android-widget><homescreen>","1","0","","",""
"4084892","1","4116876","","2010-11-03 07:13:55","0","116","<p>I have four tabs which the first one inserts data on the database, the other 2 tabs take care of displaying the data using a cursor. here is my problem though when I first start the app and there is nothing on the database if I press one of the 2 tabs it gives me this error:</p><p>ERROR/AndroidRuntime: Caused by: android.database.sqlite.SQLiteException: no such table</p><p>my question is the following how can I avoid getting this error when pressing one of 2 tabs, I would like just to display an empty tab with an empty list.Here is a piece of code where the error happens:</p><pre><code>void populate() {    array = new ArrayList&lt;String&gt;();    mydb = openOrCreateDatabase(""vivo_id.db"",            SQLiteDatabase.CREATE_IF_NECESSARY, null);    Cursor c = mydb.query(""VIVOID"", null, null, null, null, null, null);    // start the managing cursor    startManagingCursor(c);    // move to first row    c.moveToFirst();    // continue searching until it is the last row in the column    while (c.isAfterLast() == false) {        sharable = c.getString(c.getColumnIndex(""isCouponSharable""));        coupon = c.getString(c.getColumnIndex(""couponImageResult""));        rawImage = c.getString(c.getColumnIndex(""couponThumbnailResult""));        keyword = c.getString(c.getColumnIndex(""keyword""));        histDesRes = c.getString(c.getColumnIndex(""couponDescription""));        history = keyword + "" \n "" + histDesRes + "" "" + ""&lt;@&gt;"" + """"                + rawImage+""""+""&lt;@&gt;""+""""+coupon+""""+""&lt;@&gt;""+""""+sharable;        array.add(history);        c.moveToNext();    }    strings = array.toArray(new String[array.size()]);    // close everything    c.close();    mydb.close();}</code></pre><p>Any help or pointers would be greatly appreciated, Thank you so much in advance.</p>","490923","","","","","2010-11-07 07:47:12","Sqlite error when opening a TAB and when the Database is empty Android","<android><sqlite><listview><tabs>","2","0","","",""
"4084967","1","4085561","","2010-11-03 07:33:58","5","3350","<p>I have an Android app that has both <code>CursorAdapter</code> based <code>ListView</code>s (backed by sqlite) as well as custom <code>BaseAdapter</code> based <code>ListView</code>s which are built on the fly from JSON pulled down from a server.</p><p>The data displayed in both is identical - an image and a couple of <code>TextView</code>s. My Cursor-based ListView has 3000 rows, the JSON-based ListView has about 30. However, scrolling down the list is significantly faster for the Cursor-based adapter. For the JSON-based lists, the data is all fetched before the rows are made visible. Images for both types of lists are downloaded on-demand.</p><p>I have both ListViews configured identically - both with <code>fastScrollEnabled</code>, <code>scrollingCache</code> and <code>smoothScrollbar</code> set to true. </p><p>I'm looking for leads on how to go about trying to figure out what's going on here and to potentially fix it so that the JSON-based <code>ListView</code>s as as fast as the Cursor-based ones.</p>","106095","","106095","","2010-11-03 07:52:21","2010-11-03 09:18:00","Scrolling large lists of Cursor-based adapters is faster than much smaller lists of in-memory adapters","<android><listview><performance>","1","0","5","",""
"4085003","1","5226028","","2010-11-03 07:41:08","5","2983","<p>I am developing an App using Titanium for iPhone and Android. I created a button and a label and textfield. It looks good in iPhone but is scattered in Android.</p><p>I think I have to adjust the each of the control's position. But this would be a big overhead. </p><p>Is there any alternative mechanism there by which we can have controls correctly placed both in iphone and Android? </p>","189006","","232053","","2012-07-25 15:47:51","2012-07-25 15:47:51","How to use same layout for Android and iPhone using Titanium?","<iphone><android><titanium>","2","2","1","",""
"4085062","1","12928645","","2010-11-03 07:52:39","1","92","<p>I use the <strong>PackageManager</strong> to get the list of installed Android applications. But some stock applications cannot be uninstalled from the device. How do I check for those programmatically?</p><pre><code>Intent i = new Intent(Intent.ACTION_MAIN, null);i.addCategory(Intent.CATEGORY_LAUNCHER);PackageManager pm = this.getPackageManager();List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities                                   (i, PackageManager.PERMISSION_GRANTED);</code></pre>","421372","","","","","2012-10-17 06:47:18","How to check whether an application can be uninstalled?","<android>","1","0","1","",""
"4085069","1","4085098","","2010-11-03 07:55:10","0","298","<p>How can I populate a menu using <a href=""http://developer.android.com/guide/topics/intents/intents-filters.html"" rel=""nofollow"">intents</a>? I didn't understand that thing.</p><p>Or is there any better way for that?</p><h3>Update:</h3><p>Suppose I have an application that need to resize the image,and there are many other applications that have a capability of resizing the image. How can I show the list of applications on a menu in my application so that when clicking on a particular option it will invoke the intent associated with that application. Simply saying I could resize the image in my application with out bothering about how that will get done.</p>","482604","","1288","","2010-11-08 13:18:20","2010-11-08 13:18:20","How can I populate a menu using intents?","<android>","1","1","","",""
"4085093","1","4334844","","2010-11-03 08:02:12","3","5245","<p>I inflated a ListView as the contentView in a PopupWindow.If I don't set the width &amp; height, I can't see the PopupWindow.If I set them like this:</p><pre><code>setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);</code></pre><p>The layout is being set like ""fill_parent"". Why?</p><p>The layout attributes of the ListView and ListView item are all set to ""wrap_content"".Any suggestion? Thanks.</p>","428022","","","","","2012-10-08 13:35:31","How to set the width of the ListView in a PopupWindow on Android?","<android><listview><android-layout><popupwindow>","5","0","3","",""
"4085155","1","","","2010-11-03 08:15:16","6","8461","<p>Thank you in advance.I'd like to upload some bitmap image from my android app.but , I can't get it.Could you recommend some solutions for it.or collect my source code?</p><pre><code>ByteArrayOutputStream bao = new ByteArrayOutputStream();                bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);                HttpClient httpclient = new DefaultHttpClient();                HttpPost httppost = new HttpPost(                        ""http://example.com/imagestore/post"");                MultipartEntity entity = new MultipartEntity( HttpMultipartMode.BROWSER_COMPATIBLE );                byte [] ba = bao.toByteArray();                try {                    entity.addPart(""img"", new StringBody(new String(bao.toByteArray())));                    httppost.setEntity(entity);                } catch (UnsupportedEncodingException e1) {                    // TODO Auto-generated catch block                    e1.printStackTrace();                }                // Execute HTTP Post Request                HttpResponse response = null;                try {                    response = httpclient.execute(httppost);                } catch (ClientProtocolException e) {}</code></pre>","76509","","","","","2014-04-19 10:06:59","How to upload Bitmap Image from a android device?","<java><android><http><multipartform-data>","2","4","3","",""
"4085177","1","4085400","","2010-11-03 08:20:05","4","13764","<p>friends,</p><p>i am using following code to display list with radio buttonsnow i want to select specific radio button of list by default so using setSelection property which does not work.</p><pre><code>final String [] items=new String[]{""Item1"",""Item2"",""Item3"",""Item4""};            ArrayAdapter&lt;string&gt; ad=new ArrayAdapter&lt;string&gt;(this,android.R.layout.simple_list_item_single_choice,items);            list=(ListView)findViewById(R.id.List);            list.setAdapter(ad);list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);list.setSelection(2);    list.setOnItemClickListener(new OnItemClickListener()            {       public void onItemClick(AdapterView arg0, View arg1, int arg2,         long arg3) {        // TODO Auto-generated method stub        TextView txt=(TextView)findViewById(R.id.txt);        txt.setText(list.getItemAtPosition(arg2).toString());       }            }            );</code></pre><p>please guide what mistake am i doing?</p>","249991","","","","","2011-02-28 07:35:20","android single choice list selection problem?","<android><listview>","2","0","2","",""
"4085186","1","4207298","","2010-11-03 08:21:29","10","7971","<p>How can I create a <code>ListPreference</code> with <code>checkbox</code>?I know how to use <code>ListPreference</code>, but I need multiple selection like in Alarm application on ""repeat"" preference.</p><p>like this screenshot:</p><p><img src=""http://i.stack.imgur.com/l6NKM.png"" alt=""checkboxes""></p>","453407","","2015318","","2013-02-05 20:04:16","2013-02-27 22:36:23","How make a ListPreference with checkbox","<android><checkbox><preference><listpreference>","3","0","4","",""
"4085274","1","4255814","","2010-11-03 08:36:08","1","1395","<p>Maybe some background: I'm trying to have a specific keyboard-view visible above a scrollable full-screen <code>EditText</code> when the user clicks it. The problem is that if the cursor is at the bottom of the <code>EditText</code> it is hidden by the popped up keyboard-view.</p><p>The obvious difference to the regular IME-view is that the IME-view pushes the <code>EditText</code> to the top and lets the user scroll the entire <code>EditText</code> in that top area. The keyboard-view sits at the bottom. Everything is visible and accessible. That's what I want to achieve with my pop-up, too.</p><p>Therefore, my question is: what does the layout look like when a regular IME is visible? I don't need the animation (if it's hard to do I can skip that part).</p><p>I tried to loop through the layout-hierarchy to see what's different. Here's it with IME visible:</p><pre><code>root: com.android.internal.policy.impl.PhoneWindow$DecorView  android.widget.LinearLayout    android.widget.FrameLayout      android.widget.TextView    android.widget.FrameLayout               #1      android.widget.RelativeLayout        android.widget.ScrollView          android.widget.EditText        com.mytest.KeyboardView</code></pre><p>Here it is without the IME and my pop-up view visible:</p><pre><code>root: com.android.internal.policy.impl.PhoneWindow$DecorView  android.widget.LinearLayout    android.widget.FrameLayout      android.widget.TextView    android.widget.FrameLayout               #1      android.widget.RelativeLayout        android.widget.ScrollView          android.widget.EditText        com.mytest.KeyboardView</code></pre><p>Obviously, there's no difference. Is the IME really missing?</p><p>For easier understanding I marked my app with ""#1"", so the <code>RelativeLayout</code> is the root-element in my XML-layout.</p><p>Can anyone please help me? If somebody has an XML-style layout ready, I'd be more than happy to see it.</p>","483113","","483113","","2010-11-25 06:19:39","2010-11-25 06:19:39","Android: what's the layout when an IME is active?","<android><keyboard><android-layout><popupwindow>","3","0","2","",""
"4085293","1","4108935","","2010-11-03 08:40:41","0","1381","<p>I cannot find any documentation on the encoding of file names in zip files. </p><p>I have to pack file names with German umlauts into a zip, load it into an Android and unpack there. Then I have to refer to these files with names that are stored in another file. The latter is UTF-8, so there is no problem with umlauts. But I need to make sure, that the unzipped files have the proper names after unpacking on the Android.</p><p>Currently, I am using info-zip on Windows 7 to pack the archive, and the API functions on the Android to unpack, and everything worked. However, if I use jar from the Java SDK or 7z for the packaging, the files come out on the Android with wrong names. This makes me wonder, if there is any proper solution for this at all (besides using antique ASCII file names only).</p><p>I assume Android uses Unicode file names, so all I had to do is to force the zipper program to encode the file names in Unicode too. It this possible?</p><p>Thanks for your time, RG</p>","447111","","","","","2011-03-28 12:31:53","ZipEntry file name encoding?","<android>","2","0","","",""
"4085313","1","4085374","","2010-11-03 08:44:05","62","46975","<p>I am a Delphi programmer and have written, over the years, hundreds of classes and routines which I can use in every Delphi program I write.</p><p>This <strong>library</strong> is called dlib and can be <strong>used in every Delphi program</strong> by putting this folder in my library path and using one of the units in the uses section of a Delphi unit.</p><p>Being completely new to Java and Android development, I am wondering how to do this in similar way.</p><p><strong>So my question, how can I write own classes, put them in some global folder, and use these classes and routines in every Android program I write</strong> ?</p><p>I know this is a basic question, which I can probably find out by searching Google and trying it out in Eclipse, but if someone can put me on the right track, I know I will save much time.</p><p>Thanks.</p>","231181","","1440565","","2012-09-27 00:33:22","2013-07-10 15:30:33","How to create your own library for Android development to be used in every program you write?","<java><android><shared-libraries>","5","1","18","",""
"4085346","1","","","2010-11-03 08:49:40","1","946","<p>I am trying to write a routine that adds Contacts to my Android phone's AddressBook. I am getting the following exceptions:</p><pre><code>D/dalvikvm(  784): GC freed 2736 objects / 171696 bytes in 71msE/IMemory (  784): binder=0x5b5248 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646)E/IMemory (  784): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number)E/IMemory (  784): cannot map BpMemoryHeap (binder=0x5b5248), size=0, fd=-1 (Bad file number)E/JavaBinder(  784): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)E/JavaBinder(  784): java.lang.RuntimeException: No memory in memObjE/JavaBinder(  784): at android.database.CursorWindow.native_init(Native Method)E/JavaBinder(  784): at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:518)E/JavaBinder(  784): at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:27)E/JavaBinder(  784): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:493)E/JavaBinder(  784): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:496)E/JavaBinder(  784): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:96)E/JavaBinder(  784): at android.os.Binder.execTransact(Binder.java:287)E/JavaBinder(  784): at dalvik.system.NativeStart.run(Native Method)</code></pre><p>Can anyone detail on what the above logs mean?</p>","366053","","","","","2011-07-27 14:44:53","Exception when reading from Contacts","<android><exception><android-contacts>","2","3","","",""
"4085401","1","4085657","","2010-11-03 08:56:24","2","261","<p>I don't understand the correct usage of <code>menu.addIntentOptions()</code></p>","482604","","646382","","2011-08-23 20:19:28","2011-08-23 20:19:28","What is the proper usage of the menu.addIntentOptions()?","<android>","1","0","0","",""
"4085434","1","4106132","","2010-11-03 09:00:18","0","324","<p>I use pending_intents and a broadcast_receiver for pending events processing. When the broadcast_receiver receives an intent it creates an instance of a ringtone with STREAM_NOTIFICATION and `play()' it. But sounds is late for a few dozen minutes!</p><p>I have checked that the pending_intens are come in proper time and the broadcast_receiver processes them properly.</p><p>It seems there is a problem with playing notifications while a phone stay in sleep mode (screen is off).</p><p>Somebody know how to bypass the problem?</p>","219550","","","","","2010-11-05 13:14:19","Playing ringtons in a broadcast receiver","<android><broadcastreceiver><ringtone>","1","0","","",""
"4085580","1","4127179","","2010-11-03 09:20:51","3","666","<p>i am implementing puzzle game app in android  . in this application one level complete then get score number of moves and remaining level completion on time .i am level completed show in dialogbox it shows  move next level ,then number of moves and remaining time in each level value display in these dialog box todisplay (number of moves + remaing time)... </p><p>((TextView)findViewById(R.id.MovesTextView)).setText(""Moves-""+moves);((TextView)findViewById(R.id.ScoreTextView1)).setText(""Time-""+(time/(1000*60))+"":""+((time%(1000*60))/1000));</p><p>how can implemented  this problem  please forward some solution  its urgent </p>","254790","","254790","","2010-11-03 10:24:38","2010-11-09 04:26:11","in jigsaw puzzle game in game score how can identified using moves and remaining time","<android>","1","3","5","",""
"4085716","1","","","2010-11-03 09:38:57","0","990","<p>I have some doubts in getting the open server information to java program </p><ol><li>dispalying the already existing users to newly registred user</li><li>add and delete from groups</li></ol>","430394","","21234","","2010-11-03 09:42:07","2013-05-01 17:10:58","android+smack+openfire","<java><android><smack>","2","0","","",""
"4085816","1","","","2010-11-03 09:53:38","3","1366","<p>It seems that roboguice can only inject views from the contentView defined in <code>onCreate(...)</code> of the activity. Outside <code>onCreate()</code>, for example, if I have my custom dialog, which has also a content view (e.g. <code>dialog.setContentView(R.layout.dialog_layout);</code>), how can I inject views from this dialog_layout in my activity? (I got null when I directly inject the dialog views in the activity)</p>","475850","","56338","","2011-01-31 23:39:50","2012-06-12 16:25:55","How to inject a dialog view using Roboguice?","<android><roboguice>","2","0","3","",""
"4085839","1","","","2010-11-03 09:58:06","2","4730","<p>I have a rest webservice that takes a POST metod with multipart message:</p><pre><code>@Path(""transferFile"")      @POST  @Consumes(MediaType.MULTIPART_FORM_DATA)  @Produces(MediaType.APPLICATION_XML)  public String multipartTest(com.sun.jersey.multipart.MultiPart data) {  try {  // get first body part (index 0)          BodyPart bp = multiPart.getBodyParts().get(0);  etc..  </code></pre><p>Now I am trying to write a java client for that. I started with a simple jersey client:view plaincopy to clipboardprint?</p><pre><code>    MultiPart multiPart = new MultiPart();      multiPart.bodyPart( new BodyPart(wavestream,MediaType.APPLICATION_OCTET_STREAM_TYPE));      Client c = Client.create();      WebResource r = c.resource(""http://127.0.0.1:8080/webapp:);response=r.path(""transferFile"").type(MediaType.MULTIPART_FORM_DATA).accept(MediaType.APPLICATION_XML).post(String.class, multiPart);  </code></pre><p>This works great - everything is ok. However I need this client working on Android and I have trouble with using jersey on that platform. So I used the normal way to send multipart message on android:</p><pre><code>    HttpClient client = new DefaultHttpClient(); client.getParams().setParameter(""http.socket.timeout"", new Integer(90000)); // 90 second HttpPost httpPost = new HttpPost(""http://127.0.0.1:8080/webapp/transferFile""); httpPost.setHeader(""Content-Type"", MediaType.MULTIPART_FORM_DATA );//tried with and without base64 byte [] encodedWavestream = Base64.encodeBytesToBytes(wavestream); InputStream ins = new ByteArrayInputStream(encodedWavestream); InputStreamBody body = new InputStreamBody(ins, ""test"" ); int send = ins.available(); MultipartEntity requestContent = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE ); requestContent.addPart(""stream"", body);httpPost.setEntity(requestContent); HttpResponse Response = client.execute(httpPost);</code></pre><p>An this gives an annoying response from the server :</p><pre><code>HTTP Status 400 - Bad Request  The request sent by the client was syntactically incorrect (Bad Request).   </code></pre><p>I check the server log files but there is nothing there. So I don't know what's the origin of this error. I have wrote a simple html page with a post formula and 'multipart/form-data' content-type and it also works! An auto-generated request from soapUI also works! Why my client does not work? Can anybody help?</p>","279670","","","","","2012-03-15 08:46:52","HttpClient and MultipartEntity vs. Jersey Multipart and Android","<android><httpclient><jersey><multipart>","1","1","1","",""
"4085959","1","4085995","","2010-11-03 10:15:33","38","83641","<p>I am doing the <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html"">Notepad tutorial, exercise 2</a>. I started by creating a new Android project and chose <em>Create from source</em> to import the downloaded source files for the excercise.</p><p>But now I get many errors in Eclipse, and the problem is that there is no generated <code>R.java</code> class. How can I solve this? The folder <code>gen/</code> is empty.</p><hr><p>I have errors on <code>Notepadv2.java</code> and in <code>res/layout/note_edit.xml</code> and both seems to be related to the fact that the generated <code>R.java</code> is missing.</p><p>Here is my <code>import</code> statements in <code>Notepadv2.java</code>:</p><pre><code>import android.R;import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.ContextMenu;import android.view.ContextMenu.ContextMenuInfo;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.widget.ListView;import android.widget.SimpleCursorAdapter; </code></pre><p>They are created by the Eclipse command <strong>Ctrl+Shift+O</strong>.</p>","213269","","213269","","2010-11-30 12:57:15","2014-01-28 17:37:59","No generated R.java file in my project","<android><eclipse><adt><generated-code><r.java-file>","21","1","10","2014-01-28 23:26:10",""
"4086009","1","4086078","","2010-11-03 10:21:37","0","2330","<p>I want to write an application that it can record the wifi hotspot's location we are accessing and display them in map. But the problem is - how do I get wifi hotspot's location?I think I can use the wifi signal to get the wifi hotspot's location, but it may not be very accuracy at first time. And if there is no other solution, I could record the location of GPS when access wifi hotspot at the first time.</p>","369296","","25077","","2011-03-21 13:04:33","2012-10-28 03:56:14","how to get wifi hotspot's location?","<android><gps><location><wifi>","2","1","1","",""
"4086159","1","4089528","","2010-11-03 10:36:59","14","39761","<p>I have the following code for checking internet connection wifi/EDGE/GPRS/3G on my application.</p><p>the code is </p><pre><code>public static boolean checkConn(Context ctx) {    ConnectivityManager conMgr = (ConnectivityManager) ctx            .getSystemService(Context.CONNECTIVITY_SERVICE);    if (conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED        || conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING) {        return true;    } else if (conMgr.getNetworkInfo(0).getState()==NetworkInfo.State.DISCONNECTED        || conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED){        return false;    }    return false;}</code></pre><p>and I am calling it like below :</p><pre><code>if (CheckInternet.checkConn(introPage.this) == true) {    Intent toMainPage = new Intent(introPage.this, mainPage.class);    System.gc();    startActivity(toMainPage);} else if (CheckInternet.checkConn(getApplicationContext()) == false) {    Toast.makeText(getApplicationContext(),        ""Sorry, No internet connectivity found"", Toast.LENGTH_SHORT)            .show();}</code></pre><p>But I am having an issue, which is that if I am connected to wifi, and I open the application, it works fine, but if I close application and turn off wifi and re-open application, it doesn't through the error of ""no connection"" , I need to turn off my device and then turn it on, and same case is if wifi is off, and I open application, it throws error of ""no connection"", and if I turn it on, still it throws the same error of ""no connection"", until unless I turn off and on device.</p>","328518","","281545","","2013-09-22 17:47:58","2014-01-07 12:38:16","Checking internet connection on android","<android><connection><internet><check>","5","8","7","",""
"4086199","1","","","2010-11-03 10:41:03","1","746","<p>Have app displaying fine on HTC Desire,<br>but on Samsung Galaxy pad it does not fill the screen space.</p><p><strong>How do I make my Android HTC Desire app fill the screen of Samsung Galaxy pad ?</strong></p><p><em>Details:</em><br><em>Layoutfile for start activity:</em></p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:id=""@+id/LinearLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;</code></pre><p><em>Resource folders</em><br>are filled with same size PNG files (not scaled down):<br>res/drawable-hdpi<br>res/drawable-mdpi<br>res/drawable-ldpi<br>res/drawable</p><p><em>Androidmanifest.xml</em></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""my.package"" android:versionCode=""1"" android:versionName=""1.0""&gt;        &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;        &lt;application android:name=""my.package.AppContext"" android:theme=""@android:style/Theme.Light"" android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;</code></pre><p><em>default.properties</em></p><pre><code># Indicates whether an apk should be generated for each density.split.density=false# Project target.target=Google Inc.:Google APIs:8</code></pre>","77115","","77115","","2010-11-03 11:01:07","2012-06-19 14:56:14","How to make Android HTC Desire app fit screen of Samsung Galaxy pad?","<android>","1","4","","",""
"4086219","1","4086255","","2010-11-03 10:43:27","0","1391","<p>Im going to develop one android application which transfer music file, contact exchange, voice chat, text chat etc.. through WiFi. Which protocol will suit my application UDP or TCP. Because both protocol having some merits and demerits. Can u give me some suggestion, it will helpful for me..</p><p>Thanks in advance</p>","405640","","","","","2011-03-14 12:28:14","Which is best protocol TCP or UDP?","<android>","6","0","0","",""
"4086276","1","4387017","","2010-11-03 10:50:03","2","1255","<p>i used netbeans 6.5 for developing android application. i need to add LWUIT for this application. how we can add into this application?</p>","488433","","488433","","2011-06-14 10:25:46","2011-06-14 10:25:46","how we can add LWUIT in android application?","<android><lwuit><netbeans6.5>","3","0","2","",""
"4086415","1","","","2010-11-03 11:08:52","3","772","<p>I'm playing around with a modified version of the SoftKeyboard sample and ""sometimes"" get a <code>DeadObjectException</code> when using the fullscreen mode (e.g. when orientation == landscape). I can still enter text, but the <code>ExtractEditText</code> doesn't update and I get the logcat output below, whenever I hit a new key.</p><p>When I switch to portrait (no fullscreen mode) I can see the entered characters. When I then go back to landscape (fullscreen mode) the <code>ExtractEditText</code> is updated with the characters. However, when I then try to enter new character the problem repeats.</p><p>Also, when in fullscreen mode and I change the cursor position it does change it in the <code>ExtractEditText</code> but doesn't really change the position for my <code>InputConnection</code>. I believe this problem/bug is already in the SoftKeyboard API sample, since I didn't modify anything related to that, however, so far I wasn't able to figure out where.</p><p>Maybe someone can point me in the right direction?</p><pre><code>13349     InputMethodManager  W  IME died: com.playground.keyboard/.MyInputMethod13349     InputMethodManager  W  android.os.DeadObjectException13349     InputMethodManager  W     at android.os.BinderProxy.transact(Native Method)13349     InputMethodManager  W     at com.android.internal.view.IInputMethodSession$Stub$Proxy.updateSelection(IInputMethodSession.java:227)13349     InputMethodManager  W     at android.view.inputmethod.InputMethodManager.updateSelection(InputMethodManager.java:1190)13349     InputMethodManager  W     at android.widget.TextView.onDraw(TextView.java:4064)13349     InputMethodManager  W     at android.view.View.draw(View.java:6591)13349     InputMethodManager  W     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)13349     InputMethodManager  W     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)13349     InputMethodManager  W     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)13349     InputMethodManager  W     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)13349     InputMethodManager  W     at android.view.View.draw(View.java:6697)13349     InputMethodManager  W     at android.widget.FrameLayout.draw(FrameLayout.java:352)13349     InputMethodManager  W     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)13349     InputMethodManager  W     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)13349     InputMethodManager  W     at android.view.View.draw(View.java:6594)13349     InputMethodManager  W     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)13349     InputMethodManager  W     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)13349     InputMethodManager  W     at android.view.View.draw(View.java:6594)13349     InputMethodManager  W     at android.widget.FrameLayout.draw(FrameLayout.java:352)13349     InputMethodManager  W     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)13349     InputMethodManager  W     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)13349     InputMethodManager  W     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)13349     InputMethodManager  W     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)13349     InputMethodManager  W     at android.view.View.draw(View.java:6594)13349     InputMethodManager  W     at android.widget.FrameLayout.draw(FrameLayout.java:352)13349     InputMethodManager  W     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1884)13349     InputMethodManager  W     at android.view.ViewRoot.draw(ViewRoot.java:1349)13349     InputMethodManager  W     at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)13349     InputMethodManager  W     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)13349     InputMethodManager  W     at android.os.Handler.dispatchMessage(Handler.java:99)13349     InputMethodManager  W     at android.os.Looper.loop(Looper.java:123)13349     InputMethodManager  W     at android.app.ActivityThread.main(ActivityThread.java:4363)13349     InputMethodManager  W     at java.lang.reflect.Method.invokeNative(Native Method)13349     InputMethodManager  W     at java.lang.reflect.Method.invoke(Method.java:521)13349     InputMethodManager  W     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)13349     InputMethodManager  W     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)13349     InputMethodManager  W     at dalvik.system.NativeStart.main(Native Method)</code></pre>","184367","","","","","2010-12-01 10:05:01","Android: DeadObjectException for InputMethodService (SoftKeyboard API sample)","<java><android><exception><keyboard>","0","1","1","",""
"4086484","1","4086591","","2010-11-03 11:16:29","3","3968","<p>I need to hide a WebVew while it is loading its web content. I tried to do it with other view like this:</p><p></p><pre><code>&lt;WebView    android:scrollbars=""none""     android:id=""@+id/id_webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;&lt;View    android:visibility=""gone""    android:scrollbars=""none""     android:id=""@+id/id_view""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;</code></pre><p></p><p>When I want to hide the WebView I change the visibility of the View to ""visible"" (View.setVisibility(View.VISIBLE);). But the View doesn't cover the WebView and it doesn't hide. I need to put the view on the front while the WebView is loading.</p>","495239","","","","","2010-11-03 12:00:05","How I hide a WebView?","<android><webview>","1","0","2","",""
"4086666","1","4086908","","2010-11-03 11:42:30","0","424","<p>Here is my setup:</p><ul><li>I have a button and a textbox</li><li>The textbox has an ""onFocus"" Handler which triggers the ""selectAll"" method</li><li>the button has an ""onClick"" Handler which does the following:<ul><li>show textbox</li><li>textbox.focus(true) and</li><li>textbox.selectAll();</li></ul></li></ul><p>But it does not (on mobile devices).The thing is: this works in FF and Safari - but it does not on mobile WebKit. When I click the button the field gets focused and selected for a milisecond (sometimes not even that) and then returns to focus the button …</p><p>A already tried to insert a Timer which then would do the focus - does not work either.</p><p>I also tried to capture all events and prevent them - because there is an onFocus event being fired by the button after onClick. I even tried setting the focus to the textbox from the onFocus event of the button. No chance.</p><p>Any other Ideas?</p>","153678","","","","","2010-11-03 12:12:35","GWT focus problem when triggered elsewhere","<iphone><android><gwt><setfocus><mobile-webkit>","1","0","","",""
"4086693","1","4086740","","2010-11-03 11:46:46","0","753","<p>these is how to give a string as argument </p><p>String link =""http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf"";webview.loadUrl(link);</p><p>but how to give an ""URL"" variable to load its content to webview</p><p>I am new to android please help.</p>","450487","","","","","2010-11-03 11:51:46","How to use a ""URL"" variable to load a webview ? Not using ""string"" variable","<android>","1","0","","",""
"4086716","1","","","2010-11-03 11:49:39","0","837","<p>I have added a MapView element in my android project. The project is not showing any error, but when i run the application on my emulator (Google API 2.2), the map isn't visible. Instead only the grid lines are seen. The DDMS is giving me ""java.net.UnknownHostException: android.clients.google.com"" exception. I have already added INTERNET permission in my application.</p>","495863","","881229","","2013-12-21 18:33:30","2013-12-21 18:33:30","Android emulator map is not visible","<android><google-maps>","2","0","0","",""
"4086790","1","4086811","","2010-11-03 11:57:21","0","816","<p>i hav two classes...both classes are extends activity..i need  call other class method on main class on android development..its urgent..please..i done something like subclass sub = new subclass()...its not work..</p><p>In 1st activity class</p><p>package org.me.intent_testing;</p><p>import android.app.Activity;import android.os.Bundle;import android.widget.<em>;import android.view.</em>;import android.content.Intent;</p><p>/** * * @author pavankumar */</p><p>public class FirstActivity extends Activity {</p><p>@Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);</p><p>// Button orderButton = (Button)findViewById(R.id.order);Button orderButton = new Button(this);    orderButton.setOnClickListener(new View.OnClickListener() {</p><pre><code>  @Override  public void onClick(View view) {    Intent intent = new Intent(FirstActivity.this, secondActivity.class);    startActivity(intent);  }});</code></pre><p>}}</p><p>In secondActivity class</p><p>package org.me.intent_testing;</p><p>/** * * @author pavankumar */</p><p>import android.app.Activity;import android.os.Bundle;import android.widget.<em>;import android.view.</em>;import android.content.Intent;</p><p>public class secondActivity extends Activity {</p><p>@Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);              setContentView(R.layout.main);   // setContentView(R.layout.order);</p><p>// Button orderButton = (Button) findViewById(R.id.end);Button orderButton =  new Button(this);    orderButton.setOnClickListener(new View.OnClickListener() {</p><pre><code>  @Override  public void onClick(View view) {    finish();  }});</code></pre><p>}}</p><p>In AndroidManifest.xml</p><p>                                                                                          </p><p></p><p>In R.java</p><p>package org.me.intent_testing;</p><p>public final class R {    public static final class attr {    }    public static final class layout {        public static final int main=0x7f020000;    }    public static final class string {        public static final int app_name=0x7f030000;    }}</p><p>I hv problem to linking between two classes..</p>","440540","","440540","","2010-11-03 12:49:44","2010-11-03 12:49:44","how do i call a java methods from one java class to another java class in android development?","<android>","2","2","","",""
"4086794","1","4087442","","2010-11-03 11:57:50","1","893","<p>i am looking for a simple barcode reader for my android app. i only needs to be able to read the code and return it to me. i have already looked at zxing barcode reader but it is too complex and it seems to me that its focus is more on 2d barcodes and looking around the forums i found out that it has problems reading 1d codes if the phone doesn't have autofocus (maybe a general problem for all readers but still maybe another one handles them better).</p><p>any suggestions? tnx.</p>","448192","","","","","2012-07-24 11:22:58","is there any simple 1d barcode reader?","<java><android><barcode>","1","0","","",""
"4086921","1","","","2010-11-03 12:13:56","1","195","<p>My app uses 2.0 sdks (bluetooth toggle and service api changes) and in the manifest has</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""5"" /&gt;</code></pre><p>It runs perfectly fine on 1.5/1.6 devices, but when I uploaded it to the Market, it no longer shows up on 1.5/1.6 phones</p><p>Please help!</p>","398148","","","","","2010-11-03 12:13:56","targetsdkversion Market visibility problem Android","<android><google-play>","0","0","","",""
"4087026","1","4396386","","2010-11-03 12:29:55","2","1327","<p>Please tell me where can I download GoogleAdView.jar. It is not included in the SDK.</p><p>Regards.</p>","476747","","","","","2010-12-09 08:55:12","Help about GoogleAdView.jar","<android><adsense>","1","0","","",""
"4087030","1","4087169","","2010-11-03 12:30:28","2","4155","<p>how can i create a moving image object for an android game application.and also how can i add animation to the resources </p><p>plz tell me what is the correct or better way to do that</p><p>thanks in advance</p><p>-Kariyachan</p>","482604","","482604","","2010-11-03 12:38:35","2012-06-14 09:56:24","How can I create moving image in an android application","<android>","2","0","1","",""
"4087075","1","4087495","","2010-11-03 12:36:37","1","824","<p>i've been working for a while in an Android app that uses a lot of the Maps API. And the thing is it works in the emulator with my debug key, but i see only a grid when i put ""true"" key, i tried with three already that i know they worked, so why could it be? I have internet permission (in the right place, befoce ) and i just can't find why this thing only works with the debug key.</p>","495904","","569101","","2013-09-09 10:18:46","2013-09-09 10:18:46","Map API Key doesn't works in Android app","<java><android><google-maps>","1","1","","",""
"4087205","1","","","2010-11-03 12:52:54","-1","2912","<p>i hav two classes...both classes are extends activity.. i need call other class method on main class on android development..its urgent..please.. i done something like subclass sub = new subclass()...its not work..</p><p>In 1st activity class</p><pre><code>package org.me.intent_testing;import android.app.Activity; import android.os.Bundle; import android.widget.; import android.view.; import android.content.Intent;/** * * @author pavankumar */public class FirstActivity extends Activity {@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);// Button orderButton = (Button)findViewById(R.id.order); Button orderButton = new Button(this); orderButton.setOnClickListener(new View.OnClickListener() {  @Override  public void onClick(View view) {    Intent intent = new Intent(FirstActivity.this, secondActivity.class);    startActivity(intent);  }});} }In secondActivity classpackage org.me.intent_testing;/** * * @author pavankumar */import android.app.Activity; import android.os.Bundle; import android.widget.; import android.view.; import android.content.Intent;public class secondActivity extends Activity {@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // setContentView(R.layout.order);// Button orderButton = (Button) findViewById(R.id.end); Button orderButton = new Button(this); orderButton.setOnClickListener(new View.OnClickListener() {  @Override  public void onClick(View view) {    finish();  }});} }</code></pre><p>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=""org.me.intent_testing""&gt;    &lt;application&gt;         &lt;activity android:name="".FirstActivity"" android:label=""FirstActivity""&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="".OrderScreen"" /&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>I hv problem to linking between two classes..</p>","440540","","244296","","2010-11-03 13:10:47","2010-11-03 13:12:55","how do i call java class methods to other java class file on android development","<android>","1","1","","",""
"4087220","1","","","2010-11-03 12:54:39","0","916","<p>I am developing an app using phonegap for android. It consists of around 25 images and similar number of mp3 files. Each mp3 file has duration not more than 10 seconds. The requirement of app is whenever a image is shown on screen its related mp3 file should be played. I am using jqtouch swipe action to move from one page to another. I am facing following problems both on emulator and real device(samsung galaxy 3)-</p><ol><li><p>After 15-20 images sound stops playing both on emulator and galaxy 3. In logcat I got following error</p><p>ERROR/AudioFlinger(34): not enough memory for AudioTrack size=49216</p></li></ol><p>I am using following code to play mp3 files</p><pre><code>if(mp3file!=null){            mp3file.stop();            mp3file = null;        }        mp3file = new Media(""/android_asset/www/name_of_file.mp3"",            function() {                console.log(""playAudio():Audio Success"");            },                function(err) {            },                function(status) {                               });          mp3file.play();</code></pre><p>I think error is due to audiomanager objects from phonegap api of each mp3 file remaining in memory.  I want to know how to destroy media object created in javascript. You can play, stop, pause. But is there any method in phonegap for android to destroy it so that it does not remain in memory after it has done playing.</p><ol><li>Another problem that I am facing is related with left swipe action in jqtouch to view next image. If I am currently viewing image1 and if I try to view image2 by left swipe action, image2 is shown for short amount of time and after that image1 is shown for a moment and after that again image2 is shown. In short the transition from image1 toimage2 is not smooth and it has flickering effects. However if i go from image2 to image1 using right swipe transition is smooth.</li></ol><p>Thanks</p>","495906","","","","","2010-12-22 05:01:52","Sound playing and forward swiping animation flickering problem in android phonegap and jqtouch?","<android><jqtouch><phonegap>","1","1","","",""
"4087245","1","4087312","","2010-11-03 12:58:05","1","366","<p>i have a application for listing student mark and name that is stored in raw resources ..res/raw </p><p>Can i change it from the code</p><p>any idea</p><p>regards,Kariyachan</p>","482604","","","","","2010-11-03 13:07:35","is it possible to change resources at running time from the code","<android>","1","0","0","",""
"4087318","1","4087362","","2010-11-03 13:07:59","0","799","<p>I want to add a search bar in my activity. I have some lat long stored in a vector and i want to search a lat long using search bar and want to animate map to that point.How to do this?? Please give me some suggestionthnx </p>","489762","","","","","2010-11-03 13:13:02","Search Bar in android","<android>","1","0","","",""
"4087367","1","","","2010-11-03 13:13:39","0","3336","<p>Posted my problem here too<a href=""http://www.coderanch.com/t/516061/Android/Mobile/external-allocation-too-large-process"" rel=""nofollow"">HERE</a></p><p>A beginner..Im doing a school map app.</p><p>First of all I have background with 4 buttons ( level3, level4, level5, level6)I try and click all the buttons, normally after clicking 3 of it, the next one will crash.(each level button goes into a level map, whereby clicking the room image buttons, I will enter into the gallery-imageswitcher)</p><p>I have at least 5 imageswitchers in each level maps,so that about over 20 imageswitcher galleries overall.</p><p>I did all my stuffs using DRAWABLES instead of BITMAPS.. I have tons and tons of images (because its a school map, show all the photos in my school, and all those backgrounds and imagebuttons)</p><p>I did some research, and those who have problems are those using bitmap. Some of the ways that can be solved is system.gc();, and bitmap.recycle...(not so sure how to use it though)</p><p><strong>In my main background - starttour.java</strong></p><blockquote>  <p>public class StartTour extends Activity {<br>    14.     private SoundManager mSoundManager;<br>    15.     /** Called when the activity is first created. */<br>    16.     @Override<br>    17.     public void onCreate(Bundle savedInstanceState) {<br>    18.         super.onCreate(savedInstanceState);<br>    19.         setContentView(R.layout.ttour);<br>    20.<br>    21.         mSoundManager = new SoundManager();<br>    22.         mSoundManager.initSounds(getBaseContext());<br>    23.         mSoundManager.addSound(1, R.raw.beep);<br>    24.<br>    25.         //play music<br>    26.         final MediaPlayer mPlayer = MediaPlayer.create(this, R.raw.jazz);<br>    27.           mPlayer.start();<br>    28.<br>    29.         final Button button = (Button) findViewById(R.id.back);<br>    30.<br>    31.         button.setOnClickListener(new Button.OnClickListener() {<br>    32.<br>    33.             // Implement the OnClickListener callback<br>    34.             public void onClick(View v) {<br>    35.               // do something when the button is clicked<br>    36.                 startActivity(new Intent(""android.com.Android""));<br>    37.                 mSoundManager.playSound(1);<br>    38.                 mPlayer.stop();<br>    39.             }<br>    40.         });<br>    41.<br>    42.             final Button button1 = (Button) findViewById(R.id.level3);<br>    43.             button1.setOnClickListener(new Button.OnClickListener() {<br>    44.                 public void onClick(View v) {<br>    45.                     // Perform action on click<br>    46.                      startActivity(new Intent(""android.com.Lvl3""));<br>    47.                      mSoundManager.playSound(1);<br>    48.                      mPlayer.stop();<br>    49.<br>    50.                 }<br>    51.              });<br>    52.<br>    53.             final Button button2 = (Button) findViewById(R.id.level4);<br>    54.             button2.setOnClickListener(new Button.OnClickListener() {<br>    55.                 public void onClick(View v) {<br>    56.                     // Perform action on click<br>    57.                      startActivity(new Intent(""android.com.Lvl4""));<br>    58.                      mSoundManager.playSound(1);<br>    59.                      mPlayer.stop();<br>    60.<br>    61.                 }<br>    62.              });<br>    63.<br>    64.<br>    65.             final Button button3 = (Button) findViewById(R.id.level5);<br>    66.             button3.setOnClickListener(new Button.OnClickListener() {<br>    67.                 public void onClick(View v) {<br>    68.                     // Perform action on click<br>    69.                      startActivity(new Intent(""android.com.Lvl5""));<br>    70.                      mSoundManager.playSound(1);<br>    71.                      mPlayer.stop();<br>    72.<br>    73.                 }<br>    74.              });<br>    75.<br>    76.             final Button button4 = (Button) findViewById(R.id.level6);<br>    77.             button4.setOnClickListener(new Button.OnClickListener() {<br>    78.                 public void onClick(View v) {<br>    79.                     // Perform action on click<br>    80.                      startActivity(new Intent(""android.com.Lvl6""));<br>    81.                      mSoundManager.playSound(1);<br>    82.                      mPlayer.stop();<br>    83.<br>    84.                 }<br>    85.              });<br>    86.<br>    87.<br>    88.     }<br>    89. }    </p>    <p></p></blockquote><p>    </p><p></p><p>   </p><p></p><p>  </p><p>      </p><p>   </p><p></p><p>              </p><p>   </p><p><strong>In  my level 4.xml</strong></p><blockquote>  <ol>  <li>  <li>android:layout_height=""fill_parent"" android:src=""@drawable/level4map""  </li>  <li>android:layout_gravity=""center""/><br>  <ol>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m412button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""92.5px""  </li>  <li>android:layout_marginTop=""95px""  </li>  <li>android:background=""@drawable/m412_button"" />      </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m411button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""92.5px""  </li>  <li>android:layout_marginTop=""248.8px""  </li>  <li>android:background=""@drawable/m411_button"" />  </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m410button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""92.5px""  </li>  <li>android:layout_marginTop=""334.8px""  </li>  <li>android:background=""@drawable/m410_button"" />     </li>  <li>  <ol>  <li></li>  </ol></li>  <li>  <li>android:id=""@+id/m405button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""6px""  </li>  <li>android:layout_marginTop=""246.5px""  </li>  <li>android:background=""@drawable/m405_button"" />  </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m406button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""6px""  </li>  <li>android:layout_marginTop=""335px""  </li>  <li>android:background=""@drawable/m406_button"" />    </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m419button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""260px""  </li>  <li>android:layout_marginTop=""59.5px""  </li>  <li>android:background=""@drawable/m419_button"" />        </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m420button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""260px""  </li>  <li>android:layout_marginTop=""168.5px""  </li>  <li>android:background=""@drawable/m420_button"" />     </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m421button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""260px""  </li>  <li>android:layout_marginTop=""240.5px""  </li>  <li>android:background=""@drawable/m421_button"" />  </li>  <li>  <ol>  <li>  </ol></li>  <li>android:id=""@+id/m422button""  </li>  <li>android:layout_width=""wrap_content""  </li>  <li>android:layout_height=""wrap_content""  </li>  <li>android:layout_marginLeft=""260px""  </li>  <li>android:layout_marginTop=""335px""  </li>  <li>android:background=""@drawable/m422_button"" />                   </li>  <li>  </li>  </ol></li>  </ol></blockquote><p><strong>In level4.java</strong> </p><blockquote>  <p>public class Level4 extends Activity {<br>     2.     /** Called when the activity is first created. */<br>     3.     @Override<br>     4.     public void onCreate(Bundle savedInstanceState) {<br>     5.         super.onCreate(savedInstanceState);<br>     6.         setContentView(R.layout.tlevel4);<br>     7.<br>     8.         final Button button1 = (Button) findViewById(R.id.m405button);<br>     9.         button1.setOnClickListener(new OnClickListener() {<br>    10.             public void onClick(View v) {<br>    11.                     // Perform action on click<br>    12.                  startActivity(new Intent(""android.com.M405""));<br>    13.             }<br>    14.         });<br>    15.<br>    16.         final Button button2 = (Button) findViewById(R.id.m406button);<br>    17.         button2.setOnClickListener(new OnClickListener() {<br>    18.             public void onClick(View v) {<br>    19.                     // Perform action on click<br>    20.                  startActivity(new Intent(""android.com.M406""));<br>    21.             }<br>    22.         });<br>    23.<br>    24.<br>    25.<br>    26.         }<br>    27.       }  </p></blockquote><p><strong>In logcat</strong></p><pre><code>11-03 12:35:55.194: ERROR/dalvikvm-heap(708): 483406-byte external allocation too large for this process.11-03 12:35:55.194: ERROR/(708): VM won't let us allocate 483406 bytes11-03 12:35:55.204: DEBUG/AndroidRuntime(708): Shutting down VM11-03 12:35:55.213: WARN/dalvikvm(708): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)11-03 12:35:55.213: ERROR/AndroidRuntime(708): Uncaught handler: thread main exiting due to uncaught exception11-03 12:35:55.254: ERROR/AndroidRuntime(708): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.com/android.com.Level3}: android.view.InflateException: Binary XML file line #7: Error inflating class java.lang.reflect.Constructor11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.ActivityThread.access$1800(ActivityThread.java:112)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.os.Handler.dispatchMessage(Handler.java:99)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.os.Looper.loop(Looper.java:123)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.ActivityThread.main(ActivityThread.java:3948)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at java.lang.reflect.Method.invokeNative(Native Method)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at java.lang.reflect.Method.invoke(Method.java:521)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at dalvik.system.NativeStart.main(Native Method)11-03 12:35:55.254: ERROR/AndroidRuntime(708): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class java.lang.reflect.Constructor11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.createView(LayoutInflater.java:512)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.Activity.setContentView(Activity.java:1626)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.com.Level3.onCreate(Level3.java:19)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)11-03 12:35:55.254: ERROR/AndroidRuntime(708): ... 11 more11-03 12:35:55.254: ERROR/AndroidRuntime(708): Caused by: java.lang.reflect.InvocationTargetException11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.widget.ImageView.&lt;init&gt;(ImageView.java:103)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at java.lang.reflect.Constructor.constructNative(Native Method)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.view.LayoutInflater.createView(LayoutInflater.java:499)11-03 12:35:55.254: ERROR/AndroidRuntime(708): ... 22 more11-03 12:35:55.254: ERROR/AndroidRuntime(708): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:363)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:663)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.content.res.Resources.loadDrawable(Resources.java:1637)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)11-03 12:35:55.254: ERROR/AndroidRuntime(708): at android.widget.ImageView.&lt;init&gt;(ImageView.java:113)11-03 12:35:55.254: ERROR/AndroidRuntime(708): ... 26 more</code></pre><p><strong>If I click any of the buttons first and enter into the levelmap, it wil crash while im looking at the imageswitcher pictures.</strong></p><p>In logcat</p><pre><code>11-03 09:17:34.308: INFO/ActivityManager(564): Starting activity: Intent { action=android.com.M615 comp={android.com/android.com.M615_gallery} }11-03 09:17:34.638: ERROR/dalvikvm-heap(712): 212800-byte external allocation too large for this process.11-03 09:17:34.638: ERROR/(712): VM won't let us allocate 212800 bytes11-03 09:17:34.638: DEBUG/AndroidRuntime(712): Shutting down VM11-03 09:17:34.648: WARN/dalvikvm(712): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)11-03 09:17:34.648: ERROR/AndroidRuntime(712): Uncaught handler: thread main exiting due to uncaught exception11-03 09:17:34.677: ERROR/AndroidRuntime(712): java.lang.OutOfMemoryError: bitmap size exceeds VM budget11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:363)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:663)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.content.res.Resources.loadDrawable(Resources.java:1637)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.content.res.Resources.getDrawable(Resources.java:535)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.ImageView.resolveUri(ImageView.java:482)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.ImageView.setImageResource(ImageView.java:268)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.com.M615_gallery$AddImgAdp.getView(M615_gallery.java:71)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.Gallery.makeAndAddView(Gallery.java:754)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.Gallery.fillToGalleryRight(Gallery.java:703)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.Gallery.layout(Gallery.java:634)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.Gallery.onLayout(Gallery.java:339)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.View.layout(View.java:6133)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.View.layout(View.java:6133)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.View.layout(View.java:6133)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.View.layout(View.java:6133)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.View.layout(View.java:6133)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.ViewRoot.performTraversals(ViewRoot.java:929)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.os.Handler.dispatchMessage(Handler.java:99)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.os.Looper.loop(Looper.java:123)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at android.app.ActivityThread.main(ActivityThread.java:3948)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at java.lang.reflect.Method.invokeNative(Native Method)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at java.lang.reflect.Method.invoke(Method.java:521)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)11-03 09:17:34.677: ERROR/AndroidRuntime(712): at dalvik.system.NativeStart.main(Native Method)</code></pre><p>really really appreciate if someone can help..thanks </p><p>PS: I have tons of images in the app; I have at least 5 imageswitcher gallerys in each level, so that kinda adds up to over 20 imageswitchers in my app. </p>","495937","","495937","","2010-11-04 12:45:08","2010-11-13 17:06:17","external allocation too large for this process,Error inflating class, bitmap size exceeds VM budget","<android><android-emulator><android-manifest>","1","3","","",""
"4087421","1","4087469","","2010-11-03 13:19:39","0","695","<p>I have lot of lists: for example: Categories, and subCategories, in my case some Categories has subcategories, </p><p>So What I want to do, is if the categories has subcategories I want to clean the recently list and show the subcategories,</p><p>(This can be solved by creating new activity for only subcategories, but I would say that the most of the code woyld same)</p><p>I wounder how can I updoate list whit new data?If possible to add some animation when clicking, so the list goes to left when clicking, and showing data comes from right, </p>","371301","","","","","2010-11-03 13:25:45","Android: Remove data from list and add new list","<android><list><listview>","1","0","","",""
"4087426","1","4087970","","2010-11-03 13:20:30","1","2684","<p>I'm developing an audio application. It plays sounds in the background and I want it to turn off when an incoming call happens but not when the screen locks.My first chance was to call player.stop() on onPause as I thought it will do the trick when incoming or other applications will run on top. But I found that screen lock calls also this onPause event.</p><p>Is there any chance to get the cause of that calling?</p>","474684","","114066","","2010-11-03 14:49:17","2011-02-06 06:05:05","onPause difference between screen lock and incoming call","<android><onresume>","1","0","0","",""
"4087444","1","4088677","","2010-11-03 13:23:04","1","4310","<p><br>      Im developing one application which used SeekBar to control volume in MediaPlayer. The problem is when i move the seek bar at that time only the volume is increased, rest of the time default volume was set. Here is my code    </p><pre><code>seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {    public void onProgressChanged(SeekBar seekBar, int progress,        boolean fromUser)     {        //Log.i(""Seek Bar"", """" + validBpm);        mp.setVolume(left, right);    }    public void onStartTrackingTouch(SeekBar seekBar)    {        left=left+20;        right=right+20;        mp.setVolume(left, right);    }    public void onStopTrackingTouch(SeekBar seekBar) {        left=left-20;        right=right-20;        mp.setVolume(left, right);    }});</code></pre>","405640","","19750","","2010-11-03 13:42:37","2010-11-03 15:26:35","How to set seek bar value in Android?","<android>","1","0","1","",""
"4087454","1","","","2010-11-03 13:24:13","5","257","<p>Since I added the install location to the manifest (tried both auto and preferExternal) and made my update available in the Market I get some users that can't install the application on their (so far only HTC Desire with Froyo) devices. Is there any known issue on this? Or better a working solution?</p><p>I got also the following workaround from a user. Unmount the SD card, install the app, and mount the SD card again does succesfull install the app.</p>","443175","","995926","","2012-05-22 07:57:10","2013-01-23 19:11:51","Some users can't install app since installLocation is added to the manifest","<android><android-2.2-froyo><app2sd>","1","1","","",""
"4087470","1","","","2010-11-03 13:25:45","1","2163","<p>I am on Android 2.1 and I have one multi column Custom listview Using BaseAdapter with an editable edittext at the end of the listview. If the data in the listview do not contain the data of user choice then user should be able to enter data. If the data is already there in the list user will be able to select the data using custom selector. If a selection is made in the list view and user wanted to enter data in the text field at the bottom after selection then the marker in the list view should be unselected. I tried to use onclick() method on edit text using click listener. First time when it is clicked, edit text is getting focus and onclick() method is not fired. And when it is clicked second time, onclick() method is fired and notifyDataSetChanged() method is called. I tried to call the notifyDataSetChanged() method from the Focus Listener, list view selection is gone in my first attempt and edit text is not receiving any data input from the keyboard (frozen).Please help. Thanks, Venkat</p>","495952","","495952","","2010-11-04 06:43:33","2012-02-20 05:11:20","multi column Custom list view with an editable edit text at the end of the list view","<android><listview><onclick><edittext>","1","0","","",""
"4087616","1","4087967","","2010-11-03 13:44:01","0","113","<p>So does anyone know if there is a program that will allow me to track how many times my app is opened daily? </p><p>I'm not looking to track the users behavior or anything, I just what stats on the average use of my app.</p>","325400","","","","","2010-11-03 16:15:10","Is there a way to track how many users open your app(hourly,daily,etc)?","<android><statistics>","2","0","","",""
"4087674","1","4087865","","2010-11-03 13:49:40","37","65109","<p>Things are simple but don't work as supposed to.</p><p>I have a text file added as a raw resource. The text file contains text like:</p><blockquote>  <blockquote>    <p>b) IF APPLICABLE LAW REQUIRES ANY WARRANTIES WITH RESPECT TO THE    SOFTWARE, ALL SUCH WARRANTIES ARE     LIMITED IN DURATION TO NINETY (90)    DAYS FROM THE DATE OF  DELIVERY.</p>  </blockquote>    <p>(c) NO ORAL OR WRITTEN INFORMATION OR  ADVICE GIVEN BY  VIRTUAL ORIENTEERING,  ITS DEALERS, DISTRIBUTORS, AGENTS OR  EMPLOYEES SHALL CREATE A WARRANTY OR  IN ANY WAY INCREASE THE SCOPE OF ANY  WARRANTY PROVIDED HEREIN. </p>    <p>(d) (USA only) SOME STATES DO NOT  ALLOW THE EXCLUSION OF IMPLIED  WARRANTIES, SO THE ABOVE EXCLUSION MAY  NOT  APPLY TO YOU. THIS WARRANTY GIVES  YOU SPECIFIC LEGAL  RIGHTS AND YOU MAY  ALSO HAVE OTHER LEGAL RIGHTS THAT   VARY FROM STATE TO STATE.</p></blockquote><p>On my screen I have a 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=""wrap_content""                      android:gravity=""center""                      android:layout_weight=""1.0""                     android:layout_below=""@+id/logoLayout""                     android:background=""@drawable/list_background""&gt;             &lt;ScrollView android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""&gt;                    &lt;TextView  android:id=""@+id/txtRawResource""                                android:layout_width=""fill_parent""                                android:layout_height=""fill_parent""                               android:padding=""3dip""/&gt;            &lt;/ScrollView&gt;      &lt;/LinearLayout&gt;</code></pre><p>The code to read the raw resource is:</p><pre><code>TextView txtRawResource= (TextView)findViewById(R.id.txtRawResource);txtDisclaimer.setText(Utils.readRawTextFile(ctx, R.raw.rawtextsample);public static String readRawTextFile(Context ctx, int resId){    InputStream inputStream = ctx.getResources().openRawResource(resId);    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();    int i;    try {        i = inputStream.read();        while (i != -1)        {            byteArrayOutputStream.write(i);            i = inputStream.read();        }        inputStream.close();    } catch (IOException e) {        return null;    }    return byteArrayOutputStream.toString();}</code></pre><p>The text get's showed but after each line I get a strange character [] How can I remove that character ? I think it's New Line.</p><p>WORKING SOLUTION</p><pre><code>public static String readRawTextFile(Context ctx, int resId){    InputStream inputStream = ctx.getResources().openRawResource(resId);    InputStreamReader inputreader = new InputStreamReader(inputStream);    BufferedReader buffreader = new BufferedReader(inputreader);    String line;    StringBuilder text = new StringBuilder();    try {        while (( line = buffreader.readLine()) != null) {            text.append(line);            text.append('\n');        }    } catch (IOException e) {        return null;    }    return text.toString();}</code></pre>","379865","","514483","","2013-07-27 01:42:50","2013-08-29 09:51:40","Android read text raw resource file","<android><text><resources>","6","0","18","",""
"4087767","1","4089061","","2010-11-03 13:59:32","5","4541","<p>How can I access the EditText field in a DialogBox?</p>","482604","","63550","","2012-01-15 08:08:50","2012-01-15 08:08:50","How can I access the EditText field in a DialogBox?","<android>","1","0","2","",""
"4087839","1","4903973","","2010-11-03 14:06:23","6","4271","<p>On just one phone I am testing on (HTC Incredible, Android 2.2, Software 3.21.605.1), I am experiencing the following behavior.</p><p>The onEditorAction event handler is being called twice (immediately) when the Enter key on the Sense UI keyboard is pressed.</p><p>The KeyEvent.getEventTime() is the same for both times the event is called, leading me to this work-around:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    [...]    EditText text = (EditText)findViewById(R.id.txtBox);    text.setOnEditorActionListener(new OnEditorActionListener() {        private long lastCalled = -1;        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            if ( event.getEventTime() == lastCalled ) {                return false;            } else {                lastCalled = event.getEventTime();                handleNextButton(v);                return true;            }        }    });    [...]}</code></pre><p>The EditText is defined as:</p><pre><code>&lt;EditText     android:layout_width=""150sp""     android:layout_height=""wrap_content""    android:id=""@+id/txtBox""     android:imeOptions=""actionNext""    android:capitalize=""characters""     android:singleLine=""true""    android:inputType=""textVisiblePassword|textCapCharacters|textNoSuggestions""    android:autoText=""false""     android:editable=""true""     android:maxLength=""6""/&gt;</code></pre><p>On all other devices I've tested on, the action button is properly labeled ""Next"" and the event is only called a single time when that button is pressed.</p><p>Is this a bug in Sense UI's keyboard, or am I doing something incorrectly?</p><p>Thank you for any assistance.</p><hr><p>Updated - thanks to the answers given, I have settled on the following as my checks. This works fine on both of the phones I have available to test (Sense UI and Cyanogenmod CM7)</p><pre><code>            if (event != null &amp;&amp; event.getAction() != KeyEvent.ACTION_DOWN) {                return false;            }            if ( actionId != EditorInfo.IME_ACTION_NEXT &amp;&amp; actionId != EditorInfo.IME_NULL ) {                return false;            }</code></pre>","293483","","293483","","2011-02-16 16:53:00","2011-02-16 16:53:00","OnEditorActionListener called twice with same eventTime on SenseUI keyboard","<android>","2","2","1","",""
"4087856","1","","","2010-11-03 14:07:49","0","829","<p>I've been struggling on this for a while now and my search for an answer on Internet was unsuccessful.</p><p>I have a custom class that extends PreferenceActivity. I implemented a menu: when the user clicks on the menu button, onPrepareOptionsMenu() is called and I can hanldle the menu correctly.</p><p>The problem is, I do have a child PreferenceScreen which I basically add like this:</p><pre><code>   final PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this);   final PreferenceScreen screenPrefAdd = getPreferenceManager().createPreferenceScreen(this);   screenPrefAdd.setTitle(""Access child pref screen"");   //stuff   root.addPreference(screenPrefAdd);   //stuff   setPreferenceScreen(root);</code></pre><p>When the user clicks on <em>Access child pref screen</em>, then clicks on the Menu button, nothing happens. Actually, the methods of my activiy onKeyDown(), onPrepareOptionsMenu(), etc. are not called.</p><p>Has anyone run into this issue? Any ideas as how to fix it?</p><p>Any help would be much appreciated, thank you.</p>","495994","","","","","2011-03-24 20:13:08","How to add an options menu to a child PreferenceScreen on Android?","<android><menu><options><preferencescreen>","1","0","","",""
"4088003","1","","","2010-11-03 14:22:00","0","778","<p>this is basically what i want to achieve : <a href=""http://i52.tinypic.com/15qelwy.jpg"" rel=""nofollow"">http://i52.tinypic.com/15qelwy.jpg</a></p><p>so far this is my main.xml file</p><pre><code>&lt;TableLayout  android:paddingTop=""80sp""  android:paddingLeft=""40sp""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;TableRow&gt;   &lt;TextView    android:text=""@string/questions""    android:textColor=""#000""     android:textStyle=""bold""    android:textSize=""18dip""    android:layout_height=""100px""    android:layout_width=""100px""/&gt;       &lt;ImageButton     android:id=""@+id/button_one""     android:src=""@drawable/button_flat""     android:layout_width=""227px""     android:background=""@null""     /&gt;    &lt;ImageButton     android:id=""@+id/button_one""     android:src=""@drawable/button_flat""     android:layout_width=""227px""     android:background=""@null""     /&gt;  &lt;/TableRow&gt; &lt;/TableLayout&gt;</code></pre><p>The result isn't pretty as it displays the 2nd button into another column.  How can i create just two columns; the first one is expandable and the next column contains multiple image buttons?</p><p>thanks.</p>","496012","","","","","2010-11-03 14:48:32","how to create complicated tablelayout on android","<android><tablelayout>","1","0","1","",""
"4088080","1","4088131","","2010-11-03 14:29:52","51","25365","<p>was just wondering, how can I obtain the value of a boolean field in a sqlite database in android?</p><p>I usually use <code>getString()</code> <code>getInt()</code> etc to get the values of my fields, but there does not seem to be a <code>getBoolean()</code> method.</p><p>Any takers?</p>","409826","","409826","","2013-07-25 14:52:27","2014-01-06 07:15:13","Android/sqlite get boolean from database","<java><android><sqlite><boolean>","7","0","10","",""
"4088181","1","4143238","","2010-11-03 14:40:08","1","1682","<p>hii have changed my code as below but the problem now is ,the recording wont stop at 2 minutes in samsung galaxy.ohters fine </p><pre><code>Intent i = new Intent(""android.media.action.VIDEO_CAPTURE"");                                i                                        .putExtra(                                                android.provider.MediaStore.EXTRA_OUTPUT,                                                Uri.fromFile(videofile));                                i                                        .putExtra(                                                android.provider.MediaStore.EXTRA_VIDEO_QUALITY,                                                0);                                i.putExtra(""android.intent.extra.durationLimit"", 120);                                 startActivityForResult(i, 2);</code></pre>","487219","","487219","","2010-11-10 09:34:05","2013-07-01 06:17:10","Android video recording","<android><video-capture>","2","0","","",""
"4088196","1","4113011","","2010-11-03 14:41:28","6","5721","<p>I have a project with a linked source folder. This project depends on another (remote service) project, so the <strong>aidl files</strong> and the classes passed across the remote interface are in a <code>common_src</code> linked folder shared between the two projects. This work just fine with Eclipse builds, (one source file, two projects,  changes in one project are reflected in the other, just as it should be).</p><p>I'd now like to do an Ant build from the command line. I managed to get another project with a single src directory building across all targets using the example <code>build.xml</code> from the SDK tools. It imports <code>ant_rules_r3.xml</code> automatically and once the <code>source.dir</code> and <code>out.dir</code> are defined in the <code>build.properties</code> it's all fairly painless.</p><p>Turning to the project with the <code>src</code> and <code>common_src</code> folders, I can't get it to build. Firstly I cut and pasted the compile target and all those it depends upon into the <code>build.xml</code> above the setup task. I added and defined the element <code>common_src</code> to the <code>build.properties</code> and added the last line shown below to the <code>-compile target</code> (copied from <code>ant_rules_r3.xml</code>) into the <code>build xml</code>:</p><pre><code>  &lt;src path=""${source.absolute.dir}"" /&gt;  &lt;src path=""${gen.absolute.dir}"" /&gt;  &lt;src path=""${common_src}"" /&gt;&lt;!--ADDED--&gt;</code></pre><p>which got it further on in the build process - it could find the .java files in common_src but not the .aidl files. No surprise I realised as the aidl is a separate target. I then added</p><pre><code>&lt;src path=""${common_src}"" /&gt; </code></pre><p>to the -aidl target in the build xml, and it failed with:</p><pre><code>BUILD FAILEDC:\dev\projects\Eclipse\AndroidWorkspace\MapProject\build.xml:77: aidl doesn't support the nested ""src"" element.</code></pre><p>So that's got me well and truly stuck. <strong>Ideally I'd like to modify just the build.properties file to include the common_src and pass it to the ant_rules_r3.xml but I can't think of a way of doing it. I'd be most grateful if anyone can suggest how it can be done.</strong></p>","440010","","621188","","2011-06-28 05:48:39","2014-01-10 06:51:22","Android Ant build on a project with two source folders","<android><ant>","6","2","2","",""
"4088204","1","4088310","","2010-11-03 14:42:14","3","2189","<p>I'd like to develop for Android but I don't really like using an IDE for programming as I find them to be pretty cumbersome compared to a text editor and command console. Is there any way I can develop for Android without doing so in Eclipse, and instead using Gedit? The system requirements specified on the Android developers site list Eclipse as a requirement, but I Ewas wondering if anyone had found a way to manually tap into the SDK libraries outside of Eclipse. I'm using a Linux setup as my development box.</p>","360907","","","","","2010-11-03 19:54:08","Is it possible to use the Android SDK without using eclipse?","<android><linux><gedit>","2","0","","",""
"4088219","1","5044959","","2010-11-03 14:43:27","3","2491","<p>What I am trying to do is once the AppWidget is removed from the homescreen of the user's Android phone, I want to stop the background service that Updates the AppWidget.</p><p>Here is the code that I am using...don't understand whats wrong?</p><pre><code>@Override public void onDeleted(Context context, int[] appWidgetIds){ Intent serviceIntent = new Intent(context, UpdateService.class); context.stopService(serviceIntent); super.onDeleted(context, appWidgetIds);}</code></pre><p>Any ideas? Thanks for the help.</p>","447886","","447886","","2010-11-03 17:59:50","2011-10-30 22:12:36","AppWidget Update Service does not stop on Widget being Deleted from host","<android><android-widget><appwidget>","2","3","5","",""
"4088231","1","","","2010-11-03 14:44:17","2","1430","<p>I have tried adding a bookmark on the home screen manually. Need some help on doing it programatically. Thanks.</p>","496042","","","","","2013-03-26 05:32:57","How to add bookmarks(URL) on the home screen for android","<android>","4","0","1","",""
"4088263","1","4088355","","2010-11-03 14:47:54","0","1629","<p>I have some questions about android development.I have googled around, but cannot seem to find any answers to my questions.</p><ol><li>Is it possible to display google maps in a widget?</li><li>Is it possible to run (and view) two apps simultaneously?</li><li>Is it possible to run an App within an App?</li></ol>","24872","","244296","","2010-11-03 16:46:47","2011-09-09 00:13:53","Is it possible to run (and view) two apps simultaneously?","<android><simultaneous>","1","2","1","",""
"4088295","1","","","2010-11-03 14:50:09","0","348","<p>I have some issues with the x10 mini pro soft keyboard: when entering a text, you can select the input method by choosing between multitap or quick text. I use different ways to validate the user input according to the input method setting, so I would really need to know what type of input method the user has selected (multitap or quick text). Is there a way I could to this from the code?</p>","496058","","49246","","2010-11-13 10:45:47","2010-11-13 10:45:47","Is it possible to find what input method is used by the soft keyboard (multitap, quick text, etc)?","<android><android-softkeyboard><android-input-method>","0","3","","",""
"4088317","1","","","2010-11-03 14:52:50","2","665","<p>I am trying to insert an image into the phone memory of an Android phone.  I am getting the following exceptions, although when I tried with the <code>EXTERNAL_CONTENT_URI</code> there was no problem, but if the SD card is not present, I want to write to phone memory.</p><p>Could any one please give me a solution for this? Thanks in advance.</p>#<p>MY CODE</p>#<pre><code>ContentValues values = new ContentValues(2);values.put(Media.DISPLAY_NAME, ""My Bitmap"");values.put(Media.MIME_TYPE, ""image/jpeg"");Uri uri = getContentResolver().insert(Media.INTERNAL_CONTENT_URI,values);//Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI,values);OutputStream outStream = getContentResolver().openOutputStream(uri);b.compress(Bitmap.CompressFormat.JPEG, 50, outStream);outStream.close();###################################11-03 20:02:48.526: ERROR/DatabaseUtils(167): java.lang.UnsupportedOperationException: Writing to internal storage is not supported.11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at com.android.providers.media.MediaProvider.generateFileName(MediaProvider.java:1646)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at com.android.providers.media.MediaProvider.ensureFile(MediaProvider.java:1337)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1413)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1381)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:150)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:140)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at android.os.Binder.execTransact(Binder.java:287)11-03 20:02:48.526: ERROR/DatabaseUtils(167):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","496072","","","user658042","2011-11-28 15:42:31","2011-11-28 15:42:31","Inserting Image into Internal Memory ","<android>","0","0","","",""
"4088366","1","","","2010-11-03 14:57:48","3","2777","<p>Is there a way for setting a number of maximum visible rows for a listview?</p><p>Thanks a lot!</p>","460611","","","","","2014-02-27 07:32:22","Set maximum number of visible rows for listview","<android>","2","4","","",""
"4088370","1","","","2010-11-03 14:58:16","0","579","<p>Often, a simple of ArrayAdapter does what I want and during early development I will provide the android.R.simple_list_item_1 for the view id required by the ArrayAdapter constructor.  Is it possible to provide a customized view which is based on the android.R.simple_list_item_1 to the ArrayAdapter constructor?</p><p>I do not fully understand Android's 'include' functionality, but what I would like to do is something like:</p><ul><li>Define a new TextView based on customizing the android.R.simple_list_item_1.(I have no idea what the valid syntax would be)</li></ul><p>e.g.</p><pre><code>&lt;TextView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/MyTextView""    android:textSize=""20dip""&gt;        &lt;include android.R.simple_list_item_1/&gt;&lt;/TextView&gt;</code></pre><ul><li><p>Reference my customized TextView.  I assume that something like this would go into my layout directory.  Then in my code I would do something like:</p><pre><code>LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);View view = inflater.inflate(R.id.MyTextView, null);ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, view.getId(), myArrayOfData);</code></pre></li></ul><p>Is this possible and if it is, what is the appropriate syntax to accomplish what I want?</p>","467507","","","","","2010-11-03 15:24:55","Is it possible to use an ArrayAdapter (no subclassing) with a custom View to display data?","<android>","1","0","","",""
"4088711","1","4088763","","2010-11-03 15:29:09","19","6059","<p>I've a <code>ListView</code> that can have <strong>0 custom items</strong> inside (like ""My Downloads"").</p><p>Is there anyway to show a default text ""<em>No download yet</em>"" ?</p><p>Thanks !</p><p><strong>EDIT</strong> : here is my solution,</p><pre><code>TextView emptyView = new TextView(getApplicationContext());emptyView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));emptyView.setTextColor(R.color.black);emptyView.setText(R.string.no_purchased_item);emptyView.setTextSize(20);emptyView.setVisibility(View.GONE);emptyView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);((ViewGroup)getListView().getParent()).addView(emptyView);getListView().setEmptyView(emptyView);</code></pre><p><img src=""http://i.stack.imgur.com/GJx9q.jpg"" alt=""alt text""></p>","406761","","406761","","2010-11-03 19:12:18","2011-05-04 21:51:19","Android ListView : default text when no items","<android><listview>","3","0","6","",""
"4088712","1","4184955","","2010-11-03 15:29:09","2","1286","<p>I am using an Android <code>Intent</code> with <code>ACTION_SEND</code> and <code>EXTRA_STREAM</code> to share a generated PNG via a <code>ContentProvider</code>.  This works perfectly for e-mail/GMail, Flickr, MMS, etc. but doesn't work if I select Bluetooth from the activity chooser dialog.</p><p>The device is an HTC Legend running Android 2.1.  The device is able to share images with my computer over Bluetooth normally, just not when invoked by my app.  I get a toast message with the following text:</p><blockquote>  <p>Bluetooth share: File Unknown file not sent</p></blockquote><p>The logcat output is not particularly informative.  The only error level entry is the following, which appears to happen immediately after the <code>query</code> method of my <code>ContentProvider</code> is called (which itself is invoked by the <code>openFileHelper</code> method).  There is no stacktrace.</p><pre><code>E/BluetoothOppSendFileInfo(  337): scheme: content, authority: mydomain.myapp.myprovider</code></pre><p>I have searched through the <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Bluetooth.git"" rel=""nofollow"">Android Bluetooth source code</a> and I cannot find where this uninformative log message is written.</p><p>Perhaps there is something wrong with my <code>ContentProvider</code>, but I don't know what seeing as it works for the other Intent targets.</p><p>Is anybody aware of any Bluetooth-specific gotchas that I may be ignorant of?</p><p>For what it's worth, here's what my <code>ContentProvider</code> looks like:</p><pre><code>@Overridepublic Cursor query(Uri uri,                    String[] projection,                    String selection,                    String[] selectionArgs,                    String sortOrder){    if (uri.equals(CONTENT_URI))    {        String[] columns = projection == null                         ? new String[]{""uri"", ""mime_type"", ""_data""}                         : projection;        MatrixCursor cursor = new MatrixCursor(columns);        cursor.addRow(getColumns(columns));        return cursor;    }    throw new IllegalArgumentException(""Unsupported URI"");}@Overridepublic ParcelFileDescriptor openFile(Uri uri,                                     String mode) throws FileNotFoundException{    return openFileHelper(uri, mode);}</code></pre>","5171","","","","","2010-11-15 13:48:56","Using ACTION_SEND with Bluetooth","<android><bluetooth><android-intent>","1","0","","",""
"4088862","1","4088889","","2010-11-03 15:47:46","7","30292","<p>I have one ListView which is showing me some data through an array (which is in another class and I'm accessing it through it's object). </p><p>Whenever I delete an element from the ListView through context menu, the list is not refreshing but the element is deleted from the array. How can I refresh the list to show this?</p><p>Code:</p><pre><code>     public void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    if (v.getId()==R.id.mainListView) {        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;        post=info.position;      menu.setHeaderTitle(stocks[info.position]);        String[] menuItems = stt;        for (int i = 0; i&lt;menuItems.length; i++) {            menu.add(Menu.NONE, i, i, menuItems[i]);            }    }  }     @Override      public boolean onContextItemSelected(MenuItem item) {        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();        int menuItemIndex = item.getItemId();        String[] menuItems = stt;        String menuItemName = menuItems[menuItemIndex];        listItemName = stocks[info.position];        stockname.remove(post-1);    return true;  }</code></pre>","383597","","1965587","","2014-02-17 04:56:10","2014-02-17 04:56:10","Android List view refresh","<android><dom><xml-parsing><android-listview>","3","1","3","",""
"4088863","1","","","2010-11-03 15:47:48","5","2942","<p>I have a slider drawer in my application. If I set wrap_content as a value for the layout_height field, the slider drawer will stretch on the whole screen. Using a constant as a height is not a good alternative either.Is it possible to have a slider drawer with the height of it's content?</p><p>Thanks in advance!</p><pre><code>  &lt;LinearLayout   android:layout_width=""wrap_content""  android:layout_height=""wrap_content""   android:id=""@+id/frameLayout""   android:layout_gravity=""bottom""  android:orientation=""vertical""&gt;    &lt;View      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_weight=""1""       android:background=""@color/blue""/&gt;    &lt;SlidingDrawer         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""         android:handle=""@+id/handle""         android:content=""@+id/content""        android:id=""@+id/slide""         android:orientation=""vertical""&gt;    &lt;RelativeLayout android:id=""@+id/handle""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@drawable/list_header""&gt;          &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentLeft=""true""            android:layout_centerVertical=""true""            android:layout_marginLeft=""@dimen/padding""            android:textColor=""@color/black""            android:textStyle=""bold""            android:text=""@string/ingredients_list_title""/&gt;         &lt;ImageView            android:id=""@+id/handle_indicator""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentRight=""true""            android:layout_centerVertical=""true""            android:layout_marginRight=""@dimen/padding""            android:src=""@drawable/arrow_up""         /&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout android:id=""@+id/content""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@drawable/list_row_background""&gt;        &lt;LinearLayout android:id=""@+id/list_ant_title""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:layout_above=""@+id/gallery""             android:orientation=""vertical""&gt;              &lt;ListView                 android:id=""@+id/listview""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:divider=""@drawable/divider""                android:cacheColorHint=""@color/transparent""                android:fadingEdge=""none""/&gt;        &lt;/LinearLayout&gt;        &lt;Gallery             android:id=""@+id/gallery""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center_horizontal""            android:layout_alignParentBottom=""true""            android:background=""@drawable/list_row_background""/&gt;    &lt;/RelativeLayout&gt;&lt;/SlidingDrawer&gt;</code></pre><p></p>","460611","","460611","","2010-11-04 08:26:01","2012-06-10 06:40:13","Set slider drawer height","<android>","2","0","","",""
"4089051","1","4090300","","2010-11-03 16:06:39","2","5872","<p>If it is possible to keep an Air for Android application alive during sleep, how can it be done? I know how to prevent sleep and lock but this course is not preferable to some users.<br /><b>Update</b><br />The reason in this case is to keep the video streaming from the phone to a server.</p>","127938","","127938","","2010-11-03 22:00:39","2011-04-29 16:04:55","Android Air - How to keep application alive during sleep","<android><air>","2","0","2","",""
"4089119","1","4089901","","2010-11-03 16:14:09","0","1069","<p>I am trying to create a screen (in portrait mode) that shows 4 images (same size, intended to scale down to fit screen), taking up the entire screen, breaking up the screen into quadrants (a tall, 2x2 grid).  This will act as a main menu type of activity and each image should be clickable, in order to take the user to a different activity.</p><p>I have tried using a GridView inside a LinerLayout (using a lot from Google's GridView tutorial) but cannot get the images to all scale properly to fill the entire screen.  I get extra margins around the images and/or scrolling of the entire screen.</p><p>I have also tried using a TableLayout, placing 2 images in each of the 2 rows.  Visually, that worked perfectly.  Unfortunately when using that, I cannot seem to reference the ImageView items in the TableLayout in my activity code (findViewById always returns null).</p><p>I feel like a TableLayout is really not the ""right thing to do"" but I would like to hear what others have to say.  Either way, what should be done to accomplish my desired functionality?</p><p>Thanks.</p><p>Edit 1.1:The relative layout works much better for getting things lined up.  Now I'm just left with the issue where findViewById always returns null.  Here is my code so far:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:background=""@color/homescreen_bgcolor""        &gt;    &lt;ImageView id=""@+id/one""               android:layout_alignParentTop=""true""               android:layout_alignParentLeft=""true""               android:src=""@drawable/item1""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""/&gt;    &lt;ImageView id=""@+id/two""               android:layout_alignParentTop=""true""               android:layout_alignParentRight=""true""               android:src=""@drawable/item2""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""/&gt;    &lt;ImageView id=""@+id/three""               android:layout_alignParentBottom=""true""               android:layout_alignParentLeft=""true""               android:src=""@drawable/item3""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""/&gt;    &lt;ImageView id=""@+id/four""               android:layout_alignParentBottom=""true""               android:layout_alignParentRight=""true""               android:src=""@drawable/item4""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""/&gt;    &lt;/RelativeLayout&gt;public class HomeScreenActivity2 extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.homescreen2);    ImageView imageView = (ImageView) findViewById(R.id.one);    imageView.setClickable(true);    imageView.setOnClickListener(new View.OnClickListener() {      public void onClick(View view) {        Log.i(""Test"", ""test"");      }    });  }}</code></pre>","496163","","496163","","2010-11-03 19:49:31","2010-11-03 19:49:31","Which layout to use for a 2x2 image-based menu?","<android><layout><image-scaling>","1","0","","",""
"4089195","1","4090174","","2010-11-03 16:22:06","0","47","<p>I'm developing an Android application. I'm very new on Android development.</p><p>I see on other projects that textures are hold on res directory. They have to be compiled and deployed into device.</p><p>I'm wondering if I can download a picture as a texture from a web service and use it.</p><p>I don't know if every media that I need has to be compiled.</p><p>Thanks.</p>","68571","","68571","","2010-11-03 16:33:11","2010-11-03 18:09:05","Using not compiled media on Android","<android><web-services><opengl-es>","1","3","","",""
"4089213","1","4101083","","2010-11-03 16:24:25","5","6326","<p>I think I have a problem but I can't manage to solve it :(</p><p>I am creating like timer application and  when  I start timer I have option to go to android Home or start any other activity .</p><p>When I start timer I set a notification bar icon  and if  i use  some other application (mean go from started timer activity) and  now  I need to go to back to my previously started timer activity by clicking on notification icon ???</p><p>When I click  I am starting a new instance timer  activity ,  not the previously started timer activity ! ,  and if I then click back button it show me a previously timer activity ..</p><p>Question is: How to call previously started activity  trough notification bar , not to start new instance of that activity ??</p><p>This is sample of my code below :</p><pre><code>private void notificationBar(){    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);    int icon = R.drawable.ico;    CharSequence tickerText = ""some title..."";    long when = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, when);    Context context = getApplicationContext();    CharSequence contentTitle = ""some app title"";    CharSequence contentText = ""...some info !"";    Intent notificationIntent = new Intent(this, main.class);    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,  PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    mNotificationManager.notify(NOTIF_ID, notification);}    private void notificationClose(int notifID){    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);    mNotificationManager.cancel(notifID);}</code></pre>","365860","","1292730","","2012-05-01 14:52:14","2012-05-01 14:52:14","Android notification bar open last active activity?","<android><activity><call><android-notification-bar>","2","1","3","",""
"4089290","1","","","2010-11-03 16:33:34","0","577","<p>When I'm back from the background, <code>onResume()</code> method is called. Okay. So if I want to do some special code when I'm back I can put it there.</p><p>What about if I've many activities ? Do I've to duplicate that code everywhere ? Should I used the Application class and call a method in each <code>onResume()</code> methods ?Plus, I would need to access the UI (changes, dialogs, ...). Maybe the application class isn't that a good idea ... ?</p><p><strong>Concretely</strong>, I want to refresh my cache every XX time and I want to do that check when the application (or activity) is back from the background but I don't know exactly how to do and where to do that. </p><p>How do you do that guys ? Thanks for help.</p>","406761","","","","","2012-07-09 13:47:51","Android Return from background : how to manage code?","<android><caching><background><activity>","2","0","","",""
"4089319","1","4094049","","2010-11-03 16:36:31","0","603","<p>Is there a way to have an global settings variable for an android application, which is accessable as well from any help java classes without giving them context?!</p><p>I try to explain what I mean.</p><ul><li>I have an application version as string value in strings.xml</li><li>I can get its value from every android activity, but not from help java classes withought giving context</li><li>What I do now, is saving it in a static variable of my first activity, but it seems, that sometimes it will be erased and set to null.</li></ul><p>May be I do something wrong?!</p><p>Sorry for newbie question.</p><p>And thank you in advance,</p><p>Mur</p><p><strong>P.s.</strong></p><p>I wrote <a href=""http://hello-android.blogspot.com/2010/11/static-variable-in-your-android.html"" rel=""nofollow"">a small tutorial</a> for this topic, to show the solution.</p>","408780","","408780","","2010-11-08 09:13:51","2010-11-08 09:13:51","Settings variable in Android","<android>","3","2","","",""
"4089323","1","","","2010-11-03 16:36:38","2","4089","<p>I am a seasoned ASP.NET developer but a novice Android developer who is just getting started.  </p><p>The first page in my new app is a login page.  I would like to pass a username and password to my web service authentication method from my android app.  I would like to employ JSON since, from what I've read, would be the most simple and clean method of transmitting data to a mobile device.</p><p>I've been searching around and trying to find sample code or syntax that would show me how to accomplish this but it's been difficult.</p>","496189","","","","","2013-11-26 13:40:53","Accessing a .NET web service via Android using JSON","<android><web-services><json><.net-3.5>","2","3","","",""
"4089383","1","","","2010-11-03 16:43:58","2","5583","<p>How to use code to capture screen on android phone?Cound someone give some demo code to guide me?</p>","496201","","","","","2012-03-30 07:29:28","Android screen capture problem","<android><source-code><root><screen-capture>","3","0","0","",""
"4089460","1","4089489","","2010-11-03 16:51:16","1","1289","<p>Hey guys,I searched the last 4 hours to solve this issue, I wasn't able to do so, so I finally decided to post the question here.</p><p>2 Problems,first:Everything added, implemented like described in the manual, testAds work fine (a month ago, also real ads did fine - without a change -at least one, i realized) BUT no real ads are showing, -maybe? while connected on usb - that time it always sends the ""use code xxxxx to show test ads"" but sometimes it also shows some ads... and i really want to <strong>understand</strong> why and when ads are showing.my testdevice is a htc hero, connected via USB, but with wifi enabled, and internet, so there shouldn't be a problem.month a ago, ads were showing without problems at all. (all the time)</p><p>second:sometimes no ads are showing at all, usb disconnected, internet on, nothings happens, i can wait for minutes without an single ad showing.could it be because its the debug version running on my phone? havent found a solution, so i hoped maybe brain-storming :=) could solve this one!</p><p>Is there maybe a way to force-load an ad .. and check if its displayed correctly? Sometimes after 30 seconds.. an ad appears. sometimes... rare .. sometimes... :=//</p><p>thanks a lot for any feedback,cV </p>","371749","","","","","2012-03-31 06:52:04","Wait until AdMob Ads are loaded - sometimes ads not showing","<android><show><admob>","1","0","","",""
"4089496","1","4089581","","2010-11-03 16:55:23","6","28914","<p>I'm not sure whether I need to add an exit button to my app. Is there any point to doing this? And if on exiting one activity or service is not .finish() or closed properly could this cause a lot of damage? </p>","485498","","","","","2014-04-09 09:11:26","Android App Exit Button","<android><button><exit>","10","0","2","",""
"4089541","1","","","2010-11-03 17:00:53","2","338","<p>My application want to read each frame from a movie file and used to other.How can I do it?</p>","496214","","82118","","2010-11-03 19:25:08","2012-05-09 13:23:09","How to read each frame from a movie file in android?","<android>","1","0","","",""
"4089919","1","4090110","","2010-11-03 17:39:57","1","366","<p>if this is a silly question, am sorry about that. I was wondering if its possible to design android icons using a 3d modelling package like blender? i know i have to stick to the guidelines documented already, but was just wondering if anyone had come across or done something similar? Its that little part of the icons(launchers) being able to have a slight perspective  and looking through the requirements to design icons it seems i might be a lot faster using a 3d modelling package and then following part of the icons template guide(based from my requirement though!).  what you guys think? </p>","447570","","","","","2010-11-03 18:02:40","using 3d packages for android icon design","<android>","2","0","","",""
"4089972","1","5881449","","2010-11-03 17:46:12","8","1044","<p>How can I apply a style to all the dialogs without creating my custom implementation of the various dialog windows ?</p><p>I want to override Theme.Dialog</p><p>My ultimate goal is to change the color of the title bar for every popup in the application.</p>","271395","","","","","2014-01-27 01:21:14","Applying a style to all dialogs (spinner dialog, alertdialog, etc.)","<android><coding-style><dialog><themes>","1","0","3","",""
"4090352","1","4657339","","2010-11-03 18:30:09","0","1467","<p>I'm creating an application that uses an ImageSwitcher to show some images. I want to show arrows on either side of the screen in addition to a button on the bottom whenever a user has touched the screen or switched images. Just like you'll see when viewing screenshots for an application in Android Market.</p><p>So far I've had my activity implement OnGestureListener, and I've created an AsyncTask that fades in, sleeps for 1 seconds then fades out again whenever the ACTION_UP event is triggered. The problem is that I want to remove an arrow if the user flings to another image. There's three images.</p><p>Here's an exerpt of my code.</p><pre><code>@Override public boolean onTouchEvent(MotionEvent event) {  if (event.getAction() == MotionEvent.ACTION_UP) {   new FadeInOutButtons().execute();  }  return mGesture.onTouchEvent(event); }private void fadeOutAll() {Animation fadeOut = AnimationUtils.loadAnimation(    MyActivity.this, android.R.anim.fade_out);  mButtonHolder.startAnimation(fadeOut);  mButtonHolder.setVisibility(View.GONE);  if (mRightArrow.getVisibility() == View.VISIBLE) {   mRightArrow.startAnimation(fadeOut);   mRightArrow.setVisibility(View.GONE);  }  if (mLeftArrow.getVisibility() == View.VISIBLE) {   mLeftArrow.startAnimation(fadeOut);   mLeftArrow.setVisibility(View.GONE);  } }private class FadeInOutButtons extends AsyncTask&lt;Void, Void, Void&gt; {  @Override  protected Void doInBackground(Void... params) {   try {    Thread.sleep(1000);   } catch (InterruptedException e) {   }   return null;  }  @Override  protected void onPostExecute(Void result) {   fadeOutAll();   super.onPostExecute(result);  }  @Override  protected void onPreExecute() {   Animation fadeIn = AnimationUtils.loadAnimation(     MyActivity.this, android.R.anim.fade_in);   mButtonHolder.startAnimation(fadeIn);   mButtonHolder.setVisibility(View.VISIBLE);   final int sz = mImages.size();   if (sz &gt; 1) {    if (mPosition &lt; sz - 1) {     mRightArrow.startAnimation(fadeIn);     mRightArrow.setVisibility(View.VISIBLE);    }    if (mPosition &gt; 0) {     mLeftArrow.startAnimation(fadeIn);     mLeftArrow.setVisibility(View.VISIBLE);    }   }   super.onPreExecute();  } }@Overridepublic boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,   float velocityY) {  final int sz = mImages.size();  if (sz &gt; 1) {   if (velocityX &lt; 0 &amp;&amp; mPosition &lt; sz - 1) {    mInactive = mActive;    mActive = (ImageView) mSwitcher.getNextView();    mActive.setImageResource(mImages.get(++mPosition));    mSwitcher.showNext();   } else if (velocityX &gt; 0 &amp;&amp; mPosition &gt; 0) {    mInactive = mActive;    mActive = (ImageView) mSwitcher.getNextView();    mActive.setImageResource(mImages.get(--mPosition));    mSwitcher.showPrevious();   }  }  mInactive.setImageURI(null);  return true; }</code></pre><p>Have any of you done anything like this before? How can I make only the left arrow disappear when the third image is focused, and only the right one when the first is... And so on... ? I've been stuck on this for an hour.</p><p>Thanks!</p><p>Sorry about the formatting.</p>","397060","","","","","2011-01-12 00:20:37","Fading arrows on imageswitcher","<android><multithreading><imageview><android-asynctask><viewswitcher>","1","1","1","",""
"4090427","1","4090448","","2010-11-03 18:38:39","0","1592","<p>I need to show a ""grid"" or ""table"" of data in a pop-up dialog box on Android.</p><p>Basically, a column listed down the left with rows of names, for example, then multiple columns to the right of the names with values in columns.</p><p>Is this possible?</p>","179518","","","","","2012-04-05 11:13:16","On Android, Is it possible to show a table of data in a dialog box?","<android>","2","0","1","",""
"4090439","1","","","2010-11-03 18:39:34","0","1352","<p>I am new to Android and relatively new to Java so please bear with me. 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. Could someone point me in the right direction please.</p>","496341","","","","","2010-11-03 18:49:38","Read/Write to a Local XML File in Android","<java><android>","2","2","","",""
"4090534","1","4090723","","2010-11-03 18:50:30","2","4018","<p>I need a control where user can pick a number from a list like one in below image.This image is from myTouch 3g Slide. If this is part of android source, can somebody provide me the link?</p><p>Thanks</p><p><img src=""http://i.stack.imgur.com/MrI5Q.png"" alt=""alt text""></p>","339725","","","","","2012-09-07 07:29:37","Spin wheel control in Android","<android>","2","0","4","",""
"4090546","1","4090640","","2010-11-03 18:52:14","3","1011","<p>I have a Collection (a Set to be specific) and want to create a PriorityQueue from it. I also want my custom comparator, but there's no such constructor.</p><pre>PriorityQueue(Collection c)PriorityQueue(int initialCapacity, Comparator comparator)</pre><p><a href=""http://developer.android.com/reference/java/util/PriorityQueue.html"" rel=""nofollow"">http://developer.android.com/reference/java/util/PriorityQueue.html</a></p><p>Is there any way to first create the PriorityQueue from the Collection and then add the Comparator later? If no, what's the most efficient way to add it ""manually""?</p>","496353","","","","","2010-11-03 19:02:17","Create PriorityQueue from Comparator and Collection","<java><android>","3","0","","",""
"4090680","1","4091160","","2010-11-03 19:07:51","0","722","<p>look at this:<a href=""http://www.eurodroid.com/pics/android_foursquare_update_1.jpg"" rel=""nofollow"">http://www.eurodroid.com/pics/android_foursquare_update_1.jpg</a></p><p>Someone knows how is structured this layout?Is a 3 tab layout, but the content of this tab?Is a table, a ListAdapter, what is?</p><p>Thank you a lot.</p>","496371","","1288","","2010-11-04 01:01:38","2010-11-04 01:01:38","Info about Foursquare's app Layout","<android><foursquare>","2","0","","",""
"4090715","1","4094829","","2010-11-03 19:12:21","0","589","<p>We are trying to develop an Android based text reader for books in Daisy3 (<a href=""http://www.daisy.org/z3986/structure/SG-DAISY3/index.html"" rel=""nofollow"">http://www.daisy.org/z3986/structure/SG-DAISY3/index.html</a>) format. Currently we are only focusing on rendering the text part and not on the audio (daisy3 format has both text and audio, primarily for users with reading disabilities). </p><p>I want to know if there already are any efforts going on in this regard.I know that there is Daisy2 android project (<a href=""http://code.google.com/p/android-daisy-epub-reader/"" rel=""nofollow"">http://code.google.com/p/android-daisy-epub-reader/</a>). However, we want to develop for Daisy 3 standard, which is structurally different from Daisy2.</p><p>I would also like to know if there are any Java based text readers for Daisy3 format which can serve as a reference?Any pointers/help will be greatly appreciated.</p>","223363","","","","","2013-03-05 22:42:11","Any Daisy-3 book readers for Java/Android?","<java><android>","2","0","1","",""
"4090959","1","","","2010-11-03 19:39:04","4","162","<p>I'm wondering if it's possible to receive a notification if user presses a number in dialer on the other side of connection during the phone call. Like the scheme used by various automated support services - ""Press 1 to..., press 2 to..."". So I would like to receive that number pressed.</p><p>Thanks</p>","94892","","94892","","2012-08-21 19:53:54","2012-08-21 19:53:54","Android: receive dialer number press from the other party","<java><android><telephony>","1","1","3","",""
"4091087","1","4092440","","2010-11-03 19:55:57","7","1637","<p>sometimes when i work on android in eclipse the logcat output just seems to output the last line of messages and discards everything before.</p><p>this usually happens after 30mins of work but i cant find a concrete way to repro it.</p><p>any hints? thanks!</p>","97688","","","","","2010-11-03 23:03:42","android LogCat only outputting last line","<android><eclipse><logcat>","2","1","4","",""
"4091198","1","4091268","","2010-11-03 20:07:48","0","633","<p>I need to get the context to be able to get a resource.  Like this:</p><pre><code>getApplicationContext().getResources().openRawResource( R.raw.texture );</code></pre><p>I've seen the getApplicationContext() in the android documentation but when I try to use it in the above code it doesn't work - it doesn't exist.</p><p>I can send the context through functions to get it to where it's needed and it works.  However, I find it cumbersome to send a variable through many functions that doesn't need or use it.  Then I would rather just try to get it in the function that do.  But the getApplicationContext(), as in the android documentation, doesn't work - <a href=""http://developer.android.com/reference/android/content/Context.html"" rel=""nofollow"">http://developer.android.com/reference/android/content/Context.html</a></p><p>So how do I get the context so I can read resources?  Or are my only option to send it through all my functions?</p>","324943","","","","","2012-01-06 23:10:21","How to get the context","<android><opengl-es>","2","0","","",""
"4091215","1","4091474","","2010-11-03 20:09:39","0","156","<p>I have a ListView, displaying some items, containing an ImageView filled with a standard image at first and a line of text.</p><p>What I wanna do is downloading one thumb after another with an AsyncTask and step for step change the standard image with the downloaded one. How to realise this?</p><p>The ListView contents are managed by an enhanced ArrayAdapter.</p><p>greetz</p><p>EnflamedSoul</p>","486084","","","","","2010-11-03 20:40:55","Modifying single list items","<java><android><listview>","1","0","","",""
"4091369","1","4096163","","2010-11-03 20:28:19","0","2321","<p>I have a tab layout with drawable resources as tab images. In landscape mode everything fine. But in portrait mode images doesn't have some margin from tabs. How I can change images scale or how to set some margin to image? I don't want use fixed size, don't think that it is right way.</p><p>Here is my layout</p><pre><code>&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;ListView                    android:id=""@+id/list""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    /&gt;        &lt;/FrameLayout&gt;&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/logo"" android:state_selected=""true""  /&gt;    &lt;item android:drawable=""@drawable/logo_disabled"" /&gt;&lt;/selector&gt;</code></pre><p>Here is tab creation</p><pre><code>    Drawable d = res.getDrawable(R.drawable.logos);     spec = tabHost.newTabSpec(1).setIndicator("""", res.getDrawable(R.drawable.logos)).setContent(intent);    tabHost.addTab(spec);</code></pre>","423868","","","","","2010-11-04 11:28:28","How to change tab image scale","<android><layout><tabs><margin><scale>","1","0","","",""
"4091405","1","","","2010-11-03 20:32:40","5","1500","<p>I've scowered the 5 corners of the internet without much of a nibble.</p><p>I'm trying to produce a animated rectangle to change its length. when it moves to the next length I want it to animate to the new length..</p><p>I'm drawing  the rectangle as follows:</p><pre><code>    Paint rectanglePaint = new Paint();    rectanglePaint.setARGB(255, 0, 0, 255);    rectanglePaint.setStrokeWidth(2);    rectanglePaint.setStyle(Style.FILL);    Rect rectangle = new Rect(1, 1, 200, 20);    canvas.drawRect(rectangle, rectanglePaint);</code></pre><p>However I'm not sure how to add the ScaleAnimation to the above. I also want to generate through Java code only.</p><p>Can anyone help?</p>","436725","","","","","2011-08-23 05:59:59","Android: animate a rectangle","<android>","1","0","","",""
"4091631","1","4091652","","2010-11-03 20:59:19","1","317","<p>I want to develop an app for android and am a newbie to pretty much anything server related.  I want my app to be able to perform simple get and post requests to my server.  I don't intend on hosting a website on it and it will only be accessed by the app.  Do I still need to get a registered domain name or can I directly access the ip address of my server?  Obviously it would have to be able to be accessed by things other than the local network the server is on.</p><p>Thanks!</p>","476514","","","","","2010-11-03 21:07:08","Does my server need a registered domain name if it is only accessed from mobile application?","<android>","5","0","","",""
"4091648","1","","","2010-11-03 21:02:09","0","77","<p>Hi I'm new to android programming and I've checked the forums but I can't quite find what I'm looking for.  I'm trying to make an app where you start at a menu, click a button and are brought to a list of items (which I later hope to make clickable). But I can't seem to make it call my next activity. Can anyone help?Thanks.</p>","496483","","341251","","2010-11-03 21:05:52","2010-11-03 21:53:48","Help with buttons please","<android><button>","2","0","","",""
"4091894","1","4092652","","2010-11-03 21:34:09","0","557","<p>For some reason, when I create a bitmap from an image in asset, it does not display fullscreen.  When I take an image from drawable, resId, the image shows fullscreen.  Why is this?</p><pre><code>            //the image is not fullscreen        ImageView iv = new ImageView(getBaseContext());        iv.setImageBitmap(bitmapFileFromAssetorSD);            //this makes the image fullscreen        //iv.setBackgroundResource(resId);        iv.setLayoutParams(                new LayoutParams(                        android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT                )        );  </code></pre>","375566","","","","","2010-11-03 23:39:49","Android SDK - convert bitmap to resource for layout params issue","<android>","1","0","","",""
"4091921","1","4093089","","2010-11-03 21:36:44","1","2296","<p>I updated my build to build against Android 1.6, and now my bitmaps are scaled down on high density screens. I do NOT want this behavior. I gave this a shot:</p><p><a href=""http://blog.tomgibara.com/post/190539066/android-unscaled-bitmaps"" rel=""nofollow"">http://blog.tomgibara.com/post/190539066/android-unscaled-bitmaps</a></p><p>but the images are STILL scaling, that is UNLESS I set them to a specific height &amp; width. If I use <code>wrap_content</code> they are scaled down.</p><p>I have an image loader using the unscaled bitmap loader to create a drawable like so:</p><pre><code>Bitmap bm = UnscaledBitmapLoader.loadFromResource(imageBufferInputStream);drawable = new BitmapDrawable(bm);</code></pre><p>which I later assign to an ImageView like so:</p><pre><code>imageView.setImageDrawable( copyBitmapDrawable( (BitmapDrawable) drawable) );</code></pre>","413414","","413414","","2010-11-04 00:12:58","2011-08-23 10:14:48","Android: How to stop Android 1.6+ from scaling images","<android><bitmap><scale><drawable>","4","0","2","",""
"4092001","1","4092594","","2010-11-03 21:49:44","1","1791","<p>I managed to programm an app that communicates with a server. I can write and I can read. I even managed to do it with Java NIO.</p><p>My problem is that I have a endless while loop that is listening for new data to read. It blocks the whole program and I can't write anymore data.</p><p>I need a solution so the loop keeps running in background listening for new data to read while I send data.</p><p>Any suggestions?</p>","492704","","","","","2010-11-04 13:14:00","Asynchronous socket communication in Android with threads","<java><android><sockets><nio>","3","1","3","",""
"4092161","1","4092190","","2010-11-03 22:18:11","1","4522","<p>I was wondering if there is a way to compare strings in android with greater than or >.</p><p>Lets say I have this:</p><pre><code>String numbers = number.getText().toString();if (numbers.equals(""9"")){output.setText(""50"");}</code></pre><p>so if you enter 9 in the number EditText field the output TextView will display 50.<br>I have quite a few different numbers that will then = a different number but what can I do   if I want 10,11,12,13,etc to = 100?</p><p>Is there a way to do this by using something like this?</p><pre><code>if (numbers.equals(""9""++))</code></pre><p>or is there some kind of wildcard in android like</p><pre><code>if (numbers.equals(""1""+""*""))</code></pre><p>i know if i replace the * with zero it will be 10 so if this is possible I could make  one for 1, one for 2, one for 3, etc. and this would still save me so much code.<br>If this is not possible let me know if you have any ideas.</p><p>Thanks guys!</p>","478121","","5171","","2010-11-03 22:23:29","2010-11-03 22:23:29","How can you compare strings in android with greater than","<java><android><compare>","2","0","","",""
"4092231","1","4092583","","2010-11-03 22:28:28","1","3155","<p>I have a sprint anycom bluetooth reciever connected to my car stereo.  I think it only supports the A2DP bluetooth profile (no hfp).</p><p>Right now the music plays through the car stereo just fine but when I get a phone call it does not.  Ideally I would like to have the phone call audio go through the stero and use the phone's microphone as if it were on speakerphone. Is this possible?</p><p>My phone is a g1 running the latest experimental release of cyanogenmod rom.</p><p>I would love a built in solution but I think the ability to do that is so non standard it wouldn't exist.  An existing marketplace app with the ability would be great, too.  I have not done any android development but I am a java developer, so a pointer on how to do it programmatically (or that it is not possible) would be great, too.</p>","476244","","","","","2010-11-03 23:27:43","Make Android Phone Call Audio go through A2DP Bluetooth Connection","<android><bluetooth>","1","0","1","",""
"4092361","1","4092450","","2010-11-03 22:49:24","4","2347","<p>How can I add a ""drawable left"" icon to a button object?</p><p>I mean something like this:</p><pre><code>Button button = new Button();button.setDrawableLeft(R.drawable...);</code></pre>","496571","","759866","","2014-02-04 15:48:56","2014-02-04 15:48:56","Android Button drawableLeft - how to hardcode it (no xml)","<android><button><drawable>","1","0","","",""
"4092438","1","4452190","","2010-11-03 23:03:28","9","5415","<p>I am trying to pause music that is playing when the headset is unplugged. </p><p>I have created a BroadcastReceiver that listens for ACTION_HEADSET_PLUG intents and acts upon them when the <em>state</em> extra is 0 (for unplugged). My problem is that an ACTION_HEADSET_PLUG intent is received by my BroadcastReceiver whenever the activity is started. This is not the behavior that I would expect. I would expect the Intent to be fired only when the headset is plugged in or unplugged. </p><p>Is there a reason that the ACTION_HEADSET_PLUG Intent is caught immediately after registering a receiver with that IntentFilter? Is there a clear way that I can work with this issue? </p><p>I would assume that since the default music player implements similar functionality when the headset is unplugged that it would be possible. </p><p>What am I missing?</p><p>This is the registration code</p><pre><code>registerReceiver(new HeadsetConnectionReceiver(),                  new IntentFilter(Intent.ACTION_HEADSET_PLUG));</code></pre><p>This is the definition of HeadsetConnectionReceiver</p><pre><code>public class HeadsetConnectionReceiver extends BroadcastReceiver {    public void onReceive(Context context, Intent intent) {        Log.w(TAG, ""ACTION_HEADSET_PLUG Intent received"");    }}</code></pre>","1094550","","","","","2013-09-06 19:15:59","Intent.ACTION_HEADSET_PLUG is received when activity starts","<android>","3","0","3","",""
"4092447","1","4092477","","2010-11-03 23:04:38","0","1112","<p>I'm searching for a best practice for securely sending data FROM a remote server TO an android device. This data needs to be secure from anyone sniffing the wire, and I expect HTTPS to handle this much. The real concern I have is this...</p><p>The data will be consumed by the app, but the real content hidden from the user. Think of it as if the user is taking a test, and the app has downloaded all the possible answers (and knows which one is correct). Obviously, you would not want the user to be able to sniff the traffic to discover which answer is correct, nor would you want the user to be able to reverse engineer the app and find the super-secret decryption key used to decipher the data.</p><p>This may be an impossible task, but are there any good methods for really locking down this kind of sensitive data? I know these days nothing is safe, not even the blu-ray decryption key. But maybe someone could point me in the right direction.</p>","496564","","","","","2010-11-05 00:18:09","developing for android, secure data transfer best-practice","<android><security><encryption>","2","0","","",""
"4092519","1","4092797","","2010-11-03 23:16:17","2","694","<p>I have some large JPG files that need to be downsampled in an android service. BitmapFactory (i.e. skia libray) can handle this but probably does not get any GPU support. Is there any portable way to get hardware acceleration for scaling ?</p><p>Could a service create a hidden View and then use OpenGL ES to do the scaling part or is that only feasible in activities ?</p>","355993","","44729","","2010-11-04 02:35:37","2010-11-04 02:35:37","Android accelerated bitmap scaling","<android><opengl-es><bitmap><scaling><hardware-acceleration>","1","0","","",""
"4092520","1","4092977","","2010-11-03 23:16:25","1","1030","<p>I want to give my users oppertinty to choose destination. from the beginning it will already have a point on the map, and after that they can choose/change to another location if they want.. </p><p>how is it possible to change the point on the map, by clicking somewhere else on the map? </p>","371301","","","","","2011-12-23 06:49:26","Android: Move point on the google map when clicking somewhere on the map","<android><android-sdk-2.1>","2","0","1","",""
"4092566","1","4102288","","2010-11-03 23:23:42","1","567","<p>I try this tutorial for building a Widget for Android Homescreen.</p><p><a href=""http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf"" rel=""nofollow"">http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf</a></p><p>But if i try to start the example with the Service (the second way in that tutorial) i got in the LogCat of DDMS the following error message:</p><pre><code>WARN/ActivityManager(52): Unable to start service Intent { cmp=de.tlindig.android/.HelloWidget$UpdateService }: not found</code></pre><p>What i not understand is, where slash (""/"") after the package name comes from.</p><p>I also add a log-statement ahead of the service creation to check, whats going in. The code looks like this:</p><pre><code>@Override</code></pre><p>public void onUpdate(Context context, AppWidgetManager appWidgetManager,       int[] appWidgetIds) {</p><pre><code>  Log.d(""HelloWidget.onUpdate"", ""UpdateService.class is: "" + UpdateService.class);  Intent intent = new Intent(context, UpdateService.class);  context.startService(intent); }</code></pre><p>And so i got the following output in the LogCat:</p><pre><code>DEBUG/HelloWidget.onUpdate(320): UpdateService.class is: class de.tlindig.android.HelloWidget$UpdateServiceWARN/ActivityManager(52): Unable to start service Intent { cmp=de.tlindig.android/.HelloWidget$UpdateService }: not found</code></pre><p>I work on Windows 7 64bit with eclipse. I did copy the code step by step direct from the tutorial. I tried also own example, but got the same error. In both cases i got that slash in the path.</p><p>Have anybody a idea what i doing wrong? </p><p>Thanks for you help.</p>","496587","","","","","2010-11-04 23:19:13","Android: Why i got a slash in the full qualified class name and ""WARN/ActivityManager(52): Unable to start service Intent""","<android><service><android-intent>","1","0","","",""
"4092603","1","4092765","","2010-11-03 23:32:33","0","665","<p>I hav an existing android app in version 1.5 . I have to make it to support Multiscreen .</p>","412168","","","","","2010-11-04 00:00:18","How to make a android app to MultiScreen support?","<android>","1","0","","",""
"4092631","1","4092735","","2010-11-03 23:35:47","1","693","<p>In the past I have used Python for backend stuff along with Django for frontend stuff, but I don't know how well those two work with Android.</p><p>Can anyone recommend a good way to go about making server-side software that works well with Android?</p><p>Please take into account that I also want a web application as a frontend, so the backend should work with both the web app and the Android app.</p><p>Thanks for the help!</p>","487060","","","","","2010-11-03 23:55:29","How should I approach making server-side software for an Android application?","<android><frontend><backend>","1","0","1","",""
"4092663","1","","","2010-11-03 23:40:45","0","115","<p>Is there some easy way of transforming KeyValuePairs into json</p><p>For Example</p><pre><code>{ ""keyvaluepairs"" :          { ""long"": ""6,5"",            ""heavy"": ""200"",         }</code></pre><p>}</p><p>long and heavy are inside the keyvaluepairs? some easyway of doing this?</p>","371301","","","","","2010-11-04 01:04:02","Android: KeyValuePairs to json","<java><android><json>","1","0","","",""
"4092696","1","4092910","","2010-11-03 23:47:41","1","1521","<p>hi im wanting to stop all threads when my main activity closes as some are still running afterwards and are giving NullPointerException as they try to access ArrayLists which no longer exist. however none of the obvious methods are working and they are also deprecated. is it possible as im currently using a try/catch statement as a workaround but would prefer a fix.</p><p>TIA</p><p>ng93</p>","364727","","","","","2010-11-04 00:28:21","android stop thread","<android><multithreading><arrays><nullpointerexception>","1","0","","",""
"4092842","1","4093087","","2010-11-04 00:16:31","0","1037","<p>Can anyone offer an insight into my problem please?</p><p>My app works when GPS is disabled, but FC's when starting while GPS is enabled. On a cold start it offers the option to turn on the GPS. After doing that, pressing the back arrow button it returns to the app activity (although the GPS icon is not visible in the status bar, on a side note, how do I get it to display here?).</p><p>I exit the application by pressing the back button or using the menu option whilst GPS is still on.Now, when I try to start the app, it FC's. The blinking GPS icon appears behind the FC message and disappears when I acknowledge the FC.</p><p>Here is the code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    getLocation();    setupWebView();    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);}private void setupWebView() {    final String centerURL = ""javascript&amp;#058;centerAt(""        + mostRecentLocation.getLatitude() + "",""
        + mostRecentLocation.getLongitude() + "")"";    webView = (WebView) findViewById(R.id.webview);    // Get rid of white line on the right    webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);    webView.getSettings().setJavaScriptEnabled(true);    // Wait for the page to load then send the location information    webView.setWebViewClient(new WebViewClient() {        @Override        public void onPageFinished(WebView view, String url) {            webView.loadUrl(centerURL);        }    });    webView.loadUrl(MAP_URL);}/** * The Location Manager manages location providers. This code searches for * the best provider of data (GPS, WiFi/cell phone tower lookup, some other * mechanism) and finds the last known location. **/private void getLocation() {    locationManager = (LocationManager)             getSystemService(Context.LOCATION_SERVICE);    if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {        createGpsDisabledAlert();    }    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    provider = locationManager.getBestProvider(criteria, true);    // In order to make sure the device is getting location, request    // updates. Look to tweaking the arguments to this for a smooth ride    locationManager.requestLocationUpdates(provider, 1, 0, this);    mostRecentLocation = locationManager.getLastKnownLocation(provider);}private void createGpsDisabledAlert() {    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setMessage(""Your GPS is disabled! Would you like to enable it?"")            .setCancelable(false)            .setPositiveButton(""Enable GPS"",                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int id) {                            showGpsOptions();                        }                    });    builder.setNegativeButton(""Use Wifi or 3g for location"",            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    dialog.cancel();                }            });    AlertDialog alert = builder.create();    alert.show();}private void showGpsOptions() {    Intent gpsOptionsIntent = new Intent(            android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);    startActivity(gpsOptionsIntent);}// Menu setup@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    menu.add(0, 0, 0, R.string.close).setIcon(            android.R.drawable.ic_menu_close_clear_cancel);    return super.onCreateOptionsMenu(menu);}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case 0:        super.onStop();        super.onDestroy();        this.finish();        return true;    default:        return super.onOptionsItemSelected(item);    }}@Overrideprotected void onResume() {    locationManager.requestLocationUpdates(provider, 1, 0, this);    super.onResume();}@Overrideprotected void onPause() {    locationManager.removeUpdates(this);    super.onPause();}/** Sets the mostRecentLocation object to the current location of the device **/public void onLocationChanged(Location location) {    mostRecentLocation = location;    final String centerURL = ""javascript&amp;#058;centerAt(""        + mostRecentLocation.getLatitude() + "",""
        + mostRecentLocation.getLongitude() + "")"";    // This line is good to update the map with the current location    webView.loadUrl(centerURL);}</code></pre><p></p><p>and this is the logcatfrom eclipse:</p><pre><code>11-04 11:45:10.774: INFO/ActivityManager(52): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.weuni.android.mups/.ViewCampusActivity }11-04 11:45:10.925: INFO/ActivityManager(52): Start proc com.weuni.android.mups for activity com.weuni.android.mups/.ViewCampusActivity: pid=225 uid=10030 gids={3003, 1015}11-04 11:45:10.934: DEBUG/AndroidRuntime(197): Shutting down VM11-04 11:45:10.944: DEBUG/dalvikvm(197): DestroyJavaVM waiting for non-daemon threads to exit11-04 11:45:10.954: DEBUG/dalvikvm(197): DestroyJavaVM shutting VM down11-04 11:45:10.954: DEBUG/dalvikvm(197): HeapWorker thread shutting down11-04 11:45:10.954: DEBUG/dalvikvm(197): HeapWorker thread has shut down11-04 11:45:10.954: DEBUG/jdwp(197): JDWP shutting down net...11-04 11:45:10.964: INFO/jdwp(197): adbd disconnected11-04 11:45:10.974: DEBUG/dalvikvm(197): VM cleaning up11-04 11:45:11.055: ERROR/AndroidRuntime(197): ERROR: thread attach failed11-04 11:45:11.185: DEBUG/dalvikvm(197): LinearAlloc 0x0 used 636388 of 5242880 (12%)11-04 11:45:11.485: DEBUG/ddm-heap(209): Got feature list request11-04 11:45:11.555: DEBUG/NetworkLocationService(52): onCreate11-04 11:45:11.555: DEBUG/ddm-heap(225): Got feature list request11-04 11:45:11.595: DEBUG/LocationManager(52): Constructor: service = com.android.server.LocationManagerService@43ceb72011-04 11:45:11.625: ERROR/ActivityThread(52): Failed to find provider info for com.google.settings11-04 11:45:11.625: ERROR/ActivityThread(52): Failed to find provider info for com.google.settings11-04 11:45:11.934: INFO/ARMAssembler(52): generated scanline__00000177:03515104_00000001_00000000 [ 73 ipp] (95 ins) at [0x45ef00:0x45f07c] in 1428001 ns11-04 11:45:12.004: INFO/ARMAssembler(52): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x33bf28:0x33c034] in 772000 ns11-04 11:45:12.185: WARN/WindowManager(52): No window to dispatch pointer action 011-04 11:45:12.195: WARN/WindowManager(52): No window to dispatch pointer action 111-04 11:45:12.724: DEBUG/LocationManager(225): Constructor: service = android.location.ILocationManager$Stub$Proxy@43d1464811-04 11:45:12.794: DEBUG/GpsLocationProvider(52): setMinTime 111-04 11:45:12.794: DEBUG/GpsLocationProvider(52): startNavigating11-04 11:45:12.834: DEBUG/AndroidRuntime(225): Shutting down VM11-04 11:45:12.834: WARN/dalvikvm(225): threadid=3: thread exiting with uncaught exception (group=0x4001b188)11-04 11:45:12.834: ERROR/AndroidRuntime(225): Uncaught handler: thread main exiting due to uncaught exception11-04 11:45:12.894: ERROR/AndroidRuntime(225): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.weuni.android.mups/com.weuni.android.mups.ViewCampusActivity}: java.lang.NullPointerException11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.os.Handler.dispatchMessage(Handler.java:99)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.os.Looper.loop(Looper.java:123)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at java.lang.reflect.Method.invokeNative(Native Method)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at java.lang.reflect.Method.invoke(Method.java:521)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at dalvik.system.NativeStart.main(Native Method)11-04 11:45:12.894: ERROR/AndroidRuntime(225): Caused by: java.lang.NullPointerException11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at com.weuni.android.mups.ViewCampusActivity.setupWebView(ViewCampusActivity.java:41)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at com.weuni.android.mups.ViewCampusActivity.onCreate(ViewCampusActivity.java:35)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)11-04 11:45:12.894: ERROR/AndroidRuntime(225):     ... 11 more11-04 11:45:12.934: INFO/Process(52): Sending signal. PID: 225 SIG: 311-04 11:45:12.944: INFO/dalvikvm(225): threadid=7: reacting to signal 311-04 11:45:12.944: ERROR/dalvikvm(225): Unable to open stack trace file '/data/anr/traces.txt': Permission denied11-04 11:45:13.165: DEBUG/ddm-heap(144): Got feature list request11-04 11:45:13.265: DEBUG/ddm-heap(158): Got feature list request11-04 11:45:13.315: INFO/ARMAssembler(52): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x4bdcb0:0x4bdd6c] in 591000 ns11-04 11:45:13.345: INFO/ARMAssembler(52): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x4bdd70:0x4bdf38] in 752000 ns11-04 11:45:13.375: DEBUG/ddm-heap(182): Got feature list request11-04 11:45:13.385: DEBUG/ddm-heap(198): Got feature list request11-04 11:45:14.265: DEBUG/NetworkLocationProvider(52): updateNetworkState(): Updating network state to 211-04 11:45:14.294: DEBUG/NetworkLocationProvider(52): onCellLocationChanged [0,0]11-04 11:45:14.305: DEBUG/NetworkLocationProvider(52): onDataConnectionStateChanged 311-04 11:45:14.844: INFO/ActivityManager(52): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=242 uid=10019 gids={}11-04 11:45:14.995: DEBUG/ddm-heap(242): Got feature list request11-04 11:45:15.624: DEBUG/MediaScanner(158): opendir /system/media/ failed, errno: 211-04 11:45:15.634: DEBUG/MediaScanner(158):  prescan time: 5425ms11-04 11:45:15.634: DEBUG/MediaScanner(158):     scan time: 18ms11-04 11:45:15.644: DEBUG/MediaScanner(158): postscan time: 2ms11-04 11:45:15.644: DEBUG/MediaScanner(158):    total time: 5445ms11-04 11:45:15.664: DEBUG/MediaScannerService(158): done scanning volume internal11-04 11:45:15.674: DEBUG/MediaScannerService(158): start scanning volume external11-04 11:45:15.694: VERBOSE/MediaProvider(158): /sdcard volume ID: 28377910311-04 11:45:15.835: VERBOSE/MediaProvider(158): Attached volume: external11-04 11:45:15.995: VERBOSE/MediaScanner(158): pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor@43bb5fd011-04 11:45:16.005: VERBOSE/MediaScanner(158): /pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor@43bb5fd011-04 11:45:16.036: DEBUG/MediaScanner(158):  prescan time: 123ms11-04 11:45:16.036: DEBUG/MediaScanner(158):     scan time: 4ms11-04 11:45:16.036: DEBUG/MediaScanner(158): postscan time: 52ms11-04 11:45:16.036: DEBUG/MediaScanner(158):    total time: 179ms11-04 11:45:16.065: DEBUG/MediaScannerService(158): done scanning volume external11-04 11:45:19.655: INFO/Process(225): Sending signal. PID: 225 SIG: 911-04 11:45:19.685: INFO/ActivityManager(52): Process com.weuni.android.mups (pid 225) has died.11-04 11:45:19.685: WARN/GpsLocationProvider(52): Unneeded remove listener for uid 100011-04 11:45:19.685: DEBUG/GpsLocationProvider(52): stopNavigating11-04 11:45:19.795: INFO/UsageStats(52): Unexpected resume of com.android.launcher while already resumed in com.weuni.android.mups11-04 11:45:20.085: WARN/InputManagerService(52): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43d2d03011-04 11:45:24.585: WARN/ResourceType(52): Resources don't contain package for resource number 0x7f0700e511-04 11:45:24.595: WARN/ResourceType(52): Resources don't contain package for resource number 0x7f02003111-04 11:45:24.595: WARN/ResourceType(52): Resources don't contain package for resource number 0x7f02003011-04 11:45:24.595: WARN/ResourceType(52): Resources don't contain package for resource number 0x7f05000011-04 11:45:24.605: WARN/ResourceType(52): Resources don't contain package for resource number 0x7f06000111-04 11:45:24.625: WARN/ResourceType(52): Resources don't contain package for resource number 0x7f060000</code></pre>","496625","","281545","","2013-05-11 17:53:30","2013-05-11 17:53:30","Starting my android app when GPS is enabled force closes","<java><android><crash><gps><locationlistener>","1","7","","",""
"4092915","1","4092941","","2010-11-04 00:28:55","1","1612","<p>What if the result is not OK, </p><p>What can I use instead for RESULT_OK when the result is not oK?</p>","371301","","345717","","2010-11-04 00:32:55","2013-12-02 16:24:52","Android: What is the opposite of RESULT_OK","<android>","1","0","1","",""
"4092971","1","4092995","","2010-11-04 00:39:13","1","1684","<p>Hey there, I've been stuck for ages now trying to implement threading or background image loading for a custom tile overlay class I've been working on. I'm pretty useless when it comes to Java so threading isn't something I've had any experience with.</p><p>Basically I have extended an ItemizedOverlay and in the draw() method calculate the tiles I need to display over the standard google tiles then fetch those images with a URLConnection and using BitmapFactory decode them and draw them to the canvas at the correct position on the screen so that the images are on top of the google tiles with about 50% opacity ( the custom tiles are cellphone network coverage png's which are used for our web app) </p><p>I initially got this all working with the tiles loading in the correct places but hit issues with memory and ""freezing"" while panning so implemented some basic caching and memory management to only store the tiles that are displayed on the map in memory and when downloading a tile store it to SD card. </p><p>Then I figured the freezing while panning is due to the blocking nature of downloading the images so, have been trying to implement threading. I created a class that extends AsyncTask to download the images in the background and store them to SD, in the onPostExecute method I then try to draw all the tiles. </p><p>But onPostExecute never seems to fire, now I know that the AsyncTask has to be called in the main ui thread so tried to debug the execution with Thread.currentThread().getId() calls through out the code. The thread Ids through out is 1 and then 10 for the doInBackground method for the AsyncTask. Now I'm not sure if 1 is the main UI thread or not. In the extened MapActivity class I have, the onCreate method's Thread.currentThread().getId() returns 1 but I'm not sure if the MapActivity class is executed in the main ui thread?</p><p><a href=""http://stackoverflow.com/questions/3606505/onpostexecute-not-called-after-completion-asynctask"">Here</a> Romain Guy mentions that the onPostExecute method should have @Override but when I do that eclipse flags it as an error </p><pre><code>""The method onPostExecute(Boolean...) of type TileCache.ImageLoadTask must override or implement a supertype method""</code></pre><p>So I guess something is wrong there but the only fix eclipse offers is to remove the @OverrideSo I guess with out post all my source code, the question's I have are:</p><ol><li>Is the MapActivity onCreate method called in the main ui thread?</li><li>What does the @Override error mean? or why does it show that error</li><li>Does anyone have an example of a custom tile overlay implementation with background image loading and tile caching? </li></ol><p>Thanks</p>","323694","","","","","2011-05-09 18:40:30","Android Threading - Custom Googlemaps Tile Overlay","<android><google-maps>","1","0","","",""
"4093114","1","","","2010-11-04 01:16:09","2","2051","<p>I am trying to write code that will allow the user to choose a picture from the pictures folder and send that picture to the internet. I am new to Android so any help would be much appreciated.</p><p>Thanks in advance.</p>","489655","","","","","2010-11-04 06:17:44","Allowing the User to choose a picture from the pictures folder","<android>","3","0","2","",""
"4093147","1","4093235","","2010-11-04 01:28:22","1","479","<p>I'm writing a simple database app on Android.  The main activity is just a list of products - a ListActivity using a CursorAdapter.  How is the best way to go about changing the order of the list (is sort by Price or ProductID or something).  I'm guessing I need to execute a new query to get a new cursor - or can I recycle things?</p>","48445","","","","","2010-11-04 02:22:21","Changing the order in a ListActivity","<android><cursor><listactivity>","2","0","","",""
"4093150","1","","","2010-11-04 01:28:50","30","21992","<p>I am trying to register a Broadcast Receiver that catches ""com.android.vending.INSTALL_REFERRER"" intents launched by Android after an app is installed from the Market.</p><p>I am following the details here: <a href=""http://code.google.com/mobile/analytics/docs/android/#referrals"">http://code.google.com/mobile/analytics/docs/android/#referrals</a></p><p>However, I cannot use Google Analytics so I have created my own solution. I have added the following to my manifest file:</p><pre><code>&lt;receiver android:name=""com.test.Receiver"" android:exported=""true""&gt;&lt;intent-filter&gt;    &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;&lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>and created a basic BroadcastReceiver class:</p><pre><code>public class Receiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    Bundle extras = intent.getExtras();    String referrerString = extras.getString(""referrer"");    Log.w(""TEST"", ""Referrer is: "" + referrerString);}</code></pre><p>}</p><p>However, when the app is installed the receiver doesn't seem to catch the Intent (if the Intent is even broadcast?) and I get no logging output.</p><p>Am I going wrong somewhere or is the Market no longer launching these Intents when an app is installed?</p>","496670","","","","","2013-11-19 12:45:15","Get referrer after installing app from Android Market","<android><install><google-play><referrer>","6","2","11","",""
"4093281","1","4093349","","2010-11-04 02:00:55","1","228","<p>Hey all, I am developing droid apps with eclipse (new to both) and have a basic Layout question.</p><p>When using the layout tab (rather than the coding tab) in my main.xml, I am trying to create a home screen for when my app opens.</p><p>There is going to be the logo at the top center, then 3 simple buttons below, all centered.</p><p>How do I go about formatting the Logo so it maintains a size relative to the person's screen size, and stays in the center?</p><p>I don't want to write sloppy code to where my program looks fine (UI wise) on my screen and is poorly formatted on other's screens.</p><p>Also, is there good documentation explaining all of the Property values in the layout view?</p><p>Thanks!</p>","496686","","","","","2010-11-04 02:13:43","Basic beginner program development question:","<android><eclipse><gui>","1","0","","",""
"4093321","1","4102310","","2010-11-04 02:09:06","0","585","<p>I have a ListView that I'm populating with names and images (if one exists) for each contact on my phone.  This works fine when the app initially loads, but once I start to scroll through the ListView the images that were originally correct disappear.  The only thing I can think of is that the resources are used and then destroyed once they scroll off the screen, but I am not having any luck finding out how to keep them around.</p><p>I'm looping through all of my contacts and storing the name and using ContactsContract.Contacts.openContactPhotoInputStream(context.getContentResolver(), photoUri); to retrieve an InputStream of the contact's image.  Then, in my custom ArrayAdapter, I am using Drawable.createFromStream() to set the image for the ImageView of my ListView item.</p><p>Thanks!</p><p>Edit:As requested, here is my getView method</p><pre><code>public View getView(int position, View convertView, ViewGroup parent){    LinearLayout contact_view;    //Get the current alert object    ContactInfo contact = getItem(position);    //Inflate the view    if(convertView==null)    {        contact_view = new LinearLayout(getContext());        String inflater = Context.LAYOUT_INFLATER_SERVICE;        LayoutInflater vi;        vi = (LayoutInflater)getContext().getSystemService(inflater);        vi.inflate(resource, contact_view, true);    }    else    {        contact_view = (LinearLayout) convertView;    }    //Get the fields to populate from the listitem.xml file    TextView contact_name = (TextView)contact_view.findViewById(R.id.contact_name);    ImageView contact_image =(ImageView)contact_view.findViewById(R.id.contact_image);    //Assign the appropriate data from our alert object above    contact_name.setText(contact.get_name());    if(contact.get_contact_image() != null) {        contact_image.setImageDrawable(Drawable.createFromStream(contact.get_contact_image(), ""src""));    } else {        contact_image.setImageResource(R.drawable.dummy_image);    }    return contact_view;}</code></pre>","460105","","460105","","2010-11-04 02:42:03","2010-11-04 23:23:49","Android ListView Vanishing Images","<android><image><listview><android-2.2-froyo>","1","1","","",""
"4093323","1","4093512","","2010-11-04 02:09:22","0","2043","<p>I can't use <code>getIntent()</code>..</p><p>What else do I need to use <code>getIntent()</code>, What I want to do, is retrieve data from the parent activity. and I have put some values, </p><p>Do I need to declare Intent? </p><pre><code>getIntent.getExtras().getString(""CallerClass"");</code></pre>","371301","","68805","","2011-12-06 11:10:52","2011-12-06 11:10:52","Android: Can't use getIntent","<android><activity><android-intent>","2","0","","2013-03-12 22:58:31",""
"4093399","1","","","2010-11-04 02:24:54","0","1587","<p>How can I center the map on my current location overlay.I have <strong>enableMyLocation()</strong>; and there is a blue dot. <strong>How can I center on the blue dot?</strong></p><p>The reason is that it takes a while to get GPS location from the Location Manager. So I have the blue location dot already displayed but still cannot move the map to my location. Right now it's tied to the GPS/location manager. </p>","114446","","","","","2012-10-01 13:57:06","Center map using MyLocationOverlay","<android><google-maps>","2","0","","",""
"4093438","1","","","2010-11-04 02:34:55","1","1452","<ul><li>Please give me some keyworkds to toggle between 2g and 3g in Android by code.</li><li>If you have code snippets. Please give me.</li><li>Thanks for all<ul><li>Nguyen Dai Son</li></ul></li></ul>","434538","","434538","","2010-11-05 01:50:21","2010-11-05 01:50:21","How to toggle between 2g and 3g in Android","<android><3g>","1","0","","",""
"4093514","1","","","2010-11-04 02:54:05","1","156","<p>I've set up proguard according to this link: <a href=""http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html"" rel=""nofollow"">http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html</a></p><p>When I build with Ant I get no errors or warnings, but I also don't get any verbose output telling me that ProGuard is doing anything. By other means I'm able to tell that the apk is not being obfuscated. </p><p>All of my code, with the exception of the Activity class is in a library (as source files). I've read that the activity class will not obfuscated, but I'm wondering if I have to set up something different in my build files to include the library files?</p>","495330","","","","","2011-09-04 20:31:00","Proguard is not Doing Anything","<android>","2","1","","",""
"4093618","1","4104744","","2010-11-04 03:19:42","4","11848","<p>I have a problem. I want to use the facebook api and make a post to my wall without calling a dialog. Basically I have an app and I want people to be able to share the app, so I want to have a specific message to post. I keep getting a response of ""Method not implemented"". Heres the code for the post.</p><pre><code>//I tried this also -&gt;&gt;String path = ""http://graph.facebook.com/me/feed"";String path = ""https://api.facebook.com/method/stream.publish"";Bundle b = new Bundle();//And i tried this -&gt; b.putString(""access_token"",facebook.getAccessToken());b.putString(""message"", ""this is just a test..."");try {    String ret = facebook.request(path, b);    Toast.makeText(fmasterActivity.this, ret, Toast.LENGTH_LONG).show();    } catch (MalformedURLException e) {    // TODO Auto-generated catch block    e.printStackTrace();    } catch (IOException e) {    // TODO Auto-generated catch block    e.printStackTrace();    }</code></pre>","222054","","","","","2011-03-25 13:59:36","android facebook api post","<android><facebook><post>","1","0","5","",""
"4093623","1","","","2010-11-04 03:20:20","0","2260","<p>I am new to android developed. however,</p><ul><li>got installed htc evo 4G drivers successfully (can see in device manager)</li></ul><p>But </p><p>I cannot see that device in android sdk target option (in eclipse)</p><p>can someone help me in that please</p><p>regards</p>","496739","","21234","","2011-06-27 18:25:26","2012-07-12 15:26:40","cannot see that device in android sdk target option (in eclipse)","<android>","2","1","","",""
"4093640","1","4094772","","2010-11-04 03:23:00","1","484","<p>Is there a standard way to add a <strong>footer</strong> to a <strong>context menu</strong>, in which I can add a <strong>checkbox</strong> to make the selected option the default one?Similar to the context menu that comes up when choosing the default home screen for example.</p><p><img src=""http://i.stack.imgur.com/B2wvC.png"" alt=""alt text""></p><p>From the Api docs for ContextMenu I see that you can set a header view, but not a footer view. Also the <code>setCheckable</code> / <code>setGroupCheckable</code> methods don't seem to help much here.</p><p>Does this need to be done via a custom (alert) dialog? I would be wondering if nobody has yet developed such a component yet in case it's not possible through the standard SDK api. Any standalone open source component out there (beside the Android source itself)?</p>","241475","","241475","","2010-11-04 05:36:51","2010-11-04 08:00:40","ContextMenu with footer view (to add checkbox for 'make default' option)","<android><contextmenu>","1","0","2","",""
"4093744","1","4642101","","2010-11-04 03:44:54","1","1754","<p>I have looked into the MediaPlayer documentation for Android, but this seems to be primarily for playing media in a localized media player.  I just want to be able to tell if music is playing in Android default Media Player.</p><p>Thanks</p>","323482","","","","","2011-01-09 21:55:04","Is there a way to tell if the Android MediaPlayer is currently playing a song?","<android>","2","1","1","",""
"4093906","1","","","2010-11-04 04:29:26","1","1317","<p>I'm trying to build an activity that has a checkbox on top, a button at the bottom, and a bunch of other widgets scrolling in between.  Conceptually that's<br>LinearLayout<br> CheckBox<br> ScrollView<br>  LinearLayout<br>   [stuff]<br>  LinearLayout-end<br> ScrollView-end<br> Button<br>LinearLayout-end<br></p><p>When it renders I get the checkbox at the top, the stuff scrolling nicely underneath, but the Button drawn offscreen (I assume) below the ScrollView.  The only way I can get the Button to be visible is to hard-code the height of the ScrollView, which of course only works on one screen-size.  I've tried all combinations of gravity and layout_weight I can think of to no avail.  Am I using the right combination of Views?  Anybody managed to get this working?</p><p>(I don't think RelativeLayout is quite the right container for this, but regardless I hope to avoid it since it's broken on 1.5.)</p><p>Thanks,</p><p>--Eric</p>","496795","","21234","","2010-11-05 15:10:04","2013-01-12 16:02:24","scrollview inside linearlayout forces buttons offscreen","<android><layout>","2","0","2","",""
"4094030","1","4094091","","2010-11-04 05:04:23","0","659","<p>My first page contains 3 tabs. I want to retain all these 3 tabs through out my entire application. That means I want to see these 3 tabs in every view. For example : I have 3 views. First view is Main.class. It contains 3 tabs (Home tab, Favourite tab, settings tab). When I am clicking any one tab (Ex: Home Tab), it shows the contents of Home.class (a ListView) below these tabs. But when I am clicking the ListView view , it will go to another activity(SubListView.class), and I can't see the tabs in that activity. Only contents of that view will be displayed there. How can I show these header tabs in that view also?</p><p>Main View: (in Main.class)</p><pre><code>   final TabHost tabHost = getTabHost();    Intent intent;    LayoutInflater.from(this).inflate(R.layout.main, tabHost.getTabContentView(),true);    tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""Home"",getResources().getDrawable(R.drawable.img_home)).setContent(new Intent(this, Home.class)));    tabHost.addTab(tabHost.newTabSpec(""tab2"").setIndicator(""Favourites"",getResources().getDrawable(R.drawable.img_fav)).setContent(new Intent(this, Favourites.class)));    tabHost.addTab(tabHost.newTabSpec(""tab3"").setIndicator(""Settings"",getResources().getDrawable(R.drawable.img_set)).setContent(new Intent(this, Settings.class)));    tabHost.setCurrentTab(0); </code></pre><p>Home View: (in Home.class)</p><pre><code> public ArrayAdapter&lt;String&gt; adapter;          final ArrayList&lt;String&gt; results = new ArrayList&lt;String&gt;();  ListView listitems=(ListView)findViewById(R.id.list);  adapter=new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,results);  listitems.setAdapter(adapter);  listitems.setOnItemClickListener(new AdapterView.OnItemClickListener()  {        //@Override           public void onItemClick(AdapterView arg0, View view, int position, long id)        {                                                                       categoryNameFromList=results.get(position);                Bundle category_bundle = new Bundle();                category_bundle.putString(""selected_item"",categoryNameFromList);                 Intent category_intent = new Intent(view.getContext(), SubListView.class);                category_intent.putExtras(category_bundle);                startActivityForResult(category_intent, 1);        }  });   </code></pre><p>SubList View (in SubListView.class)</p><pre><code> TextView txtmessage=new TextView(this);  txtmessage.setTex(""WELOCME TO SUB LIST VIEW!!"");  setContentView(txtmessage); </code></pre><p>Please help me.. Thanking you in advance..</p>","453607","","453607","","2010-11-04 05:09:50","2010-11-04 06:07:11","Tabs in every activity in android","<android>","1","0","","",""
"4094065","1","4094937","","2010-11-04 05:12:48","0","248","<p>I am on my first Android application and I am on a timeline so details and examples will be useful since my knowledge is still minimal.</p><p>I want my first screen to present the user with a list of activities to choose from. In my situation it is a recipe app where the user first chooses the type of food, such as, Beef, Chicken, or Pork. I want the application to launch an activity depending on the list item that the user clicked on.</p><p>I am not sure if I should use a list view, a text view, a scroll view, a list activity, an activity group... I need help please.</p><p>Thank you in advance!</p>","484707","","","","","2010-11-04 08:35:44","Whats the best way to present a list to a user where each item on the list starts an Activity when selected?","<android><list><activity><android-intent>","1","1","","",""
"4094097","1","","","2010-11-04 05:22:29","1","514","<p>I am New to android, My task is to playing a small audio file when we touch an image?</p>","486291","","73488","","2010-11-04 05:33:29","2010-11-04 05:49:58","how can i play small music file when i tuch an image in android?","<android>","2","1","","",""
"4094103","1","4458364","","2010-11-04 05:24:32","1","1571","<p>Excuse the simplicity of this request - but is there a way for me to link onClick commands for buttons through the Layout rather than code. I am trying to create a simple app and I want to be able to make buttons and have clicks go from one ""page"" to the other.</p><p>Is there a site that might overview how to use the UI to code for droid?</p><p>Thanks!</p>","496686","","21234","","2010-11-04 15:19:44","2012-04-27 06:09:30","Linking xml pages with layout","<android><gui><layout>","2","0","1","",""
"4094109","1","4094421","","2010-11-04 05:26:13","10","10029","<p>I have search Android docs and for some insane reason I am not able to find the list of all available intent filters.</p><p>I am finding an intent filter, which would do something like , notifying me through Broadcast Receiver that a particular Activity (example browser, or email ) has been started or in foreground. Can anyone help me with that .</p>","435597","","","","","2013-05-15 07:21:03","Android -- How to I get a list of all available intent filters?","<android><documentation><activity><broadcastreceiver><intentfilter>","7","0","4","",""
"4094124","1","8588270","","2010-11-04 05:30:45","4","988","<p>I'm working on an app which allows users to view images, so I'm sending an intent to let the Gallery display the image. For some reason, it takes several seconds to display the image. LogCat shows it trying to connect to ""GoogleLoginService""? Why does gallery connect to the internet? Can this be turned off on the phone or in code?</p><pre><code>I/CacheService(19326): Preparing DiskCache for all thumbnails.I/CacheService(19326): DiskCache ready for all thumbnails.I/ActivityManager( 1433): Starting activity: Intent { act=android.intent.action.VIEW     dat=file:///mnt/sdcard/x/attachments/68efeba8-7f0c-47bf-b7d7-d714f29f99c7.jpg typ=image/* cmp=com.cooliris.media/.Gallery }I/Gallery (19326): onCreateD/GoogleLoginService( 1601): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }I/RenderView(19326): First DrawD/GoogleLoginService( 1601): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }I/ActivityManager( 1433): Displayed activity com.cooliris.media/.Gallery: 477 ms (total 477 ms)D/GoogleLoginService( 1601): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }I/GridLayer(19326): Slot changing from -1 to -1</code></pre>","145279","","","","","2011-12-21 10:20:57","Why is Gallery So Slow / Accessing GoogleLoginService?","<android><login><internet><gallery>","1","1","3","",""
"4094125","1","4095292","","2010-11-04 05:31:11","1","421","<p>I am trying to install Android on Beagleboard (TI's OMAP35x chip). They have provided toolchain to build the OS and port it on the chip. Now the next question is developing Android apps. I am interested in knowing about the Java SDK for android. So can I use the standard SDK provided by google, so far I cannot find any SDK provided by TI for Java.</p><p>Putting it in simple terms, will an application developed on standard Android SDK work on beagleboard.</p>","441632","","110028","","2011-01-01 12:25:29","2011-01-01 12:25:29","Android SDK over cross platform","<java><android><arm><cross-compiling><beagleboard>","2","0","","",""
"4094276","1","","","2010-11-04 06:07:52","0","1039","<p>My entire game slows down when returning from another app in the emulator (ie pressing the phone button, then back). frame rate drops by half - which turns it into sludge.</p><p>Everything is still there, apart from the thread which I kill when the (only) view is surfaceDestroyed (after calling join repeatedly, as with the lander sample.). I make a new thread and attach it - and the game runs, after a fashion. </p><pre><code>     if (_thread.getState() == Thread.State.TERMINATED)      {      _thread = null;   _thread = new TutorialThread(getHolder(), this);   _thread.setRunning(true);   _thread.start();  }  else   {   _thread.setRunning(true);   _thread.start();  }</code></pre><p>This was after some headbanging and searching on this forum and the game crashing when returning. All the big objects in the game (bitmaps, sound etc) are in the main activity so they don't need to be destroyed or recreated I hope. Music is paused onPause and restarted onResume. It all works much more smoothly on a real phone (htc desire) but I'm worried this behaviour is something to do with 1.6 (which the emulator runs for broad compatibility) or something has been left dangling. </p><p>LOGCAT - Lots of SurfaceFlinger messages do turn up (write blocked for n ms) SurfaceFlinger (""executeScheduledBroadcasts skipped, contention on the client"") and SurfaceComposerClient whinges about ""lock_layer"" timing out.</p><p>Also, running and jumping back to the home page then running the app (several times) on both the htc and the emulator will eventually cause the app to crash, but with no red issues turning up in Logcat. I'm baffled - any help much appreciated. </p><p>Cheers,Robin. </p>","496848","","","","","2011-03-18 14:03:29","Returning to a surfaceview after onResume kills performance","<android>","1","0","","",""
"4094298","1","","","2010-11-04 06:11:38","0","655","<p>How to pass parameter value to webservice in android</p>","496850","","","","","2010-11-04 08:21:44","passing parameter","<android>","2","0","","",""
"4094361","1","","","2010-11-04 06:27:28","3","1105","<p>I want to communicate with android RIL daemon with my daemon directly.</p><p>Could you tell me how to do it without using telephony layer.</p><p>Best regards.</p>","368916","","1448363","","2013-07-10 08:25:29","2013-07-10 08:25:29","How to communicated with android ril deamon directly","<android><android-source><ril>","1","0","1","",""
"4094402","1","4094523","","2010-11-04 06:34:28","1","4523","<p>I have a class named dot and many instances of this same class are created when the app runs. Problem is I need to be able to click on one of the instances of this class and have the clicked instance only change colors.</p><p>The problem is whenever I click on one of the dot instances, all of them change color instead of just the one I clicked.</p><p>Here's the code:</p><pre><code>    package com.ewebapps;import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.view.MotionEvent;import android.view.View;public class Dot extends View {     private final float x;     private final float y;     private final int r;     private final Paint mBlack = new Paint(Paint.ANTI_ALIAS_FLAG);     private final Paint mWhite = new Paint(Paint.ANTI_ALIAS_FLAG);     private final Paint mGreen = new Paint(Paint.ANTI_ALIAS_FLAG);     private boolean touched;     public Dot(Context context, float x, float y, int r) {         super(context);         mBlack.setColor(0xFF000000); //Black         mWhite.setColor(0xFFFFFFFF); //White         mGreen.setColor(0xFF00FF00); //Green         this.x = x;         this.y = y;         this.r = r;     }     @Override  public boolean dispatchTouchEvent(MotionEvent event) { // On touch.      touched = true;      //mPaint.setColor(0xFF00FF00); // Turn dot green.      this.invalidate();         return super.dispatchTouchEvent(event);     }     @Override     protected void onDraw(Canvas canvas) {         super.onDraw(canvas);         canvas.drawCircle(x, y, r+2, mWhite); //White stroke.         if(!touched)         {          canvas.drawCircle(x, y, r, mBlack); //Black circle.         }         else         {          canvas.drawCircle(x, y, r, mGreen); //Green circle.         }     }}</code></pre>","494151","","","","","2010-11-04 21:38:31","private dispatchTouchEvent?","<android><instance><private><public><ontouchevent>","1","0","","",""
"4094567","1","4094586","","2010-11-04 07:13:01","1","1160","<p>I have a class that extends AppWidgetProvider that provides the content for my widget. This is a clock widget so I want to make sure that buildUpdate() is invoked exactly on the minute, every minute. How can I add this functionality?</p>","431115","","759866","","2013-12-09 12:47:14","2013-12-09 12:47:14","Android clock widget: how do I invoke buildUpdate() every minute (a.k.a. synchronize with clock)?","<android><widget><clock>","1","0","","",""
"4094674","1","4095296","","2010-11-04 07:35:57","0","1710","<p>I would like to write to an Android screen as if it were a simple terminal. I want the output to appear at the time I write it. My application does some cpu intensive churning, writes a bit to the screen and continues. I am using a list adapter for the output. The problem is that the output is not displayed until the activity relinquishes.</p>","496890","","","","","2010-11-04 09:30:00","How to write to the screen and have the output appear before the activity relinquishes","<android><screen>","2","0","","",""
"4094694","1","4094728","","2010-11-04 07:37:59","0","405","<p>I have following queries.</p><ol><li><p>How can I display icon in Signal Area(what it is called?) ? Like default audio player when playback is on and u press HOME or BACK at last screen of audio player, Play icon is displayed in that areA? Kind of minimize application.</p></li><li><p>How to display shortcut of media player? the minimal version of media player in that area</p></li></ol>","465751","","","","","2010-11-04 09:01:48","Android how to display Icon in Signal icon area?","<android><gui>","2","0","1","",""
"4094726","1","","","2010-11-04 07:47:41","0","126","<p>As far as I know, there is no way to control over the activities occurring in an app in android phones unless the application that you want to log/monitor is written by you.</p><p>I wonder is it really like that or is there any possible way to do this? For example, is it possible to control over emails which, let's say, who I sent an email to in an android phone?</p>","26379","","","","","2010-11-04 23:50:27","Control over app activities in android","<android>","2","0","","",""
"4094758","1","","","2010-11-04 07:55:21","0","1290","<p>Please, Help me...</p><pre><code>public class TestActivity extends PreferenceActivity {/********/            mTestPref = findPreference(""test_preference"");            mTestPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {       @Override       public boolean onPreferenceClick(Preference preference) {        // TODO Auto-generated method stub        String Message = mMessagePref.getSummary().toString();        MainActivity main = new MainActivity();        main.execute(Message);        return true;       }     });    }    public class MainActivity extends Activity {    /************/     public void execute(String message) {      Toast.makeText(getBaseContext(), message, Toast.LENGTH_SHORT).show(); // NullPointerExcepiton     }    }11-04 16:50:12.317: ERROR/AndroidRuntime(19524): Uncaught handler: thread main exiting due to uncaught exception11-04 16:50:12.356: ERROR/AndroidRuntime(19524): java.lang.NullPointerException11-04 16:50:12.356: ERROR/AndroidRuntime(19524):     at android.widget.Toast.&lt;init&gt;(Toast.java:89)</code></pre>","493363","","345717","","2010-11-04 08:02:10","2010-11-05 00:08:18","NullPointerException... Why?","<java><android><nullpointerexception>","3","4","","",""
"4094950","1","4094969","","2010-11-04 08:37:34","0","1257","<p>I am getting the dynamic value from web server like article desc, date,title etc .for one value article id,desc display in one webview. I am using array of webview .my requirment is if user click the first webview .I have to pass first article id to another activity .can anybody tell how to pass array value in antoher activity can anybody give example? </p><p>this code explain I am getting the value from webservice and stored in arraylist and iterate the array list and display in webview and implement in touch event.my requirment is if user touch the first view .I have to pass first article id to another activity can anybody tell how to do?</p><pre><code>ArrayList articleParsedValue=new ArrayList();articleParsedValue=articleParser.parseXmlArticle(webservicevalue</code></pre><p>);</p><pre><code>for(int i=0;i&lt;articleParsedValue.size();i++)        {                ArticleDataSet articleDataset=(ArticleDataSet)articleParsedValue.get(i);                HashMap&lt;String, String&gt; mapValue=new HashMap&lt;String, String&gt;();              WebView webviewcontent=new WebView(this);           String html =""&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;label style=\""font:bold 17.5px verdana; color:#C1002B\""&gt;""+articleDataset.getArticle_title()+""&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+""|""+""&lt;/label&gt;""+""&lt;label style=\""font:bold 13px verdana; color:#000000\""&gt;""+articleDataset.getArticle_type()+""&lt;/label&gt;&lt;br&gt;&lt;label style=\""font:13px verdana; color:#AAAAAA\""&gt;""+articleDataset.getArticle_date()+"" &lt;/label&gt; &lt;/div&gt;"";           html=html+""&lt;div&gt;&lt;label style=\""font:13px verdana; color:#000000\""&gt;""+articleDataset.getArticle_summary()+""&lt;/label&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;"" ;           webviewcontent.getSettings().setJavaScriptEnabled(true);           webviewcontent.clearCache(true);           webviewcontent.loadData(html, ""text/html"", ""utf-8"");          webviewcontent.setOnTouchListener(this);             mainlinear2.addView(webviewcontent);        }@Overridepublic boolean onTouch(View v, MotionEvent event) {    // TODO Auto-generated method stub    {            Intent newIntent=new Intent(this,MyCompaniesActivity.class);            //newIntent.putExtra(""articleid"", );             startActivity(newIntent);            return false;        }</code></pre>","426344","","","","","2010-11-04 08:41:40","how to pass array of value to another activity in android","<android>","2","0","","",""
"4094960","1","","","2010-11-04 08:38:42","0","1607","<p>I'm little bit fed up with the device back button functionality.</p><p>I have two activities. From 1st I go to 2nd and display one item through array in <code>ListView</code> and when I presses the back button i came back to 1st activity.</p><p>when I again go to 2nd activity to display the item once again it showing me the previous items at 1st row and then the same item in the second row as well.</p><p>Means it is not removing the previous item when i presses the back button.</p><p>I have used:</p><pre><code> public void onBackPressed ()  {      for(int i=0; i&lt;sub_categories.length;i++)      {          sub_categories[i]="""";      }      Log.d(this.getClass().getName(), ""*****************back button pressed"");  }</code></pre>","383597","","119895","","2010-11-04 10:40:53","2010-11-04 11:51:17","Android Back Button functionality","<android>","3","1","","",""
"4095059","1","4095310","","2010-11-04 08:54:40","2","3548","<p>I used this tutorial <a href=""http://mobiforge.com/developing/story/using-google-maps-android"" rel=""nofollow"">http://mobiforge.com/developing/story/using-google-maps-android</a> to display Map view and set onTouch event to display a toast message (latitude/longitude) when I click on a particular area. Now my problem is that the Toast message is displayed the moment I touch the screen even if it is to move the map? I want to display the toast only if the touch down point and touch up point are the same. How do I implement that?</p>","481239","","481239","","2010-11-04 09:00:56","2011-08-02 07:20:49","Android: How to make onTouch work like onClick?","<android><map><ontouchevent>","3","0","0","",""
"4095190","1","5456665","","2010-11-04 09:14:59","1","1114","<p>I have some experience with the <code>SurfaceView</code>. To prevent unneeded redrawing, I always use a countdown variable which tells the thread how often the view should be drawn.</p><pre><code>countdown &gt; 0 : draw ? doNothing</code></pre><p>However I was thinking about changing that to use a ""push surface"". So just push a buffer to the surface and show that instead of setting a countdown variable everywhere in my project.</p><p>My problem is that I can't find a good tutorial/resource where the usage is described. Currently I have something like this:</p><pre><code>// panel is the SurfaceViewc = panel.getHolder().lockCanvas(null);synchronized (panel.getHolder()) {    panel.updatePhysics();    panel.onDraw(c);}panel.getHolder().unlockCanvasAndPost(c);</code></pre><p>I have no idea on how to get the canvas to draw on when I can't use <code>lockCanvas()</code> as mentioned in the documentation.</p>","180538","","","","","2011-03-28 08:56:49","SurfaceView of type PUSH_BUFFERS","<android><drawing><surfaceview><surfaceholder>","1","0","","",""
"4095266","1","","","2010-11-04 09:25:17","0","270","<p>Hi I have a layout that contains</p><ul><li>a gallery</li><li>a textview with .setEllipsize(TruncateAt.MARQUEE);</li></ul><p>They do not overlap. Whenever the Marquee ist activated the gallery does not move smoothly and starts to stutter. What is the reason for this and how to fix this?</p><p>Thanks</p>","472355","","","","","2011-04-30 03:54:52","Using Gallery beside marquee text","<android>","1","1","","",""
"4095309","1","","","2010-11-04 09:31:11","5","20633","<p>I want to write a Query to delete a row from the table. I am confused of writing the statement. I need some help in writing this. I am providing my requirement here with plain sql statement. </p><p><code>delete from tablename where value ==""string1"" &amp;&amp; value2 == ""string2"" &amp;&amp; value3 == ""string3"";</code></p><p>I want to write this in the Sqlite syntax for android ""db.delete(tablename, whereclause, whereargs);"". I would be thankful for your help.</p><p>Thanks,</p><p>Baluk</p>","496994","","","","","2013-12-18 09:10:53","Sqlite Delete Query syntax in Android","<android><sqlite>","3","0","1","",""
"4095390","1","4097553","","2010-11-04 09:42:33","2","3945","<p>I am looking for a lightweight cross platform GUI library for different signal-processing applications. An ANSI-C program must be statically linked with it and the size matters. A finished application must have the same look on any platform like iPad, iPhone, Android, Ubuntu, Leopard, Windows, etc.</p><p>Qt is not appropriate, because it is C++, too big, and doesn't work on iOS devices. I lean toward OpenGL-based GUI library, because OpenGL is supported by every modern target platform and an OpenGL application will have the same look and feel on every device. </p><p>Preferably, such GUI must support forms definitions using the declarative semantics, e.g. from C strings or from external textual files.</p>","215571","","44729","","2010-11-04 14:30:10","2012-09-23 18:21:00","Lightweight cross platform C GUI (OpenGL)","<android><c><gui><ios><opengl-es>","5","4","4","",""
"4095654","1","4095806","","2010-11-04 10:20:11","0","1765","<p>I am trying to set an ImageView's background every x seconds.The used Drawables are downloaded from a server, placed in a Vector and when they all have been downloaded I am starting a Timer and a TimerTask which simply has to set an ImageView in an Activity's Layout.</p><p>The problem is that I am getting a :android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p><p>I am guessing here thats because of the TimerTask, even though it simply calls a method from the original Activity which in turn sets the ImageView from the local Vector.</p><p>This exception isn't thrown every time though, but the times it does go through the ImageView won't show the Image, unless I force a refresh by clicking the device's ""home"" button and resuming the app... I have tried to force an update/refresh of the ImageView itself by calling forceLayout() and requestLayout() but that won't do anything :(</p><p>So any idea's how to solve these issues ? Should I implement like a Hnadler within the Timer/TimerTask ? Is that even possible ? Will it refresh my ImageView correctly ?</p>","162147","","","","","2010-11-04 10:45:00","TimerTask and ImageView.setBackgroundDrawable a no-go?","<android><timer><imageview>","1","0","","",""
"4095758","1","","","2010-11-04 10:32:58","6","10297","<p>can i change color of button in alert dialog when touch in that button in android. How?Thanks for your help!</p>","487481","","","","","2014-04-04 06:30:39","change color of button in alert dialog (ANDROID)","<android><button><colors><dialog><alert>","5","0","3","",""
"4095827","1","4098433","","2010-11-04 10:41:47","-1","140","<p>How to do this? <img src=""http://i.stack.imgur.com/GALzq.png"" alt=""alt text""></p>","472537","","","","","2010-11-04 15:45:44","Android how to do usa today like News picture scroller?","<android><scroll><news>","1","2","","2012-08-20 15:26:48",""
"4095850","1","4123669","","2010-11-04 10:45:05","0","1355","<p>I have written some code for autocompletetextview in custom dialog box.When typing some text that text dynamically search into the hashmap.This hashmap is with large lines of text.It works.But slowly giving me result.</p><pre><code>AutoCompleteTextView searchText = (AutoCompleteTextView)searchDialog.findViewById(R.id.searchText);    if(searchText.getText()!=null){    //                  searchString = searchText.getText().toString().trim();                    String[] autoList = getAutoCompletWords(searchText.getText().toString().trim());                    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(ctx,android.R.layout.simple_dropdown_item_1line,autoList);                    searchText.setAdapter(adapter);                    }private String[] getAutoCompletWords(String text){        Set&lt;String&gt; wordsSet = new TreeSet&lt;String&gt;();        Pattern wordPattern = Pattern.compile(""\\b""+text+""\\w+"",Pattern.CASE_INSENSITIVE);        Matcher matcher = wordPattern.matcher(bookContentMap.values().toString());        while(matcher.find()){            wordsSet.add(matcher.group());        }        String[] wordsArray = wordsSet.toArray(new String[0]);        return wordsArray;    }</code></pre><p>If I take thread for above code it is giving me thread handler exception.Please give me an idea for quick response of list on autocomplettext.</p><p>Rajendar Are</p>","486216","","610090","","2011-09-23 14:19:27","2011-09-23 14:19:27","dynamic autocomplete textview displayes slowly,how to display faster?","<android>","1","0","","",""
"4095860","1","","","2010-11-04 10:46:47","1","999","<p>I am working on an android app. Where i need to parse some plist files from assets folder. I do understand how to use assets in android but now problem is that file sizes are more than 1MB and so android gives error Data Exceeds UNCOMPRESS_DATA_MAX (2183588 vs 1048576)</p><p>Would any one tell me that how to access such larger files from assets?Also I cant reduce a file into small buffers because i am just sending it to ""DocumentBuilder.parse(in)"" as a whole so can not use buffer. The error is on line: <code>Document doc = db.parse(in);</code>.</p>","497069","","","","","2010-11-04 11:58:40","How to access larger files (more than 1 mb plist files ) from assets folder","<android><file><assets>","0","1","1","",""
"4095893","1","4393622","","2010-11-04 10:50:33","7","12594","<p>I would like to be able to use the facebook android sdk and post a link to facebook. An example of what I want would be is if you were on facebook and you type a link into your status part, like ""http://www.google.com"". When you do this a box pops up and your post ends up being a block that has an image and a link. I found documentation in the facebook api for this using an attatchment, though when I try to do this with the android facebook api it doesn't seem to work. I've looked for hours on the net, with no luck. Thanks.</p>","222054","","","","","2012-09-24 17:22:27","android facebook api post to wall with image","<android><facebook><api>","2","3","6","",""
"4096014","1","4096077","","2010-11-04 11:08:52","1","1474","<p>Is there a way to get the Timezone given the name of a Country? I use <code>getCountryName()</code> in Maps to get the name of the Country.</p>","481239","","","","","2010-11-04 11:17:08","Android: Is there a way to get timezone for Country name?","<android><timezone><maps>","1","0","","",""
"4096142","1","","","2010-11-04 11:26:27","1","5778","<p>I have been starting out in the world of Android development recently and I am working on an application which shows a map using the Google API SDK, it is pretty much the original example but edited a little bit. It works a treat but I wish to do more with it. My question is:</p><p>How do you add a KML layer to this? I've not found many examples out there and none of them are very clear. I know how to do this with Javascript on websites but not in android.</p><p>Can anyone help?</p>","497097","","213269","","2010-12-11 13:22:41","2014-04-03 02:42:24","Adding a KML layer to an Android maps application","<android><google-maps><android-mapview><kml>","1","0","","",""
"4096166","1","4127126","","2010-11-04 11:28:41","0","157","<p><img src=""http://i.stack.imgur.com/TyJYx.png"" alt=""alt text""></p>","478535","","","","","2010-11-08 19:12:30","How to make the following type of listview in which every row is different","<android><listview>","2","2","1","",""
"4096169","1","","","2010-11-04 11:29:05","53","70691","<p>I'm trying to save and restore the state of an <code>Activity</code> using the methods <code>onSaveInstanceState()</code> and <code>onRestoreInstanceState()</code>.</p><p>The problem is that it never enters the <code>onRestoreInstanceState()</code> method. Can anyone explain to me why this is?</p>","377730","","1300995","","2012-10-01 12:14:50","2014-02-22 00:26:58","onSaveInstanceState () and onRestoreInstanceState ()","<android><activity><states>","6","3","29","",""
"4096273","1","","","2010-11-04 11:41:50","46","16592","<p>I just wonder what are the different between two of them for streaming video?</p><p>I know <code>VideoView</code> can be used for streaming and what is for <code>Mediaplayer</code>? so far as I know is <code>MediaPlayer</code> can do the same thing as <code>VideoView</code> right?</p><p>Can anyone give me the answer?</p><p>And if I want to streaming video from the server by using RTSP to Android, what should I start up with? <code>VideoView</code> or <code>MediaPlayer</code>?</p><p>Any suggestion?</p>","492708","","56285","","2014-01-27 22:16:36","2014-01-27 22:16:36","What are the difference between MediaPlayer and VideoView for Android","<android><streaming><android-mediaplayer><videoview>","4","2","10","",""
"4096356","1","4102302","","2010-11-04 11:53:21","1","249","<p>I can't figure out why I need to do to get my views in a TableLayout to align perfectly.</p><p>I have a layout similar to this:</p><pre><code>&lt;TableLayout android:id=""@+id/keyboard""     android:layout_width=""fill_parent""     android:layout_height=""378px""&gt;    &lt;TableRow android:layout_span=""5"" &gt;      &lt;TextView android:id=""@+id/button20""          android:layout_width=""63px""          android:layout_height=""42px""          android:textSize=""10""          android:text=""L1"" /&gt;      &lt;TextView android:id=""@+id/button21""          android:layout_width=""63px""          android:layout_height=""42px""          android:textSize=""12""          android:text=""L2"" /&gt;      &lt;TextView android:id=""@+id/button22""          android:layout_width=""63px""          android:layout_height=""42px""          android:textSize=""12""          android:text=""L3"" /&gt;      &lt;TextView android:id=""@+id/button23""          android:layout_width=""63px""          android:layout_height=""42px""          android:textSize=""12""          android:text=""L4"" /&gt;      &lt;TextView android:id=""@+id/button24""          android:layout_width=""63px""          android:layout_height=""42px""          android:textSize=""12""          android:text=""L5"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>Now, when drawn, the first TextView is displayed 2 pixels <strong>lower</strong> than all the other ones.Overriding the onLayout method ; I see that onLayout is being called for the first View with:top = 2 ; bottom = 44 ; while all the other ones are top = 0 ; bottom = 42.</p><p>This happens whenever the font size is slightly different than the others ; or if the text wrap on another line (because it doesn't fit within the width).All TextViews have the same dimensions ; but some are displayed slightly lower than the other.</p><p>This layout is within a RelativeLayout if that makes a difference.</p><p>I tried a lot of different combination, and there's always some discrepancies happening.Any help will be greatly appreciated.</p><p>Thanks !JY</p>","298699","","69742","","2010-11-04 23:23:12","2010-11-04 23:23:12","Why aren't those views aligned?","<java><android><xml><tablelayout>","1","0","","",""
"4096386","1","4105094","","2010-11-04 11:57:38","0","188","<p>I want to send back my activity to starting one. Let me explain you.I am using Main activity having 4 tabs, and each tabs has his own activity. Each activity in has more activities in it. Problem starts when I click on 1st activity in my 1st tab. The next activity is independent. I create an intent of my next activity. In such case to prevent draw my tab-bar layout in that new activity. I use my existing activity layout, remove all the view in it. Then i put new activity in it. </p><p>e.g..        contentViewLayout.removeAllViews();        View view = activityManager.startActivity(id, intent).getDecorView();        contentViewLayout.addView(view, contentViewLayoutParams);</p><p><strong>Its done. But problem arise when device BACK button pressed. Because new activity is starting in existing activity. So when back button pressed , then it quite to main activity and application close. I want to do that in such a case ""new activity"" should be terminate and existing activity must start again. And then if again BACK button pressed then it should terminate main activity.I override the onKeyDown() down method as follow but it. dose not working properly?</strong></p><p>In my new activity.</p><p>public boolean onKeyDown(int keyCode, KeyEvent event) {</p><pre><code>    if(keyCode == KeyEvent.KEYCODE_BACK){            childActivity = null;            contentViewLayout.removeAllViews();                            mainActivity = new Intent(this,MainActivity.class);                            View view = activityManager.startActivity(id, intent).getDecorView();                             contentViewLayout.addView(view, contentViewLayoutParams);            return false;    }else{        return super.onKeyDown(keyCode, event);    }}</code></pre><p><strong>But it always quite the application instead of closing child activity</strong></p>","486139","","486139","","2010-11-04 12:03:49","2010-12-10 09:27:42","Why my activites are not performing my overiden back button event?","<android><layout><activity>","2","0","","",""
"4096592","1","4096674","","2010-11-04 12:24:12","0","504","<p>I want to take the input from a standard, off the shelf, IP based webcam - which, has yet to be decided, so the API is not yet clear - manipulate it a little and then pump it back out so that others can view my manipulated image.</p><p>Given that this is a little vague, which technologies can you recommend?</p><p>I am thinking to use an Adroid slate, to save costs, so it's probably Java coding. So, how best to get an image stream (plus void, modify the stream and send the modified video plus unmodified audio?</p><p>I might also add file transfer &amp; IM chat into the mix ...</p><p>FOSS solutions highly welcomed </p>","192910","","","","","2010-11-04 12:34:54","Take input from IP_webcam, manipulate & pump it out","<java><android><video-streaming><video-capture>","1","0","1","",""
"4096623","1","4104083","","2010-11-04 12:28:57","1","1322","<p>I have custom view in a HorizontalScrollView wrapped in a ScrollView and I want to act on ACTION_UP in onTouchEvent when the touch point has been moved but no scroll has been done, i.e. when the view is smaller than or equal to the window size. A single touch without move gives ACTION_UP as it should.</p><p>When running the (following) code under 2.1 I get ACTION_UP as expected. When running the same code on 2.2 I do not get the ACTION_UP (I have tested with both SDK 2.1 and 2.2 on the 2.2 emulator).</p><p>Have I accidentally used a ""bug that works"" in the 2.1 version and has been fixed for 2.2 or is this a new error? Is there a workaround?</p><p>See the following logcat:</p><pre><code>2.1I/CustomActivityView(  225): ACTION_DOWN at 307.000000,I/CustomActivityView(  225): ACTION_MOVE at 297.000000,I/CustomActivityView(  225): ACTION_MOVE at 292.000000,I/CustomActivityView(  225): ACTION_MOVE at 290.000000,I/CustomActivityView(  225): ACTION_MOVE at 289.000000,I/CustomActivityView(  225): ACTION_MOVE at 286.000000,I/CustomActivityView(  225): ACTION_UP at 286.000000,2.2/CustomActivityView(  279): ACTION_DOWN at 249.000000,/CustomActivityView(  279): ACTION_MOVE at 249.000000,/CustomActivityView(  279): ACTION_MOVE at 249.000000,/CustomActivityView(  279): ACTION_MOVE at 249.000000,/CustomActivityView(  279): ACTION_DOWN at 198.000000,/CustomActivityView(  279): ACTION_MOVE at 199.000000,/CustomActivityView(  279): ACTION_MOVE at 207.000000,/CustomActivityView(  279): ACTION_MOVE at 214.000000,/CustomActivityView(  279): ACTION_MOVE at 221.000000,</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:background=""#ffdddddd""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;ScrollView android:id=""@+id/ScrollView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;HorizontalScrollView android:id=""@+id/HorizontalScrollView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            &lt;com.example.eventconsumption.CustomActivityView            android:background=""#ffaaaaff""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/CustomActivityView""            /&gt;        &lt;/HorizontalScrollView&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>The view:</p><pre><code>package com.example.eventconsumption;import android.content.Context;import android.graphics.Canvas;import android.util.AttributeSet;import android.util.Log;import android.view.Display;import android.view.MotionEvent;import android.view.View;import android.view.WindowManager;public class CustomActivityView extends View {    private static final String TAG = ""CustomActivityView"";    private int mSetViewWidth = -1;    private int mSetViewHeight = -1;    private int mScreenWidth;    private int mScreenHeight;    public CustomActivityView(Context context) {        super(context);        init(context);    }    public CustomActivityView(Context context, AttributeSet attrs) {        super(context, attrs);        init(context);    }    public CustomActivityView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        init(context);    }    private void init(Context context) {        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);        Display display = windowManager.getDefaultDisplay();        mScreenWidth = display.getWidth();        mScreenHeight = display.getHeight();        setWidthHeight(mScreenWidth / 2, mScreenHeight * 2);        //setWidthHeight(mScreenWidth * 2, mScreenHeight / 2);    }    private void setWidthHeight(int w, int h) {        mSetViewWidth = w;        mSetViewHeight = h;    }    @Override    public void draw(Canvas canvas) {        super.draw(canvas);    }    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        if (mSetViewWidth != -1 &amp;&amp; mSetViewHeight != -1) {            setMeasuredDimension(mSetViewWidth, mSetViewHeight);        } else {            super.onMeasure(widthMeasureSpec, heightMeasureSpec);        }    }    @Override    public boolean onTouchEvent(MotionEvent event) {        switch (event.getAction()) {        case MotionEvent.ACTION_DOWN:            Log.i(TAG, String.format(""ACTION_DOWN at %f, %f"", event.getX(), event.getY()));            return true;        case MotionEvent.ACTION_MOVE:            Log.i(TAG, String.format(""ACTION_MOVE at %f, %f"", event.getX(), event.getY()));            break;        case MotionEvent.ACTION_UP:            Log.i(TAG, String.format(""ACTION_UP at %f, %f"", event.getX(), event.getY()));            return true;        }        return super.onTouchEvent(event);    }}</code></pre><p>The activity:</p><pre><code>package com.example.eventconsumption;import android.app.Activity;import android.os.Bundle;public class EventConsumptionTestActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre>","128800","","47680","","2010-12-03 03:11:27","2010-12-03 03:11:27","Android 2.2 consumes ACTION_UP where 2.1 does not (in nested scroll views). Am I using an old bug?","<android><events><scrollview><horizontalscrollview>","1","1","","",""
"4096633","1","4105053","","2010-11-04 12:29:55","2","4469","<p>I want to start a new activity intent in my current view! How i can do that?</p>","486139","","","","","2011-11-21 10:22:22","how to start a sub activity in same view?","<android><layout><activity>","3","0","2","",""
"4096677","1","4096903","","2010-11-04 12:35:13","8","6014","<p>On Tuesday, I released my first app to the Android Market. Since then I found a few bugs which I have fixed and uploaded a new version.</p><p>In the Developer Console, it still shows the version number as the original (v0.8.0) but the last version uploaded is different (v0.9.0).</p><p>If I check the market on my phone, then the update is not even showing.</p><p>How long before they show?</p><p>Can I check if there are any errors with my upload process? Does a different filename for the apk matter?</p><p>Cheers</p>","67419","","","","","2013-12-19 16:43:52","Publishing Android Updates to Market - How long till they appear?","<android><google-play>","4","2","","",""
"4096730","1","4099267","","2010-11-04 12:41:25","0","479","<p>I have report which consists of 5 questions (there can be <strong>only one answer</strong> or <strong>multiple choice answer</strong>). Question are different for each report. So everytime I generate questions and answers as <code>RadioButtons</code> (one answer) or <code>CheckBoxes</code> (multiple choice answer)...But now I really don't know how to save those answers (I'd like to save to it as <code>_question_id</code>, <code>_answer_id</code>).</p><p>How can I assign good <code>_answer_id</code>, to <code>_question_id</code>...</p><p>Thanks for help in advance</p>","295141","","","","","2010-11-04 17:11:51","Getting information from RadioButtons and Checkboxes","<android>","2","0","","",""
"4096783","1","4833432","","2010-11-04 12:47:52","9","4280","<p>After the 1st call to LoadData() the event onLoadResource fires as it should and the display is fine.  Next I want to refresh the screen with a new page, when I use LoadData() the second time the page does not update and onLoadResource() DOES NOT FIRE.</p><p>Then second call to LoadData() onlyfires onPageFinished ... onPageStarted never fires!</p><p>A work around was to call .reload() after LoadData() but that causes all sorts of problems during the other logic in the activity.</p><p>Why doesn't LoadData() work multiple times?</p><p>I am using extremely simple HTML, and since using .reload() makes it work my LoadData() statement doesn't seem to be the problem.</p><p>Any Ideas would be helpful, TIA</p>","465199","","465199","","2010-11-04 12:58:11","2013-08-27 14:24:11","Android WebView - 1st LoadData() works fine, subsequent calls do not update display","<android><loaddata>","3","0","2","",""
"4096851","1","4463535","","2010-11-04 12:55:09","30","9434","<p>i am using 2 textview to display links from database, i managed to change link colors but i want to remove underline</p><pre><code>email.setText(c.getString(5));    website.setText(c.getString(6));    Linkify.addLinks(email, Linkify.ALL);    Linkify.addLinks(website, Linkify.ALL);</code></pre><p>Can i do that from XML or Code ?</p>","487015","","","","","2013-10-02 09:26:05","Remove underline from links in TextView - Android","<android><hyperlink><textview><underline>","3","0","16","",""
"4097018","1","","","2010-11-04 13:14:56","0","435","<p>I am trying to send terminal commands programmaticly from an android activity.  At the moment I'm using something like the following:</p><pre><code>Process process = null;    DataOutputStream os = null;    process = Runtime.getRuntime().exec(""su"");    os = new DataOutputStream(process.getOutputStream());    os.writeBytes(""./data/program1\n"");    os.writeBytes(""./data/program2\n"");    os.writeBytes(""exit\n"");    os.flush();</code></pre><p>However, my program1 is failing to run successfully and I believe it is due to inadequate user permissions.  Now for my question:</p><p>Does anyone know how I can dump the terminal to a file and save it on the phone or sdcard?  The program is tying into the terminal to feed it commands, I want to know a way to open a connection the otherway and access the (what is normally visual on a terminal screen) output.</p>","497183","","","","","2010-12-23 21:49:55","Android Terminal and Log Dumping","<android><logging><terminal><android-sdcard>","1","0","","",""
"4097088","1","4097326","","2010-11-04 13:25:09","8","8649","<p>I know how to read a bitmap file into a byte array. How is the byte array then converted to a Java Bitmap?</p>","","user490074","","user490074","2011-01-06 12:25:58","2011-01-08 08:53:16","How to read a file into a Java Bitmap?","<java><android><file-io><bitmap><bytearray>","2","5","1","",""
"4097242","1","4097296","","2010-11-04 13:44:13","3","3160","<p>I created a simple java function to truncate a string to be displayed in my list view. I am displaying a news title and below this a news summary. I would like to have the same behavior as the image below. Currently, i am truncating the news title with 45 chars and then appending ""..."" at the end of it. However, when I change the orientation to landscape, the title could appear without being truncated. I dont think the app below truncates the news title, but it keeps the title in a single line and automatically ""truncates"".</p><p><img src=""http://i.stack.imgur.com/E6OCr.jpg"" alt=""alt text""></p><p>How can I achieve this behavior in my app?</p>","491604","","","","","2010-11-04 13:49:52","How to ""truncate"" a text inside textview in android according to the orientation?","<android><android-sdk-2.1>","1","0","","",""
"4097323","1","","","2010-11-04 13:52:43","1","3620","<p>I made a simple Android application which gives the latitude and longitude of the place where I am via GPS and I want to send the coordinates to a Webpage and represent them on google maps.Which is the simpliest possibility to send the data to the server ?</p>","497215","","180538","","2010-11-04 14:07:11","2011-04-08 08:41:51","How to send the longitude and latitude (GPS coordinates) to a Server","<android><geolocation><gps><maps><latitude-longitude>","2","0","","",""
"4097325","1","4097399","","2010-11-04 13:52:50","0","222","<p>Iamtrying to have a button at the bottom of the list, so when u scroll down and the list has ended than there will be a button ""Get more"", which will populate the list with more items. </p><p>But the button is not visible. this is how my xml file looks like.Maybee this occurs because of the scroller,, maybe the scroller only works for the list. </p><p></p><pre><code>    &lt;ListView        android:id=""@+id/android:list""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;    &lt;Button android:id=""@+id/search_browser""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Get more ads"" /&gt;&lt;/LinearLayout&gt;</code></pre>","371301","","","","","2010-11-04 14:18:31","Android: when list has ended than it should show button","<android><list>","2","0","","",""
"4097385","1","4115382","","2010-11-04 13:58:31","2","11344","<p>I've done all of the research on the matter. I know that Google thinks it's pointless and that the developers, know that it's not. I also know that there is no known workaround, but I know that I am close to making one. The user DougW posted this code:</p><pre><code>public class Utility {    public static void setListViewHeightBasedOnChildren(ListView listView) {        ListAdapter listAdapter = listView.getAdapter();         if (listAdapter == null) {            // pre-condition            return;        }        int totalHeight = 0;        for (int i = 0; i &lt; listAdapter.getCount(); i++) {            View listItem = listAdapter.getView(i, null, listView);            listItem.measure(0, 0);            totalHeight += listItem.getMeasuredHeight();        }        ViewGroup.LayoutParams params = listView.getLayoutParams();        params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));        listView.setLayoutParams(params);    }}</code></pre><p>Which almost gets the job done for me. But when I try it, I get a NullPointer exception at the listItem.measure(0, 0) line. The listItem itself is initialized, but the method throws the exception anyway. Please tell me how I can fix this.</p><p>Here is my code:</p><pre><code>public class ExpenseReportsActivity extends Activity {    private ListView lvReports;    private ExpenseReportListAdapter adapter;    private Button btnSend;    private Button btnCancel;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.expensereports);        lvReports = (ListView)findViewById(R.id.lv_reports);        lvReports.setBackgroundResource(R.drawable.shape_expense_report_list);        ColorDrawable cd = new ColorDrawable(0xFFffffff);        lvReports.setDivider(cd);        lvReports.setDividerHeight(1);        adapter = new ExpenseReportListAdapter(this);        lvReports.setAdapter(adapter);        int totalHeight = 0;        for (int i = 0; i &lt; adapter.getCount(); i++) {            View listItem = adapter.getView(i, null, lvReports);            listItem.measure(0, 0);            totalHeight += listItem.getMeasuredHeight();        }        ViewGroup.LayoutParams params = lvReports.getLayoutParams();        params.height = totalHeight + (lvReports.getDividerHeight() * (adapter.getCount() - 1));        lvReports.setLayoutParams(params);    }}</code></pre><p>Another workaround I am working on is using my custom view's onWindowFocusChanged method. It tells the exacts height of the view. The problem is that the event isn't fired while I am still in my Activiy's onCreate method, nor in my Activity's onWindowFocusChanged method. I tried a custom event, but it never fired (it was placed inside my custom view's onWindowFocusChanged method and the listener was in my Activity's onWindowFocusChanged method).</p>","247927","","881229","","2013-12-06 05:10:05","2013-12-06 05:10:05","ListView in ScrollView potential workaround","<android><listview><scrollview>","2","11","6","",""
"4097404","1","","","2010-11-04 14:00:52","0","90","<p>I read already some topics about orientations changes, but no idea how to use them for my problem.</p><p>There are two server requests in an activity. Both will be processed in separate threads.</p><p>First request happens during onCreate-phase and it seems, that there are no problems with it if orientation will be changed.</p><p>If the first request was successfull a listview can be created and be displayed. By selecting of a list item the second request (a bigger one) will be sent. After it was executed a dialog window occurs and activity will be finished when the user clicks on OK-Button.</p><p>In that part problems occur if orientation will be changed. </p><p>Is there a way to interrupt second request (or its processing thread) if orienation's changed?</p><p>Could it be a solution to start new activity for second request?</p>","408780","","401025","","2010-11-04 14:05:58","2010-11-04 14:05:58","Server requests and orientaion's changes","<android><multithreading><request><screen-orientation>","0","2","","",""
"4097498","1","","","2010-11-04 14:12:05","0","314","<p>I built a little graph app for a few different channels, but then had to move it into a tab view to support different pages of inputs using the same graphs.  I converted what was an <code>Activity</code> into a <code>View</code> (because Activity tabs are evil?), which has a bunch of bars, numbers, and text in a grid, not doing much in it (no overloading aside from init) besides inflating the old XML layout into it.</p><p>Now whenever I use the view in my tabs, it doesn't draw initially.  If I manually switch tabs or <code>.setCurrentTab(1); .setCurrentTab(0);</code> it does and works fine.</p><p>I tried calling <code>.invalidate()</code> on my custom view and the container that holds it, but that doesn't seem to do anything.  What's the proper call?</p>","194586","","101258","","2011-09-20 19:39:15","2011-09-20 19:39:15","Custom Android view does not draw","<android><view><tabs>","0","2","","",""
"4097546","1","4097971","","2010-11-04 14:17:24","1","1550","<p>I've created a class which is an extension of Thread.  This class hits a web service and throws some data on screen.  I don't care about persisting this data (the screen displays search results).</p><p>Currently, the user simply types into an EditText and clicks a search button.  I'd like to take away the search button and implement something similar to Google's Instant Search where, as you type, the search results get updated.</p><p>This means, as the user types, the search parameters change.  <strong>I want to be able to kill the currently running thread (if one is currently running) and spawn a new one with the new search string</strong>.  How can this be achieved?  Can I do it with Thread or will I need to use a new object?</p>","406790","","406790","","2010-11-04 14:45:00","2010-11-04 17:38:34","Killing threads","<android><multithreading><android-asynctask>","4","3","","",""
"4097652","1","4098607","","2010-11-04 14:29:08","1","1715","<p>I am developing for the Android.  When I create icons in Photoshop (and convert them to PNG), they appear larger and stretched within my Android application.  The emulator that I am using is medium density. Does anyone have some tips for how I can create my icons in Photoshop so that they appear normally on the Android?</p><p>Thanks!</p>","123891","","","","","2011-12-12 22:45:39","Android Photoshop PNG Icons appear large and stretched","<java><android><png><photoshop>","3","0","","",""
"4097686","1","","","2010-11-04 14:32:12","8","4776","<p>My company is reworking its <strong>API</strong> and wants to make everything RIGHT for this time ;) <strong>Thats the setup...</strong></p><ul><li>We are delivering data to clients over the internet. </li><li>Clients are mobile handsets like iPhone, Androids, J2ME, Blackberry... </li><li>The server is coded in Ruby on Rails</li></ul><p><strong>We want to achieve through a framework...</strong></p><ul><li>Take use of ActiveResource on the clients.</li><li>The framework should do the connection (REST), parsing and (dynamically) providing of models </li><li>Licence must be open source.</li><li>Authorization shall be included. We use OAuth and need to deliver the Access Token on any request. Maybe as parameter or in the HTTP-Header?</li><li>HTTPS/SSL support</li><li>Pagination and Relationships (with lazy loading) support would be great! Otherwize the framework must be able to be adjusted for these things.</li></ul><p><strong>We already have found</strong> following frameworks and kindly ask you guys to evaluate them. Maybe one of you used some of them or something different...</p><hr><ul><li><p>Android: <a href=""http://www.github.com/novoda/restprovider/"">RESTProvider from Novoda / Carl-Gustaf Harroch</a></p><ul><li>Providers offer an abstraction from data sources on Android and the RESTProvider Automatically parses RESTful API responses into a Provider. RESTProvider is an implementation of all commonly re-implemented functionality when dealing with web services in Android. Users can seamlessly interface with any Web Service API which provides JSON or XML as a response. To query a RESTProvider in an activity a user need only specify an endpoint and then query an APIs RESTful functions. RESTProvider also handles all HTTP querying &amp; caching.</li><li>Haven't found much documentation other than that </li><li>Provides caching as well</li><li>Release + Documentation is planned for early 2011</li></ul></li></ul><hr><ul><li><p>iOS: <a href=""http://iphoneonrails.com/"">http://iphoneonrails.com/</a></p><ul><li>Lib for communication between iOS and Rails</li><li>RESTful and ""ActiveResource""-based </li><li>includes XML/JSON Parser</li><li>free licence</li><li>pagination?, android?, lazy loading?  </li></ul></li></ul><hr><ul><li>Android: <a href=""http://mgmblog.com/2008/11/25/android-ruby-on-rails-project-part-3-using-android-cursors/"">Hand made approach with the use of cursors backed by a SQLLite DB</a><ul><li>intended to be very performant and best practice of Android</li><li>uses cursors</li></ul></li></ul><hr><ul><li>Android: <a href=""http://static.springsource.org/spring-android/docs/1.0.x/reference/html/rest-template.html"">Spring Android Rest Template Module</a><ul><li>Spring's RestTemplate is a robust, popular Java-based REST client. The Spring Android Rest Template Module provides a version of RestTemplate that works in an Android environment.</li></ul></li></ul><hr><ul><li>Android: You always should take a look at <a href=""http://www.youtube.com/watch?v=xHXn3Kg2IQE"">this video of Google IO 2010</a> when thinking serious about REST</li></ul><hr><ul><li>Android: <a href=""http://code.google.com/p/libs-for-android/wiki/FeedFramework"">Feed Framework</a> <ul><li>com.google.android.feeds</li><li>A collection of classes to help you build content providers. The framework is specially designed to help connect your application to Web APIs.</li></ul></li></ul>","433718","","433718","","2010-12-01 09:10:26","2011-12-06 20:33:04","RESTful frameworks for Android, iOS...?","<iphone><android><rest><restful-authentication><activeresource>","3","1","18","",""
"4097708","1","4098505","","2010-11-04 14:34:15","0","1576","<p>I am having trouble finding a class or API in Android documentation that would help me get battery usage statistics per application. </p><p>I have read <code>PowerManager</code> and <code>BatteryManager</code> classes but they are of no use.</p><p>However, I can find applications like PowerTutor that do provide battery usage statistics per application, so I think it's technically possible.</p><p>Can any one point me in right direction?</p>","435597","","418613","","2012-06-07 03:02:43","2012-06-07 03:02:43","Android -- How can we determine the Battery Usage statistics per application?","<java><android><statistics><power-management>","1","0","1","",""
"4097967","1","","","2010-11-04 15:00:06","1","217","<p>We're planning to export an application layer AIDL interface. What are some best practices with regards for managing version compatibility? Does Android provide any version-related mechanisms for AIDL interfaces?</p>","440093","","","","","2013-07-16 04:43:48","Does Android provide any versioning mechanisms for AIDL interfaces?","<android><aidl>","1","0","1","",""
"4098138","1","4106458","","2010-11-04 15:16:35","4","3255","<p>I am aware that SoundPool was intended to handle small fx like sounds and I made sure my 4 sound clips which I want to play one by one in some sequence are small enough.</p><p>I used ogg quality 0 and clips are 35kb, 14kb, 21kb and 23kb totaling 92kb of compressed audio. I have no idea how to estimate what the uncompressed size would be, but it should not be a lot, right?</p><p>So when I play 4 sounds in sequence, it works well for first 9 times (9 sequences x 4 sounds) but starts to cause memory issues on the nines sequence for one of the sounds. It is always sequence 9 when I start to see error.</p><p>What is the best way to handle that? I have a few ideas:</p><p>1) compress sounds even more (ogg quality -1 and mono instead of stereo)</p><p>2) unload and load sounds constantly using SoundPool.load and SoundPool.unload</p><p>3) release and recreate soundPool instance time from time</p><p>Is there anything else I can do? It is embarrassing that android api cannot handle so small clips. I wonder how people create games with a lot of sound effects...</p><p>Errors look like that:</p><p>ERROR/AudioFlinger(35): not enough memory for AudioTrack size=1048640DEBUG/MemoryDealer(35):   AudioTrack (0x25018,size=1048576)</p>","473725","","473725","","2010-11-05 04:01:24","2010-11-05 13:52:24","and again about memory issues with SoundPool","<android><soundpool>","2","0","","",""
"4098141","1","4098293","","2010-11-04 15:16:55","1","5057","<p>Excuse the simplicity of this request - but is there a way for me to link onClick commands for buttons through the Layout rather than code. I am trying to create a simple app and I want to be able to make buttons and have clicks go from one ""page"" to the other.</p><p>If not, could someone please point me in the direction of the code needed for it?</p><p>Is there a site that might overview how to use the UI to code for droid?</p><p>Thanks!</p>","496686","","21234","","2010-11-04 15:19:39","2010-11-04 15:30:20","How can I link XML pages with layout, by clicking on buttons?","<android><xml><gui><layout>","2","0","","",""
"4098198","1","","","2010-11-04 15:21:26","18","27141","<p>Okay I have been referencing the code here: <a href=""http://stackoverflow.com/questions/937313/android-basic-gesture-detection"">Android - basic gesture detection</a> </p><p>but just can not get it to work. In my main activity I have a simple image defined. I want to detect a fling on the image. Here is my code below. The onclick method at the bottom is empty. Is it because of this? I left it blank because in the other code sample its not what I want. I just want a simple toast to pop up saying fling right or fling left.</p><pre><code>public class GestureRightLeft extends Activity implements OnClickListener  {    ImageView peek;    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 gestureDetector;    View.OnTouchListener gestureListener;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        peek =(ImageView) findViewById(R.id.peek);        peek.setImageResource(R.drawable.bluestrip);        gestureDetector = new GestureDetector(new MyGestureDetector());        gestureListener = new View.OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if (gestureDetector.onTouchEvent(event)) {                    return true;                }                return false;            }        };    }    class MyGestureDetector extends SimpleOnGestureListener {        @Override        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {            try {                if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)                    return false;                // right to left swipe                if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                    Toast.makeText(GestureRightLeft.this, ""Left Swipe"", Toast.LENGTH_SHORT).show();                }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                    Toast.makeText(GestureRightLeft.this, ""Right Swipe"", Toast.LENGTH_SHORT).show();                }            } catch (Exception e) {                // nothing            }            return false;        }    }    @Override    public void onClick(View v) {}}</code></pre>","497320","","2137020","","2014-02-05 22:33:15","2014-02-05 22:33:15","Adding Fling Gesture to an image view - Android","<android><imageview><gestures><onfling>","5","0","15","",""
"4098207","1","","","2010-11-04 15:21:52","0","1265","<p>I created an app to simply open a web browser and go to a specific website. However, after it's run for the first time, if I go to another app and run the app again, I will get nothing except the black screen. I knew I can find the page from web browser, however I wonder if there is a way to bring the content back when I launch the app and the user could get back to work from where he/she stopped.</p><p>here is my code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    /** setup the url and start a browser with      *  the hotmial.com and return to the user     * */    String url = ""http://www.hotmail.com"";    Intent i = new Intent(Intent.ACTION_VIEW);    i.setData(Uri.parse(url));    startActivity(i);}</code></pre><p>Thanks guys</p>","497321","","","","","2010-11-04 22:12:45","Question about open a web browser from an Android app","<android><browser><android-intent>","4","0","","",""
"4098390","1","","","2010-11-04 15:41:53","2","2479","<p>Hey, I am using an application for obtaining the raw data from the image sensor on an Android device. The files I am getting out are in the YUV420SP format,and XnView does not supprt it. Does anyone knows which software I could use to get a proper image? (to convert it)</p>","497351","","","","","2011-06-02 04:53:44","How to read a YUV420SP file format image?","<android><image><yuv>","0","1","","2012-11-20 17:40:15",""
"4098466","1","","","2010-11-04 15:48:22","0","561","<p><strong>here is the full error</strong>Problem signature:  Problem Event Name:   APPCRASH  Application Name: emulator.exe  Application Version:  0.0.0.0  Application Timestamp:    4c79ab54  Fault Module Name:    ntdll.dll  Fault Module Version: 6.1.7600.16559  Fault Module Timestamp:   4ba9b21e  Exception Code:   c0000005  Exception Offset: 0005a6f0  OS Version:   6.1.7600.2.0.0.768.11  Locale ID:    1033  Additional Information 1: 0a9e  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789  Additional Information 3: 0a9e  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789</p><p><strong>here is the full src .java code</strong></p><pre><code>package com.example.helloandroid;</code></pre><p>import android.app.Activity;import android.os.Bundle;import android.widget.TextView;</p><p>public class HelloAndroid extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);</p><pre><code>    TextView tv = new TextView(this);    tv.setText(""Hello, Android"");    setContentView(tv);    //setContentView(R.layout.main);}</code></pre><p>}</p><p>i am running in eclipse gallileo  for the 2.0 sdk, though i have tried others</p>","497361","","","","","2010-11-04 15:57:15","When trying to run the hello android test app i get an error APPCRASH and the emulator will not open","<android><eclipse>","1","0","","",""
"4098604","1","4117392","","2010-11-04 16:01:26","1","178","<p>Does anybody have experience with Tersus for Android ? Is it useful and worth to try or to continue to develop GUI on standard way from Eclipse ?</p>","486578","","","","","2010-11-07 11:08:56","Tersus for Android","<android>","1","1","","",""
"4098615","1","4795878","","2010-11-04 16:03:06","0","1647","<p>My team and I are trying to connect an Android phone to the <a href=""https://www.sparkfun.com/products/9954"" rel=""nofollow"">WiFly</a> board. We are having trouble getting this to connect. Is it that certain phones that do not support this or do support this functionality and what must we do to be able to perform this connection? </p><p>We have tried a few things, and it is still not working. If you need further information let me know.</p>","427763","","63550","","2012-08-03 17:01:29","2013-07-22 13:17:20","Connect an Android phone to the WiFly board","<android><wifi><root><phone><adhoc>","4","3","","",""
"4098794","1","4099024","","2010-11-04 16:21:51","1","973","<p>I'm displaying a standard <code>&lt;form&gt;</code> with a few <code>&lt;input&gt;</code> fields in a web view.When editing the first input field and pressing the enter key on the soft keyboard, the form is posted insted of focusing the next input field in the form.</p><p>How can I stop the form from being posted and instead put focus on the next input field?</p><p>Edit:Problem solved by adding a piece of javascript to the page;</p><pre><code>&lt;body onkeypress='return event.keyCode!=13; '&gt;</code></pre>","233947","","233947","","2010-11-05 09:25:34","2010-11-05 09:25:34","Default action on input field in Android WebView","<android><forms><input><webview>","1","0","","",""
"4098814","1","4098845","","2010-11-04 16:23:49","5","873","<p>Very basic question. I plan to do our builds via Hudson and have android apk files available for download there. Is R.java in the /gen directory something that you check-in with you VCS? Or is it something that needs to be ignored and android sdk will generate every time if it doesn't exist?</p>","419075","","213269","","2010-11-30 13:01:28","2013-01-12 01:47:29","Are you supposed to check-in R.java file in to VCS?","<android><git><version-control><r.java-file>","4","1","","",""
"4098924","1","","","2010-11-04 16:34:08","1","2982","<p>I´m trying to use my webservice via the jersey client api.This is my webservice:</p><pre><code>@Path(""/myresource"")@Component@Scope(""request"")public class MyResource {@GET@Produces(MediaType.TEXT_PLAIN)@Path(""test"")public String test(){     return ""test"";} </code></pre><p>}</p><p>This is my Client:</p><pre><code>public class MyClient {public static void main(String[] args) { System.out.println(Client.create().resource( ""http://testwebservice.de:8080/CompetenceNetwork/api/myresource/test"" ).get( String.class ) );}</code></pre><p>}</p><p>Everythings works fine. Now I try this in an android class:</p><pre><code> TextView tv; public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      tv = new TextView(this);      Client c = Client.create();      WebResource r = c.resource(""http://testwebservice.de:8080/CompetenceNetwork/api/myresource/test"");      String s = r.get(String.class);      tv.setText(s);      setContentView(tv);   }</code></pre><p>Nothing happends and after a few minutes I get the following exception:</p><pre><code>11-04 17:13:27.382: ERROR/AndroidRuntime(231): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tablayout/com.example.tablayout.MyLogin}: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: The operation timed out11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2335)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:648)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.widget.TabHost.setCurrentTab(TabHost.java:320)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:129)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:379)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.View.performClick(View.java:2364)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.View.onTouchEvent(View.java:4179)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.View.dispatchTouchEvent(View.java:3709)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.os.Handler.dispatchMessage(Handler.java:99)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.os.Looper.loop(Looper.java:123)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.ActivityThread.main(ActivityThread.java:4363)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at java.lang.reflect.Method.invokeNative(Native Method)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at java.lang.reflect.Method.invoke(Method.java:521)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at dalvik.system.NativeStart.main(Native Method)11-04 17:13:27.382: ERROR/AndroidRuntime(231): Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: The operation timed out11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.sun.jersey.api.client.Client.handle(Client.java:616)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at com.example.tablayout.MyLogin.onCreate(MyLogin.java:94)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)11-04 17:13:27.382: ERROR/AndroidRuntime(231): ... 31 more11-04 17:13:27.382: ERROR/AndroidRuntime(231): Caused by: java.net.SocketException: The operation timed out11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.platform.OSNetworkSystem.connectSocketImpl(Native Method)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:114)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:245)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:535)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at java.net.Socket.connect(Socket.java:1054)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:145)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:67)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:821)11-04 17:13:27.382: ERROR/AndroidRuntime(231): at org.apache.harmony.luni.internal.net.www.protocol.ht</code></pre><p>I´m using target GoogleAPI 7 and the following jars:</p><p>jersey-bundle-1.4.jarjsr311-api-1.1.jarjunit-4.5.jar</p><p>Does anybode has an idea to fix this?</p><p>GreetingsChristine Bauers</p>","497419","","59058","","2010-11-04 17:44:01","2011-12-07 20:36:19","How to use jersey client api in an android context?","<java><android><timeout><client><jersey>","3","2","","",""
"4098998","1","4099224","","2010-11-04 16:42:06","0","1005","<p>I am attempting to have a new view appear on top of my main view. </p><p>Here is the XML for the new view:</p><p></p><pre><code>    &lt;RelativeLayout         android:id=""@+id/mapdetaillayout""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""          android:gravity=""left""        xmlns:android=""http://schemas.android.com/apk/res/android""&gt;             &lt;TextView                 android:text=""This is the Text from the XML File.""                 android:id=""@+id/DetailTextView""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;            &lt;/TextView&gt;    &lt;/RelativeLayout&gt;       </code></pre><p>And here is the code I am using to push the new viev onto the screen:</p><pre><code>        RelativeLayout DetailLayout = new RelativeLayout(c);        LayoutInflater inflater = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        View v = inflater.inflate(R.layout.mapdetailview, DetailLayout);            TextView tv = (TextView) v.findViewById(R.id.DetailTextView);        tv.setText(""HERE IS THE TEXT FROM THE CODE"");        // This Log works        Log.i(""MESSAGE"", tv.getText());        DetailLayout.setBackgroundColor(Color.WHITE);        LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        params.gravity = Gravity.NO_GRAVITY;        DetailLayout.bringToFront();        DetailLayout.setVisibility(View.VISIBLE);</code></pre><p>The code is getting called and the Log outputs the expected text, which to me indicates that the View has been created - it just isn's being displayed on the screen.</p><p>Any help would be appreciated.</p>","300129","","","","","2010-11-04 17:19:34","Android View Not Appearing","<android><visibility>","2","0","","",""
"4099005","1","4099055","","2010-11-04 16:43:04","0","607","<p>I have been struggling with this for hours. My SQLite insert always returns -1 ...</p><p>Here is my code from the main activity in one file that calls my db code in another file:</p><p>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    jobsdb = new NotifyJobsDBAdapter(this);    jobsdb.open();    currentjobid = 1;    currentjob = new Job(currentjobid, ""Starting Tele Num"", ""Starting Text Msg"");    currentjobid = jobsdb.insertJob(currentjob);   // this last statement returns -1}</code></pre><p>This is my db adaptor code in another file:</p><p>public class NotifyJobsDBAdapter {</p><pre><code>private static final String DB_NAME = ""notifyjobsdb"";private static final String DB_TABLE = ""notifyjobs"";private static final int DB_VERSION = 1;private final Context ctx;// Database column namesprivate static final String JOB_ID = ""jobid"";private static final String JOB_TELE = ""contactnumber"";private static final String JOB_TEXT = ""textmessage"";private SQLiteDatabase notifyjobsdb;private NotifyJobsDatabaseHelper dbHelper;private boolean openness;private boolean err;private boolean err0;private int cnt;private int i1;private String s1;private String s2;private static String s3;private int res;private SQLiteException ex0;private SQLiteException ex1;private static class NotifyJobsDatabaseHelper extends SQLiteOpenHelper {    private static final String DATABASE_CREATE =         ""CREATE TABLE IF NOT EXISTS "" + DB_TABLE +        "" (+ "" + JOB_ID + ""INTEGER PRIMARY KEY, "" +        JOB_TELE + ""TEXT NOT NULL, "" +        JOB_TEXT + ""TEXT NOT NULL);"";    private static final String DATABASE_UPGRADE =         ""DROP TABLE IF EXISTS notifyjobs "";    public NotifyJobsDatabaseHelper(Context _context) {        super(_context, DB_NAME, null, DB_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(DATABASE_CREATE);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        db.execSQL(DATABASE_UPGRADE);                }}public NotifyJobsDBAdapter(Context _context) {    this.ctx = _context;}public void open() {     dbHelper = new NotifyJobsDatabaseHelper(ctx);    try { notifyjobsdb = dbHelper.getWritableDatabase();    } catch(SQLiteException ex) {        ex0 = ex;    }}  public void close() {    notifyjobsdb.close();}</code></pre><p>// this is my problem method</p><pre><code>public int insertJob(Job _job) {    ContentValues newJobValues = new ContentValues();    newJobValues.put(JOB_ID, _job.getjobid());    newJobValues.put(JOB_TELE, _job.gettelenum());    newJobValues.put(JOB_TEXT, _job.gettextmsg());    notifyjobsdb.beginTransaction();    // res is always returned a -1    try {    res = (int) notifyjobsdb.insertOrThrow(DB_TABLE, null, newJobValues);    } catch (SQLiteException ex) {        ex1 = ex;    }    notifyjobsdb.setTransactionSuccessful();     close();    return res;</code></pre><p>Here, res is always -1 and the debugger shows the detailmessage for ex1 as </p><p>""no such table: notifyjobs: , while compiling: INSERT INTO notifyjobs(contactnumber, textmessage, jobid) VALUES(?, ?, ?);</p><p>I would appreciate any help!</p>","479542","","","","","2010-11-07 06:58:19","Insert returns -1 with SQLite","<android>","3","0","","",""
"4099057","1","","","2010-11-04 16:48:25","2","11910","<p>Hi again i seem to be having one more problem developing my app.  I got the buttons to function the way i want it to but now im having a problem calling a picture to view.  In my app after they click the button i want to take them to a new page where it will display a picture and under it some text.  For this example say i want a pic if dog to be at the top of the page then under it say i want something like the breed and the cost of breed. Can anyone help me? Thanks everyone.</p>","496483","","","","","2013-02-27 06:07:10","How to show a picture?","<android><image>","4","0","","",""
"4099117","1","4101074","","2010-11-04 16:54:49","0","337","<p>I have an issue with the rendering of some views (buttons and edittext) which edges are distorted (the left and right edges appear 1 px below the body of the control). Controls on my device behave like that, but not on the emulator. Does anyone know the reason of this?</p>","497452","","","","","2011-10-01 10:43:13","Distorted buttons and edittexts","<android><layout>","3","0","","",""
"4099332","1","4099395","","2010-11-04 17:18:33","1","70","<p>What I'm trying to accomplish here is to set the text in a given row as read if the user clicks on it, now I was able to do that by using the onclick method, the problem with it is that it goes away when an intent is fired or the user exits the app. I want the Text to be set up as read permanently. here is my piece of code if anybody can help I would greatly appreciate it.Thank you in advance:</p><pre><code>public void onListItemClick(ListView parent, View v, int position, long id) {  LinearLayout ll = (LinearLayout) v;  TextView clickedTextView = (TextView) ll.getChildAt(1);  clickedTextView.setTextColor(Color.GREEN);  StringTokenizer st = new StringTokenizer(strings[position],""&lt;@&gt;"");  for(int i=0;i&lt;3;i++)  {    coupon = st.nextToken(""&lt;@&gt;"");  }  sharable=st.nextToken();  Intent i = new Intent(getApplicationContext(), CouponImage.class);  i.putExtra(""The coupon"", coupon);  i.putExtra(""Sharable"", sharable);  startActivity(i);}</code></pre>","490923","","319618","","2010-11-04 17:25:24","2010-11-04 17:31:17","Marking text in the row of the list as ""READ"" permenatly Android","<android><listview><onclick>","2","0","","",""
"4099362","1","4099460","","2010-11-04 17:23:31","1","82","<p>What's the proper way to add a photo from a url to my main.xml and having that placed on my activity?</p>","479180","","","","","2010-11-04 17:33:38","pulling photo from url and placing on screen","<java><android><android-sdk-2.2>","1","0","","",""
"4099439","1","4099504","","2010-11-04 17:31:46","4","15211","<p>I am looking for code for a button that completely closes my app.</p><p>I tried with some stuff from Google, but my app is still running in the background. I need to close it completely. Is there code that does this?</p>","479886","","496830","","2011-11-07 02:40:20","2012-12-28 06:46:44","How can I programmatically close an application?","<android>","5","1","1","",""
"4099499","1","4099747","","2010-11-04 17:37:55","2","4532","<p>I've been testing sending and receiving broadcasts in my application but I have a problem. The service starts and I get the Toast to say the broadcast has been sent but onReceive is never called in the myMapView class. I've only included the code I think is relevant below... any help would be much appreciated. I don't think I'm registering the receiver correctly.</p><p>Thanks in advance.</p><pre><code>public class myLocationService extends Service implements LocationListener {    private static final String GEO_LNG = ""GEO_LNG"";    private static final String GEO_LAT = ""GEO_LAT"";    private void updateWithNewLocation(Location location){    if (location != null){            Double geoLat = location.getLatitude() * 1E6;            Double geoLng = location.getLongitude() * 1E6;            Intent intent = new Intent(this, myMapView.class);            intent.putExtra(GEO_LNG,geoLng);            intent.putExtra(GEO_LAT, geoLat);            sendBroadcast(intent);            Toast.makeText(myLocationService.this, ""Broadcast sent"", Toast.LENGTH_SHORT).show();        }       else{        Toast.makeText(myLocationService.this, ""Location = null"", Toast.LENGTH_SHORT).show();    }}}public class myMapView extends MapActivity{    private static final String GEO_LNG = ""GEO_LNG"";    private static final String GEO_LAT = ""GEO_LAT"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.map_layout);         IntentFilter filter = new IntentFilter();    filter.addAction(GEO_LONG);    filter.addAction(GEO_LAT);    registerReceiver(locationRec, filter);    Intent i = new Intent(this, myLocationService.class);            startService(i);}    private BroadcastReceiver locationRec = new BroadcastReceiver(){        @Override        public void onReceive(Context context, Intent intent) {                       double geoLng = intent.getExtras().getDouble(GEO_LONG);                       double geoLat = intent.getExtras().getDouble(GEO_LAT);            Toast.makeText(GeoTrailsMap.this, ""Got broadcast"", Toast.LENGTH_LONG).show();        }    };</code></pre><p><strong>Edit</strong> I've modified my code to look like this, but I'm still not having any luck with receiving the broadcasts.</p><pre><code>public class myLocationService extends Service implements LocationListener {private static final String GEO_LNG = ""GEO_LNG"";private static final String GEO_LAT = ""GEO_LAT"";public static final String LOCATION_UPDATE = ""LOCATION_UPDATE"";private void updateWithNewLocation(Location location){if (location != null){        Double geoLat = location.getLatitude() * 1E6;        Double geoLng = location.getLongitude() * 1E6;        Intent intent = new Intent(this, myMapView.class);        intent.putExtra(GEO_LNG,geoLng);        intent.putExtra(GEO_LAT, geoLat);        intent.setAction(LOCATION_UPDATE);        sendBroadcast(intent);        Toast.makeText(myLocationService.this, ""Broadcast sent"",    Toast.LENGTH_SHORT).show();    }       else{    Toast.makeText(myLocationService.this, ""Location = null"", Toast.LENGTH_SHORT).show();    }}}public class myMapView extends MapActivity{private static final String GEO_LNG = ""GEO_LNG"";private static final String GEO_LAT = ""GEO_LAT"";private static final String LOCATION_UPDATE = myLocationService.LOCATION_UPDATE;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.map_layout);         IntentFilter filter = new IntentFilter();    filter.addAction(LOCATION_UPDATE);    registerReceiver(locationRec, filter);    Intent i = new Intent(this, myLocationService.class);    startService(i);}private BroadcastReceiver locationRec = new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent) {                   double geoLng = intent.getExtras().getDouble(GEO_LNG);                   double geoLat = intent.getExtras().getDouble(GEO_LAT);        Toast.makeText(GeoTrailsMap.this, ""Got broadcast"", Toast.LENGTH_LONG).show();    }};</code></pre>","497503","","497503","","2010-11-04 19:59:44","2010-11-04 19:59:44","Broadcast receiver onReceive() never called - Android","<android><broadcastreceiver><broadcast>","2","0","","",""
"4099593","1","4099990","","2010-11-04 17:48:03","2","12762","<p>I'd like to connect a HTC Desire to the pc ONLY as debugging device.Every time I plug the cable in it searches for the HTC Sync software on the pc, and it takes a looong time until finally a message appears on the phone like ""no HTC Sync found, ... please install..."". After that, the phone is available to eclipse for debugging. But how can I avoid that everlasting searching process?</p>","474326","","387076","","2012-05-12 20:23:45","2012-05-12 20:23:45","How to connect a HTC android phone to the pc as debugging device","<debugging><sync><android>","3","3","","",""
"4099705","1","4104408","","2010-11-04 18:00:47","1","1158","<p>I have an app I am working on that does some math on a few variables and outputs the answer. Well that's the plan anyway. Being a total n00b at Android &amp; Java I am not sure of a couple of things.</p><p>1) I have created text fields in the layout file for user to enter values. Instead of text fields should I use numerical value fields, if such a thing exists?</p><p>2) How can you convert from a text field to a numerical value and back again?</p><p>Many thanks for any helpTim</p>","497517","","210818","","2010-11-04 18:23:54","2012-04-24 12:20:58","Input fields & converting text to numeric","<java><android><text><textfield>","3","0","","",""
"4099706","1","","","2010-11-04 18:00:52","2","355","<p>So I'm writing an app that detects movement, and needs to be calibrated to various movements. Over the past few days, I've noticed that right after a <code>SensorEventListener</code> is registered, <code>onSensorChanged(SensorEvent)</code> throws out incomplete (and therefore erroneous) <code>.values[]</code>. This behavior screws up my calibration process, and the amount of force that signifies a movement is way too high. I have verified that this is the case for every accelerometer logging app I have downloaded and tested, so its not an error specific to my code. I think this might be caused by bad hardware (possibly specific to my moto droid 1), or a software bug by the custom ROM I'm using (Simply Stunning 4.9, from Froyo 2.2.1 source.)</p><p>Example:</p><pre><code>sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),SENSOR_DELAY);....onSensorChanged(SensorEvent event){    // event.values[0] = 0.0    // event.values[1] = -0.47    // event.values[2] = 0.0}....onSensorChanged(SensorEvent event){    // event.values[0] = 0.08    // event.values[1] = -0.47    // event.values[2] = 0.0}....onSensorChanged(SensorEvent event){   // event.values[0] = 0.08    // event.values[1] = -0.47    // event.values[2] = 10.1}</code></pre><p>As you can see, it often takes 2 readings before all of the correct values are accessible.</p><p>Can anyone confirm or deny this behavior on the moto droid 1 or other phone? Do you think a good solution is to just drop the first 2 or 3 readings so that they don't warp my calibration?</p>","127422","","127422","","2010-11-04 18:16:47","2011-07-19 00:39:20","Android - accelerometer on motodroid 1 reports incorrect values at first?","<android><accelerometer><motorola-droid>","1","1","2","",""
"4099784","1","","","2010-11-04 18:11:14","0","924","<p>I need two markers in a Map (start/end) depending on my programs' state on each tap event i want to move the selected marker from his position to the tap-position.</p><p>I'm not quite sure how two do this architecturally?. Do i need one ItemizedOverlay for both markers or an Overlay for each marker?</p>","497549","","","","","2010-11-04 18:11:14","Android: ItemizedOverlay Vs. Overlay and moving markers","<android><overlay><itemizedoverlay>","0","3","","",""
"4099789","1","","","2010-11-04 18:11:44","1","425","<p>I'm trying to set up my machine to do some Android development, but I'm running into a couple of issues when installing everything I need. Here's some info about my set up:</p><p>I'm running Windows 7 64 bit<br>I have the Java JDK 1.6.0_22 version installed<br>I downloaded Eclipse Galileo 3.5 R2 for Java Developers</p><p>My first issue is that because the Android SDK doesn't work with Eclipse 3.6 yet I had to download 3.5 instead. I can see a 64 bit Java Developers version on the main download page, but I can only see the 32 bit for Galileo:</p><p><a href=""http://www.eclipse.org/downloads/packages/release/galileo/sr2"" rel=""nofollow"">http://www.eclipse.org/downloads/packages/release/galileo/sr2</a></p><p>However the classic edition does have a Windows 64 bit option. The Android SDK documentation recommends using the Java Development edition, so I decided to give the 32 bit Java version a try. Unfortunately the Eclipse launcher gives me an error about the JVM terminated with exit code -1.</p><p>I tried searching for solutions, but didn't come up with anything useful. Should I go ahead and use the classic version of Eclipse or try to get the 32 bit version to work? Is there a 64 bit version of Galileo for Java Developers available somewhere? I think my computer set up is fairly common so I feel like I'm running into these issues because I misunderstood the set up process.</p>","497550","","","","","2010-11-04 18:53:09","The Eclipse launcher is giving me an error message","<android><eclipse>","3","0","","",""
"4099928","1","4100101","","2010-11-04 18:26:35","3","1605","<p>Iam trying to find the id for the listview, but it dosen't work just typing like this:this.view = (ListView) findViewById(R.id.list);R.id.list -> dosen't work, cause it can't find the idIam using my own custom made list. </p><pre><code>        &lt;ListView        android:id=""@+id/android:list""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;</code></pre>","371301","","","","","2010-11-04 18:46:39","List id not found: android:list","<android><listview>","1","1","","",""
"4099993","1","","","2010-11-04 18:33:29","3","1964","<p>I am working on an Android application that deals with graphical operations in native code on a shared memory buffer. I have made functions to call my native code from Java using JNI, and my native code uses the JNI API to call Java from native code. Since copying large arrays of pixels has a significant effect on performance, I need to avoid it as much as possible.</p><p>The Android documentation for the Bitmap class talks of two ways for copying pixels onto the Bitmap internal buffer:<a href=""http://developer.android.com/reference/android/graphics/Bitmap.html"" rel=""nofollow"">http://developer.android.com/reference/android/graphics/Bitmap.html</a></p><p>setPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height)Replace pixels in the bitmap with the colors in the array.</p><p>copyPixelsFromBuffer(Buffer src)Copy the pixels from the buffer, beginning at the current position, overwriting the bitmap's pixels.</p><p>The problem with the API documentation is that it is very vague about what is happening behind the scenes when you use those functions. However, it is mentioned somewhere that copyPixelsFromBuffer() copies pixels directly without any internal color format conversion, as opposed to setPixels() which will in all case do that conversion even if the original pixels are in the target pixel format. Obviously, that is not something I want, since the pixels in my buffer are in the good format already.</p><p>Now, copyPixelsFromBuffer() looks very nice since it won't do that conversion, but the documentation does not talk of how to copy pixels from a buffer to a particular offset in the target bitmap. Oops, that is something very important, since I don't want to copy the entire buffer every time, but only a region on it. Yes, the documentation says that it is going to copy from the current position <em>in the source buffer</em> but nothing is said about the destination buffer. SetPixels() does the unnecessary conversion, but allows you to specify an offset in the destination buffer.</p><p>So, I am stuck between:</p><p>Copying only the region that I want at the cost of having pixel conversion</p><p>OR</p><p>Avoiding pixel conversion at the cost of copying the entire buffer every time</p><p>To get an idea, I may have a buffer representing a 1024x768 screen, with an invalid region that goes from (300,300) to (400,400).</p><p>If I copy only the region I need to update, I can copy and convert 100*100 pixels or copy without converting 1024*768 pixels. a 100x100 invalid region is small and only a particular case, most invalid regions would take a much larger portion of the buffer. Both methods have very negative effects on performance.</p><p>Does anybody have an idea on how I could copy pixels from my buffer to a particular offset on the target buffer, without forced pixel conversion? That would be the best of both worlds, and I don't see why it does not appear to be available.</p><p>Thanks a lot for your help</p>","497548","","","","","2010-11-05 16:36:47","Android copyPixelsFromBuffer() to particular bitmap offset?","<android><bitmap><jni><android-ndk><pixels>","1","0","1","",""
"4100048","1","4100528","","2010-11-04 18:41:02","1","391","<p>Is there a way to programmatically deselect/wipe whatever the user has selected with the trackball/trackpad?</p><p>When I hit the back button on an Activity, the Activity it falls back to has a button that is selected as if the user had used the trackball/pad.  I'm not sure what is selected on the previous Activity, but obviously something is.  I'd like to programmatically wipe any selection just before the Activity finishes.</p>","406790","","","","","2010-11-04 19:34:28","Deselect any trackball/trackpad selection","<android><selection><trackball><trackpad>","1","0","","",""
"4100272","1","4103380","","2010-11-04 19:05:14","6","10303","<p>I have this ImageView block inside a Relative layout:</p><pre><code>&lt;ImageView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_marginBottom=""50dip""    android:layout_marginLeft=""81dip""    android:src=""@drawable/swipehelp""    /&gt;</code></pre><p>This draws the image right where it would be expected in both normal and high density resolution screens on Android 1.6 however on 2.2 it seems to ignore the layout_marginBottom and always draw the image aligned all the way at the bottom. Has anyone seen this before, and if so do you know a fix?</p><h2>Edit 1:</h2><p>It sits inside a RelativeLayout declared thusly:</p><pre><code>&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/excusescreen""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:background=""@drawable/woodbg""&gt;</code></pre><h2>Edit 2:</h2><p>Here's the full layout 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:id=""@+id/excusescreen""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""@drawable/woodbg""&gt;   &lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/imlateTopBar""    android:layout_width=""fill_parent""    android:layout_height=""44dip""    android:background=""@drawable/topandbottombars""    android:layout_alignParentTop=""true""        &gt;    &lt;ImageView            android:id=""@+id/excHomeBtn""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_marginLeft=""5dip""            android:layout_marginTop=""7dip""            android:src=""@drawable/catexcusehomebtn""            &gt;    &lt;/ImageView&gt;    &lt;ImageView            android:id=""@+id/excBackToCatsBtn""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_marginLeft=""10dip""            android:layout_marginTop=""7dip""            android:src=""@drawable/backtocats""            &gt;    &lt;/ImageView&gt;     &lt;/LinearLayout&gt;     &lt;ViewFlipper    android:id=""@+id/excuses""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_marginTop=""50dip""     &gt;     &lt;/ViewFlipper&gt;     &lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/imlateTopBar""    android:layout_width=""fill_parent""    android:layout_height=""44dip""    android:background=""@drawable/topandbottombars""    android:layout_alignParentBottom=""true""     &gt;    &lt;ImageView        android:id=""@+id/emailItBtn""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginLeft=""5dip""        android:layout_marginTop=""7dip""        android:src=""@drawable/emailit""        &gt;    &lt;/ImageView&gt;    &lt;TextView        android:id=""@+id/numExcusesText""        android:layout_width=""100dip""        android:layout_height=""30dip""        android:layout_marginLeft=""5dip""        android:layout_marginTop=""7dip""        android:textColor=""#66ffffff""        android:gravity=""center""        android:textSize=""18dip""        android:textStyle=""bold""        android:text=""1/13""        &gt;    &lt;/TextView&gt;    &lt;ImageView        android:id=""@+id/shareItBtn""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginLeft=""5dip""        android:layout_marginTop=""7dip""        android:src=""@drawable/shareit""        &gt;    &lt;/ImageView&gt;     &lt;/LinearLayout&gt;     &lt;ImageView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_marginBottom=""50dip""    android:layout_marginLeft=""81dip""    android:src=""@drawable/swipehelp""    /&gt; &lt;/RelativeLayout&gt;</code></pre><h2>Edit 3</h2><p><img src=""http://i.stack.imgur.com/dBsX8.png"" alt=""alt text""></p>","469219","","469219","","2010-11-05 01:47:50","2013-10-25 13:56:04","android: layout_marginBottom doesn't seem to work properly in 2.2 (Froyo)","<android><layout>","5","5","1","",""
"4100318","1","4100477","","2010-11-04 19:10:44","0","811","<p>In my android game I want to have a rhythm Mediaplayer object and a lead Mediaplayer object playing in sync. However at the moment the rhythm is a slight bit behind the playback of the lead Mediaplayer object. Is there a way I can make it so that both are started at the same time, for instance using Runnables etc?!</p><p>It's quite crucial that they play in sync with each other as you can imagine! Many thanks</p>","300037","","","","","2011-05-08 20:06:33","Having 2 Mediaplayer objects playing in sync - Android","<android><media-player>","1","0","","",""
"4100388","1","","","2010-11-04 19:19:09","1","851","<p>Hoping someone can assist with this what seems to me a peculiar problem.. My mind is pulsing a little here as it's blown my understanding of the Android Activity Lifecycle.. Let me try to make things clearer.</p><p>Problem: I'm receiving a 'StaleDataException' during the 'getView' method of a custom adapter (extending BaseAdapter) that I use on an activity to populate a GridView. Sounds straight forward so far.. When I first go into the activity, the adapter is working as expected and the grid is populated.I have a button on the activity which fires off an Intent to allow the user to take a photo, and comes back via 'onActivityResult' saving the image to a database.  This all worked also. In fact I wrote that portion first, then added the adapter &amp; gridview afterwards.</p><p>Now the StaleDataException is occuring when I've gone to the camera to take a pic, and then click OK to return...  I have lots of Log statements in most events on my activity, and very bizarrely the StaleDataException is occuring before ANY of these events are triggered... before OnActivityResult/OnResume etc.</p><p>SO I'm quite confused as to why the Adapter is being accessed before I've properly returned to my activity and before onActivityResult/OnResume have been called.. </p><p>Debugging the steps that lead up to the exception, it all occurs on this line : </p><pre><code>String contentType = dataCursor.getString(dataCursor.getColumnIndexOrThrow(DbStatics.ACCIDENTS_MEDIA_KEY_TYPE));</code></pre><p>What's also baffling me is the dataCursor is actually Open and the first call (getColumnIndexOrThrow) is also returning a value.. so its the getString() which leads to the exception.</p><p>So I hope that's clear enough... and really really hope someone might be able to shed some light on what's going on..</p><p>Many Thanks,</p>","333276","","","","","2011-12-17 18:27:33","Cursor problem/Stale Data Exception in unusual situation","<android><sqlite><staledataexception>","1","0","","",""
"4100969","1","","","2010-11-04 20:20:42","11","3889","<p>I want to develop an application for both android and iOS devices. Is there a way to develop the application once and deploy on both? Or is it a must to develop for each platform separately?</p><p>Thank you</p>","214418","","","","","2012-12-27 17:35:24","Android & iOS: How to develop for both?","<android><ios><portability>","6","0","2","",""
"4101057","1","","","2010-11-04 20:29:45","2","1690","<p>I'm writing an Android app, and would like to have a Lite and Pro version. The application itself would largely be the same for the Lite and Pro version, the main difference being that the Pro version would have a widget for convenience purposes. Obviously, I would like to reuse the code, drawables and layout files for the common parts in both applications, without having to create to projects. I thought I would be able to create two application tags in the manifest file, one without and one with the receiver for the widget. However, I don't see how I could create two packages from this. Is there a way to accomplish what I try to do? Am I looking in the correct direction, or are there more efficient ways?</p><p>I could of course create a common java package that I can reuse, but then I would still need two separate projects with the same drawables and layout.</p><p>Any ideas?</p><p>Bart</p>","497653","","","","","2012-06-29 09:10:21","Multiple <application> in AndroidManifest.xml","<android><android-manifest>","3","0","","",""
"4101233","1","4102722","","2010-11-04 20:48:38","0","738","<p>I am creating custom shapes for certain buttons but I want them to maintain the systems current color scheme. I thought that by not applying a gradient or color it would automagically take care of this for me but I am mistaken. By doing that I end up with a black button and black text.</p><p>Any pointers?</p><p>Obligatory code:</p><pre><code>&lt;shape android:shape=""rectangle""&gt;  &lt;corners android:radius=""1dp"" android:bottomRightRadius=""0dp"" android:bottomLeftRadius=""7dp"" android:topLeftRadius=""0dp"" android:topRightRadius=""7dp"" /&gt;&lt;/shape&gt;</code></pre>","265609","","265609","","2010-11-04 21:11:56","2013-01-22 03:03:36","How do you make a custom button shape keep the systems colors?","<android><android-layout>","1","0","","",""
"4101330","1","","","2010-11-04 21:00:04","0","65","<p>Say I have folder containing about 150 png images with transparency(named fire0001.png all the way through fire0150.png), and I wanted to have it so when the use clicks on the screen, it plays through all the pictures, changing them quickly. Behind the element displaying the animation, I want to have a camera preview. Is this at all possible performance wise, and if so, how would I carry it out? If not, is there a better way?</p>","497721","","","","","2010-11-05 17:26:45","Android ImageViews Animations","<android><imageview><android-camera>","1","0","","",""
"4101331","1","4108500","","2010-11-04 21:00:06","11","7730","<p>I have created a WebView layout, which is used to access a specific website, however it would be useful to edit or create a custom ""<strong>Web page not available</strong>"" resource when a handset doesn't have a network connection or the page times out. I know it's possible because if you open the app ""<strong><em>Wikidroid</em></strong>"" while a handset is in Airplane mode you receive ""<strong>Article not available</strong>"" error page instead of the standard Android ""<strong>Web page not available</strong>"" error page.  </p><p>I have search high and low on the internet and haven't come up with any online resources which address this request. Any and all help is much appreciated. Thanks in advance.</p>","497725","","497725","","2012-04-27 05:14:28","2013-11-12 20:16:15","Editing or creating a custom ""Web page not available""","<android><webview>","2","0","3","",""
"4101346","1","4110558","","2010-11-04 21:01:21","2","10625","<p>I am trying to catch when the user has pressed the Home button.  I thought I could use</p><pre><code>protected void onResume(){   registerReceiver(homeReceiver, new IntentFilter(Intent.CATEGORY_HOME));}...private BroadcastReceiver homeReceiver = new BroadcastReceiver()       {          public void onReceive(Context context, Intent intent)          {             // logic here          }       };</code></pre><p>but that doesn't seem to work.  I understand that onPause will be called, but my particular app has some logic that I need to handle separately.  Short story is based on some info coming in, the app will display new Activities to the user.  To prevent Back button issues, as each Activity hits it's onStop it calls finish on itself.  However if the user presses the Home button I do not want the Activity to call finish so that when the user presses the app icon on the home screen or via the Recently run apps list, the last Activity is brought back.</p><p>I suspect that I have made this more complicated than planned.  Any suggestions are appreciated.</p>","418714","","","","","2013-01-08 05:57:11","Android - How to catch that the Home button was pressed?","<android>","5","4","","",""
"4101459","1","4102069","","2010-11-04 21:13:03","1","433","<p>I have a TextView in my home screen widget. Can I use the following selector as the background of the TextView so the TextView can be highlighted when clicked? I know I can do it in Activity, but I am not sure about home screen widget. Thanks.</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:drawable=""@drawable/button_selected"" /&gt; &lt;!-- pressed --&gt;    &lt;item android:state_pressed=""false""       android:drawable=""@drawable/beige_button"" /&gt; &lt;!-- not pressed --&gt;    &lt;item android:drawable=""@drawable/beige_button"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre>","445302","","","","","2010-11-04 22:37:29","Does Android home screen widget support background selector in a TextView?","<android>","1","0","","",""
"4101480","1","4101545","","2010-11-04 21:15:00","3","3077","<p>I'm using a LayerDrawable to merge multiple Drawable. Now, I'd like to export my LayerDrawable to a file.</p><p>I've tried this way:</p><pre><code>Bitmap b = ((BitmapDrawable)myLayerDrawable).getBitmap();--&gt; ClassCastException...</code></pre><p>What can I do?</p>","446576","","","","","2013-04-04 08:43:20","LayerDrawable to bitmap","<android><bitmap><drawable>","2","0","","",""
"4101657","1","","","2010-11-04 21:37:56","0","371","<p>I have tried everything according to instructions to get the MapsDemo to work on API8. I followed all the certificate signing instructions and all I get is a blank (blue) screen on the emulator. I see that people have been having the same issues but all the suggested solutions boil down to the certificate signing and that has not worked for me. One guy on the Internet even said he got it to work but never said how!</p><p>So, I thought I'd try the MapsDemo that comes with ""Google APIs by Google Inc, Android API7, revision 1"". There I saw the map come up on the emulator but only once. That one time it came up clearly and I was able to pan it but after exiting the app and trying it again, it no longer worked. Now all I get is some faint outlines that makes it look like it's trying to work but for some reason is not successful.</p><p>I am running on Windows Vista Service Pack 2 and using Eclipse Helios.</p>","497759","","313758","","2010-12-21 12:30:52","2011-02-09 08:50:05","I can't get the MapsDemo that comes with ""Google APIs by Google Inc, Android API8, revision 2"" to work","<android><google-api>","1","0","1","",""
"4101695","1","4102122","","2010-11-04 21:43:46","0","276","<p>As I am reviewing and prototyping my android project, I noticed that there is a view that has a list of items that are very customized. I have figured out most of my tools that I plan to use but I need some advice. </p><p>I have a list of items which can contain photos, some text to the right, an image to the bottom and more text below that. Very confusing I know. Each of these might be present for an item. The only thing that will always be there is the title. </p><p>So my question - what is the best way to create each custom list item view? I am thinking I have to use this <a href=""http://developer.android.com/reference/android/widget/Adapter.html#getView%28int,%20android.view.View,%20android.view.ViewGroup%29"" rel=""nofollow"">getView</a> to create each view. But when creating each view, is it best to 1) create a view dynamically and adding an image, for example, if it exists, or 2) create an xml file with all possible elements and hide them depending on the item? </p>","419075","","","","","2010-11-04 23:08:48","Best way to create a custom view for every list item","<java><android><performance><implementation>","2","0","","",""
"4101747","1","4101894","","2010-11-04 21:50:59","1","1060","<p>I'm working on a game which will use projectiles. So I've made a Projectile class and a new instance is created when the user touches the screen:</p><pre><code>@Overridepublic boolean onTouch(View v, MotionEvent e){    float touch_x = e.getX();    float touch_y = e.getY();    new Projectile(touch_x, touch_y);}</code></pre><p>And the Projectile class:</p><pre><code>public class Projectile{    float target_x;    float target_y;    Path line;    public Projectile(float x, float y){        target_x = x;        target_y = y;        line = new Path();        line.moveTo(MyGame.mPlayerXPos, MyGame.mPlayerYPos);        line.lineTo(target_x, target_y);    }}</code></pre><p>So this makes a Path with 2 points, the player's position and and touch coords. My question is - How can you access points on this line? For example, if I wanted to get the x,y coords of the Projectile at the half point of the line, or the point the Projectile would be at after 100 ticks (moving at a speed of X pixels/tick)?</p><p>I also need the Projectile to continue moving after it reaches the final point.. do I need to use line.addPath(line) to keep extending the Path?</p><p><strong>EDIT</strong></p><p>I managed to get the Projectiles moving in a straight line, but they're going in strange directions. I had to fudge some code up:</p><pre><code>private void moveProjectiles(){        ListIterator&lt;Projectile&gt; it = Registry.proj.listIterator();        while ( it.hasNext() ){            Projectile p = it.next();            p.TimeAlive++;            double dist = p.TimeAlive * p.Speed;            float dx = (float) (Math.cos(p.Angle) * dist);            float dy = (float) (Math.sin(p.Angle) * dist);            p.xPos += dx;            p.yPos += -dy;        }    }</code></pre><p>The <code>Angle</code> must be the problem.. I'm using this method, which works perfectly:</p><pre><code>private double getDegreesFromTouchEvent(float x, float y){        double delta_x = x - mCanvasWidth/2;        double delta_y = mCanvasHeight/2 - y;        double radians = Math.atan2(delta_y, delta_x);        return Math.toDegrees(radians);    }</code></pre><p>However, it returns 0-180 for touches above the center of the screen, and 0 to -180 for touches below. Is this a problem?</p>","408178","","408178","","2010-11-04 22:47:48","2010-11-04 22:58:52","Following a straight line (via Path?)","<android><path><coordinate-systems>","3","1","0","",""
"4101906","1","","","2010-11-04 22:14:17","2","6060","<p>Hi I'm writing an app for DroidX which is 480x854. I set up my AVD as follows:</p><p>target:API level 7<br>skin:480x854<br>hw.lcd.density:160  </p><p>That's it. The emulator loads fine and looks great but my app doesn't fill_parent for some reason. See here:</p><p><img src=""http://i.stack.imgur.com/8oHQZ.png"" alt=""alt text""></p><p>It doesn't scale all the way up and I'm not sure why. Here is my 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;ImageView android:src=""@drawable/logo_recruiting""    android:background=""#FF000000""     android:adjustViewBounds=""true""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:padding=""30dip"" /&gt;&lt;LinearLayout android:orientation=""vertical""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:layout_weight=""1""     android:gravity=""center""    android:background=""@drawable/menu_background""&gt;    &lt;Button android:layout_height=""wrap_content""        android:layout_width=""wrap_content""         android:layout_marginBottom=""25dip""        android:text=""@string/events""        android:textColor=""#FFFFFFFF""        android:textSize=""22dip""        android:paddingBottom=""5dip""        android:background=""@drawable/events_button""        android:onClick=""launchEventsMap""        android:id=""@+id/events_button""        /&gt;    &lt;Button android:layout_height=""wrap_content""        android:layout_width=""wrap_content""         android:layout_marginBottom=""25dip""        android:text=""@string/jobs""        android:textColor=""#FFFFFFFF""        android:textSize=""22dip""        android:paddingBottom=""5dip""        android:background=""@drawable/jobs_button""        android:id=""@+id/jobs_button""        /&gt;    &lt;Button android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginBottom=""25dip""         android:text=""@string/applicants""        android:textColor=""#FFFFFFFF""        android:textSize=""22dip""        android:paddingBottom=""5dip""        android:background=""@drawable/applicants_button""        android:id=""@+id/applicants_button""        /&gt;    &lt;Button android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginBottom=""25dip""         android:text=""@string/resumes""        android:textColor=""#FFFFFFFF""        android:textSize=""22dip""        android:paddingBottom=""5dip""        android:background=""@drawable/resumes_button""        android:id=""@+id/resumes_button""        /&gt;    &lt;Button android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginBottom=""25dip""         android:text=""@string/settings""        android:textColor=""#FFFFFFFF""        android:textSize=""22dip""        android:paddingBottom=""5dip""        android:background=""@drawable/settings_button""        android:id=""@+id/settings_button""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","129705","","","","","2010-12-08 17:49:01","Android LinearLayout not stretching full screen","<android><layout><screen>","2","1","","",""
"4102127","1","","","2010-11-04 22:47:35","2","566","<p>I have two bitmap overlapped .The top bitmap is transparent and when user touch to screen i copy pixels from another bitmap to top bitmap.My goal is to give to users the feeling of erasing image with touching to see another image.However it is not working properly especially when user drags his finger too fast on the screen.I made a few tests and i beleive drawing bitmaps to the canvas every time cause the lag but i don't know how to fix it.</p>","476324","","","","","2010-11-04 22:58:34","Application gets too slow while drawing two bitmaps on a Canvas !","<android><canvas><bitmap>","1","0","","",""
"4102172","1","4102199","","2010-11-04 22:58:14","1","403","<p>I am trying to run a query for my media player as follows:</p><pre><code>audioCursor = getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null,       AlbumColumns.ALBUM + ""='"" + albumKey + ""'"", null,AudioColumns.TRACK + "" ASC"");</code></pre><p>A problem arises when the album has an apostrophe in it, as it ends the albumKey segment and errors out.</p><p>Does anyone have any suggestions on how to fix?</p><p>All help is greatly appreciated.</p><p>Thank You,Josh</p>","453305","","","","","2010-11-04 23:04:00","Android : Trouble with query containing apostrophe","<android><apostrophe>","1","0","1","",""
"4102193","1","4102226","","2010-11-04 23:02:49","4","7985","<p>I'm using this to see if a file already exists and get its timestamp:</p><pre><code>File file = new File(getResources().getString(R.string.file_name));if (file.exists()) {  Date lastModified = new Date(file.lastModified());}</code></pre><p>Even though I can see that this file does indeed exist using the Context.fileList() method, the code above always says it doesn't.</p><p>How can I get a file's last modified date?</p>","460887","","","","","2012-10-19 09:12:39","Getting a File's Last Modified Date","<android>","2","2","1","",""
"4102219","1","4141385","","2010-11-04 23:07:23","4","4013","<p>I've been scouring throug the examples and tutorials but I can't seem to get my head around how to handle recycling within a subclassed SimpleCursorAdapter.  I know that for regular ArrayAdapters you can check convertView for null and inflate if null from the xml and if not null, recycle, but I'm having a little trouble visualizing how that works with the from and to arrays within the SimpleCursorAdapter subclass.  I tried to figure this out from the The Busy Coders Guide to Android Development by Commonsware but was unsuccessful.  If anyone knows of any tips, examples, or tutorials, I would be grateful to see them.</p>","411435","","","","","2012-06-11 11:59:56","Subclassing SimpleCursorAdapter to include convertView for memory conservation","<android><list><android-listview><recycling>","5","1","6","",""
"4102299","1","4384436","","2010-11-04 23:21:14","1","2300","<p>Ok, so I have been searching for quite some time on this.</p><p>I have a lat/long from my new found location. geocoder's getFromLocation returns a certain number of addresses from the lat/long and that is all fine and dandy. I then put it into an adapter which populates a spinner... also works perfect. </p><p>What I need now though is to get business names instead of addresses. I would prefer to use the lat long and get all businesses within a certain distance because not all the addresses returned from getFromLocation are complete. Some are just neighborhoods or countries.</p><p>This link does a good job although I have not implemented it yet. In my mind, it seems like a lot of processing power for what should be pretty standard from a big-wig like Google.</p><p><a href=""http://www.smnirven.com/?p=39"" rel=""nofollow"">http://www.smnirven.com/?p=39</a></p><p>Thanks in advance.</p><pre><code>public void getFeature() {    double lat = currentLocation.getLatitude();    double lon = currentLocation.getLongitude();    Geocoder gc = new Geocoder(getBaseContext(), Locale.getDefault());    try {        List&lt;Address&gt; tmpfeatures = gc.getFromLocation(lat, lon, 15);        Iterator itr = tmpfeatures.iterator();        while (itr.hasNext()) {            featuresAdapter.add(((Address) itr.next()).getFeatureName().toString());        }    } catch (IOException e) {        e.printStackTrace();    }}</code></pre>","491044","","569101","","2013-09-16 09:27:59","2013-09-16 09:27:59","Getting business names or landmarks from lat/long in Android","<android><google-maps-api-3><geocoding>","1","0","","",""
"4102369","1","4109666","","2010-11-04 23:34:17","1","195","<p>Should I create a Listener within a BaseAdapter or should I pass it in?</p><p>I have 4 classes that inherit from a base class. I pass the Adapter a list objects. The Adapter is eventually used with a ListActivity</p><p>I want to create a View based on the derived class and I want them to launch an Activity based on the type of a View. </p><p>Currently I create the intent and Listener in the BaseAdapter. Is what I'm doing a good pratice?</p>","431435","","","","","2010-11-05 20:14:41","Design Question on Android Adapters","<android><design><listener><listactivity><addeventlistener>","1","3","0","",""
"4102386","1","4102405","","2010-11-04 23:37:55","5","21787","<p>I have implemented a simple Android application that I now would like to test on a real device. I have a Nexus One.</p><p>In the Android Eclipse plugin, I have downloaded and installed the USB driver (revision 3) package. But when I connect my Nexus One to my PC (running Windows 7) using the USB cable, a message box pops up and shows that ""No driver found"" for ""Nexus One"".</p><p><img src=""http://i.stack.imgur.com/XALqJ.png"" alt=""Driver Software Installation""></p><p>I have activated <strong>USB Debugging</strong> on my device. And when I run <code>adb devices</code> on my PC, it just prints <code>List of devices attached</code> and no devices are listed. And if I use <strong>Device Manages</strong> in Windows, and tries to update the driver for ""Nexus One"", I can not select a driver in the ""driver directory"" of <em>Android SDK</em>.</p><p>How can I install a driver for Nexus One on Windows 7 so I can use it for USB debugging my Android applications on a real device?<img src=""http://i.stack.imgur.com/SE4Kq.png"" alt=""Android SDK and AVD Manager""><img src=""http://i.stack.imgur.com/QQOKL.png"" alt=""Device Manager""></p>","213269","","213269","","2010-11-05 00:06:34","2013-06-24 09:36:59","How do I install the USB driver for Nexus One on Windows 7 for debugging purposes?","<android><debugging><usb><driver><nexus-one>","4","1","2","",""
"4102513","1","4102703","","2010-11-05 00:04:51","1","886","<p>This one is bedeviling me.   What am I overlooking?   I want a button exactly one inch wide, on any density screen.  I declare it in the layout like this:</p><pre><code>&lt;Button  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:width=""160dip""android:text=""How wide?""/&gt;</code></pre><p>What I get is a button that is exactly 7/8ths of an inch wide on all screens, not the expected 1 inch.  Is the difference maybe the margin or padding around the button?  If so, how to set that to zero?</p>","253661","","","","","2010-11-05 00:43:37","Android DIP size wrong","<android><size><dip>","2","0","","",""
"4102627","1","4102724","","2010-11-05 00:28:39","4","1542","<p>I have a widget that contains 4 buttons to show 4 stock prices, each of them will launch into the same activity Quote.class to show stock details. In onUpdate(), it will set up the pendingIntent with extras with stock symbol. After I hit button A, it goes to Quote activity that shows stock A. Then I hit the BACK button to the homescreen, Quote activity calls onDestroy() and when I hit button B, stock B will show properly. However, when i hit HOME button after it shows stock A, the Quote activity only calls onStop without calling onDestroy(), then as i hit button B, it will call onStart() and it shows the same instance that shows stock A.</p><pre><code>RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.etappwidget); setQuoteIntent(context, views, R.id.view1, ""BAC"", 1);setQuoteIntent(context, views, R.id.view2, ""C"", 2);setQuoteIntent(context, views, R.id.view3, ""GOOG"", 3);setQuoteIntent(context, views, R.id.view4, ""AAPL"", 4); private static void setQuoteIntent(Context context, RemoteViews views, int viewId, String symbol, int requestCode) { Intent i = new Intent(context, Quote.class); i.putExtra(""SYMBOL"", symbol); i.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); PendingIntent pi = PendingIntent.getActivity(context, requestCode, i, PendingIntent.FLAG_UPDATE_CURRENT); views.setOnClickPendingIntent(viewId, pi);</code></pre><p>}</p><p>Originally I thought adding a flag in the Intent should solve this problem. But I have triedi.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK or FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_NO_HISTORY), none of them makes any difference. </p><p>So is there any ways to make it work? How can i remove the history stack from HOME button? How can I call onCreate in Quote activity and get new extras when i hit button B? Any help is appreciated. Thanks </p>","497847","","345717","","2010-11-05 00:44:56","2012-03-11 13:32:25","Android - When launch the same activity from widget with different extras, how to prevent the same instance show up after returned from HOME button?","<android><android-widget>","5","0","1","",""
"4102758","1","4118821","","2010-11-05 00:56:42","16","14291","<p>In my application I load a couple of images from JPEG and PNG files. When I place all those files into assets directory and load it in this way, everything is ok:</p><pre><code>InputStream stream = getAssets().open(path);Bitmap bitmap = BitmapFactory.decodeStream(stream, null, null);stream.close();return new BitmapDrawable(bitmap);</code></pre><p>But when I try to load the exact same images from sd card, I get an OutOfMemory exception!</p><pre><code>InputStream stream = new FileInputStream(""/mnt/sdcard/mydata/"" + path);Bitmap bitmap = BitmapFactory.decodeStream(stream, null, null);stream.close();return new BitmapDrawable(bitmap);</code></pre><p>This is what I get in the log:</p><pre><code>11-05 00:53:31.003: ERROR/dalvikvm-heap(13183): 827200-byte external allocation too large for this process.11-05 00:53:31.003: ERROR/GraphicsJNI(13183): VM won't let us allocate 827200 bytes...11-05 00:53:31.053: ERROR/AndroidRuntime(13183): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget11-05 00:53:31.053: ERROR/AndroidRuntime(13183):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)...</code></pre><p>Why can this happen?</p><p>UPDATE: Tried both of these on real device - it seems that I can't load more than 12MB of bitmaps into whatever is called ""external memory"" (this is not an sd card).</p>","6533","","6533","","2010-11-13 22:04:04","2013-02-13 04:27:36","OutOfMemory exception when loading bitmap from external storage","<android><out-of-memory>","13","8","7","",""
"4102805","1","","","2010-11-05 01:06:58","4","3464","<p>I'm writing an android app that requires binding a JSON object into a domain entity with the keys from the JSON as instance variables. Since there are several domain entities, each with different instance variables that the JSON needs to bind to in the app, i'd like to write a method such as ths following:</p><ol><li>Loop through all the instance variables from the domain</li><li>if a key exists in the JSON with the name of the instance variable, take the value for this key from the JSON and set the Domain's instance variable with this key name equal to this value. </li></ol><p>The reason i'm interested in the doing the binding from the class to the JSON is because if the JSON changes for some reason, I don't want it to break the app when the instance variable doesn't exist in the app's domain for a specific JSON key.</p><p>Thanks in advance for any help!</p>","497899","","","","","2010-11-05 10:48:59","Java Reflection - Get all instance variable names of a class","<java><android><json><reflection>","2","0","1","",""
"4102841","1","4121498","","2010-11-05 01:16:38","1","365","<p>I've been messing around with C2DM and have a nice little app working perfectly in the Emulator.  I send a message from my app server to Google's C2DM servers, the message will arrive on the emulator and my app would respond appropriately.</p><p>My problem now is running the app on my smartphone (a Nexus One).  The app runs fine and registers for C2DM with Google and then forwards it's rego ID to my application server.  This is all working as expected. Problem is, when I send a message from my app server to the phone, my app never receives the message.  After some investigation I found outthat the message reaches the phone, but the C2DM subsystem seems to be forwarding the message to the Google Talk app and not MY app.</p><p>Has anyone seen this behavior before?  Can anyone give hints on what to look for to solve this?  I was assuming that if the registration messages where forwarded to my app, then everything else should be as well.</p><p>Thanks,</p><p>Jamie </p>","393329","","","","","2010-11-08 05:28:14","Android C2DM messages reach phone, forwarded to wrong app","<android><android-emulator><android-c2dm>","1","0","1","",""
"4102888","1","4105537","","2010-11-05 01:30:25","0","850","<p>Me Doing ""edu.sju.BlackJack""  Is not causing updates that are later called to occur.I reference the layout correctly and the calls that are supposed to update it are correct, so what do I put in for the package name?</p><p>I should add that my package name according to the manifest is the above.This is the code I have now which currently doesn't update the screen (or i'm guessing change the value correctly).</p><p>RemoteViews name = new RemoteViews(""edu.sju.BlackJack"", R.layout.play_screen);</p><p>If that's not it.. would it then be this code?</p><p>name.setTextViewText(R.id.Dealer_Total, ""0"");</p><p>Dealer_Total is the id for the TextView that I want to change.. however again the Change is not occurring.</p><p>Thanks in advance for any and all assistance.</p><p>Here is the whole of my code that i'm talking about,  first Playscreen.java</p><pre><code>package edu.sju.BlackJack;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.widget.ImageView;import android.widget.RemoteViews;import android.widget.TextView;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import java.util.*;public class PlayScreen extends Activity implements OnClickListener {    /** Called when the activity is first created. */    GameEngine Engine = new GameEngine();     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.play_screen);        TextView TextDealer =  (TextView)findViewById(R.id.Dealer_Total);         Engine.setView(TextDealer);        //Set up click listeners for all the buttons        View hitButton = findViewById(R.id.hit_button);        hitButton.setOnClickListener(this);        View standButton = findViewById(R.id.stand_button);        standButton.setOnClickListener(this);        //new preplay button (ML 10/24/10)        View prePlayButton = findViewById(R.id.prePlay_button);        prePlayButton.setOnClickListener(this);        Thread thread = new Thread(Engine);        thread.start();    }       public void onClick(View v) {        switch (v.getId()) {            case R.id.prePlay_button:                v.setVisibility(View.GONE);                System.out.println(""Working?"");                Engine.setGameStart(1);                break;            case R.id.hit_button:                Engine.gameHit(1);                break;            case R.id.stand_button:                Engine.gameStand(1);                break;        }            // More buttons go here (if any) ...            }}</code></pre><hr><p><strong>Now here's the GameEngine Thread</strong>Not the Whole of it,  just enough so you get the idea</p><hr><pre><code>package edu.sju.BlackJack;import java.util.Random;import android.widget.RemoteViews;import android.widget.TextView;public class GameEngine   implements Runnable {    static int playerCount = 0;    //keep record of which cards to change for player when hit is selected    static int dealerCount = 0;    //keep record of which cards to change for dealer when dealer hits    static int win = 0;     //keeps record of wins  (JV 10/01/10)    static int lose = 0;    //keeps record of loss  (JV 10/01/10)    static int hit = 0;     //let's engine know if hit button was selected (0 means it has not)    static int stand = 0;    //let's engine know if stand button was selected (0 means it has not)    static int playerTotal = 0; //tells player's total (JV 10/01/10)    static int dealerTotal = 0; //tells dealer's total (JV 10/01/10)    static int playerTurn = 0;  //activates buttons so that they do actions when clicked (as it's players turn)    static int startGame = 0; //starts the game when the start game button is pressed    TextView TextDealer;    RemoteViews name = new RemoteViews(""edu.sju.BlackJack"", R.layout.play_screen);public void run() {    name.setTextViewText(R.id.Dealer_Total, ""0"");    //main();}public void setView(TextView a){TextDealer = a;}public void setGameStart(int i){    startGame = i;}public void gameHit(int i){    if(playerTurn == 1)    hit = 1;}public void gameStand(int i){    if(playerTurn == 1)    stand = 1;}public void main()    {//Start Game        Deck mainDeck = new Deck();        fillDeck(mainDeck);        //TextView TextPlayer =  (TextView)findViewById(R.id.Player_Total);         //TextDealer.setText("""" + dealerTotal);        //TextPlayer.setText("""" + playerTotal);        while(true)        {            if(startGame == 1)            {                if(mainDeck.getList().size() &lt; 15){                    mainDeck = emptyDeck();                    fillDeck(mainDeck);                    }                  //RESET CARD VIEWS TO DEFAULT                //RESET DEALERCARD AND PLAYERCARD TOTALS TO 0                dealerTotal = 0;                playerTotal = 0;                playerCount = 0;                dealerCount = 0;                //playHand(mainDeck);            }        }    }</code></pre>","487645","","487645","","2010-11-05 15:16:11","2010-11-05 15:16:11","How Do I Pass The Package To RemoteView in Android?","<android><views><package>","1","1","1","",""
"4102903","1","","","2010-11-05 01:32:38","0","190","<p>I need to have a layout for my widget, but I don't know how to arrage my images on widget screen.</p><p>I need to have 4 small Images on first row</p><p>then 2 Images on 2nd row</p><p>1 Image on 3rd row</p><p>and 1 Image on 4th row</p><p>Could you please someone create the xml file ?</p>","490383","","","","","2011-02-02 14:14:29","Layout for android","<android>","3","3","","",""
"4102943","1","","","2010-11-05 01:39:57","8","5518","<p>New to Android development.  I'm wondering if its possible to programmatically draw an icon to put in the notification bar? What if we want the icon to display some dynamic text for something like battery level?  </p><p>If anyone has a code sample it would be nice.  Thanks.</p>","494249","","","","","2012-11-02 06:14:12","Android Notification Icon","<android>","3","2","3","",""
"4103058","1","4103082","","2010-11-05 02:10:28","0","1018","<p>Hey guys, I have this code for an android application, the funny thing is that data is never equal to datas, can you guys explain me why, and if in case give me new read / write file functions :/ , thanks</p><pre><code>   String datas = ""volume of"";    writesettings(datas);    String data = readsettings();    String data2 = ""volume of"";    if (data == datas) {     System.out.println(""success"");    }    System.out.println(data);    System.out.println(data.length());    System.out.println(datas.length());}// Write Settingspublic void writesettings(String data){     try {        FileOutputStream fOut = openFileOutput(""settings.dat"", MODE_WORLD_READABLE);  OutputStreamWriter osw = new OutputStreamWriter(fOut);   osw.write(data);  osw.flush();  osw.close(); }catch(Exception e){  e.printStackTrace(System.err); }}public String readsettings(){ try {  FileInputStream fIn = openFileInput(""settings.dat"");  InputStreamReader isr = new InputStreamReader(fIn);  char[] inputBuffer = new char[9];  isr.read(inputBuffer);  String readString = new String(inputBuffer);  datax = readString;  isr.close(); } catch (IOException ioe) {  ioe.printStackTrace(); } return datax;}</code></pre>","497918","","","","","2010-11-05 02:16:36","Android Write / Read Text","<android>","1","2","","",""
"4103099","1","4103131","","2010-11-05 02:20:09","0","121","<p>This is generated from my website from google map:</p><p>Longtitude = 20.802268981933594;Altitude = 41.114279428574434;</p><p>But the Geopoint takes only int only, How can I get use of the values that I have from my website,, cause this app is based on my website.  </p>","371301","","","","","2010-11-05 02:25:37","Android: Google map on android has different Longtitude and Altitude","<android><google-maps>","1","1","","",""
"4103147","1","4103213","","2010-11-05 02:30:59","0","443","<p>I would like to define an ImageView in Xml, and then listen to gestures which occur only on that ImageView.  But, it appears that the constructor for GestureDector requires an Activity as a parameter, and then responds to gesture events on all components in that Activity.  Is there any way to limit this such that events are only generated for gestures upon the pre-defined ImageView?</p><p>Thank you</p>","426493","","","","","2011-03-09 23:12:20","In android, how to listen to gestures on an ImageView?","<android>","1","0","","",""
"4103322","1","4113463","","2010-11-05 03:12:06","1","1256","<p>What should I do to get different input keyboards for text input in my Android. For example when I want to input text in Korean, I want a Korean KB. And if I want to do the same in Chinese, I want to get a Chinese keyboard. How do I do it programmatically? Any pointers will be greatly appreciated. Thanks.</p>","421372","","421372","","2010-11-05 04:50:30","2012-12-27 13:21:26","Getting different keyboards for text input programmatically","<android><input><keyboard><user-input>","1","0","","",""
"4103384","1","5476614","","2010-11-05 03:27:09","1","1269","<p>Any mobile/web developer who targets smartphones has the following questions in his mind:</p><ul><li>Should I develop on Native environment or just use a Framework?</li><li>But which framework?</li><li>Or just a web app wouldn't be sufficient to my purpose?</li></ul><p>And most of us have more or less but incomplete answer. yes we know, all of this approaches has advantages and disadvantages. But, if we look to the subject like using-the-tool-in-the-right-place-and-time perspective, in which kind of jobs I should go with the <strong>Native</strong> and in which kind of jobs I should go with the <strong>Framework</strong> (and which framework). Or just a <strong>web app</strong> is just fine for which kind of jobs.</p><p>I know that I can find some information around the web and SO. To tell the truth, I have a solid opinion also about the subject. But, let's make a total guide for all of us by collaborating. </p><p>I will write my opinion also as an answer and since all the opinions will be subjective at the end, I will accept the most voted answer as the right answer after 7 days. </p><p>I hope I made my point clear and thank you for sharing your opinion.</p>","40929","","","","","2011-03-29 17:39:44","Pros and Cons of developing mobile application on Native vs. Framework vs. Web App","<iphone><android><frameworks><blackberry><symbian>","1","4","","","2010-11-05 17:32:25"
"4103609","1","","","2010-11-05 04:31:23","1","869","<p>I love the API Demo examples from the Android webpage and used the <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/AnimateDrawable.html-"" rel=""nofollow"">AnimateDrawable.java</a> toget started with a WaterfallView with several straight falling images which works great. Now I like the images to stop when they are clicked. I found out that Drawables can't handle events so I changed AnimateDrawable and ProxyDrawable to be extended from View instead and added a Click-Event-Listener and Handler on the parent WaterfallView. The animation still works great, but the handler doesn't, probably because in AnimateDrawable the whole canvas is shifted when the drawabled are animated. How can I change that example so that I can implement an event handler? Or is there a way to find out where exactly my AnimateDrawables are in the view?</p><p>So the more general question is: <em>How to add an Event Listener / Handler to an animated View?</em></p><p>Here are my changes to the example above:</p><ul><li>AnimateView and ProxyView instead of AnimateDrawable and ProxyDrawable</li><li>ProxyView extended from View and all super calls changed to mProxy</li><li>I commented out mutate()</li><li>The context is still the main Activity which is passed down in the constructors</li><li>In the constructors of AnimateView setClickable(true) and setFocusable(true) are called</li></ul><p>And here is the important source code of the parent/main WaterfallView:</p><pre><code>  public class WaterfallView extends View implements OnClickListener {  private Context mContext;  // PictureEntry is just a value object to manage the pictures  private Vector&lt;PictureEntry&gt; pictures = new Vector&lt;PictureEntry&gt;();  public WaterfallView(Context context) {  super(context);  mContext = context;  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_0)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_1)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_2)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_3)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_4)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_5)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_6)));  pictures.add(new PictureEntry(context.getResources().getDrawable(R.drawable.sample_7)));  }  @Override  protected void onDraw(Canvas canvas) {  if(!setup) {  for(PictureEntry pic : pictures) pic.setAnimation(createAnimation(pic));  setup = true;  }  canvas.drawColor(Color.BLACK);  for(PictureEntry pic : pictures) pic.getAnimateView().draw(canvas);  invalidate();  }  private Animation createAnimation(PictureEntry picture) {  Drawable dr = picture.getDrawable();  dr.setBounds(0, 0, dr.getIntrinsicWidth(), dr.getIntrinsicHeight());  Animation an = new TranslateAnimation(0, 0, -1*dr.getIntrinsicHeight(), this.getHeight());  an.setRepeatCount(-1);  an.initialize(10, 10, 10, 10);  AnimateView av = new AnimateView(mContext, dr, an);  av.setOnClickListener(this);  picture.setAnimateView(av);  an.startNow();  return an;  }  @Override  public void onClick(View v) {  Log.i(""MyLog"", ""clicked ""+v);  }  }</code></pre>","440387","","440387","","2010-11-05 04:37:03","2010-11-05 05:48:44","Android: Change APIDemo example AnimateDrawable.java to have a ClickEvent-Handler","<android><events><animation><view>","1","0","","",""
"4103924","1","4103960","","2010-11-05 06:15:15","3","286","<p>Lately I have been thinking about developing some basic android app. Its only due to personal interest. Please guide me where to start from, what tools I require and any pointers to certain pdf's etc.</p><p>My background:</p><p>1) Embedded software developer in C.2) Had got some chance to work on flex. Hence familiar with eclipse.3) Working in multi-threaded environment. (RTOS)4) Worked in unix/linux environment.</p><p>Since I have not worked on Java, how bad is it for me to get started? </p><p>Please guide me, I am ready to start with the very basics.</p>","95880","","","","","2011-09-27 15:56:18","Learning Android dev due to curiosity","<android>","2","0","1","",""
"4103963","1","10248817","","2010-11-05 06:29:56","7","4518","<p>I want to use the default user agent for the phone in a HttpClient connection and would like to know if there is a way to obtain the user agent without having to have a WebView to query.</p><p>Thanks</p>","445348","","","","","2013-12-11 14:03:59","Is there a way to obtain the default user agent string aside from WebView.getSettings().getUserAgentString()?","<android><httpclient><user-agent>","3","3","1","",""
"4103983","1","","","2010-11-05 06:39:39","4","730","<p>My Android application is calling a JSON service via HTTP and I would like to only allow my application to call the service and block others.</p><p>What is the best way to do it?</p><p>One way I can think of is using private/public key encryption. Can we embed a private key securely in the application?</p>","434784","","434784","","2010-11-05 08:22:42","2010-11-05 09:48:09","Block non-Android users calling JSON service","<android><web-services><json><encryption>","3","0","1","",""
"4104045","1","4105519","","2010-11-05 06:59:10","5","497","<p>I wonder if it's possible to reference a XML string value in another XML String resource.</p><p>Things like the following are possible:</p><pre><code>&lt;string name=""title""&gt;MyTitle&lt;/string&gt;&lt;string name=""activityTitle""&gt;@string/title&lt;/string&gt;</code></pre><p>But in case of an concated resource string, I found no solution yet, so what I'm searching for is the following:</p><pre><code>&lt;string name=""title""&gt;MyTitle&lt;/string&gt;&lt;string name=""subTitle""&gt;@string/title - mySubTitle&lt;/string&gt;</code></pre><p>So far I was only able to solve it programmically via:</p><pre><code>&lt;string name=""title""&gt;MyTitle&lt;/string&gt;&lt;string name=""subTitle""&gt;%1$s - mySubTitle&lt;/string&gt;getResources().getString(R.string.subTitle, getResources().getString(R.string.title));</code></pre><p>I would like to keep the string references in the string.xml file itself.</p>","498049","","498049","","2010-11-05 08:09:03","2010-11-05 11:41:15","Internal string resource references","<android><resources>","1","0","1","",""
"4104087","1","4104459","","2010-11-05 07:13:15","1","372","<p>I have a given URL with specific IDs. I'm suppose to pass those IDs to this URL as argument and retrieve the XML in java. Any clue?</p>","2355649","","","","","2010-11-05 09:30:24","Reading XML from the web in Java","<android>","3","0","","",""
"4104186","1","4779418","","2010-11-05 07:41:03","3","1115","<p>I was wondering: <strong>can you transfer a database</strong> you use on an Android device <strong>onto a virtual Android device</strong> in your development environment  ?</p><p>I am using a program to enter books on my Samsung Galaxy S. From this program I can <strong>download the source</strong>, which can help me a lot in understanding various aspects of the Android development cycle.</p><p>I can compile the program fine and run it to an Android virtual device just fine. But, can I 'download' or 'transfer' the database I created on my mobile onto my pc and than onto the virtual device ?</p>","231181","","135152","","2011-05-25 03:07:49","2011-07-18 20:26:51","Can you transfer a database from an Android device onto your computer to use as database in an Android virtual device","<android><sqlite><android-emulator><android-2.1-eclair>","2","0","1","",""
"4104532","1","6111769","","2010-11-05 09:02:55","1","762","<p>I'm trying to do animation around View that changes size due to setVisible on it's child.I've got View like that:  </p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_height=""wrap_content""  android:layout_width=""fill_parent""  android:background=""@drawable/roundedtable_filled""  android:layout_margin=""8dip""  android:orientation=""vertical""&gt;      &lt;TextView      android:id=""@+id/title""      style=""@style/appInfoTextBold""      android:text=""Jakie dane powinna uwzgledniac reklamacja?"" /&gt;      &lt;TextView      android:id=""@+id/text""      style=""@style/appInfoText""      android:text=""Kochasz kino? Z niecierpliwoscia czekasz na kolejne odcinki  swoich ulubionych seriali? Marzysz o przeprowadzce do Hollywood? Jesli tak, to vod.onet.pl jest serwisem wlasnie dla Ciebie."" /&gt;  &lt;/LinearLayout&gt;  </code></pre><p>On <em>title</em> clicked I change Visibilisty of <em>text</em>. Now I'd like to have nice animation of growing size of my View. What's the correct way to do that?Maybe I shouldn't change text visibility and instead try resize the view in thread so it would be bigger every 40ms or sth like that?</p>","475837","","","","","2011-05-24 14:12:21","Animation on View sizechanged","<android><animation><android-animation>","1","0","1","",""
"4104598","1","","","2010-11-05 09:14:55","0","1157","<p>How can i include a URL in my tooltip in Google Map? Thanks</p><p>Here is an image of what exactly i require:<img src=""http://i.stack.imgur.com/Uewy9.jpg"" alt=""alt text""></p>","2355649","","2355649","","2010-11-11 10:11:03","2010-11-11 10:11:03","Android: How to override Tooltip in Google Map to include URL","<android>","1","0","","",""
"4104675","1","","","2010-11-02 13:07:47","0","3886","<p>My machine is using a WiFi connection for internet, and the LAN card is idle.it's not behind a proxy or firewall, but somehow, my emulator's browser isn't loading any page.meaning that the emulator can't connect to the internet.</p><p>I searched a lot but with no luck.what might be the possible reasons?</p><p>Please help.</p><p>Thanks in Advance!!</p>","","Sheikh Aman","","","","2012-12-21 05:24:15","Emulator unable to connect to internet","<android><android-emulator>","7","4","","",""
"4104790","1","","","2010-11-05 09:42:21","1","891","<p>I've got a custom layout which is like a grid. I registered it for contextmenu. Now if I do a long click on it, I'd like to know the position where the user clicked on. I have to let my custom layout implement MenuInfo right? But what about the click position?</p>","474326","","","","","2010-11-05 11:40:10","How do I find out which grid row was clicked for contextmenu?","<android><grid><click><contextmenu><position>","1","0","","",""
"4104886","1","4105021","","2010-11-05 09:57:19","1","743","<p>My Android application currently has TableLayout with several TableRow's containing an ImageView then TextView side-by-side.</p><p>Clicking any where on a TableRow will load a new activity showing further info.</p><p>If I use the trackball, it will work its way through the rows, but I don't see which is currently selected so have no idea which TableRow is selected when I click the button to load the activity.</p><p>Likewise, when a user touches the screen with a finger, there is no highlight showing which one they selected.</p><p>I've searched with terms such as Highlight, Selected, Focus but none of the pages I see returned have given me any insight into achieving what I require.</p><p>Using a TableLayout is required I guess, it was just what I used and may not even be the best solution!</p><p>Any examples out there I can try to get this working??</p><p>Thanks! :)</p>","67419","","","","","2010-11-05 10:22:02","ANDROID: Highlight/Select with Trackball and when Touched","<java><android><android-layout>","1","0","","",""
"4105107","1","","","2010-11-05 10:38:51","0","466","<p>I created a thread in my activity, and that thread will print out the value of my instance variables in my activity after running for about 10 seconds. I pressed the back key to destroy my activity before the thread prints out the values, and when the thread reaches that line of code, it can still print out the values correctly. That means even though the activity is finished, the java object of the activity is still there. Will the object always be there? Or it is just waiting to be GCed? Or it will be killed only when Android needs memory?</p>","412759","","","","","2010-11-05 11:58:06","When does the activity object really get killed after calling finish()?","<android>","1","0","1","",""
"4105555","1","","","2010-11-05 11:47:23","2","275","<p>I have two views, both of a specific width.  I would like them laid out on a horizontal line as follows:</p><ul><li>View 1 should be centred. </li><li>View 2 is pinned to the right edge of the display.</li></ul><p>However, if this arrangement would cause the views to overlap (ie. the screen is too narrow)</p><ul><li>View 2 is pinned to the right edge of the display.</li><li>The right edge of View 1 should touch the left edge of View 2</li></ul><p>Can anyone think of a layout that can achieve this?</p><p>I've tried using a LinearLayout, but that results in one of two things: View 2 is compressed (with ugly text wrapping), or View 1 can't be centred.</p><p>A RelativeLayout appears to get closer to the solution, but again I have to choose between two poor solutions - either the views overlap or View 1 can't be centred.</p>","498251","","491044","","2011-03-11 07:56:57","2011-12-30 09:24:20","How do I center and Android view, while allowing to move away from other view it would overlap with?","<android><layout>","1","1","1","",""
"4105578","1","","","2010-11-05 11:50:34","1","2516","<p>I am working on an Android project that uses classes and methods from a seperate JAR file I am also creating, and the issue is with a specific util class called <code>XpathUtil</code> that is throwing a <code>VerifyError</code> every time I try calling one of its static methods.</p><p>Here is how my XpathUtil class looks like:</p><pre><code>public class XpathUtil { private static XPath xpath = XPathFactory.newInstance().newXPath(); private static String TAG = ""XpathUtil""; public static Document createXpathDocument(String xml) {  try {   Log.d(TAG , ""about to create document builder factory"");   DocumentBuilderFactory docFactory = DocumentBuilderFactory     .newInstance();   Log.d(TAG , ""about to create document builder "");   DocumentBuilder builder = docFactory.newDocumentBuilder();   Log.d(TAG , ""about to create document with parsing the xml string which is: "");   Log.d(TAG ,xml );   Document document = builder.parse(new InputSource(     new StringReader(xml)));   Log.d(TAG , ""If i see this message then everythings fine "");   return document;  } catch (Exception e) {   e.printStackTrace();   Log.d(TAG , ""EXCEPTION OCCURED HERE "" + e.toString());   return null;  } } public static NodeList getNodeList(Document doc, String expr) {  try {   Log.d(TAG , ""inside getNodeList"");   XPathExpression pathExpr = xpath.compile(expr);   return (NodeList) pathExpr.evaluate(doc, XPathConstants.NODESET);  } catch (XPathExpressionException e) {   e.printStackTrace();  }  return null; } // extracts the String value for the given expression public static String getNodeValue(Node n, String expr) {  try {   Log.d(TAG , ""inside getNodeValue"");   XPathExpression pathExpr = xpath.compile(expr);   return (String) pathExpr.evaluate(n, XPathConstants.STRING);  } catch (XPathExpressionException e) {   e.printStackTrace();  }  return null; }}</code></pre><p>And this is the exact line where the exception occurs from the main project I am working with:</p><pre><code>mDocument = XpathUtil.createXpathDocument(xml);</code></pre><p>As you can see, all I'm doing is simple calling <code>createXpathDocument</code> that is located from a seperate jar file that's been succesfully imported and included in my build path via eclipse (any other call I make to different classes from this jar works fine). So I'm not too sure what the issue is.</p><p>I tried doing a clean and build on both the main project and the other project I am using that I then export it to a actual jar file for third party apps to use, but for some strange reason this XpathUtil doesnt work.</p><p>edit: here is the exception:</p><pre><code>Uncaught handler: thread AsyncTask #1 exiting due to uncaught exceptionjava.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.VerifyError: com.kc.unity.agent.util.xml.XpathUtil    at com.kc.unity.agent.util.xml.ContactDescHelper.&lt;init&gt;(ContactDescHelper.java:67)   at com.kc.unity.agent.federation.contacts.ContactPlatformWrapper.constructContactDetails(ContactPlatformWrapper.java:218)  at com.kc.unity.agent.federation.contacts.ContactPlatformWrapper.getContactDetails(ContactPlatformWrapper.java:101)    at com.kc.unified.contacts.ContactDetails.setContactFields(ContactDetails.java:154)   at com.kc.unified.contacts.ContactDetails.access$6(ContactDetails.java:150)   at com.kc.unified.contacts.ContactDetails$LoadScreen.doInBackground(ContactDetails.java:79)  at com.kc.unified.contacts.ContactDetails$LoadScreen.doInBackground(ContactDetails.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>","444668","","","user357812","2010-11-05 12:46:53","2012-06-25 05:22:31","java.lang.VerifyError","<java><android><xpath>","2","3","","",""
"4105655","1","4105721","","2010-11-05 12:03:17","3","8281","<p>I am trying to add two numbers together from EditText fields. So far I have the code below that I believe converts the EditText field 'pos1_deg' &amp; 'pos2_deg' into integers deg1 &amp; deg2.</p><pre><code>deg1 = Integer.parseInt(pos1_deg.getText().toString());deg2 = Integer.parseInt(pos2_deg.getText().toString());</code></pre><p>I could then do the following to add them together</p><pre><code>degSum = deg1 + deg2</code></pre><p>And then the degSum register holds the sum of deg1 &amp; 2. Is this correct so far?</p><p>Then to output back to the 'result' EditText I need to change the integer degSum into a string. I thought the correct way was to use the code below: </p><pre><code>result.setText(degSum.toString());</code></pre><p>However I get an 'Cannot invoke toString() on the primitive type int' error. What am I doing wrong?</p><p>Many thanks for any help</p>","497517","","251173","","2010-11-05 12:34:39","2010-11-05 12:34:41","Problems converting Integer to String","<java><android><string><integer>","4","5","1","",""
"4105715","1","","","2010-11-05 12:10:57","0","749","<p>I have two applications X and Y. Application X has one activity ""A"" that needs to run on the application Y`s process. I am trying to create an instrumentation test like bellow:</p><p>public class ATest extends SingleLaunchActivityTestCase {...}</p><p>The issue is that when I point the AndroidManifest.xml of my test application to instrument process X I get the following error:</p><p>java.lang.RuntimeException: Intent in process test.application.a resolved to different process test.application.b</p><p>I expected that since if activity A runs on process Y the instrumentation framework must run on the same target process Y.</p><p>But if I change to instrument process Y then the following error occurs:java.lang.RuntimeException: Exception during suite construction    at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:239)...Caused by: java.lang.NoClassDefFoundError: test.application.a.A</p><p>I guess that happens since on application Y there is no class test.application.a.A!</p><p>Is this a limitation from the instrumentation framework?</p><p>Thanks in advance!</p>","498288","","","","","2010-11-05 12:33:54","Instrument Activity that runs on foreign process","<android>","1","0","","",""
"4105799","1","4106416","","2010-11-05 12:24:46","2","2449","<p>I can create a new preferences file by calling <a href=""http://developer.android.com/reference/android/content/Context.html#getSharedPreferences%28java.lang.String,%20int%29"" rel=""nofollow"">Context.getSharedPreferences(String name, int mode)</a>, putting some values in the returned preferences' editor, and committing.  However, I don't see an interface in the API to remove the created file when I no longer need it.  I've tried <a href=""http://developer.android.com/reference/android/content/Context.html#deleteFile%28java.lang.String%29"" rel=""nofollow"">Context.deleteFile(String name)</a>, passing in the same <code>name</code> argument from above, but that returns <code>false</code>, indicating the file wasn't actually deleted.  I'm using MODE_PRIVATE, if that makes a difference.</p><p>Browsing the source for <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/app/ContextImpl.java#l37"" rel=""nofollow"">context's implementation of the editor</a> doesn't reveal any clues either, as far as I can tell.</p><p>Any ideas?  The background here is that I'm allowing my users to save copies of their ""current"" preferences so that they can restore previously saved settings.  When they don't want those settings anymore, I want to remove the saved preferences file so it doesn't take up space.  At the moment the best I can do is an <code>edit().clear().commit</code> on the file, which I believe will remove most of the contents.  Not as good as delete, though.</p>","335650","","","","","2010-11-05 13:47:47","Delete a named preferences file in Android","<android><preferences><sharedpreferences>","1","0","","",""
"4105800","1","","","2010-11-05 12:25:10","1","1963","<p>I've been reading about performance issues decoding Bitmaps and have received the OutOfMemoryError ""Bitmap exceeds VM budget"" issue when I would expect to not be out of memory and read online that this is a common problem referred to as a bug in the framework by many devs.</p><p>Typically, I get the error mentioned above on my second pass.  Let's say I load a somewhat sizable Bitmap successfully and then recycle it and even set the ref to null.  When I call this same method a second time that does the work of loading my Bitmap(s) into memory...crash.</p><p>I've read on previous posts here and elsewhere online that there are a few things that can be done with BitmapFactory.Options (for instance, providing an input buffer explicitly).   But, before proceeding blindly in using what I've found, I'm hoping someone with more knowledge of these classes can shed a little more light.</p><ol><li><p>What is the difference between providing a byte array to BitmapFactory.Options.inTempStorage explicitly and what the BitmapFactory would be doing without it during the encoding process?  Why would/should this help with the OutOfMemoryError?  Is it providing a smaller buffer than the default and therefore having more opportunities to clean up before running out of memory?</p></li><li><p>What is specifically going on when I call Bitmap.recycle(), and why is it different from setting the Bitmap to null?  Note: doing either or both has yet to make a difference in whether or not (and when) I get OutOfMemory errors.</p></li><li><p>Is there ever a time that I should explicitly invite the GC into the picture with these kinds of issues?  I've always operated (in both Java and .Net) under the assumption that the GC, for the most part, should be trusted to decide where and when it does its thing because there are more consequences to a collection than just freeing up memory (and I'm personally not well versed in them enough to make that decision).</p></li></ol><p><strong>Update:</strong></p><p>This video answered most of my questions:</p><p>Google I/O 2011: Memory management for Android Apps</p><p><a href=""http://www.youtube.com/watch?v=_CruQY55HOk"" rel=""nofollow"">http://www.youtube.com/watch?v=_CruQY55HOk</a></p>","53501","","53501","","2011-06-29 19:23:48","2011-06-29 19:23:48","Questions about BitmapFactory.Options in Android","<java><android><garbage-collection><bitmap><bitmapfactory>","1","2","1","",""
"4105963","1","4106636","","2010-11-05 12:51:00","1","943","<p>I am working on an Application that require some interaction between two activities, and I am not sure of what is the best way to achieve it:</p><ul><li>One of the Activities is a ""Logbook"" (Just a ListView that displays a bunch of events).</li><li>The other Activity allows the user to create the events, that will be sent (and displayed in the Logbook).</li></ul><p>How do I notify my Logbook Activity when a new Event is ready to be added?Also, where should I add the event to the database? From the Logbook Activity, when I add it to the ListView, or from the NewEvents Activity, as soon as it's ready?</p><p>Thanks!</p>","488054","","","","","2010-11-05 14:10:28","Activities interactions in Android","<android><activity>","4","0","2","",""
"4106017","1","","","2010-11-05 12:57:53","16","2887","<p>I am using a GridView. Four items in a column. Each element is composed of the following layout:</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=""vertical""&gt;  &lt;ImageView    android:layout_width=""32dip""    android:layout_height=""32dip""/&gt;  &lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""11dip""    android:paddingTop=""2dip"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>So each element is a small image with a bit of text below it. The layout works great on the first pass. However, if an item's text is long, it wraps to two lines. This works ok, until you scroll it in and out of view. By default, all the images in a row are top-aligned. When you scroll a row off-screen, then back on screen, you'll see that the row somehow gets bottom-aligned. It looks like:</p><p>First layout:</p><pre><code>[image]   [image]   [image]  [text]    [text]    [text                     wrap]</code></pre><p>so even though the third element has 2 lines of text, the tops are aligned which is perfect. If I scroll this row off screen, then back on, it looks like this:</p><pre><code>                    [image][image]   [image]   [text[text]    [text]     wrap]</code></pre><p>so the row gets bottom-aligned here. I'm not sure if this is a bug in GridView, or if there's some way to control the layout to always top-align rows. I've tried setting the gravity of the element layout to ""top"", no good. There also doesn't appear to be any setting unique to GridView to control this. Any ideas?</p><p>Thanks</p>","291701","","","","","2013-05-09 04:16:03","GridView - sometimes rows are top-aligned, sometimes they're bottom-aligned!","<android>","4","3","3","",""
"4106071","1","4106316","","2010-11-05 13:08:26","3","15364","<p>I'm trying to use the ViewSwitcher to perform switches between two views. One is an ImageView and the other is a MapView. I have a button which the user clicks to perform this switch but my codes are causing an error. Do you guys have any idea what's about?</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;RelativeLayout android:id=""@+id/RelativeLayout01""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;ImageView android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/banner""    android:background=""@drawable/banner_location"" android:clickable=""false""    android:layout_alignParentTop=""true""&gt;&lt;/ImageView&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:orientation=""horizontal"" android:layout_gravity=""center_horizontal""    android:layout_below=""@+id/banner"" android:layout_centerHorizontal=""true""    android:paddingBottom=""5px""&gt;    &lt;ImageButton android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:background=""@drawable/btn_bus_svcs""    android:id=""@+id/btnBusSvcs"" android:layout_marginRight=""5px""    android:layout_marginTop=""5px""&gt;&lt;/ImageButton&gt;    &lt;ImageButton android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:background=""@drawable/btn_drv_route""    android:id=""@+id/btnDrvRoute"" android:layout_marginLeft=""5px""    android:layout_marginTop=""5px""&gt;&lt;/ImageButton&gt;    &lt;/LinearLayout&gt;    &lt;ViewSwitcher android:layout_above=""@+id/imgViewBusSvcs""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:layout_below=""@+id/LinearLayout01"" android:id=""@+id/switcher""&gt;             &lt;ImageView android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:id=""@+id/imgViewBusSvcs""    android:clickable=""false"" android:layout_below=""@+id/LinearLayout01""    android:layout_centerInParent=""true"" android:background=""@drawable/bus_svcs""       android:layout_gravity=""center_horizontal""&gt;&lt;/ImageView&gt;&lt;com.google.android.maps.MapView    android:id=""@+id/mapview"" android:layout_width=""fill_parent""    android:clickable=""true""    android:apiKey=""REMOVE MY API KEY"" android:layout_height=""300px""/&gt;   &lt;/ViewSwitcher&gt;  &lt;ImageButton android:layout_width=""wrap_content""   android:layout_height=""wrap_content"" android:background=""@drawable/btn_back_to_home""   android:id=""@+id/btnBackHome"" android:layout_gravity=""center_horizontal""   android:layout_alignParentBottom=""true""   android:layout_centerHorizontal=""true""&gt;&lt;/ImageButton&gt; &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The error is as such</p><pre><code>11-05 20:53:13.964: ERROR/AndroidRuntime(1417): Uncaught handler: thread main exiting due to uncaught exception11-05 20:53:13.995: ERROR/AndroidRuntime(1417): java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.RelativeLayout.getRelatedView(RelativeLayout.java:694)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.RelativeLayout.getRelatedViewParams(RelativeLayout.java:708)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.RelativeLayout.applySizeRules(RelativeLayout.java:629)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:279)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.View.measure(View.java:7115)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.View.measure(View.java:7115)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.View.measure(View.java:7115)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.View.measure(View.java:7115)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.ViewRoot.performTraversals(ViewRoot.java:698)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.os.Handler.dispatchMessage(Handler.java:99)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.os.Looper.loop(Looper.java:123)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at android.app.ActivityThread.main(ActivityThread.java:3948)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at java.lang.reflect.Method.invokeNative(Native Method)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at java.lang.reflect.Method.invoke(Method.java:521)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)11-05 20:53:13.995: ERROR/AndroidRuntime(1417):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Really appreciate the help! :)</p>","498329","","1522562","","2013-04-29 03:55:44","2014-03-09 16:33:53","How to use Android ViewSwitcher?","<android><android-mapview><viewswitcher>","4","0","1","",""
"4106112","1","4106749","","2010-11-05 13:11:47","0","350","<p>Does anyone tried to use <code>CursorAdapter</code> with old and new api? </p><p>Do you have some code examples of such solutions?</p>","296427","","296427","","2010-11-05 14:52:04","2010-11-05 14:52:04","How to deal with CursorAdapter and switching Contacts API?","<android><cursor><adapter><android-contacts>","1","0","","",""
"4106198","1","4106329","","2010-11-05 13:24:50","1","3169","<p>for( i=0; i&lt;26; i++)    {</p><pre><code>        btnAlpha[i] = new Button(this);        btnAlpha[i].setBackgroundColor(Color.TRANSPARENT);        btnAlpha[i].setTextColor(Color.GREEN);        btnAlpha[i].setText(Character.toString ((char)(j+i)));        btnAlpha[i].setOnClickListener(new View.OnClickListener(){                          public void onClick(View v){            //Want to get the text from the current button.                             btnAlpha[i].getText();                            //But it gives error that ""i"" cannot be accessed.        }});</code></pre><p>The error i get is  ""cannot refer to a non-final variable inside an inner class defined in a different method"". But i need to get the text at that right time. How to do it? Is there any other way to do it?Please Help!</p>","498338","","121493","","2010-11-05 13:30:32","2010-11-05 13:41:37","Android:How to get the text from the Button when clicked?","<android><button><android-widget>","2","0","1","2013-09-25 02:53:14",""
"4106280","1","4106393","","2010-11-05 13:34:43","0","505","<p>I don't exactly know how android updates the applications. As far as I've read around here it keeps the SQLite database. So, imagine this scenario: one application that uses SQLite database for persisting data. After a while I release v2 which contains some database changes and I need to update user data in database. How can I make this during the update process ?</p>","379865","","","","","2010-11-05 13:46:23","Android update - perform database actions","<android><sqlite>","1","0","","",""
"4106379","1","4108140","","2010-11-05 13:44:38","1","318","<p>I'm trying to run the ImageTarget sample program but it keeps crashing.</p><p>After some debugging it looks as though its failing to load some libraries.I copied them into the system/lib of the android device and it still doesn't seem to be working.</p><p>any tips?</p>","498346","","","","","2010-11-05 16:55:47","Has anyone had the Qualcomm Augmented Reality SDK working on Linux?","<android><augmented-reality><apk>","1","0","","",""
"4106502","1","7142316","","2010-11-05 13:57:38","9","8144","<p>How do I set wifi ip address, dns address, gateway from android java i.e programatically ,I didn't find any method which has the capability to store the values...</p><p>anyone knows? how to do this?</p>","498384","","437301","","2010-11-08 12:33:05","2013-08-21 09:29:18","Set Android IP,DNS,GATEWAY setting programatically","<android><set><wifi><ip>","3","0","8","",""
"4106515","1","","","2010-11-05 13:58:45","1","289","<p>So for some reason that standard orange highlight that happens when you click on something in an Android app has completely vanished. I never put any code anywhere to change its color(to my knowledge). Does anyone know of  reasons this would happen? Or how to manually add it back via code(XML or Java).</p>","325400","","","","","2010-11-05 13:58:45","How did the orange highlight for selecting dissapear?","<android>","0","2","","",""
"4106552","1","","","2010-11-05 14:02:09","2","4561","<p>In my app, I am creating a bitmap from its colors code like this :</p><pre><code>int width=getImageWidth();int height=getImageHeight();int[] array=getbitmap();int[] colorsAsIntegers = new int[width*height];int i = 0;int j = 0;while (i&lt;width*height*4) {colorsAsIntegers[j] = Color.argb(array[i], array[i+1], array[i+2],array[i+3]);i += 4;j++;}myBitmap=Bitmap.createBitmap(colorsAsIntegers,width,height,Bitmap.Config.ARGB_8888);</code></pre><p>And often I get the outofmemoryerror :(So how can I use the BitmapFactory optimisation to avoid this problem?because I don't have an input stream or a file, I only have an arraycontaining my pixels</p><p>Thank you</p>","438244","","","","","2013-09-13 05:01:43","createBitmap causes an outofmemory error","<android><memory><bitmap><out-of-memory>","3","2","1","",""
"4106588","1","","","2010-11-05 14:05:39","0","838","<p>The ANR occurs for my application for some undefined reasons I'd like to figure out. Unfortunately there is not stack trace in traces.txt file. Is there any reason why there is nothing about my app in traces.txt? There are other applications' stack but mine. </p><p>Is there any other way to figure out what cause ANR except traces.txt and DDMS traces, which unfortunately show nothing when my app hangs. I am not also able to use Debug.startMethodTracing as I am not able to call stoptMethodTracing as I do not know when it hangs.</p><p>It happens on Android Froyo</p><p>Best Regards,</p>","498398","","498398","","2010-11-05 14:13:07","2010-11-05 14:42:56","Android ANR and missing logs in traces.txt file","<android>","1","1","","",""
"4106611","1","4106665","","2010-11-05 14:07:40","1","386","<p>Howdy,I'm currentyl new to Java and Android but I would like to write an App which checks a webserver on a particular file. If that file is NEWER than the locally saved file it should go ahead and download the file.</p><p>Now I've already got the download in place .. but I don't know how I can check the file on the webserver. Any help would be appreciated! :)</p>","498400","","","","","2010-11-05 14:13:03","Get FileModification/Creation time of a file on a webserver","<java><android>","1","0","","",""
"4106736","1","","","2010-11-05 14:20:44","2","565","<p><br>I need to create an xml with the following content:<br>* Two TextViews with varying text (1- 3 rows), one TextView below the other.<br>* One ImageView to the right of the 2 TextViews, centered vertically, 30x30 px. </p><p>One major <strong>limitation</strong> is that it can't take the whole screen when inflated into a PopupWindow, which means that I cannot use the attributes fill_parent in many places.</p><p>I tried a lot of different layouts, but the ImageView keeps getting pushed away by the TextViews when the text is long. When the text is ""half long"" the image gets tiny but is still visible. I want it to always be 30x30 px, the text can wrap and use another line instead. </p><p>I tried to specify values for width and minWidth. Also tried layout_weight=""1"" for the ImageView. Also tried wrapping the ImageView into a LinearLayout and give that the layout_weight=""1"" parameter. Nothing works.. Please help, it's getting frustrating!</p><p>Here's an example of what is not working:  </p><pre><code> &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;LinearLayout android:layout_width=""wrap_content""       android:layout_height=""wrap_content"" android:orientation=""vertical""&gt;       &lt;TextView android:id=""@+id/popupTitle"" android:layout_width=""wrap_content""      android:layout_height=""wrap_content""/&gt;       &lt;TextView android:id=""@+id/popupContent""      android:layout_width=""wrap_content"" android:layout_height=""wrap_content""/&gt;    &lt;/LinearLayout&gt;    &lt;ImageView android:layout_width=""wrap_content""       android:layout_height=""wrap_content"" android:src=""@drawable/img_30x30_px"" /&gt; &lt;/LinearLayout&gt;  </code></pre><p>Thanks!!</p>","498412","","","","","2010-11-05 18:56:17","How to guarantee space for an ImageView, keep it from shrinking?","<android><layout><width><imageview><weight>","2","2","","",""
"4106816","1","4109517","","2010-11-05 14:29:59","0","1643","<p>What I'm trying to do is use an if statement to determine which item in my spinner is selected and then from there allow two different radio buttons to be selected and depending on which one do something different. The output for a TextView will change based on which Spinner item and which radio button is selected. I'm not having any problems with the radio buttons and the output will vary based on which one is selected but the spinner does not do anything. I can select any item and it will have the same output and ignore the first if statement regarding the spinner and just use the second.I thought it worked and moved on to the rest of my app then went back and tested it and now im back to square one. I don't want to use a OnItemSelectedListener but I realize that Im probably trying to compare the item to the spinner the wrong way. For an OnItemSelectedListener I would use:</p><pre><code>if (parent.getItemAtPosition(pos).toString().equals(""1-17""))</code></pre><p>but I was trying to do this inside a TextChangedListener and thought it would work but I find spinners really confusing.</p><p>Below is an example that is similar to what I have only I'm not at home so I tried to recreate it as much as possible. I left a number format exception that I have out of the code because I don't remember how i did it but my app was force closing if a number was entered and then deleted so i don't think its necessary for this.</p><pre><code>EditText et1;Spinner age;RadioGroup radio;RadioButton male;RadioButton female;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.calc);    number = (EditText) findViewById(R.id.number);    tv1 = (TextView) findViewById(R.id.tv1);    male = (RadioButton) findViewById(R.id.male);    female = (RadioButton) findViewById(R.id.female);    radio = (RadioGroup) findViewById(R.id.radio);    age = (Spinner) findViewById(R.id.ageselect);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.age_array, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        age.setAdapter(adapter);textEdit.addTextChangedListener(new TextWatcher(){            @Override            public void afterTextChanged(Editable editable)            {             int number = Integer.parseInt(number.getText().toString());             if (age.getItemAtPosition(0).toString().equals(""1-17"")){             if (male.isChecked()){             if (number == 40){             tv1.setText(""60""); }}             if (female.isChecked()){             if (number == 40){             tv1.setText(""50""); }}}             if (age.getItemAtPosition(1).toString().equals(""18-20"")){             if (male.isChecked()){             if (number == 40){             tv1.setText(""65""); }}             if (female.isChecked()){             if (number == 40){             tv1.setText(""55""); }}}            }            @Override            public void beforeTextChanged(CharSequence text, int start, int count, int after)            {                    // Do Stuff            }            @Override            public void onTextChanged(CharSequence arg0, int start, int before, int count)            {                    // Do Stuff            }    });</code></pre><p>I'd appreciate any recommendations or links where I can find this info. I've been searching around alot with no luck and this spinner is driving me crazy. I'm ready to just give it up and use more radio buttons but I dont want to clutter my app.Thanks guys!</p>","478121","","","","","2010-11-05 19:55:31","I want to use an if statement with a spinner item but without an OnItemSelectedListener","<android><if-statement><spinner>","1","1","","",""
"4107204","1","4107711","","2010-11-05 15:10:01","1","769","<p>I have seen a number of examples of using an ActivityGroup to embed multiple Activites in a single view. In each of these cases, the Activities being loaded are internal to the current application. In addition, they all appear to take over the entire view. </p><p>I would like to start an external Activity using an Intent for a particular mime type. Specifically, if the device has a PDF viewer installed, I would like to start that Activity to view a PDF. However, I would like it to appear within the View of my running application Activity, keeping my main Activities header and footer Views intact.</p><p>Is it possible to load an external Activity within a View inside my running application? </p>","257036","","","","","2010-11-05 16:05:34","Embed external Intent in main Activity","<android><view><activity><embed>","1","0","","",""
"4107226","1","","","2010-11-05 15:12:19","1","640","<p>I can <a href=""http://developer.android.com/reference/android/location/Geocoder.html#getFromLocationName%28java.lang.String,%20int,%20double,%20double,%20double,%20double%29"" rel=""nofollow"">specify a square</a> where the Geocoder shall search in, but I found no way to specify a certain country. Unfortunately, my country isn't quadrangular ;( What should I do? Use another reverse geocoding service? </p><p><em>I'd want to build a search box where the user can search for a city (with auto suggestion). On every keystroke the current search query is going to be delivered to the Geocoder.</em></p>","433718","","41012","","2011-07-22 16:20:57","2011-07-22 16:20:57","Specify the country to be searched in Android GeoCoder?","<android><google-geocoder><android-location>","1","3","","",""
"4107446","1","","","2010-11-05 15:36:38","0","632","<p>I have been playing around with a LazyList code sample which is pretty neat for displaying images in a safe and non-memory-hogging way.  It uses a very simple mechanism of displaying images based on a list that exists within the class file.  </p><p>Example:</p><pre><code>private String[] mStrings={        ""http://a3.twimg.com/profile_images/670625317/aam-logo-v3-twitter.png"",        ""http://a3.twimg.com/profile_images/740897825/AndroidCast-350_normal.png"" };</code></pre><p>I am trying to load these values from an index file that is downloaded to the SD card, and then loaded from it.  Here is the code that loads the index file and simply displays it as a Toast message (this works fine).</p><pre><code>// PULL FILE FROM SD CARD        try{               File f = new File(Environment.getExternalStorageDirectory()+""/LazyList/gkindex.txt"");               FileInputStream fileIS = new FileInputStream(f);               BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));               String readString = new String();                //just reading each line and pass it on the debugger               while((readString = buf.readLine())!= null){                   Toast.makeText(MainActivity.this, ""WIN: ""+readString, Toast.LENGTH_LONG).show();               }            } catch (FileNotFoundException e) {                Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();                e.printStackTrace();            } catch (IOException e){                Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();                e.printStackTrace();            }</code></pre><p>What I am struggling with is how to take this string that is being loaded from the SD card and pass it into the list adapter.</p><p>The code presently looks like this:</p><pre><code>adapter=new LazyAdapter(this, mStrings);list.setAdapter(adapter); </code></pre><p>I am trying to reload or refresh that same adapter using the values I pulled from the SD card file, presently called ""readString"".</p><p>Can anyone give me some pointers?  I am leaving out the code that I created that doesn't work ... because I don't think I am handling this at all correctly.  Also - go easy on my, I am a complete newbie to all of this.  :-)</p><p>Thanks in advance for any help or advice!</p><p>-Ray</p><p><strong>EDIT #1:</strong>Here is my what I am trying to do.  Simply copy and paste the working code where I want it.  I know it's not that simple, but I am having a hard time reconstructing it properly.  Here is my edited code ...</p><pre><code>// PULL FILE FROM CARD ATTEMPT #2        try{               File f = new File(Environment.getExternalStorageDirectory()+""/LazyList/gkindex.txt"");               FileInputStream fileIS = new FileInputStream(f);               BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));               String readString = new String();                //just reading each line and pass it on the debugger               while((readString = buf.readLine())!= null){                   Toast.makeText(MainActivity.this, ""WIN: ""+readString, Toast.LENGTH_LONG).show();               // THIS DOESN'T WORK ...                    adapter=new LazyAdapter(this, readString);                    list.setAdapter(adapter);               }            } catch (FileNotFoundException e) {                Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();                e.printStackTrace();            } catch (IOException e){                Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();                e.printStackTrace();            }</code></pre><p>The error that I get on ""adapter=new LazyAdapter(this, readString);"" is ""The constructor LazyAdapter(new View.OnClickListener(){}, String) is undefined"".</p><p>Having not shared the contents of LazyAdapter, that information may not be helpful.  So here is the LazyAdapter class in it's entirety ...</p><pre><code>package com.fedorvlasov.lazylist;import android.app.Activity;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.View.OnClickListener;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.TextView;public class LazyAdapter extends BaseAdapter {private Activity activity;private String[] data;private static LayoutInflater inflater=null;public ImageLoader imageLoader; public LazyAdapter(Activity a, String[] d) {    activity = a;    data=d;    inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    imageLoader=new ImageLoader(activity.getApplicationContext());}public int getCount() {    return data.length;}public Object getItem(int position) {    return position;}public long getItemId(int position) {    return position;}public static class ViewHolder{    public TextView text;    public ImageView image;}public View getView(int position, View convertView, ViewGroup parent) {    View vi=convertView;    ViewHolder holder;    if(convertView==null){        vi = inflater.inflate(R.layout.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();    holder.text.setText(""item ""+position);    holder.image.setTag(data[position]);    imageLoader.DisplayImage(data[position], activity, holder.image);    return vi;}</code></pre><p>}</p>","493706","","493706","","2010-11-05 18:18:58","2010-11-05 18:43:34","Android: How can I get a String from and SD card into a list adapter?","<android>","1","2","","",""
"4107491","1","4107513","","2010-11-05 15:40:50","0","1067","<p>I've just started out with android and write a simple dialog app with some random strings presented to the user. I started to think about best way to do that?</p><p>if strings.xml consist of strings like:</p><pre><code>&lt;string name=""quote1""&gt;blaha blaha&lt;/string&gt;&lt;string name=""quote2""&gt;chit chat&lt;/string&gt;</code></pre><p>I guess there's a better way then generating a random int and then do </p><pre><code>case 1:   R.id.quote1</code></pre><p>I guess it will end up with at least 50 different quotes in that file, that's one ugly switch ..</p><p>Best regards</p>","498112","","","","","2010-11-05 16:14:14","Pick random strings from string.xml","<android>","5","0","1","",""
"4107515","1","4441834","","2010-11-05 15:43:54","9","11646","<p>I'm not sure is this is a problem with my installation of Eclipse (Helios) and Android SDK or something else but Eclipse Content Assist doesn't propose Object Methods for Android classes. </p><p>For example, if I create a simple program and add a Button btn, when I go to use the btn method setBackgroundResource(int) with Content Assist (Ctrl + Space) or Word Completion (Alt + /) neither of them have any proposals. If I type btn.(Ctrl + Space), Content Assist lists;    equals(), getClass(), hasCode(), Notify()...wait(), shows none of the Button methods!  Can anyone help?</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.Button;public class HelloWorld extends Activity {@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    Button btn = Button(this);    btn.(Ctrl + Space)    }}</code></pre>","498468","","","","","2012-08-31 14:17:20","Eclipse Content Assist not working with Android","<android><eclipse><methods><content-assist>","4","0","3","",""
"4107565","1","4107805","","2010-11-05 15:48:49","2","1398","<p>I am trying to detect gesture events on the emulator by making mouse clicks, should this work?  I've tried double clicking (which i would expect to produce a onDoubleTap), clicking (which I would expect to produce a onSingleTapConfirmed), and dragging (to hopeful produce a onScroll), but these all produce the same three series of events: onDown, onShowPress, onLongPress.</p><p>Is there a particular way mouse clicks/drags must be made to produce gesture events on the emulator?  Or is there something wrong with the below code, which I am using to detect events:</p><pre><code>public class GestureEnabledImageView extends ImageView implements OnGestureListener, OnDoubleTapListener{    private GestureDetector gestureScanner;    public GestureEnabledImageView(Context context)    {        super(context);        gestureScanner = new GestureDetector(this);        gestureScanner.setOnDoubleTapListener(this);    }    public GestureEnabledImageView(Context context, AttributeSet atts)    {        super(context, atts);        gestureScanner = new GestureDetector(this);        gestureScanner.setOnDoubleTapListener(this);    }    public GestureEnabledImageView(Context context, AttributeSet atts, int style)    {        super(context, atts, style);        gestureScanner = new GestureDetector(this);        gestureScanner.setOnDoubleTapListener(this);    }    @Override    public boolean onTouchEvent(MotionEvent me)    {        return gestureScanner.onTouchEvent(me);    }    @Override    public boolean onDown(MotionEvent e)    {        log(""onDown: "" + e.getRawX() + "", "" +e.getRawY());        return false;    }    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        log(""onFling: "" + e1.getX() + "", "" + e1.getY() + "" -- "" + e2.getX() + "", "" + e2.getY() + "" -- "" + velocityX + "" -- "" + velocityY);        return false;    }    @Override    public void onLongPress(MotionEvent e)    {        log(""onLongPress: "" + e.getRawX() + "", "" +e.getRawY());    }    @Override    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)    {        log(""onScroll: "" + e1.getX() + "", "" + e1.getY() + "" -- "" + e2.getX() + "", "" + e2.getY() + "" -- "" + distanceX + "" -- "" + distanceY);        return false;    }    @Override    public void onShowPress(MotionEvent e)    {        // TODO Auto-generated method stub        log(""onShowPress: "" + e.getRawX() + "", "" +e.getRawY());        System.out.println();    }    @Override    public boolean onSingleTapUp(MotionEvent e)    {        log(""onSingleTapUp: "" + e.getRawX() + "", "" +e.getRawY());        // TODO Auto-generated method stub        return false;    }    @Override    public boolean onDoubleTap(MotionEvent e)    {        log(""onDoubleTap: "" + e.getRawX() + "", "" +e.getRawY());        // TODO Auto-generated method stub        return false;    }    @Override    public boolean onDoubleTapEvent(MotionEvent e)    {        log(""onDoubleTapEvent: "" + e.getRawX() + "", "" +e.getRawY());        // TODO Auto-generated method stub        return false;    }    @Override    public boolean onSingleTapConfirmed(MotionEvent e)    {        log(""onSingleTapConfirmed: "" + e.getRawX() + "", "" +e.getRawY());        // TODO Auto-generated method stub        return false;    }    private void log(String text)    {        Log.i(""MyInfo"", text);    }}</code></pre>","426493","","","","","2013-02-26 18:00:41","On Android, do gesture events work on the emulator?","<android>","2","0","1","",""
"4107597","1","4117324","","2010-11-05 15:53:17","12","4039","<p>There is something weird about this ImageView, after big image scaled down there is still ""free space"".  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""vertical""&gt;&lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:src=""@drawable/bb""    android:scaleType=""fitStart"" /&gt;&lt;TextView    android:id=""@+id/textMainBoxTitle""    android:text=""some text""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""1"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Some  screens:  </p><p><strong>Eclipse</strong>:<br><img src=""http://img560.imageshack.us/img560/6218/eclipse.png"" alt=""eclipse""></p><p><strong>simulator</strong>:<br><img src=""http://img600.imageshack.us/img600/3023/simulator.png"" alt=""simulator""></p><p>And the original image:<br><img src=""http://www.janissary.eu/img/obraz.jpg"" alt=""original""></p><p>Why am'I getting space after image?</p>","475837","","1404505","","2012-10-06 13:13:33","2012-10-06 13:13:33","Blank space after ImageView","<android><android-layout>","2","0","1","",""
"4107824","1","4108246","","2010-11-05 16:19:15","5","3991","<p>I have an ImageView, and I want it to be clickable. The image itself is only 32x32 pixels, but I want the clickable region to be larger so it's easier to hit. I was hoping I could set the layout margin values to increase the size of the imageview's clickable area:</p><pre><code>&lt;ImageView   layout_width=""32dip""   layout_height=""32dip""   layout_margin=""20dip"" /&gt;</code></pre><p>That doesn't work, what I could do is just recreate the image resource to have a larger transparent region around it. That's a bit annoying because it's hard to tweak if I ever need to change the clickable region. It's not just a single png either, it's a statelistdrawable so I have to resize 3 different pngs if I ever need to tweak the clickable area.</p><p>Anything else I can do?</p><p>Thanks</p>","291701","","","","","2013-04-11 16:00:23","Expand clickable area of an ImageView by using padding?","<android>","3","2","2","",""
"4107890","1","","","2010-11-05 16:27:39","0","436","<p>I go back and forth about how to name activity classes.  Activity seems to imply a verb, like EditContact, for example.  But that seems more like what one would call the Intent that triggers EditContact.  Should the activity be named ContactEditor instead? </p>","369722","","","","","2010-11-05 16:46:56","What are some rules of thumb for naming classes that extend Android's Activity class?","<android><naming-conventions><activity><naming>","2","1","0","",""
"4107971","1","4108093","","2010-11-05 16:36:28","0","204","<p>I'm relatively new in Android's world and the UI/Thread model is still confusing.</p><p>Here is what I am trying to do:</p><p>Load data from the webHandle themShow themShow an AlertDialog if there is a problem</p><p>I'm currently doing like this, but I'm not sure that using many thread like that is the best way to do it.</p><p>Inside the onCreate()</p><pre><code>  final ProgressDialog pd = ProgressDialog.show(this, """", loadingText, true);  final AlertDialog.Builder b = new AlertDialog.Builder(this);  new Thread(new Runnable() {   @Override   public void run() {    try {     loadResorts();    } catch (ResortsRetrievalException e) {     runOnUiThread(new Runnable() {      @Override      public void run() {       b.setMessage(R.string.resorts_retrieval_error)       .show();      }     });    }    pd.dismiss();   }  }).start();</code></pre><p>And my loadResorts method finishes with</p><pre><code>  final BaseAdapter a = new ResortAdapter(this, R.layout.resort_item, resorts);  runOnUiThread(new Runnable() {   @Override   public void run() {    resortsList.setAdapter(a);   }  });</code></pre><p>I have one Thread and two calls of runOnUiThread for that. I feel that there could be a better solution without having to deal with these threads. Am I right?</p><p>Thanks</p>","183665","","","","","2010-11-05 16:49:00","Is this the best way to show content?","<android><post><runnable>","1","0","","",""
"4108005","1","4108085","","2010-11-05 16:40:05","1","257","<p>I have a database of notes and lists, with three association tables.Basically, lists are parents of notes and other lists, and notes can be parents of other notes in a outline like hierarchy.  </p><p>I am using this query to return all notes within a list as well as the number of subnotes each note has.</p><pre><code>SELECT count(n2.note_id) as Num_Subnotes, _id, title, detailsFROM NOTESJOIN NOTES_IN_LISTS n1 ON NOTES._id=n1.note_idLEFT JOIN NOTES_IN_NOTES n2 ON NOTES._id=n2.parent_note_idWHERE n1.listId=12GROUP BY NOTES._idCOLLATE NOCASE</code></pre><p>This query works just fine, but it's overkill.  I don't need to return <code>count(n2.note_id) as Num_Subnotes</code> because I'm only using that value to check if the note has ANY SUBNOTES AT ALL.  Essentially it's a boolean value where 0 is false and > 0 is true.</p><p>It seems to me that counting all those records is a waste of time when I could just return 1 after finding the first matching value.  </p><p>Is there a more efficient way to check if <code>count(n2.note_id)&gt;0</code> in the above query?</p>","131871","","","","","2010-11-05 16:48:09","SQL efficiently check if an association exists?","<sql><android><sqlite>","1","0","","",""
"4108236","1","4109057","","2010-11-05 17:07:12","2","3631","<p>I connected to a server after then, to close InputStream and OutputStream call the belows.</p><pre><code>try {        if (mInputStream != null) {            mInputStream.close();            mInputStream = null;        }        if (mOutputStream != null) {            mOutputStream.close();            mOutputStream = null;        }    } catch (IOException e) {        e.printStackTrace();    }</code></pre><p>But, the streams is still alive. If I make once again, there are 2 different InputStream. ^^;;;; Exception does not happen.</p><p>How to completely close the streams? Thanks in advance..</p>","417294","","","","","2010-11-06 05:55:43","In Android, How to close InputStream and OutputStream","<android><close><inputstream><outputstream>","1","4","0","",""
"4108247","1","4108269","","2010-11-05 17:07:52","0","330","<p>I am simply trying to create a layout where there are multiple TextViews (and ultimately an EditText) stacked vertically in the activity. However, the only thing displayed is my top title bar and the first TextView (with the ""Name"" text). Why won't anything else show up? Here is my code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;LinearLayout android:orientation=""vertical""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:layout_weight=""1""&gt;    &lt;TextView android:text=""Name:"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:textColor=""#4096cc""        android:paddingTop=""15dip"" android:paddingLeft=""15dip""        android:textSize=""20sp"" /&gt;    &lt;TextView        android:text=""This is my little description.""        android:layout_width=""wrap_content"" android:layout_height=""fill_parent""        android:textColor=""#333333"" android:paddingTop=""10dip""        android:paddingLeft=""15dip"" android:textSize=""10sp"" /&gt;    &lt;EditText android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>Thanks!</p>","123891","","","","","2010-11-05 17:20:47","Android cannot get TextViews to display with LinearLayout","<java><android><text><layout><view>","1","0","","",""
"4108446","1","4108476","","2010-11-05 17:31:19","1","5007","<pre><code>browserIntent   =new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));</code></pre><p>i want to:</p><pre><code>browserIntent.close or something... browserIntent.finish(); ?</code></pre><p>how to?</p>","472537","","178060","","2010-11-05 17:40:45","2010-11-05 17:40:45","Android how to close an intent?","<android><android-intent><close>","3","0","","",""
"4108501","1","4108539","","2010-11-05 17:37:53","2","2808","<p>I have the following application.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.currency.mobile.android""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""                 android:theme=""@android:style/Theme.Light.NoTitleBar""&gt;        &lt;activity android:name="".MainActivity"" android:noHistory=""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:name="".LoginActivity""/&gt;        &lt;activity android:name="".HomeActivity"" /&gt;        &lt;activity android:name="".FriendsActivity""/&gt;        &lt;activity android:name="".PlacesActivity""/&gt;        &lt;activity android:name="".ProfileActivity""/&gt;        &lt;activity android:name="".PurchasesActivity""/&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>This is my tab view:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@android:id/tabhost""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;    &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""&gt;        &lt;TabWidget                android:id=""@android:id/tabs""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""/&gt;        &lt;FrameLayout                android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:padding=""5dp""/&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>When using Theme.Light.NoTitleBar I get this ugly line in the middle:</p><p><img src=""http://i.stack.imgur.com/nVA0j.png"" alt=""alt text""></p><p>But when I use Theme.Black it doesn't have such a weird line. Any way to fix it so that I can use light theme? </p>","419075","","","","","2010-11-05 17:43:10","Where is this top border in Theme.Light.NoTitleBar coming from?","<android>","1","0","1","",""
"4108737","1","4109076","","2010-11-05 18:06:59","4","911","<p>How can I regulate the framerate in my android app?   I would like the game to run at a constant speed.  My app doesn't require a high framerate so I don't want one because that would take up more battery then necessary.</p>","467090","","","","","2010-11-05 18:50:14","How can I regulate the framerate in my android app?","<android><fps>","1","0","1","",""
"4108763","1","4108848","","2010-11-05 18:09:47","1","968","<p>I would like to find the dimensions of an ImageView to use to scale a Bitmap, prior to to calling view.setImageBitmap.  ImageView.getWidth and ImageView.getHeight return 0 if no image has been set.  (Presumably because the ImageView has not yet been measured?).  Is there anyway to determine the dimensions of the ImageView prior to setting the Bitmap?</p><p>Thank you</p>","426493","","","","","2010-11-05 18:22:28","On android, how to get dimensions of ImageView?","<android>","1","0","1","",""
"4108818","1","","","2010-11-05 18:17:25","3","973","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/821085/technology-to-write-iphone-blackberry-and-android-phone-at-the-same-time"">Technology to write iPhone, BlackBerry and Android phone at the same time?</a>  </p></blockquote><p><strong>Edit</strong> - guys, we need one more vote to close this. This question is a dup (read the comments)</p><p><s>I've heard that Apple banned such tools</s>. Ok, so Apple lifted their ban in September. Still, the question holds - is there a sane way to develop apps to these two platforms without writing nearly everything twice?</p><p>Is there something I'm missing, or is the current state of affairs really that every company that develops a cross-platform legally has to maintain two code bases?</p>","11236","","11236","","2010-11-05 22:20:23","2012-02-07 12:35:02","Is there a way to develop a cross-platform app for iPhone/iPad/Android?","<iphone><android><ipad><cross-platform>","9","2","2","2010-11-05 22:34:40",""
"4108881","1","4109094","","2010-11-05 18:26:06","14","26244","<p>I would like to make a file browser that will do two things:1) Allow the user to browse and select a directory2) Allow the user to browse all files on their sdcard</p><p>I've looked for tutorials but can't seem to find any?Can someone please help me by either explaining how what my code would need to do in order to have a simple file browser or providing me with a link to a tutorial/source code?</p><p>Please and thanks!</p>","427234","","59303","","2010-12-03 22:07:40","2013-04-29 11:02:03","Android Programming: Where To Start For Creating A Simple File Browser?","<android><file><browser>","3","0","14","",""
"4108937","1","4109199","","2010-11-05 18:32:17","0","329","<p>I need to represent the following diagram:<br><img src=""http://i.stack.imgur.com/f5Yoa.png"" alt=""alt text""></p><p>Each X will be an image button.  I was thinking of making three tables with one column each and have each cell height be half the height of the table.  The problem is that the table needs to be able to stretch or shrink because I am worried about getting everything on the screen and the tables are the only part that can change size and have the entire thing still look ok.  The problem I am having is that the rows are only as big as the image buttons.  While all the image buttons are the same size, the left and right table in particular, need to have some padding around the image buttons to make it alright.  I would add margins to the buttons but that defeats the reshaping problem I am having...I think.  Any suggestions?</p>","451037","","","","","2010-11-05 19:07:59","How to represent this in Android Layout","<android><tablelayout>","3","0","","",""
"4109116","1","8194436","","2010-11-05 18:56:00","1","3306","<p>A couple of other people and me are working on an app for android. It requires locating the device in latitude and longitude. We've been able to create a location object, but the object is always blank. We even tried recreating the code in a completely empty project, but that also failed. Here's our root activity:</p><pre><code>package com.app.Locationtest;import android.app.Activity;import android.content.Context;import android.location.Location;import android.location.LocationManager;import android.os.Bundle;public class locationtest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LocationManager locman =(LocationManager)getSystemService(Context.LOCATION_SERVICE);         Location loc = locman.getLastKnownLocation(LocationManager.GPS_PROVIDER);        if (loc==null)        {           finish();        }    }}</code></pre><p>Here's the Manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.app.Locationtest""      android:versionCode=""1""      android:versionName=""1.0""&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_GPS"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".locationtest""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>How do we fix this problem?</p>","498680","","569101","","2013-09-11 11:44:35","2013-09-11 11:44:35","Creating a blank location object","<android><location><latitude-longitude><locationmanager>","2","0","","",""
"4109167","1","4109273","","2010-11-05 19:01:49","4","4224","<p>Where can I find an implementation of multimap for Java that will work on Android without having to include any other classes etc. The implementations I've found all require other things which require other things and it gets messy quick. I'm porting a project from C++ and am new to java (and this project as well so I'm trying to keep things as identical as possible while getting it working) so any references or examples would be great.</p>","463183","","","","","2010-11-05 19:26:43","How can I create a Multimap in Java on Android","<java><android><multimap>","2","0","1","",""
"4109182","1","4111735","","2010-11-05 19:04:33","3","1434","<p>I'm getting a string sent to me from a server (my app is running on android). One of the characters is a unicode symbol which is a musical note. I take the response from the server in a String, then hand it directly to a TextView. This is what should appear:</p><pre><code>?</code></pre><p>but instead I see just a block (kinda looks like):</p><pre><code>[]</code></pre><p>when I print the string to logcat, I see:</p><pre><code>â«</code></pre><p>I'm not sure how to get TextView to display the character correctly. I tried this:</p><pre><code>tv.setText(Html.fromHtml(text).toString());</code></pre><p>but it's still rendering out the block. What's the right way to do this?</p><p>Thanks</p><p>-------------------- Update -----------------------------</p><p>I tried just creating a webpage with the character in it, then pointing the system browser to the page (on my nexus one). Same render issue, looks like the glyph for that character just does not exist?:</p><pre><code>&lt;html&gt;  &lt;body&gt;    &amp;#x266B;    &lt;br /&gt;    &amp;#9835;  &lt;/body&gt;&lt;/html&gt;</code></pre>","291701","","291701","","2010-11-05 19:52:50","2010-11-06 03:23:24","Rendering a unicode character correctly in TextView?","<android>","1","1","","",""
"4109194","1","","","2010-11-05 19:07:37","0","8458","<p>I am trying to have 2 Android applications which can access each other's data.  I have a two test applications which I am experimenting with. I set the 'Shared user id' for each to 'com.gabysoft.sharedfiles'. However, when I sign the first app and try and install it, I get the error:</p><p>11-05 16:50:33.422: ERROR/PackageManager(61): Package com.gabysoft.sharedfiles1 has no signatures that match those in shared user com.gabysoft.sharedfiles; ignoring!</p><p>Clearly, I am not signing it correctly (I am using Eclipse's ""Export signed application package"" function).  How do I properly sign the .apk file so that I don't have this problem?</p><p>Thanks </p>","457607","","","","","2013-12-20 08:47:54","Shared User ID and Signing with Android","<android>","4","0","2","",""
"4109261","1","4109808","","2010-11-05 19:18:03","3","535","<p>Hey has anyone ever used the API for face detect in their android program?</p><p>More simply stated, can I have a java class that pulls up the camera, scans a person's face and returns parameters back into the program?</p><p>Thanks for any help!</p>","496686","","21234","","2010-11-05 19:19:01","2010-11-05 20:31:08","Using face detect in your program","<android><camera><detection>","1","1","","",""
"4109310","1","","","2010-11-05 19:27:26","0","202","<p>We've been developing an Android app at work for a few months now and recently acquired Droid Incredibles (API ver. 8) to replace our HTC Dev Phones (API ver. 4).</p><p>DANG are these some sweet new toys, but unsurprisingly, they've got a few quirks...</p><p>1)  It's normal for my user to let the program run for long periods without any input, but he'd still need the display to work the entire time.  Can anybody suggest a function call or setting or something that will prevent the Incredible's screen from dimming while my application is running??</p><p>2)  On the Dev phone, I was able to copy my application's database file (thousands of uses, that) onto the SD card's root directory and fly.  I could view the directory on my PC via USB; when I released the SD card from the PC, my application was perfectly happy with it and obediently read from and wrote to the database; and I didn't have to remove the SD card, ever.  That doesn't seem to be the case with the newer, better phone, though.  My application seems to be reading my start up parameters properly, but all attempts to save data in my database aren't working so well unless I'm just doing something wrong.  Can anybody point me to documentation specifically geared toward the Incredible??</p><p>Thanks,</p><p>R </p>","453989","","","","","2010-11-05 19:36:05","New Droid Incredibles, Having Some Annoying Problems","<android>","2","0","","",""
"4109361","1","4109396","","2010-11-05 19:33:44","1","379","<p>I have notice that quite a few application show version/history informations <strong>before</strong> installation. And I wonder how they do it.</p><p>Also, which may or may not be related, Titanium Backup has a full version history on AppBrain. Again I wonder how that is done.</p><p>Does anybody know?</p><p>Since titanium Backup has a funny star in the URL so normal links won't work, here the link for cut/copy/paste. </p><pre><code>http://www.appbrain.com/app/titanium-backup-?-root/com.keramidas.TitaniumBackup</code></pre><p>Sorry for the inconvenience.</p>","341091","","","","","2010-11-05 19:37:40","Add Version info to Android Application","<android><android-manifest>","1","0","0","",""
"4109452","1","4109576","","2010-11-05 19:46:22","1","470","<p>This is not a programming question per se but a question that may be relevant to all <em>future</em> Android developers.</p><p>I am in the market for an Android developer phone. I can buy it used on eBay, or I can buy it new on the Android Market.</p><p>All nice and dandy but in order what the Android market has to offer, I have to first <a href=""http://market.android.com/publish/signup"" rel=""nofollow"">register</a>, which requires signing the <a href=""http://www.android.com/us/developer-distribution-agreement.html"" rel=""nofollow"">Android Market Developer Distribution Agreement</a>.</p><p>Well, I know that many developers signed that agreement and stayed alive, but before signing anything I prefer to read what I am about to sign. Unfortunately, certain information that is needed to be understood in order to sign the agreement can be accessed only after you sign the agreement...</p><p>For example, how do I know which are the ""authorized payment processors"" mentioned in <a href=""http://www.android.com/us/developer-distribution-agreement.html"" rel=""nofollow"">clause 1.2</a>?</p><p>Also, it sounds strange to me that in order to just see what developer phones are available (and their specs) I first have to register and pay the $25 registration fee. It will take at least 6 months before I will be ready to place anything on the Android market, so why should I register now?</p><p>Any idea whether to find these 2 pieces of information without having to register so early in the process?</p>","418055","","502381","","2012-05-23 13:31:03","2012-05-23 13:31:03","Catch 22 re Android Market Developer Agreement","<android><google-play>","2","6","","",""
"4109583","1","","","2010-11-05 20:03:14","0","1158","<p>i'm developing a small application in with a list view filled with a compound component. This component has two text view and one button inside. One of the text view is invisible and when the button is clicked it should appear. I can show the list but i can't make the textview visible when the button is clicked.Here is the xml of the component:</p><pre><code>&lt;RelativeLayout   xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""   android:layout_height=""wrap_content""&gt; &lt;TextView   android:text=""@+id/TextView01""   android:id=""@+id/placeNamwView""   android:layout_height=""wrap_content""   android:textSize=""30dp""   android:layout_width=""wrap_content""   android:maxWidth=""250dp""&gt;  &lt;/TextView&gt; &lt;Button   android:layout_height=""wrap_content""   android:layout_toRightOf=""@+id/placeNamwView""   android:layout_width=""wrap_content""   android:id=""@+id/Button01""   android:text=""More""&gt;  &lt;/Button&gt; &lt;EditText   android:layout_below=""@+id/placeNamwView""   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""   android:text=""@+id/TextView01""   android:id=""@+id/placeAddressView""   android:textSize=""20dp""   android:textColor=""#FFFF0000""   android:maxWidth=""250dp""&gt;  &lt;/EditText&gt;&lt;/RelativeLayout&gt;</code></pre><p>And this is the ArrayAdapter that fills the list:</p><pre><code>   public class AddressAdapter extends ArrayAdapter&lt;Item&gt; {   int resource;   RelativeLayout placeView;   EditText addressText;   public AddressAdapter(Context _context, int _resource, List&lt;Item&gt; _items) {       super(_context, _resource, _items);       resource = _resource;   }   private OnClickListener buttonClick = new OnClickListener() {     public void onClick (View v) {       int i = placeView.findViewById(R.id.stub_import).getVisibility();       visibility(i);     }   }   private void visibility(int i) {    //   TODO Auto-generated method stub     switch(i) {       case(View.GONE):          addressText.setVisibility(View.VISIBLE);         break;       case(View.VISIBLE):          addressText.setVisibility(View.GONE);         break;   }   @Override   public View getView(int position, View convertView, ViewGroup parent) {     Item item = getItem(position);     String name = item.getName();     String address = item.getAddress();     if (convertView == null) {       placeView = new RelativeLayout(getContext());       String inflater = Context.LAYOUT_INFLATER_SERVICE;       LayoutInflater vi = (LayoutInflater)getContext().getSystemService(inflater);       vi.inflate(resource, placeView, true);     }      else      {       placeView = (RelativeLayout) convertView;     }     TextView nameText = (TextView)placeView.findViewById(R.id.placeNamwView);     Button button = (Button)placeView.findViewById(R.id.Button01);     addressText = (EditText)placeView.findViewById(R.id.placeAddressText);     button.setOnClickListener(buttonClick);     nameText.setText(name);     addressText.setText(address);     return placeView;  }}</code></pre>","498746","","644972","","2012-04-21 08:03:27","2012-08-06 12:19:13","expanding listview custom component with button click","<android><listview><custom-component>","2","0","","",""
"4109632","1","4109648","","2010-11-05 20:10:14","4","775","<p>So I'm releasing my first app soon, and this is the first time I'm doing any of this on my own. Looking into the future of it, there are features I plan to implement within the coming months. But looking at me adding features, I realize I would be altering the original source, so if someone finds a bug, I need to either wait, or completely undo everything to fix it. What are some options for managing my source code and stuff?</p>","325400","","325400","","2010-11-05 20:15:14","2013-06-09 10:18:59","Best ways to manage an Android project?","<android><eclipse><version-control><project-management><source>","4","1","2","",""
"4109677","1","","","2010-11-05 20:16:03","0","547","<p>I have downloaded a file manager application called ""AndExplorer"" inside my Android emulator.My goal is to call this application inside my current custom application. Do you guys know any way to do this?</p>","448732","","2680216","","2013-12-09 04:41:22","2013-12-09 04:41:22","call application API inside an Android application","<android><api><call>","1","1","","",""
"4109715","1","","","2010-11-05 20:20:20","5","892","<p>I have looked at the intent-filter documentation and I can't figure out this specific intent-filter.</p><p>I'm looking to use ACTION_SEND because I only want the app to show up in ""Share"" menus in other apps.  I only want to show up in the share menu if the text of the intent is a url.  For example, what is shared from the Android Browser's share menu.  I don't want the app to appear in the share menu if it's just text and not a url.</p><p>What I have so far is:</p><pre><code>&lt;intent-filter android:label=""Label""&gt;  &lt;action android:name=""android.intent.action.SEND"" /&gt;  &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;  &lt;data android:mimeType=""text/*"" /&gt;&lt;/intent-filter&gt;    </code></pre><p>However, this will receive any text, not just urls.</p><p>Thanks</p>","445348","","","","","2010-11-06 16:43:44","What is an intent-filter than would only show an app in the share menu when sharing a url?","<android><url><share><intentfilter>","1","0","3","",""
"4109912","1","4110272","","2010-11-05 20:44:48","0","644","<p>I've seen some answers to questions about how to specify a custom layout for a spinner's pop-up list, but what I want to do is to customize the text on the Spinner control itself, such the ""setText..."" methods that you can call for a Button (TextView subclass).</p><p>Is there any way to do this? What I'm trying to do is to make my own Spinner design as I have for some of the other controls so it takes up less space and matches the general look of my app.</p>","446874","","","","","2010-11-05 21:31:17","Customizing text on Spinner control","<android>","1","0","","",""
"4110074","1","","","2010-11-05 21:03:57","0","159","<p>Iam about to create a search, But the point here is that Iam going to collect values from different activities, maybe I will store them in a keyvalue, </p><p>Where can I store the keyvalue object so I can reach from every activity without sending to eachother all the time? </p><hr><p>okej, well iam going to store values, so i can sent to my service so it returns requested items (it means I will create a search)</p><p>Property Name <br/>ID<br>Selected Name</p><p>For example:<br />Proberty : Location <br />selectedID = 36<br />selectedName = New York</p><p>By the way, I guess I can't use keyvaluepairs, what can I use if  I have three rows as in my case?</p>","371301","","19679","","2013-08-13 17:03:13","2013-08-13 17:03:13","Android: creating a search, collecting values from different actvities","<android><key-value>","1","0","","",""
"4110333","1","4110548","","2010-11-05 21:41:06","3","204","<p>I need to add gallery to my android app. I used gallery in standard way, when pictures are in my folder, but now I need to show pictures when I have just pictures URLs(pictures are on some distant server). How can I achieve that ?</p>","486578","","","","","2010-11-05 22:12:14","Gallery of pictures from distant site - Android","<android>","1","0","1","",""
"4110515","1","4190355","","2010-11-05 22:07:36","3","2058","<p>I need my Android application to run a certain Activity in my app, responding to the following Uri data from the Intent that was sent out:</p><p><a href=""http://www.example.com/redirect.aspx?customurl=example%3a%2f%2f%3fop%3dexampledetail%26stuff%3d12345%26morestuff%3dI%2520Love%25Android"" rel=""nofollow"">http://www.example.com/redirect.aspx?customurl=example%3a%2f%2f%3fop%3dexampledetail%26stuff%3d12345%26morestuff%3dI%2520Love%25Android</a></p><p>If I use the following in my manifest (for the Activity that I want to respond to the Intent), I can capture this, but the chooser pops up (which I don't want):</p><pre><code>&lt;intent-filter&gt; &lt;action android:name=""android.intent.action.VIEW"" /&gt; &lt;data android:scheme=""http"" android:host=""www.example.com"" /&gt; &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;/intent-filter&gt;</code></pre><p>Since I don't want the chooser to pop up, I tried to use the android:pathPattern, or android:pathPrefix in the  tag to further filter to make sure that only my app responds but it isn't working for me.</p><p>Can anyone help me do this?</p>","413414","","","","","2010-11-16 01:16:50","Android: Filter intent for specific Uri pattern","<android><filter><activity><android-intent><pattern-matching>","2","3","3","",""
"4110592","1","4111069","","2010-11-05 22:21:08","1","1410","<p>first off, this is more of a question about animating than a specific problem coding.  i need to fill in the broad strokes left by the research i've been doing.</p><p>what i'm trying to do:</p><p>the activity should load with only the a togglebutton visible.  when the button is touched, a png will be animated to a certain position relative to the togglebutton.  also, another button will slide in from off screen and slide off if/when the togglebutton is pressed again.</p><p>what i can't figure out:</p><p>i can draw an image, but only via xml.  creating an imageview and setting the background programmatically does nothing.</p><p>when i draw from xml, i can't move the image when the togglebutton is pressed like i want to.  when i call getPositionOnScreen() i get a null pointer, even though the complier can see i'm referring to the imageview described in both xml and in code.</p><p>i'm calling getPositionOnScreen because via xml, i have the image positioned behind the togglebutton so that it's not visible until the button has been pressed and the image starts moving.  the idea is that with different screen sizes i won't know exactly where the view is until runtime.  getPostionOnScreen allows me to get the coordinates of the imageview so i know where it has been positioned.  when i have a start position, can tell it to ""move up"" on the screen from behind the togglebutton by simply adding to x or y until it's where i want.</p><p>this is the code to draw the image (inserted in the onCreate method).  </p><pre><code>image= (ImageView) new ImageView(this);  image.setImageResource(R.drawable.pic); </code></pre><p>this is the code i'm using to animate.  when the button is clicked, it calls this method on the view from the listener.</p><pre><code>private void activate(){  int loc[] = new int [2];  image.getLocationOnScreen(loc);  int fromXDelta = loc[0];     int fromYDelta = loc[1];  int toYDelta = fromYDelta;     int toXDelta = fromXDelta - 30;  TranslateAnimation translateAnimation = new TranslateAnimation  (-fromXDelta, -toXDelta, -fromYDelta, -toYDelta);     translateAnimation.setDuration(500);     translateAnimation.setFillEnabled(true);     image.startAnimation(translateAnimation); }</code></pre><p>i'm well aware that this is horribly wrong and won't work.  what i need to understand is why.  any help would be very welcome.</p>","2451972","","","","","2010-11-05 23:52:46","drawing and animating in android","<android><graphics><animation>","1","0","1","",""
"4110599","1","4110622","","2010-11-05 22:22:15","1","486","<p>My app makes several calls to <code>getFromLocationName</code> from the <code>android.location.Geocoder;</code> class, this is currently handled in my activity which also displays some data depedant on the results of that call.</p><p>This can be quite slow, for example before the activity can load it first has to complete the various calls, and that is reliant on a network connection.</p><p>Once I have the results, I don't really need to refresh that (I mean how often do locations and geo coordinates change?)</p><p><strong>My question</strong> : How can I best avoid having to query for this data each time my app runs. Should I do something with a service that loads them all on startup? (could be quite slow if it has to query 50+ times). OR should I make the call, store results in SQL, then only query next time if I don't currently hold the results?</p>","155695","","","","","2010-11-05 22:26:18","Android; caching geocoding data?","<android><android-2.1-eclair><android-location><location-based-service>","1","0","","",""
"4110629","1","4110645","","2010-11-05 22:28:09","6","3416","<p>We are implementing a sever-client architecture and some of the client apps are supposed to run on android OS. The first idea that came to mind was to use java RMI, but the RMI api is obviously not implemented for android.</p><p>So 1) Is there a way to use the java RMI api in an android application? Can I just import it from the standard java library?2) What are the possible substitutes for RMI which will work for both android and desktop applications?</p><p>Thanks.</p>","342625","","","","","2012-10-15 11:22:51","Android networking","<java><android><networking><rmi>","2","0","1","",""
"4110774","1","4110920","","2010-11-05 22:52:01","1","317","<p>I am building an application that downloads images from the web to the SD Card and then displays them conveniently. The application also generates thumbnails for those pictures. Problem is that those images and their generated thumbnails are indexed by the Media service and for instance appear in the gallery. </p><p>Furthermore, that system service consumes lots of CPU when generating its own thumbnails.</p><p>Is there a way to tell that system service that I don't want my pictures to appear in the gallery and that it should not generate thumbnails for my images?</p>","490961","","","","","2010-11-05 23:19:08","Avoid images to be processed by the thumbnail service","<android><image><thumbnails>","1","0","3","",""
"4110796","1","","","2010-11-05 22:54:42","1","850","<p>The time says it all:</p><p>How can I get the Market working in the Android Virtual Device on my computer?  I have the 2.2 AVD installed, and can run it just fine, but I need the Market on it.</p>","498881","","19750","","2011-09-05 13:31:06","2011-09-05 13:31:06","How can I get the Market working in the Android Virtual Device on my computer?","<android><google-play>","1","0","","",""
"4110892","1","","","2010-11-05 23:11:10","0","425","<p>I've got an Android App Widget that when clicked uses a PendingIntent to start an Activity, which the main Application associated with the App Widget also uses.  After the user is done with the Activity started from the App Widget, and presses the back button, the user is taken to the Activity on the top of the MAIN application Activity stack.  I'd like the back button to take the user back to the Android desktop/home screen.  </p><p>In short, I'd like separate Activity stacks for my App Widget and Application.  Not sure why Android wants to combine these.</p><p>This is what I've got now in the App Widget and it's not working. Neither Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK seems to have any impact on the stack.</p><p>Intent intent = buildWidgetIntent(context, info);intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);</p><p>PendingIntent pendingIntent = PendingIntent.getActivity(context,mRequestCode++, intent, PendingIntent.FLAG_UPDATE_CURRENT);</p><p>Thanks for any help with this one.  </p>","498875","","","","","2011-08-11 21:10:17","How do you separate an Android App Widget Activity stack from the Application Activity stack?","<android><activity><stack><appwidget><android-pendingintent>","1","0","","",""
"4110972","1","","","2010-11-05 23:33:21","0","144","<p>I've been making some custom skins for my AVD's in Eclipse for Android development and I think I've got the whole layout file worked out except for the ""event"" parameter in the layouts section.   When I see something like </p><p><strong>event     EV_SW:0:1</strong></p><p>... what does that mean?</p>","424690","","213269","","2011-03-22 08:27:14","2011-04-21 21:11:10","Event value in Android Skin layout?","<android><avd>","1","1","","",""
"4111215","1","4111351","","2010-11-06 00:31:14","4","1208","<p>I'm making out a few menus for my Android App and throughout there is a standard textview that is repeated 5 times, only changing the android:text tag each time, everything else is the same.</p><p>There are a good number of properties on this and it feels very inefficient to be copy/pasting all these for each of the textviews.</p><p>Is there a way I define the common properties just once and add them to each TextView element?</p>","451575","","","","","2010-11-06 01:07:28","Reuse TextView code in Android XML","<android><xml><menu>","1","0","","",""
"4111374","1","","","2010-11-06 01:13:53","0","491","<p>I have price values which I want to show in 2 different spinners beside: ""from"" and ""to"", I want to have two spinners showing beside eachother, One of them will contain ""from values""and the other one ""to values""</p><p>How is this possible in android?</p>","371301","","371301","","2010-11-06 01:30:44","2010-11-06 13:10:08","Android: two spinners beside","<java><android>","1","0","","",""
"4111398","1","4112657","","2010-11-06 01:22:02","24","17043","<p>I'm trying to start a <code>Service</code> from my <code>Activity</code> to look out for changes on a web page, it's a private app so I don't bother the battery life...</p><p>But I'd like to pass data from my <code>Service</code> to my <code>Activity</code>... I can't seem to find a way to call the <code>Activity</code> from my <code>Service</code>. How can I achieve this?</p>","219554","","810368","","2012-11-08 12:14:38","2012-11-08 12:14:38","android: notify activity from service","<android><service><activity>","5","0","17","",""
"4111441","1","","","2010-11-06 01:37:35","1","1877","<p>I was thinking, maybee the best way of loading pictures that I have on the server, using for my site would be to get the url for the picture.. </p><p>How can I load picture from a url to ImageView?</p>","371301","","","","","2011-04-20 18:08:41","Android: Load Image from server","<android>","1","1","","",""
"4111449","1","","","2010-11-06 01:40:18","0","1338","<p>How do I use the imageswithcer to load picture from my website,, I mean, do I need to send images as binary? or can I use Imageswitcher on URls on the pictures?</p>","371301","","","","","2010-11-06 22:16:10","Android: ImageSwitcher","<android>","1","0","","",""
"4111615","1","","","2010-11-06 02:40:27","1","483","<h2>HTTP POST</h2><p>My android application needs to do an HTTP post to a php script. The post needs to happen in a service. For some reason the POST gets a connection timeout when running in the service but if i copy the method to the onCreate event of my application and run, it works fine. I have no idea what could be different.This is my method</p><pre><code>    String url = ""http://myurl/"" +  ""?tmpl=javascript"" +  ""&amp;mode=recieved"" +   ""&amp;id="" + id;  URI uri = null;  try {   url = url.replace("" "", ""%20"");   uri = new URI(url);  } catch (URISyntaxException e1) {   // TODO Auto-generated catch block   e1.printStackTrace();  }  HttpGet httpGet = new HttpGet(uri);  HttpParams httpParameters = new BasicHttpParams();  // Set the timeout in milliseconds until a connection is established.  int timeoutConnection = 10000;  HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);  // Set the default socket timeout (SO_TIMEOUT)   // in milliseconds which is the timeout for waiting for data.  int timeoutSocket = 10000;  HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);  DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);  try {   HttpResponse response = httpClient.execute(httpGet);  } catch (ClientProtocolException e) {   System.out.println(e.getLocalizedMessage());   e.printStackTrace();  } catch (IOException e) {   System.out.println(e.getLocalizedMessage());   e.printStackTrace();  }</code></pre><p>The Android manifest declares the service like this</p><pre><code>&lt;service android:name="".Notifications.PushService""        android:label=""Application Notifications Service""&gt;    &lt;/service&gt;</code></pre><p>I do have uses internet in the permissions.Any help would be appreciated.</p><p>Thanks!</p>","498994","","498994","","2010-11-06 02:57:59","2010-11-06 02:57:59","HTTP POST works in application but not in service","<android><web-services><http><post>","0","0","1","",""
"4111725","1","4111755","","2010-11-06 03:19:48","0","76","<p>But completely ignored so that the code keeps continuing from where the exception was thrown?  I thought it was simply having the catch method empty.. but my code does not seem to be continuing, just doing nothing... but not crashing.</p>","487645","","419075","","2010-11-06 03:32:50","2010-11-06 03:32:50","in droid how do i have an exception get not only caught","<java><android><exception><exception-handling>","3","2","","",""
"4111863","1","4115534","","2010-11-06 04:17:04","1","2127","<p>I've got a dialog which shows a list of checkboxes. The info which boxes should be checked each time it opens comes from an edittext. I searched for a way to not allow caching of the dialog but couldn't find out how to do that. Now I override onPrepareDialog to set the checkboxes before the dialog opens. I deleted the content of my edittext, opened the dialog and there were still the same boxes checked... can anyone tell me how to reset the checkboxes?</p><pre><code>    @Override    protected void onPrepareDialog(int id, Dialog dialog) {        ListView lv = ((AlertDialog) dialog).getListView();        if (lv == null)            return;        boolean[] checked = cbDialog.setAndGetCheckedArray();        String s = ""onPrepareDialog... checked="";        for (int i=0; i&lt;checked.length; i++)            s+=""[""+i+""=""+checked[i]+""]"";        System.out.println(s);            // if edittext is empty, all entries in checked[] are false here,            // but these changes do NOT affect the checkboxes in the dialog:        for (int i=0; i&lt;checked.length; i++)            if (checked[i])                lv.setItemChecked(i, true);            else                 lv.setItemChecked(i, false);    }</code></pre>","474326","","1845869","","2012-12-07 07:59:47","2012-12-07 07:59:47","Can't set checkbox state in onPrepareDialog","<android><checkbox><dialog><checkboxlist><prepare>","2","0","","",""
"4111905","1","4114569","","2010-11-06 04:34:00","12","32475","<p>Basically I need a pause (based on just a few seconds) to be put into one action so that the user can see what happens before the next action is taken.  So for blackjack, when it's the dealer's turn and he decides to hit,  he hits, a card is added, and then he decides what to do next.  So before he decides on what to do next,  I want the code to pause so it can be ""seen"" as to what the dealer is doing this way the dealer doesn't complete his actions in less than a second and the player only sees the results.  </p><p>Thanks in advance!</p><p>I should note I have tried using wait(insert number here); but i am told by eclipse that it causes a stack interception error or something of the sort and throws an exception,  thus doing nothing : (</p><p>Well this is interesting,  (the way I've programed the things is ""interesting"" to say the least)  I did the Thread.sleep(5000) and threw it under a try catch, it does sleep for 5 seconds and then continues doing the code.  However my updates to views don't show until after I press a button(Is really hating event driven programming).  </p>","487645","","487645","","2010-11-06 13:01:18","2010-11-06 18:42:39","How do you have the code pause for a couple of seconds in android?","<java><android><time><wait>","2","0","6","",""
"4111937","1","","","2010-11-06 04:43:48","1","2431","<p>Project OverView : Theres two images. Click the top image (in my app i use a cat pic) and it will set the bottom image background to the color of the pixel on the location you clicked at.</p><p>The Problem: The background color doesn't match the color of the pixel at the location of your click at times its randomly colored, other times its off by a few shades. Its wierd.</p><p><strong>This is the main java code :</strong></p><pre><code>import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Color;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.Button;import android.widget.ImageView;public class ColorRead extends Activity implements OnTouchListener{ Integer myColor; String TAG; Bitmap bMap,bMap2; ImageView image,image2; Button BTN; MotionEvent mEvent; Integer touchX,touchY;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle Icicle) {        super.onCreate(Icicle);        setContentView(R.layout.main);        bMap = BitmapFactory.decodeResource(getResources(), R.drawable.catpic);        image2 = (ImageView) findViewById(R.id.bitmap2);        image = (ImageView) findViewById(R.id.bitmap);        image.setImageBitmap(bMap);        image.setOnTouchListener(this);    }    public void scanForColor(int xMouse, int yMouse)    {     myColor = bMap.getPixel(xMouse,yMouse);     Log.i(TAG, "" R:""+Color.red(myColor)+"" G:""+Color.green(myColor)+"" B:""+Color.blue(myColor));     image2.setBackgroundColor(myColor);    } @Override public boolean onTouch(View v, MotionEvent e) {  Integer id = v.getId();  switch(id)  {  case R.id.bitmap:   if(e.getAction() == MotionEvent.ACTION_DOWN)         {                 touchX = (int)e.getX();                 touchY = (int)e.getY();         }   scanForColor(touchX,touchY);         Log.i(TAG,touchX.toString());         break;    default:     break;  }        return false; }}</code></pre><p><strong>Heres the Main.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=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;ImageView android:id=""@+id/bitmap""      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:src=""@drawable/catpic""    /&gt;    &lt;ImageView android:id=""@+id/bitmap2""      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:src=""@drawable/catpic""    /&gt;    &lt;Button android:id=""@+id/button""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""    android:text=""@string/myButton""    /&gt;&lt;/LinearLayout&gt;</code></pre>","499046","","","","","2010-11-06 04:43:48","Android Bitmap.getPixel() Is Annoyingly Inaccuracte","<android><bitmap><getpixel>","0","2","","",""
"4112094","1","","","2010-11-06 05:39:43","1","495","<p>I am a newbe to android and have been following the tutorials posted online to experiment with coding for android. I am trying to display a list which has input from two different arrays, but every time i run the code i keep on getting a force close and can seem to figure out what i am doing wrong. here is my code ( this is from an online tutorial)</p><p>Main.XML</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""                    android:orientation=""vertical""                     android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""&gt;  &lt;TextView android:id=""@+id/TextView01""           android:layout_height=""wrap_content""           android:text=""List of Country &amp;amp; their denotation""           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><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 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;/LinearLayout&gt; </code></pre><p>display.java</p><pre><code>package com.example.displayimport 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.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, null);      holder = new ViewHolder();      holder.text = (TextView) convertView.findViewById(R.id.TextView01);      holder.text2 = (TextView) convertView.findViewById(R.id.TextView02);      convertView.setTag(holder);      } else {        holder = (ViewHolder) convertView.getTag();      }      holder.text.setText(curr[position]);      holder.text2.setText(country[position]);      return convertView;    }    static class ViewHolder {      TextView text;      TextView text2;    }  }  @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 = { ""Iceland"", ""India"", ""Indonesia"", ""Iran"", ""Iraq"", ""Ireland"", ""Israel"", ""Italy"", ""Laos"", ""Latvia"", ""Lebanon"", ""Lesotho "", ""Liberia"", ""Libya"", ""Lithuania"", ""Luxembourg"" };  private static final String[] curr = { ""ISK"", ""INR"", ""IDR"", ""IRR"", ""IQD"", ""EUR"", ""ILS"", ""EUR"", ""LAK"", ""LVL"", ""LBP"", ""LSL "", ""LRD"", ""LYD"", ""LTL "", ""EUR""};}</code></pre><p>This code can also be found at <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>I have tried several times, changing different values and even trying to print one array but have been unsuccessful at it and keep on getting a force close. I would appreciate it if someone would be able to point out what is wrong with the code and point me in the right direction.</p>","499067","","1288","","2012-06-15 15:09:42","2012-06-15 15:09:42","Custom ListView adapter Force close :(","<android><listview><android-layout><android-linearlayout>","0","1","","",""
"4112117","1","","","2010-11-06 05:52:09","1","495","<p>Im trying to start a new activity once i press a notification...the related code is:</p><pre><code>NotificationManager notifManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);  Notification note = new Notification(R.drawable.android, ""New E-mail"", System.currentTimeMillis());  PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, DatabaseActivity.class), 0);  note.setLatestEventInfo(this, ""New E-mail"", ""You have one unread message."", intent);  notifManager.notify(NOTIF_ID, note); </code></pre><p>But the activity just dsnt begin..the notification pops up..but if i click it nothin happens...plz advice!!!</p>","499072","","162407","","2010-11-06 06:11:12","2011-03-23 05:43:59","Android Notifications","<android>","2","2","1","",""
"4112269","1","","","2010-11-06 07:00:37","3","2003","<p>New to Android here.</p><p>Is there an Android 2.2 3D math library in the SDK?  I couldn't find one and I was hoping there would be one. I am not able to use javax.* packages for some reason in Eclipse.</p><p>The thing I really need is rotation about an arbitrary axis of an arbitrary angle. </p><p>I don't really want to use the NDK unless I am forced to. If there is a freely available Java 3d math library, I would love to know. It should work with Android. </p><p>It should ideally have basic 3d math like cross(), dot(), etc. along with arbitrary rotation and scaling.</p><p>Thanks,</p>","470624","","","","","2012-10-22 13:32:01","Android 3d math library (vector, matrix, etc.) similar to javax.vecmath.Matrix4f.rotate()","<java><android><math><3d><rotation>","2","1","","",""
"4112369","1","4112391","","2010-11-06 07:49:49","1","3823","<p>Does anybody know what is the shake code for android 2.2? I want on shake to make buzz on my application. Thanks.</p>","477758","","16883","","2010-11-06 07:55:13","2011-11-23 11:15:00","How to shake on android 2.2","<android><shake>","4","0","","",""
"4112443","1","4112493","","2010-11-06 08:23:38","1","550","<p>everyone.I simply thought I could use jython for developing Android App.<br>But it was not easier than I thought.<br>I created android sample project and added jython.jar into the project.<br>After soon I encountered with ""Conversion to Dalvik format failed"" error msg.<br>So I googled almost every pages about that msg.<br>However I could not find a proper answer.<br>Closest answer was using ""--no-locals"" in dx option.<br>I did it in command console and it seemed to work well. I guess...<br></p><p>My question is...<br>I want to use the dx option(""--no-locals"") with eclipse.<br>Because eclipse automatically copys apk file to the emulator and runs it.<br>Is it anyway to set dx.bat option (""--no-locals"") in eclipse?<br>Is there anyone who succeed in use of jython for anroid?<br></p>","441275","","","","","2010-11-06 08:49:52","Android : How can I use DX option in eclipse?","<android><eclipse><jython>","1","2","","",""
"4112573","1","4112627","","2010-11-06 09:25:37","3","1160","<p>I am developing a multi player game app for the android.One of the participant is acting as the host (the one who created the game instance) and each of the other participants is connecting to the host using bluetooth.</p><p>My question is as follows, this host has some threads running in order to communicate and holds all the open connections. I've read that my Activities can be destroyed temporary and restored later and I should use the onSaveInstanceState mechanism for that. However, I am talking about an app that is acting as a ""server"" for the game and it has open connections and threads that serves the other clients, what happens to these connections and threads if the OS is deciding to destroy my activity? Are they terminated? If so what would be the recommended pattern in order to implement this properly, How can I keep a connection on the onSaveInstanceState bundle? it is not serializable. The same goes for the threads, do I need to recreate and destroy them upon destroy and when the activity is restored?? if I hold all this state in some static class that represents the game state? If I do so, will then the OS not destroy my threads/connections?</p><p>I looked at the sample Bluetooth chat that comes with the SDK and I so there's no handling of the onSaveInstanceState so it is very unclear what should I do.</p><p>Thank you!</p>","499134","","","","","2010-11-06 09:51:31","Keeping threads and connection state in Android app using onSaveInstanceState?","<android><bluetooth><android-lifecycle>","1","0","","",""
"4112599","1","4112620","","2010-11-06 09:37:25","70","25073","<p>I need to stop running translate animation on touch event. When I use .cancel() method of Animation, it does not affects, so animation goes till the end anyway.</p><p>Is there any tips on how to cancel the running animation?</p>","349871","","","","","2012-07-02 23:57:09","how to stop animation (cancel() does not work)","<android><animation>","2","0","7","",""
"4112791","1","","","2010-11-06 10:51:14","0","2643","<p>I know this might sound very basic but here's my problem:</p><p>I have an onclickevent listener that's supposed to increment the counter indefinitely when it's clicked:</p><pre><code>final int counter = 0;myimageView2.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        counter ++;    }});</code></pre><p>The problem is that I can't seem to call the counter from inside the onclick event unless it's set to <strong>final</strong>. However since it's final I can no longer change its value either.</p><p>I tried placing the counter within the onclick event, i.e.:</p><pre><code>myimageView2.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        int counter = 0;        counter ++;    }});</code></pre><p>However, clicking it also resets the counter back to zero.</p><p>How do I solve this? I want to continuously increment the counter each time I click it,but I can't define the counter outside of the onclick unless it's final, which means I can no longer increment it. And I can't define the counter inside the onclick either since it will only reset its value each time I click it.</p>","499169","","29995","","2011-07-08 19:23:04","2013-03-29 01:46:46","How to increment a Counter inside an OnClick View Event","<android><sdk>","1","1","","",""
"4112952","1","4113039","","2010-11-06 11:43:56","0","196","<p>Howdy,I currently have my main activity in Android. It's called start activity. My programm is designed so that it loads an XML File from the web, and parses it. </p><p>Now in future I want to add also the ability that the program loads the XML file and instead of parsing it every runtime it loads the data from an SQLLite database.</p><p>However for that I need to write an interface which capsulates the different functionalities.</p><p>In case that the XML needs to be used I wrote me a small class which should cover the XML loading - but I cannot use openFileInput(...) ... since that class is not an activity ( does it need to be one?? ).</p><pre><code>package com.android.mensa.handledata;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.util.ArrayList;import java.util.TreeMap;import javax.xml.parsers.ParserConfigurationException;import org.xml.sax.SAXException;import android.app.Activity;import com.android.mensa.datastructure.LunchPlace;import com.android.mensa.getData.XMLHandler;import com.android.mensa.interfaces.Data;/** * This class implements the interface Data * and gathers the necessary informations out of the XML File on the actual device. */public class XMLData implements Data{    @Override    public void getMenuforDay() {        // TODO Auto-generated method stub    }    public TreeMap&lt;String, LunchPlace&gt; open()    {        File test = new File(""lunchfile"");        FileInputStream fis;        TreeMap&lt;String, LunchPlace&gt; places = new TreeMap&lt;String, LunchPlace&gt;();        try {            fis = openFileInput(""lunchfile"");            XMLHandler xmlhandler = new XMLHandler();            places  = xmlhandler.parse(fis);                    } catch (FileNotFoundException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        catch (SAXException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (ParserConfigurationException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return places;    }}</code></pre><p>I guess my question is pretty basic: does the XMLhandler helper class ( which is supposed to return a TreeMap ) needs to be an activity or how else can I achieve my functionality?</p>","498400","","33857","","2010-11-06 11:51:29","2010-11-06 12:21:33","Open file in a class","<java><android>","1","0","","",""
"4112982","1","4116173","","2010-11-06 11:55:56","0","1352","<p>I am fairly new to the android platform. I have to implement a SeekBar or a ProgressBar with the following constraint: it should not be clickable. I only want to allow my users to change the value of the bar by dragging it not by clicking on it. I have not found any solutions for that so far. Do you have any ideas?</p>","384598","","","","","2010-12-28 07:19:23","Android seek bar/ progress bar with no click","<android><android-widget><android-layout>","2","2","","",""
"4113133","1","4113141","","2010-11-06 12:48:52","0","1103","<p>In Android how can I change a value to a negative number?</p><p>If I have the following code and have entered 10 for <code>pos1_deg</code>, how can I easily change this to -10 using a radio button?Is the answer to concatenate a string such as <code>pos1_deg = ""-"" + pos1_deg</code>? Or is there some mathematical command I can use?</p><pre><code>pos1_deg =(EditText)findViewById(R.id.sat1posdeg);pos1_deg.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_DECIMAL);</code></pre><p>Many thanks for any help</p>","497517","","21234","","2010-11-06 13:11:42","2013-04-01 21:19:10","Changing a positive value to a negative one","<android>","4","0","1","",""
"4113143","1","","","2010-11-06 12:49:53","5","2452","<p>I am having a common problem doing animationdrawable in Android. I wanted to start an animation when the Activity starts, in the onCreate() method, but as many people have found, it doesn't work.</p><p>I have read lots of advice but nothing seems to work for me. If I start the animation in onClick() it works, it requires user input, not starting immediately.</p><p>I tried starting it in a separate thread in onCreate() but that doesn't work either. I read here:</p><p><a href=""http://code.google.com/p/android/issues/detail?id=1818"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=1818</a></p><p>but none of the advice worked, or I couldn't understand it.</p><p>Can someone help?</p>","499203","","544198","","2011-07-03 16:55:57","2013-01-07 10:30:18","AnimationDrawable in Android problem","<android><animation>","3","0","1","",""
"4113236","1","4113600","","2010-11-06 13:14:29","1","2909","<p>I have a PreferenceActivity with settings for my app and I want to refresh activity if some preferences was changed.</p><p>For example I have a checkbox which responsible for addtional tab in my layout, when checkbox is checked tab must be shown. To catch this event I used OnSharedPreferenceChangeListener. But this listener listen every click on this checkbox and do something (your logic) every time, every click even though setting really was not changed. I want to refresh my activity only if setting was really changed. If earlier was ""OFF"" and now become ""ON"" in this case I want to refresh, but if I changed OFF - ON  - OFF I don't want to refresh.</p><p>How to catch really changes and how to handle this in activity?</p><p>Thanks!</p>","423868","","","","","2010-11-06 15:01:41","Refresh activity if preferences was changed","<android><activity><settings><refresh><preferences>","1","0","0","",""
"4113266","1","4113318","","2010-11-06 13:25:38","0","299","<p>hey, i have a dictionnary like""key2"",""value2""""key3"",""value3""""key1"",""value1""</p><p>is it possible to sort it on value ?If not, any other object can do same thing? (sort value on key/value pair)</p>","431652","","","","","2010-11-06 13:42:35","Dictionary sort?","<android><sorting><dictionary>","1","2","","",""
"4113285","1","","","2010-11-06 13:33:08","1","1927","<p>Could anyone tell me the EXACT steps of porting an Android ROM from a device to another?</p><p>I am trying to get the RedBullMobile2 latest firmware running on my HTC G1 (mostly because the device has less RAM, so the ROM would run smoother on our device, and it has some more cool feature, like Hungarian language), but I just can't get it up and running.</p><p>I've already tried dsixda's kitchen's porting tool, with more or less success. First tries: the system won't even boot, everything is dead, logcat reports that the system could not start /system/bin/sh, permission denied. Second try, the system boots up, the system process is started, and suddenly, it force closes. And I could not get through this sadly :S</p><p>Also I would like to learn porting, that's why I want a good, step-to-step guide!</p><p>Thank you very much!</p>","294814","","429063","","2010-11-24 20:42:49","2013-01-08 14:54:29","Android ROM Porting how-to","<android><porting><rom>","1","3","0","",""
"4113393","1","4113821","","2010-11-06 14:03:11","0","330","<p>I'm an android noob creating my first menu.     In the New Android XML file dialog there is a list of ""<strong>Available Qualifiers</strong>"" to choose from. What are these and what do they do regarding menus?</p><p>BTW I did a Google search for <em>""available qualifiers"" ""New Android XML File""</em>  and got only 5 hits- only 3 in English and none of them helpful.   On StackOverflow there were no hits on ""available qualifiers"".    </p><p>Thanks in advance! </p>","424690","","367677","","2010-11-06 16:42:17","2010-11-06 16:42:17","Newbie Android menu question","<android><xml><menu>","2","0","","",""
"4113632","1","5331914","","2010-11-06 15:08:37","2","13265","<p>I have tried to implement HTML5 in Android OS. But i didnt get it....Can anyone give example  HTML 5 in Android? </p>","396643","","","","","2013-08-03 00:21:07","Android HTML5 example needed","<android><html5>","4","3","2","",""
"4113704","1","4113768","","2010-11-06 15:22:41","6","15999","<p>I apologise now for the LONG post but this is the only way I could explain, and google gives 3 pages of results that aren't conclusive</p><p>Here's my error guys:</p><pre><code>*** Uncaught remote exception!  (Exceptions are not yet supported across processes.)android.util.AndroidRuntimeException: { what=1008 when=368280372 } This message is already in use.at android.os.MessageQueue.enqueueMessage(MessageQueue.java:171)at android.os.Handler.sendMessageAtTime(Handler.java:457)at android.os.Handler.sendMessageDelayed(Handler.java:430)at android.os.Handler.sendMessage(Handler.java:367)at android.view.ViewRoot.dispatchAppVisibility(ViewRoot.java:2748)</code></pre><p>What I'm attempting is to have a listview, that is populated by custom list items, each list item has multiple views and each view has an onclick listener attached. When this onClickListener is pressed it sends a Message to a Handler with a what and arg1 arguments.Clicking one of my elements fires an intent to start a new activity.Clicking the other shows a toast.When these are pressed in a combination I get the error above. Namely clicking the text to fire the intent, ( then press back) then clicking the image to show the toast, then when you click the text to fire the intent again I get the FC.</p><p>I have created a demo project that reproduces this:<a href=""http://rapidshare.com/files/429227042/HandlerTest.rar"">http://rapidshare.com/files/429227042/HandlerTest.rar</a></p><p>And here is the code below, I tried to remove as much cruft as I could to get to the bones of the error:</p><p>If you want to skip to whats important look at the onClickListener's in ConversationAdapter.class and how they interact with StartPage.class</p><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.handler.test""    android:versionCode=""1""    android:versionName=""1.0""&gt;      &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".StartPage""              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="".DetailsPage""        android:label=""DetailsPage""        &gt;    &lt;/activity&gt;     &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt;</code></pre><p>StartPage.class:</p><pre><code>package com.handler.test;import java.util.ArrayList;import android.app.ListActivity;import android.app.ProgressDialog;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.widget.Toast;public class StartPage extends ListActivity {private ArrayList&lt;Conversation&gt; mConversations = null;private ConversationAdapter mAdapter;private Context mContext;private ProgressDialog mProgressDialog;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mContext = this;    mConversations = new ArrayList&lt;Conversation&gt;();    this.mAdapter = new ConversationAdapter(mContext, R.layout.inbox_row, mConversations, mHandler);    setListAdapter(this.mAdapter);    new Thread(new Runnable() {        @Override        public void run() {            getConversations();        }    }).start();    mProgressDialog = ProgressDialog.show(StartPage.this, ""Please wait..."", ""Retrieving data ..."", true);}private void getConversations() {    try {        mConversations = new ArrayList&lt;Conversation&gt;();        Conversation o1 = new Conversation();        o1.setStatus(""SF services"");        o1.setMessage(""Pending"");                   mConversations.add(o1);    } catch (Exception e) {        Log.e(""BACKGROUND_PROC"", e.getMessage());    }    runOnUiThread(returnRes);}private Runnable returnRes = new Runnable() {    @Override    public void run() {        if(mConversations != null &amp;&amp; mConversations.size() &gt; 0){            mAdapter.notifyDataSetChanged();            for(int i=0;i&lt;mConversations.size();i++)                mAdapter.add(mConversations.get(i));        }        mProgressDialog.dismiss();        mAdapter.notifyDataSetChanged();    }  };private Handler mHandler = new Handler(){    @Override    public void handleMessage(Message msg) {        int convIndex = msg.arg1;        int viewTouched = msg.what;        switch(viewTouched){            case ConversationAdapter.PROF_ICON:                showNumber(convIndex);            break;            case ConversationAdapter.MESSAGE:                showMessageDetails(convIndex);            break;        }        super.handleMessage(msg);    }};private void showNumber(int convIndex) {    Toast.makeText(mContext, ""Pressed: ""+convIndex, Toast.LENGTH_LONG).show();}private void showMessageDetails(int convIndex) {    final Conversation conv = mConversations.get(convIndex);    Intent i = new Intent(mContext, DetailsPage.class);    i.putExtra(""someExtra"", conv);    startActivity(i);}}</code></pre><p>DetailsPage.class</p><pre><code>package com.handler.test;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class DetailsPage extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Log.i(""Test"", ""Details Page"");      }}</code></pre><p>Conversation.class:</p><pre><code>package com.handler.test;import java.io.Serializable;public class Conversation implements Serializable {private static final long serialVersionUID = -437261671361122258L;private String status;public String getStatus() {    return status;}public void setStatus(String status) {    this.status = status;}}</code></pre><p>ConversationAdapter.class:</p><pre><code>package com.handler.test;import java.util.ArrayList;import android.content.Context;import android.os.Handler;import android.os.Message;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.LinearLayout;public class ConversationAdapter extends ArrayAdapter&lt;Conversation&gt; {public static final int PROF_ICON = 0;public static final int MESSAGE = 1;private Context mContext;private Handler mHandler;private ArrayList&lt;Conversation&gt; mItems;private int mXmlId;private LinearLayout detailsOfConv;private ImageView iconImage;public ConversationAdapter(Context context, int textViewResourceId, ArrayList&lt;Conversation&gt; items, Handler handler) {    super(context, textViewResourceId, items);    this.mContext = context;    this.mItems = items;    this.mXmlId = textViewResourceId;    this.mHandler = handler;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(mXmlId, null);    }    final Message m = new Message();    m.arg1 = position;    Conversation c = mItems.get(position);    if (c != null) {        iconImage = (ImageView) v.findViewById(R.id.icon);        if (iconImage != null) {            iconImage.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    m.what = PROF_ICON;                    mHandler.sendMessage(m);                }            });        }        detailsOfConv = (LinearLayout) v.findViewById(R.id.details);        if(detailsOfConv != null){            detailsOfConv.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    m.what = MESSAGE;                    mHandler.sendMessage(m);                }            });        }    }    return v;}}</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""android:padding=""10dip""&gt;&lt;ListView android:id=""@+id/android:list"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:cacheColorHint=""#00000000"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>inbox_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""  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:id=""@+id/details""    android:orientation=""vertical""    android:layout_width=""0dip""    android:layout_weight=""1""    android:layout_height=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/toptext""        android:textColor=""#99FF66""        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""        android:singleLine=""true""        android:text=""123456789""        /&gt;         &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Sorry for all the code!</p>","413127","","","","","2010-11-06 15:52:36","Android Handler Message and ListView","<android><listview><message-queue><message><handler>","1","0","3","",""
"4113753","1","4113962","","2010-11-06 15:35:26","1","5079","<p>I tried the following to try to display two buttons in a horizontal linear layout, with the edges of the buttons flush with the border of the linear layout.  To my surprise, I found that there is always still padding between the buttons and the left, right and bottom edges of the linear layout.  Only the top edges of the buttons end up flush with the border of the linear layout.  Why is that?  And is there a way to control this behavior?  Thanks much. </p><pre><code>&lt;LinearLayout android:orientation=""horizontal""  android:layout_width=""match_parent""  android:layout_height=""wrap_content""  android:background=""#777""  android:padding=""0dip""  android:layout_margin=""0dip""&gt;  &lt;Button android:id=""@+id/feeling_done_button""     android:text=""@string/done_button_label""     android:layout_height=""wrap_content""     android:layout_width=""match_parent""     android:layout_weight=""1""     android:padding=""0dip""     android:layout_margin=""0dip""/&gt;  &lt;Button android:id=""@+id/feeling_cancel_button""     android:text=""@string/cancel_button_label""     android:layout_height=""wrap_content""     android:layout_width=""match_parent""     android:layout_weight=""1""     android:padding=""0dip""     android:layout_margin=""0dip""/&gt;&lt;/LinearLayout&gt;</code></pre>","369722","","369722","","2010-11-06 15:42:33","2010-11-06 16:26:19","Is there a way to completely eliminate padding in a LinearLayout containing buttons?","<android><layout><padding><android-linearlayout><linear>","1","0","1","",""
"4113829","1","4113858","","2010-11-06 15:52:50","2","1724","<p>I want to be able to extract text from received SMS's.I'm not sure whether I should use content providers or the sms message is included in the intent received by broadcast receiver.</p><p>I have a broadcast receiver waiting for SMS's, and want to inspect the contents of the received message.</p><p>Thank you.</p>","455048","","","","","2010-11-13 20:48:23","Android - Extract text from SMS","<android><sms><android-intent><broadcastreceiver>","3","0","1","",""
"4113836","1","4147184","","2010-11-06 15:53:42","2","5421","<p>This text</p><pre><code>BEGIN:VCARDN:Haven;Richard;;;ADR;DOM;PARCEL;HOME:;;9999 Mission Street ;Daly City;California;94014;U.S.A.EMAIL;INTERNET:richard@domain.comEMAIL;INTERNET:richard@domain.orgTEL;CELL:831-555-9315TEL;CELL:831-555-0740END:VCARD</code></pre><p>converted into <a href=""http://chart.apis.google.com/chart?cht=qr&amp;chs=350x350&amp;chl=BEGIN%3AVCARD%0AN%3AHaven%3BRichard%3B%3B%3B%0AADR%3BDOM%3BPARCEL%3BHOME%3A%3B%3B9999+Mission+Street+%3BDaly+City%3BCalifornia%3B94014%3BU.S.A.%0AEMAIL%3BINTERNET%3Arichard%40domain.com%0AEMAIL%3BINTERNET%3Arichard%40domain.org%0ATEL%3BCELL%3A831-555-9315%0ATEL%3BCELL%3A831-555-0740%0AEND%3AVCARD"" rel=""nofollow"">this QR Code</a> and imported into my Motorola Droid does not separate the first and last name, and it does not separate the address.</p><p>Also, the phone and emails are assigned Home and Work and Home and Mobile; I expected at least the phones to go in as both Mobile.</p><p>Is it just the way Android parses vCards or can I change the encoding to allow separation and correctly specify the types of emails and phones?</p><p>Thanks</p>","29420","","21234","","2010-12-15 14:53:19","2010-12-15 14:53:19","QR Code import of vCard does not separate fields. Is it the format?","<android><qr-code><vcard>","2","0","1","",""
"4113859","1","4117920","","2010-11-06 15:59:11","5","5690","<p>I have a strange problem when parsing a ISO8601 date and time with SimpleDateFormat. The relevant code is:</p><pre><code>public class DateHelper{    private static SimpleDateFormat iso8601formatter = new SimpleDateFormat(""yyyy-MM-dd'T'HH:mm:ssZ"");    public static Date parseISO8601(String date) throws ParseException    {   Date result = iso8601formatter.parse(date);   return result;    }}</code></pre><p>For input I'm giving it a string</p><pre><code>2010-09-06T15:30:00+02:00</code></pre><p>And as a return I get a Date object with date set to 6th of January 2010 with time of 13:30 and timezone of GMT+00:00.</p><p>EDIT: I also tried using ""2010-09-06T15:30:00+0200"" with same results.</p><p>Confusing thing is, that the date set is partially correct, just the month is set wrongly.</p><p>The issue is shown on Android 1.6 and Android 2.2.</p><p>How can I fix it?</p>","169115","","","","","2012-04-12 13:02:59","Strange date and time parsing problem with SimpleDateFormat","<java><android><parsing><date><simpledateformat>","5","3","1","",""
"4113939","1","4114017","","2010-11-06 16:20:06","1","5204","<p>I have a little problem with an android custom dialog.</p><p>I construct a custom dialog in the onCreateDialog(int) function:</p><pre><code>dialog = new Dialog(this);dialog.setContentView(R.layout.custom_dialog);dialog.setTitle(""Custom Dialog"");</code></pre><p>I have a onClick(View) function in the same class:</p><pre><code>   public void onClick(View v) {        switch(v.getId()) {        case R.id.dialog_button:            Log.i(""pma57"",""dialog button pressed"");            break;        case R.id.main_button:            showDialog(DIALOG_CUSTOM);            break;        }           }</code></pre><p>This is the XML definition:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:paddingLeft=""20dp""  android:paddingRight=""20dp""  android:paddingBottom=""20dp""&gt;      &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""@string/enter_username"" /&gt;      &lt;EditText        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;      &lt;Button        android:id=""@+id/dialog_button""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""OK""        android:onClick=""onClick"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The Dialog shows up. But the Button does not work (the app crashs)- which is quite ok because the onClick-function for the callback is defined in my main activity - and the dialog is a new activity (am I right?).</p><p>But I realy don't know how i implement a button in the dialog - I think this is a fundamental understanding problem of the technic. The long way would be to subclass Dialog and write everything there - but is there another way which I don't see?</p>","88144","","","","","2010-11-06 16:39:29","Handling buttons in custom dialogs","<android>","2","2","","",""
"4114011","1","","","2010-11-06 16:37:05","3","411","<p>What's a good way to limit the number of words that can be entered in an android EditText view?</p>","369722","","918414","","2013-01-29 19:07:29","2013-01-29 19:07:29","What's a good way to limit the number of words that can be entered in an android EditText view?","<android><validation><word><limit><textview>","1","0","","",""
"4114132","1","4114697","","2010-11-06 17:07:54","17","9058","<p>My activity's layout is as shown below.</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;FrameLayout android:id=""@+id/title_bar""      android:layout_width=""fill_parent""      android:layout_height=""25dip""      android:background=""@drawable/bg_title"" /&gt;   &lt;LinearLayout android:id=""@+id/main""      android:width=""fill_parent""      android:layout_height=""fill_parent""      android:layout_weight=""1""&gt;         &lt;ListView android:id=""@+id/android:list""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;         &lt;TextView android:id=""@+id/android:empty""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;      &lt;/FrameLayout&gt;   &lt;/LinearLayout&gt;   &lt;LinearLayout      android:layout_width=""fill_parent""      android:layout_height=""50dip"" &gt;      &lt;EditText android:id=""@+id/query""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""          android:hint=""Enter some search terms""         android:singleLine=""true""          android:layout_weight=""1"" /&gt;      &lt;Button android:id=""@+id/btn_hide""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:background=""@drawable/btn_hide""         android:layout_marginLeft=""6dip"" /&gt;   &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>So, the search box is fixed to the bottom of the screen. </p><p>But, when user clicks the EditText, Soft Keyboard shows up and pushes the layout out of the screen except the search box.</p><p>I'm just starting out with Android, so am I doing anything wrong here??</p>","448668","","13793","","2012-05-01 01:25:06","2013-07-05 17:43:21","Android - Soft Keyboard pushes layout of my activity out of screen","<android><edittext><android-softkeyboard>","2","0","3","",""
"4114441","1","","","2010-11-06 18:19:25","2","3284","<p>For example, I want to validate minumumlength, and if it's email., a phonenumer. </p><p>How is this possible in android. I want to validate  </p>","371301","","","","","2012-11-01 08:15:02","Android: are there any good solutions how to validate Editboxes","<android>","4","0","2","",""
"4114443","1","4114470","","2010-11-06 18:19:29","7","11605","<p>I have a server running that notifies the user with a statusbar notification that opens my main activity, how can I pass data to my activity trough that intent?</p>","219554","","","","","2012-10-08 19:05:52","android: use an intent to send data to my activity","<android><service><activity><android-intent>","2","0","1","",""
"4114496","1","4114753","","2010-11-06 18:29:11","1","4123","<p>I have a WebView on my Android application which loads (<code>WebView.loadUrl()</code>) different local HTML files from phone's internal storage. I would like to include some custom css styles for them.</p><p>Now, I could have my app edit every HTML file and add linking reference for the CSS file.</p><p>I could also read the file contents, add the CSS linking and use <code>WebView.loadData()</code> to load it.</p><p>But is it possible to do this a lot simpler and efficiently?</p><p><strong>Note:</strong> The HTML files are downloaded from a website. So editing them manually is not possible in this case, but once downloaded they can be edited via the app if necessary.</p>","336525","","","","","2011-12-03 17:25:14","Load HTML file to WebView with custom CSS","<java><html><android><css><webview>","2","0","","",""
"4114585","1","4114610","","2010-11-06 18:45:25","0","1634","<p>I want to load resource that is located in android.R.attr class. </p><p>Next code failed to load resource with Resources$NotFoundException exception: </p><pre><code>getResources().getString(android.R.attr.action); //action is a string resource</code></pre><p>Also tried to load resource using:</p><pre><code>getResources().obtainAttributes(android.R.attr.action)</code></pre><p>No exception is thrown, but returned TypedArray array has nothing valuable inside it. At least I couldn't find anything that is connected to actual resource id or resource I'm interested in.</p><p>So, how to load resources represented by android.R.attr.* ids?</p>","69802","","","","","2010-11-06 18:51:25","Loading resource represented by android.R.attr.*","<android><resources><attributes>","1","0","","",""
"4114622","1","4114654","","2010-11-06 18:53:10","0","719","<p>I have TabActivity:</p><pre><code>public class timetable extends TabActivity  {...    @Override    public boolean onTouchEvent(MotionEvent event)     {        Toast.makeText(this, ""!"", Toast.LENGTH_SHORT).show();          return true;    }...}</code></pre><p>but anything not happend when I move my finger on screen (push, fling, ..)Help me!</p>","499393","","","","","2010-11-06 19:27:44","onTouchEvent in TabActivity don't react on anything","<android><tabactivity><ontouchevent>","1","0","","",""
"4114786","1","4117722","","2010-11-06 19:28:09","1","1338","<p>I am searching a way to do this :</p><pre><code>public class SimpleText_SpinnerAdapter extends ArrayAdapter&lt;Enum1&gt; {   many lines of code with a one moment : String val = oneEnum1val_inparam.getlabel();}public class SimpleText_SpinnerAdapter extends ArrayAdapter&lt;Enum2&gt; {   exactly the same code than previously, but for Enum2}public class SimpleText_SpinnerAdapter extends ArrayAdapter&lt;Enum3&gt; {   exactly the same code than previously, but for Enum3}</code></pre><p>This is made to have 3 adapters for 3 spinners, that contains values from 3 differents Enums constructed exactly the same way but with different values.</p><p>Of course, each enum type has a getLabel() method.</p><p>I'd like to find a way to do this without needing to copy-paste 3 times the same code for each adapter. A sort of generic one, that could be referenced by 3 specialized one.</p><p>I don't find the solution.Could you help me to do this ?</p><p>Or if you have somthing more efficient...</p><p>Oliver</p>","499417","","499417","","2010-12-29 00:57:58","2010-12-29 00:57:58","Android - Java generic SpinnerAdapter","<android><generics><spinner>","1","0","","",""
"4114815","1","","","2010-11-06 19:36:04","0","596","<p>I've a problem with my android application.I'm using a background service (with notification on the status bar) which performs an audio sample every hour. To perform this sample I generate a broadcast event every hour and when I capture the event the audio recording starts. During the day, when I'm using the phone, I've no problems. The strange behavior happens during night, when it seems like if the phone goes to an ""idle"" state: the broadcast events are no more processed. From the log file I understood that the events are generated and putted in a queue... and when I start using again the phone, all those events are raised in the same moment.Do u have any idea about how to solve this problem? How can I force the phone to continue processing my events? do I have to set any variable of flag to avoid the phone going in this kind of ""idle"" state?hope someone can help me!</p><p>thank you in advance!michela</p>","499420","","","","","2010-11-06 20:48:22","android background service stops processing broadcas events","<android><events><broadcast><background-service>","1","0","","",""
"4114822","1","4114906","","2010-11-06 19:37:55","3","1916","<p>I'm running a <code>TabActivity</code>. In the following line:</p><pre><code>spec = tabHost.newTabSpec(""alltime"").setIndicator(R.string.plots_allTime)       .setContent(intent);</code></pre><p>I get an error because <code>setIndicator()</code> expects a <code>CharSequence</code>. I'm not really sure how to fix this, because I should be able to pass a string into that parameter. I think the issue lies in the fact that the generated <code>R.java</code> initializes everything in the <code>strings.xml</code> file as <code>public static final int</code>. The setIndicator() method doesn't seem to like that too much. Is there any way around this?</p>","382252","","","","","2010-11-06 20:11:31","Problem with strings.xml... can't pass R.string.foo as a CharSequence","<java><android><charsequence>","2","0","","",""
"4114838","1","5167371","","2010-11-06 19:41:30","4","1695","<p>I'm following the instructions found at <a href=""http://developer.android.com/guide/publishing/licensing.html"" rel=""nofollow"">http://developer.android.com/guide/publishing/licensing.html</a></p><p>I made a copy of the &lt;sdk&gt;/market_licensing directory, then using the New Project Wizard in Eclipse I created a new Android project from Existing source and pointed it at the library subdirectory in my copy of market_licensing.</p><p>I've checked the ""is Library"" box in the market_licensing project android properties.I've added that project as a library project in my app project. It shows up in the list with a green checkmark. </p><p>When I save the project settings and rebuild, the compiler can't find the classes in the LVL project and when I go back into my app's project settings the entry in the libraries list now has a red X instead of the green checkmark.</p><p>I don't understand what I'm doing wrong which is preventing me from referencing the LVL project. Any help?</p><p>EDIT: I've tried adding the licensing project to my build path for my app project and then I'm able to build, but when I try to run the app crashes because it can't find any of the library code. So clearly the ""library"" status of the licensing project is not set up correctly and/or its not being automatically injected into my app project on build.</p>","416631","","416631","","2010-11-06 20:59:42","2012-03-27 10:53:11","Cannot Reference LVL Android Library in my App Project","<android><eclipse><licensing>","1","1","","",""
"4114859","1","4537922","","2010-11-06 19:46:05","2","3718","<p>Is there a way to make all lines in a multi-line edittext underlined?I want all lines to show the line, even if there's no text on it.</p>","484146","","","","","2010-12-28 02:41:04","Android - edittext - underline","<android><line><edittext><underline>","1","0","5","",""
"4115041","1","4115335","","2010-11-06 20:35:34","2","2927","<p>I was wondering if would be possible to perform an action for each time the USB status of the device changes. </p><p>For example if the user plugs in the cable and it is in sync/charge mode it performs a certain action, if the user then changes the phone into USB Memory Card mode another action is performed and if the user then disconnects the cable then the another action is done. </p><p>Is this actually possible. Any help with this would be greatly appreciated. </p><p>Thank you</p>","499448","","","","","2010-11-06 21:46:44","Check USB Connection Status on Android","<android>","1","0","1","",""
"4115101","1","6631656","","2010-11-06 20:50:43","22","17333","<p>I'm developing an Android application for accessing some battle.net (https://eu.battle.net) account data (for World of Warcraft) and I'm using the <code>org.apache.http.client.HttpClient</code> to do so.</p><p>This is the code I'm using:</p><pre><code> public static final String USER_AGENT = ""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)"";  public static class MyHttpClient extends DefaultHttpClient {    final Context context;    public MyHttpClient(Context context) {      super();      this.context = context;    }    @Override    protected ClientConnectionManager createClientConnectionManager() {      SchemeRegistry registry = new SchemeRegistry();      registry.register(new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));      // Register for port 443 our SSLSocketFactory with our keystore      // to the ConnectionManager      registry.register(new Scheme(""https"", newSslSocketFactory(), 443));      return new SingleClientConnManager(getParams(), registry);    }    private SSLSocketFactory newSslSocketFactory() {      try {        // Get an instance of the Bouncy Castle KeyStore format        KeyStore trusted = KeyStore.getInstance(""BKS"");        // Get the raw resource, which contains the keystore with        // your trusted certificates (root and any intermediate certs)        InputStream in = context.getResources().openRawResource(R.raw.battlenetkeystore);        try {          // Initialize the keystore with the provided trusted certificates          // Also provide the password of the keystore          trusted.load(in, ""mysecret"".toCharArray());        } finally {          in.close();        }        // Pass the keystore to the SSLSocketFactory. The factory is responsible        // for the verification of the server certificate.        SSLSocketFactory sf = new SSLSocketFactory(trusted);        // Hostname verification from certificate        // http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d4e506        sf.setHostnameVerifier(SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);        return sf;      } catch (Exception e) {        throw new AssertionError(e);      }    }  }  private static void maybeCreateHttpClient(Context context) {    if (mHttpClient == null) {      mHttpClient = new MyHttpClient(context);      final HttpParams params = mHttpClient.getParams();      HttpConnectionParams.setConnectionTimeout(params, REGISTRATION_TIMEOUT);      HttpConnectionParams.setSoTimeout(params, REGISTRATION_TIMEOUT);      ConnManagerParams.setTimeout(params, REGISTRATION_TIMEOUT);      Log.d(TAG, LEAVE + ""maybeCreateHttpClient()"");    }  }public static boolean authenticate(String username, String password, Handler handler,      final Context context) {    final HttpResponse resp;    final ArrayList&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();    params.add(new BasicNameValuePair(PARAM_USERNAME, username));    params.add(new BasicNameValuePair(PARAM_PASSWORD, password));    HttpEntity entity = null;    try {      entity = new UrlEncodedFormEntity(params);    } catch (final UnsupportedEncodingException e) {      // this should never happen.      throw new AssertionError(e);    }    final HttpPost post = new HttpPost(THE_URL);    post.addHeader(entity.getContentType());    post.addHeader(""User-Agent"", USER_AGENT);    post.setEntity(entity);    maybeCreateHttpClient(context);    if (mHttpClient == null) {      return false;    }    try {      resp = mHttpClient.execute(post);    } catch (final IOException e) {      Log.e(TAG, ""IOException while authenticating"", e);      return false;    } finally {    }}</code></pre><p>The keystore is retrieved (by OpenSSL) like this:</p><pre><code>openssl s_client -connect eu.battle.net:443 -showcerts</code></pre><p>I have compared the certificates that command produced (http://vipsaran.webs.com/openssl_output.txt) with ones I exported from Firefox (http://vipsaran.webs.com/Firefox_output.zip) and they are the same.</p><p>By following advice on <a href=""http://blog.antoine.li/index.php/2010/10/android-trusting-ssl-certificates/"">this blog</a>, I have setup the above code and imported the (root and intermediate) certs to a keystore (battlenetkeystore.bks) which is used for HttpClient.</p><p>This are the commands I used for importing the certs to the keystore:</p><pre><code>keytool -importcert -v -file ~/lib/ThawteSSLCA.crt -alias thawtesslca -keystore ~/lib/battlenetkeystore.bks -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath ~/lib/bcprov-jdk16-145.jar -storetype BKS -storepass mysecret -keypass mysecret -keyalg ""RSA"" -sigalg ""SHA1withRSA""keytool -importcert -v -file ~/lib/thawtePrimaryRootCA.crt -alias thawteprimaryrootca -keystore ~/lib/battlenetkeystore.bks -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath ~/lib/bcprov-jdk16-145.jar -storetype BKS -storepass mysecret -keypass mysecret -keyalg ""RSA"" -sigalg ""SHA1withRSA""</code></pre><p>Btw. I have also tried <code>keytool -import</code> without the <code>-keyalg ""RSA"" -sigalg ""SHA1withRSA""</code>, but with no change.</p><p><strong>The problem</strong> is that I'm getting this error:</p><pre><code>javax.net.ssl.SSLException: Not trusted server certificate    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)    at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)    at org.homedns.saran.android.wowcalendarsync.network.NetworkUtilities.authenticateWithPass(NetworkUtilities.java:346)    at org.homedns.saran.android.wowcalendarsync.network.NetworkUtilities$1.run(NetworkUtilities.java:166)    at org.homedns.saran.android.wowcalendarsync.network.NetworkUtilities$5.run(NetworkUtilities.java:278)Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: IssuerName(CN=thawte Primary Root CA, OU=""(c) 2006 thawte, Inc. - For authorized use only"", OU=Certification Services Division, O=""thawte, Inc."", C=US) does not match SubjectName(CN=Thawte SSL CA, O=""Thawte, Inc."", C=US) of signing certificate    at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:168)    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:366)    ... 12 moreCaused by: java.security.cert.CertPathValidatorException: IssuerName(CN=thawte Primary Root CA, OU=""(c) 2006 thawte, Inc. - For authorized use only"", OU=Certification Services Division, O=""thawte, Inc."", C=US) does not match SubjectName(CN=Thawte SSL CA, O=""Thawte, Inc."", C=US) of signing certificate    at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:373)    at java.security.cert.CertPathValidator.validate(CertPathValidator.java:202)    at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:164)    ... 13 more</code></pre><p>and I can't figure a way to solve it.Tried importing the certs into the keystore in different order, aso. but nothing worked.</p><p><strong>Please help</strong> (and please focus on the solutions based on the Android's Apache HttpClient <em>only</em>).</p>","451962","","40342","","2013-10-07 12:15:27","2013-10-07 12:15:27","Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)","<android><ssl><apache-commons-httpclient><world-of-warcraft>","7","1","17","",""
"4115369","1","","","2010-11-06 21:55:50","1","330","<p>I have an ajax call that goes out to my rails server. Depending on the content type my rails server either responds with HTML or JSON. This works fine on the iPhone browser and on desktop browsers like chrome, etc. However on the Android browser somehow my server is not recognizing the content type. I don't think the overrideMimeType is working! </p><p>Anyone know of a workaround? If I can't figure it out I'll just have to create a special URL to handle the JSON requests.</p><p>Code looks something like this :</p><pre><code>function makeAjaxCall {    xmlhttp=new XMLHttpRequest();    targetUrl = window.location.pathname;    xmlhttp.open('GET',targetUrl,true);         xmlhttp.overrideMimeType(""application/json"");    xmlhttp.onreadystatechange=function()    {      if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)      {              // On android browsers only this responds with HTML when it should be JSON        alert('response:' + xmlhttp.responseText);        r = eval('(' + xmlhttp.responseText + ')');                    // Do more stuff      }    }    xmlhttp.send();}</code></pre>","58175","","","","","2011-10-20 11:07:19","How do I specify content-type with a AJAX call for Android browsers?","<javascript><android><ajax><json>","1","0","","",""
"4115508","1","4115601","","2010-11-06 22:29:33","1","1119","<p>In my main activity, I have the following code that calls my FileBrowser activity:</p><pre><code>  Intent newFileIntent = new Intent(getBaseContext(), FileBrowser.class);  newFileIntent.putExtra(""action"", ""browseDirectories"");  startActivityForResult(newFileIntent, 2);</code></pre><p>But when this code executes, my app force closes.I ran the app again this time with DDMS open to look for the error, and here's what it is:</p><pre><code>11-06 22:01:04.892: ERROR/AndroidRuntime(28287): Caused by: java.lang.NullPointerException11-06 22:01:04.892: ERROR/AndroidRuntime(28287):     at com.alexprice.devpad.FileBrowser.&lt;init&gt;(FileBrowser.java:17)</code></pre><p>Here is line 17 (located outside of onCreate):</p><pre><code>private String action = getIntent().getStringExtra(""action"");</code></pre><p>What's wrong? Can I not use putExtra with startActivityForResult? Can putExtra only be used with startActivity?</p>","427234","","","","","2010-11-06 22:51:04","Android Development: java NullPointerException When Trying To getStringExtra()","<java><android><activity><nullpointerexception>","1","0","","",""
"4115549","1","4115560","","2010-11-06 22:40:26","0","1790","<p>I want to know how to change the orientation of my layout inside of eclipse</p><p>in my manifest I have</p><p>android:screenOrientation=""landscape""</p><p>in my layout xml I have </p><p>android:orientation=""horizontal""</p><p>but when I click the ""layout"" button it still shows it as a vertical layout</p><p>Thank You</p>","478183","","","","","2010-11-06 22:42:58","Change Eclipse Layout Orientation","<android><android-layout>","1","0","","",""
"4115648","1","","","2010-11-06 23:06:25","1","579","<p>I'm new to Android, and event driven code in general. Rather than embed loads of anonymous event listener classes in my Activity to handle onClick events etc, I defined separate classes to keep the code clean. Then I use them e.g. like this</p><p>myButton.setOnClickListener(new MyEventListener());</p><p>So, when 'myButton' gets clicked, MyEventListener's onClick method does some stuff. </p><p>I wanted to know the best practice for </p><p>a) accessing things in my Activity from the event listener. For example to change the text of a label. The onClick event takes a View in, but this is the view for the button that's been clicked, so if the label is NOT a child of my button, I can't use findViewById to get a handle to it. I've modified the constructor to pass in a reference to the label, so that the event has a handle to it but not sure if this is the most elegant way of doing it.</p><p>b) Passing information back e.g. when my event fires, I might want to disable some EditText fields. I'm thinking the proper way to do this is probably to dispatch another event from my event listener, that the Activity listens for, and when it sees the event, disables the fields in question. Is that the way to do it in Android?</p><p>Hope someone can help, really appreciate it.</p><p>Thanks</p>","499532","","","","","2010-11-06 23:21:47","Passing information back from EventListener to Activity","<android><events><listener><eventlistener><dispatch>","1","0","","",""
"4115649","1","","","2010-11-06 23:06:58","11","3931","<p>THis is not really a question, Sorry. I just wanted help on getting the package and class names of alarm and clocks of different android makers' clock and alarm.</p><p>I have a listing here of HTC, Samsung, and stock android class names.But you can guess the package names.</p><pre><code>// HTC""com.htc.android.worldclock.TimerAlert"",//""com.htc.android.worldclock.AlarmAlert"",//// Samsung""com.sec.android.app.clockpackage.ClockPackage"",//""com.sec.android.app.clockpackage.alarm.AlarmAlert"",//// Motorola""com.motorola.blur.alarmclock.AlarmAlert"",//""com.motorola.blur.alarmclock.AlarmClock"",//""com.motorola.blur.alarmclock.AlarmTimerAlert"",// Stock Android Clock""com.android.alarmclock.AlarmClock"",// 1.5 / 1.6""com.android.deskclock.DeskClock"",// </code></pre><p>If you have an LG, Sony, or any other android maker out there, pleaseadd to this list. i beg you. </p>","445299","","715458","","2013-01-07 16:26:12","2013-06-07 08:15:12","Listing of manufacturer's clock / alarm package and class name, Please add","<android><class><package><clock>","4","2","7","","2011-09-19 20:42:52"
"4115727","1","4115960","","2010-11-06 23:30:20","1","771","<p>I am working on a program that is kind of like a stop watch, that notifies a user to different things. They need to be able to use other apps while waiting for the notification. The notification will be text to speech. If the UI screen is open it needs to see how much time is left, and be able to pause the timer. </p><p>I am thinking of using a service for the timer and notification. The service will update the UI through intents and BroadcastReceiver. That means I will have to send a broadcast every second for the time.</p><p>Is there a better way to do this?</p>","499533","","","","","2010-11-07 00:41:52","Stop watch app using service and BroadcastReceiver","<android>","1","0","1","",""
"4115771","1","4115828","","2010-11-06 23:43:00","0","1481","<p>I noticed that the text of the Softkeyboard in landscape mode doesn't show the same characters as I see in the EditText field in portrait mode. I use a keylistener for the EditText to only accept special chars:</p><pre><code>private class MyKeylistener extends NumberKeyListener {    public int getInputType() {        return InputType.TYPE_CLASS_NUMBER;    }    @Override    protected char[] getAcceptedChars() {        return new char[] {'0','1','2','3','4','5','6','7','8','9',',','-'};    }};</code></pre><p>When I type in a "","" in landscape mode I don't see it in the softkeyboard-text, but it appears in the EditText when I flip the screen to portrait mode. How can I make the softkeyboard-text show all allowed characters? I append a picture to show what I mean, the EditText is ""34,37,39"":</p><p><img src=""http://i.stack.imgur.com/kD1e9.png"" alt=""alt text""></p>","474326","","","","","2012-02-10 11:14:00","Softkeyboard-text in landscape mode doesn't show all chars of EditText","<android><keyboard><landscape><flip><android-softkeyboard>","1","0","1","",""
"4115920","1","","","2010-11-07 00:27:08","7","6631","<p>Can someone show me an example of how to use <code>AlphabetIndexer</code> with a Custom Adapter that uses a <code>getView</code>?  I have it working with a standard adapter, but have no clue how to implement it with a custom adapter.</p><p>Thanks</p>","411203","","205229","","2010-11-07 00:33:31","2012-06-05 08:53:41","AlphabetIndexer with Custom Adapter","<android><adapter>","2","2","5","",""
"4115938","1","4115971","","2010-11-07 00:32:29","1","1634","<p>Hello I have an application that starts on boot using a broadcast receiver, also I have an activity and a process, because the service must run always on the background I am starting the service on it's own process using the android:process manifest tag.</p><p>The ui is only for presentational needs and I would like the user to be able to run the service even if the activity is not active.</p><p>I am starting the service using this extra parameter:</p><pre><code>intent.putExtra(Intent.EXTRA_DONT_KILL_APP, true);</code></pre><p>the problem is that when I press the back button or the home button the activity's on destroy method is called and the service although seems its running (it appears on the task manager) its not behaving as supposed, it should connect to the net and send some data but every X time using an timer task but the task never fires so the data are never send.</p>","234898","","205229","","2010-11-07 00:36:15","2013-09-04 12:11:57","android service running on a seperate thread","<android><multithreading><android-service>","2","0","1","",""
"4116001","1","4666109","","2010-11-07 00:57:40","46","30452","<p>A few users have been asking me Android lock screen widgets for my app - I believe they want a widget that stays on their lock screens and allows them to interact with the app.</p><p>I haven't been able to find any official documentation for this - the only thing I found was apps that will take home screen widgets and put them on the lock screen for you.</p><p>Any clues on where I learn more about building true lock-screen widgets?</p>","106095","","1665345","","2012-10-16 01:57:08","2014-02-21 09:53:02","Android Lock Screen Widget","<android><android-widget><lockscreen>","3","5","43","",""
"4116047","1","","","2010-11-07 01:14:50","0","219","<p>I found the GeoCoder class isn't good for autosuggestion. In my app the user shall type in and select  a city. What service would you suggest me? Is there already such a search coded somewhere?</p>","433718","","","","","2011-01-19 11:43:33","Appropriate geo coder to build location search with autosuggest in Android?","<android><geocoding><android-location><google-geocoder>","1","0","","",""
"4116058","1","4116068","","2010-11-07 01:19:30","4","417","<p>I am currently working on a multi-threaded game application for the Android platform... so far so good... I just got over a bug in my application which caused it to restart on orientation change (fixed by designating a specific orientation depending on the availability of a hardware keyboard or not, which is important 'cuz it is an online game with chat capabilities), and that works... BUT now i am trying to avoid the same problem when the user simply slides open the hardware keyboard.  I'm not quite sure how to go about avoiding the restart of my application or the saving of the state of my application.  Any solutions/suggestions?</p>","461074","","31751","","2012-10-09 11:54:03","2012-10-09 11:54:03","Avoiding Application Restart when Hardware Keyboard Opens","<android><android-configchanges><android-hardware-keyboard>","1","0","","",""
"4116110","1","8092533","","2010-11-07 01:36:41","14","8290","<p>My Android app is getting called by an intent that is passing information (pendingintent in statusbar).</p><p>When I hit the home button and reopen my app by holding the home button it calls the intent again and the same extras are still there.</p><pre><code>    @Override    public void onSaveInstanceState(Bundle savedInstanceState) {      super.onSaveInstanceState(savedInstanceState);    }    @Override    public void onRestoreInstanceState(Bundle savedInstanceState) {      super.onRestoreInstanceState(savedInstanceState);    }</code></pre><p>this is the code that doesn't run like its supposed to</p><pre><code>    String imgUrl;    Bundle extras = this.getIntent().getExtras();    if(extras != null){        imgUrl = extras.getString(""imgUrl"");        if( !imgUrl.equals(textView01.getText().toString()) ){            imageView.setImageDrawable( getImageFromUrl( imgUrl ) );            layout1.setVisibility(0);            textView01.setText(imgUrl);//textview to hold the url        }    }</code></pre><p>And my intent:</p><pre><code>public void showNotification(String ticker, String title, String message,     String imgUrl){    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager =         (NotificationManager) getSystemService(ns);    int icon = R.drawable.icon;        // icon from resources    long when = System.currentTimeMillis();         // notification time    CharSequence tickerText = ticker;              // ticker-text    //make intent    Intent notificationIntent = new Intent(this, activity.class);    notificationIntent.putExtra(""imgUrl"", imgUrl);    notificationIntent.setFlags(        PendingIntent.FLAG_UPDATE_CURRENT |         PendingIntent.FLAG_ONE_SHOT);    PendingIntent contentIntent =         PendingIntent.getActivity(this, 0,         notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT |         PendingIntent.FLAG_ONE_SHOT);    //make notification    Notification notification = new Notification(icon, tickerText, when);    notification.setLatestEventInfo(this, title, message, contentIntent);    //flags    notification.flags = Notification.FLAG_SHOW_LIGHTS |         Notification.FLAG_ONGOING_EVENT |         Notification.FLAG_ONLY_ALERT_ONCE |         Notification.FLAG_AUTO_CANCEL;    //sounds    notification.defaults |= Notification.DEFAULT_SOUND;    //notify    mNotificationManager.notify(1, notification);}</code></pre><p>Is there any way to clear the intent or check whether it has been used before?</p>","219554","","445131","","2013-09-15 04:13:26","2014-01-25 17:41:47","Android how to clear intent?","<android><android-intent>","6","2","2","",""
"4116172","1","","","2010-11-07 02:01:40","0","303","<p>Okay, I belittle myself.  Its actually confusing me because it shows up fine on the Emulator, just not on my phone. </p><p>On the emulator, I see the custom SurfaceView _map Object take up the whole screen, except for the EditText text-box at the bottom, right where it should be. When I run the same code, same everything, on my Motorola Droid, there is no EditText to be seen anywhere.</p><p>I figure that I am missing something with the LinearLayout implementation I have.  Until now, I've gotten off easy on learning how to use another API's layout manager. </p><p>Here's the code:</p><pre><code>    _map = new Map(this);    _chatText = new EditText(this);    layout = new LinearLayout(this);    layout.setOrientation(LinearLayout.VERTICAL);    layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 1));    layout.setGravity(Gravity.BOTTOM);    layout.addView(_map, 0);    layout.addView(_chatText, 1);    setContentView(layout);</code></pre><p>Looks so straitforward, so I honestly don't have a clue why it just eats my EditText when run on an actual Android device.  And sadly enough, I've already spent a sad amount of time getting it to show up correctly just in the emulator itself.</p>","461074","","166712","","2010-11-07 02:05:05","2010-11-07 03:38:52","LinearLayout problem [Android]","<java><android><user-interface><view><android-linearlayout>","1","1","","",""
"4116218","1","4252240","","2010-11-07 02:13:48","0","1053","<p>Does anyone know how to intercept the genius button on the new MyTouch 4g by HTC?  Is it somehow hard wired to the kernel?</p><p>I looked at logCat, and I see that if uses the following intent:</p><pre><code>INFO/ActivityManager(1309): Starting activity: Intent { flg=0x10000000 cmp=com.nuance.android.vsuite.vsuiteapp/.VSuiteStartSession }</code></pre><p>UPDATE:I've seen another app disable the genius button on non-rooted phones, so it seems possible.</p>","265877","","265877","","2011-02-15 14:38:19","2011-02-15 14:38:19","Intercept MyTouch 4g genius button","<android>","1","0","","",""
"4116227","1","4116232","","2010-11-07 02:16:54","1","157","<p>I'm relatively new to Android development and Java (learning both simultaneously sort of...). </p><p>My question is: if I set up a button in main.xml, I still need to actually create the button in my Activity, right? Like the XML just controls the look of the button, but you need to actually create a button by doing something like</p><pre><code>private Button myButton;</code></pre><p>Just wanted to make sure I had this clear conceptually. You create an object in your class and then just tell Android to do something like </p><pre><code>myButton = (Button) findViewById(R.id.my_button);</code></pre><p>Just wanted to make sure I'm clear on this. </p>","479180","","","","","2010-11-07 03:14:37","basic question: creating a button (or anything)","<java><android>","2","0","","",""
"4116273","1","4117353","","2010-11-07 02:37:31","1","4132","<p>My whole idea is a little more complex, but just to break things down so they're simple and to the point here...I have a button on a widget that i need to open the ""places"" activity in the official facebook app.</p><p>Here's the code i'm using:</p><pre><code> Intent PlacesIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName(""com.facebook.katana"", ""com.facebook.katana.activity.places.PlacesNearbyActivity""));            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, PlacesIntent, 0);            views.setOnClickPendingIntent(R.id.places, pendingIntent);</code></pre><p>I get this error in the logcat:            </p><pre><code> 11-06 22:26:48.117: WARN/ActivityManager(85): Permission denied: checkComponentPermission() reqUid=10055    11-06 22:26:48.117: WARN/ActivityManager(85): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.facebook.katana/.activity.places.PlacesNearbyActivity bnds=[371,129][428,203] } from null (pid=-1, uid=10157) requires null    11-06 22:26:48.127: WARN/ActivityManager(85): Unable to send startActivity intent    11-06 22:26:48.127: WARN/ActivityManager(85): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.facebook.katana/.activity.places.PlacesNearbyActivity bnds=[371,129][428,203] } from null (pid=-1, uid=10157) requires null    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.startActivityLocked(ActivityManagerService.java:3223)    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:3980)    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:212)    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:3843)    11-06 22:26:48.127: WARN/ActivityManager(85):     at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:210)    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1480)    11-06 22:26:48.127: WARN/ActivityManager(85):     at android.os.Binder.execTransact(Binder.java:288)    11-06 22:26:48.127: WARN/ActivityManager(85):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>If i use, </p><pre><code>Intent PlacesIntent1 = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName(""com.facebook.katana"", ""com.facebook.katana.HomeActivity""));            PendingIntent pendingIntent1 = PendingIntent.getActivity(context, 0, PlacesIntent1, 0);            views.setOnClickPendingIntent(R.id.facebook, pendingIntent1);</code></pre><p>Everything works great and it opens the home activity, but that's not really what i'm trying to do.</p><p>I've tried</p><pre><code>com.facebook.katana.activity.places.PlacesNearbyActivity - I actually see a respons in the logcat about the denail with this onecom.facebook.katana.activity.PlacesNearbyActivitycom.facebook.katana.places.PlacesNearbyActivitycom.facebook.katana.PlacesNearbyActivity</code></pre><p>and nothing happens with the others</p><p>Here's what i see in the logcat when manually opening the activities on my phone:</p><pre><code>11-06 20:20:38.295: INFO/ActivityManager(85): Starting activity: Intent { cmp=com.facebook.katana/.activity.places.PlacesNearbyActivity }11-06 22:03:28.027: INFO/ActivityManager(85): Starting activity: Intent { flg=0x4000000 cmp=com.facebook.katana/.HomeActivity }</code></pre><p>So, that gives you sort of an idea how i got my information.</p>","393373","","","","","2011-09-16 04:42:17","Permission Denial for intent to external activity","<java><android><components><android-widget><android-intent>","2","0","2","",""
"4116330","1","4116485","","2010-11-07 03:04:31","2","5950","<p>Hey! I'd like to know which is the intent android sends when it sends a message. And how can I listen for this intent in my application. I wanted that, when I send a message in native android messaging, my application listen this intent, so it will know a new message has been sent.</p><p>So, which one is it, and how to listen for this intent?</p><p>Thanks.</p>","399459","","","","","2010-11-07 10:37:16","What is the Android sent sms intent?","<android><sms><messaging><android-contentprovider>","2","0","2","",""
"4116345","1","4116422","","2010-11-07 03:12:10","1","612","<p>How do I go about getting my app to play an mp3 (in my res) on startup? Or how how about if I wanted this to happen when a button is clicked?</p>","479180","","","","","2010-11-07 03:53:51","Playing sound on app startup","<java><android>","1","1","1","",""
"4116428","1","","","2010-11-07 03:55:31","2","726","<p>How can I fix this issue?</p><p>Code:</p><pre><code>EditText edit = (EditText)findViewById(R.id.edit); BackgroundColorSpan span = new BackgroundColorSpan(0xFFAABBCC);edit.getText().setSpan(span, 0, edit.getText().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);</code></pre>","62192","","62192","","2010-11-07 14:54:52","2011-07-02 17:21:41","When I highlight EditText content with BackgroundColorSpan, cursor is not visible","<android><cursor><highlighting><edittext>","1","2","1","",""
"4116487","1","4116741","","2010-11-07 04:29:32","15","9742","<p>I basically want to make an intent and pass it to a service from my BroadcastReceiver's onReceive().</p><p>So far I always used View.getContext(), but here, I'm stuck.How exactly can I get the context so I can use <code>public Intent (Context packageContext, Class&lt;?&gt; cls)</code>?</p>","455048","","228489","","2011-08-05 21:36:56","2011-08-05 21:36:56","Android - Getting context from a Broadcast receiver onReceive() to send to","<android><service><android-intent><broadcastreceiver>","1","0","","",""
"4116604","1","4116640","","2010-11-07 05:21:39","3","1636","<p>How can i automate Android Apis for better quality ? How can i test the android applications to get a better quality of this software..? </p>","396643","","","","","2013-01-07 06:24:40","Android Test Automation","<android><unit-testing>","7","0","1","",""
"4116649","1","","","2010-11-07 05:46:35","1","603","<p>I am launching the Camera application via an Intent and saving the image temporarily to the SD card using the EXTRA_OUTPUT option.  The URI passed needs to point to a location on external storage.  I also need to provide a URI if I want the full-size image to be returned.</p><p>I would like to account for the fact that the user might not have an SD card mounted.  </p><p>It is my understanding that due to the security measures Android imposes, the Camera application does not have write permissions to my application's cache folder.</p><p>Is there any way around this via some intermediary steps?  Or perhaps there is a better approach altogether?</p><p>I know that I can use the Camera class to implement my own camera within my application, but I would lose the features the stock Camera application provides.</p><p>Thank you!</p>","342050","","342050","","2010-11-07 06:03:50","2010-11-07 06:03:50","Saving camera data to cache when launched via intent","<android><image><caching><camera><storage>","0","2","1","",""
"4116677","1","4116802","","2010-11-07 06:02:35","0","707","<p>Is there any way to Ellipsize on the left side? Eg 123456790 becomes ...56790</p>","356580","","","","","2010-11-07 07:09:49","Android Ellipsize left","<android><textview>","1","0","","",""
"4116684","1","4117341","","2010-11-07 06:06:17","6","768","<p>I need some operations that are to be performed on large long[]s to be very fast. The only option I can see is to use the Android NDK. Can anyone give a summary on what using the NDK does to my app in terms of which devices can use the app and what the implications are to maintaining my app?</p><p>I saw that you need to specify which architecture you want to compile your C code for, like ARM and Intel. What happens when new architectures for Android appear? Will I have to update my app every time a new architecture appears?</p>","483701","","","","","2010-11-07 10:34:32","What are the portability implications of using the NDK?","<java><android><android-ndk>","1","2","1","",""
"4116699","1","","","2010-11-07 06:16:02","0","158","<p>Hi friends i am working on android services bcoz my app app requires one service which runs in background. i want to call one particular method of  that service when ever my current  location changes and i need to pass those new coordinates to that method, so i have some sort difficulty in implementing this. so will please help me, if u know any better way implementing this,  any help much appreciated </p>","400942","","","","","2010-11-07 06:16:02","how to work with android services classes","<android><service><location>","0","2","1","",""
"4116705","1","4116784","","2010-11-07 06:21:08","0","560","<p>i need some help with switch/case statement syntaxim trying to use onClick to have different buttons do different thingsi have the first one workingit just uses an intent to start a new activity.for the next button, i want it to open a specific urllooks like this so far</p><pre><code>public void onClick(View v) {    switch (v.getId()) {    case R.id.about_button:    Intent i = new Intent(this, About.class);    startActivity(i);    case R.id.engadget_button:    Intent a = new Intent(this, )</code></pre><p>how do i get the engadget_button to open engadget.com?</p><p>Is it just something like this:</p><pre><code>case R.id.engadget_button:String url =""http://www.engadget.com/"";Intent a = new Intent(Intent.ACTION_VIEW);a.setData(Uri.parse(url));startActivity(a);break;</code></pre><p>??</p>","479180","","479180","","2010-11-07 06:27:05","2010-11-07 06:59:02","case/switch statement","<java><android>","1","3","","",""
"4116835","1","","","2010-11-07 07:24:02","0","734","<p>I have created a custom adapter to display a list, there is an image that is displayed in each row ( the image is the same for all rows, except using an array i am assigning it different values depending on the position). An xml file defines the relative layout that i am using. My problem is that i can either get the entire row to be clickable or nothing at all, I only want this image to be clickable, instead of the entire row. How would i be able to do this ? i am new to android and am pretty much following different tutorials trying to create my list. Any help would be appreciated.</p><p>layout is like this :</p><p>TEXT:</p><pre><code>                     [Image]</code></pre><p>TEXT:</p><p>thats wat a row looks like...getting two texts from two different arrays and shows it, a third array is used to link to the image. I just want this image to be clickable instead of the entire row.</p><p>Thanks</p>","499707","","","","","2010-11-07 09:32:10","Image in a custom List Android","<android><image><list><adapter>","1","0","","",""
"4116861","1","","","2010-11-07 07:39:18","0","301","<p>I have an array of words. When the activity launches it displays a word, and then when you click the screen, it displays another random word from the array. I was able to get this far (with some help) but I'm a little stuck. When you click the screen to display a new word, how can I make sure the word hasn't been displayed from the array already. Here is what I have so far.</p><pre><code>private String[] myString;public static final Random rgenerator = new Random();@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.study);    //Takes a random item from array and creates string    Resources res = getResources();    myString = res.getStringArray(R.array.list);    String q = myString[rgenerator.nextInt(myString.length)];    //Displays random array string in TextView    TextView wordTextView = (TextView) findViewById(R.id.word);    wordTextView.setText(q);    //Set up click listener for new word    View newWord = findViewById(R.id.word);    newWord.setOnClickListener(this);}public void onClick(View v) {    switch (v.getId()) {    case R.id.word:        //Takes a random item from array and creates string        String q = myString[rgenerator.nextInt(myString.length)];        //Displays random array string in TextView        TextView wordTextView = (TextView) findViewById(R.id.word);        wordTextView.setText(q);    }}</code></pre>","499106","","","","","2010-11-09 21:26:33","How do you stop duplicate outputs from an array?","<android><arrays><string><duplicates>","2","0","","",""
"4116868","1","4116990","","2010-11-07 07:44:07","0","6587","<p>I'm new to java and android development. After spending few days working with java I started with android development. I've this question with regards to the Context class.</p><p>Context is a abstract class. Which cannot be instantiated and cannot be used to call methods unless it refers to a concrete subclass. Can someone tell how the call getApplicationContext which returns a context type is used in applications (a small snippet of how will be a huge help). </p><p>And also help me understand this statement Context context = getApplicationContext() getApplicationContext is an abstract method so when we use this call, which object implements this? Is it the ContextWrapper object of the current process (app) that gives this method.</p><p>Thanks in advance.</p>","499709","","102937","","2011-02-28 23:35:39","2011-02-28 23:35:39","How is the call getApplicationContext which returns a context type used in applications?","<android>","1","1","","",""
"4117113","1","","","2010-11-07 09:12:23","0","89","<p>I am making a program for recording sound. I have completed the basic record functions and the interface. However, when I test it, I have no idea how to make use of the emulator to test if the program really work. Shall my computer equip with mic to test it? </p><p>Other than that, since my program will create a .3gp audio file in a designated path, but I have no idea how to view the folder in the emulator as i dont find something like a file manager in it... could anyone advice?</p><p>Thank you very much for your help. </p>","499735","","","","","2011-03-30 09:02:04","about test the sound recording function and View new created files in emulator","<android>","1","0","","",""
"4117243","1","4117273","","2010-11-07 09:58:06","0","593","<p>I have a main activity, then i call a new activity intent from this. Lets call this SecondActivity. Then from my secont activity i call a browser intent. Then my browser intent call my second activity's onNewIntent method. </p><p>Evereything work fine, but when i click on ""back"" button on my phone on my second activity, i will not going to my main activity, but the browsers activity, why?</p><p>How can i solve this?</p>","472537","","","","","2010-11-07 10:09:33","Android Main activity to Browser activity error","<android><browser><activity>","1","0","","",""
"4117278","1","","","2010-11-07 10:10:28","0","938","<p>I have a basic file browser within my app that for each row of the list, outputs an ImageView and a TextView.</p><p>A few lines into my code I do a isDirectory() (located below somewhere) on the current file/folder that is being added to the ListView, so that I can set a folder image as the icon for that row if it is a folder, or set a file image as the icon if it's a file.</p><p>But when I run the file browser activity, it force closes.</p><p>I checked DDMS and it tells me it's a NullPointerException on the following line of code:</p><pre><code>listicon.setImageResource(R.drawable.foldericon);</code></pre><p>Which is located in the following statement:</p><pre><code>if(file.isDirectory()){listicon.setImageResource(R.drawable.foldericon);}else{listicon.setImageResource(R.drawable.fileicon);}</code></pre><p>I don't understand what I'm doing wrong? Eclipse isn't giving me any errors for that line, and foldericon and fileicon do exist in my drawable folder.</p>","427234","","","","","2010-11-07 10:16:11","Android Development: setImageResource Causing Force Close?","<android><listview><nullpointerexception><drawable>","1","1","","",""
"4117311","1","4117317","","2010-11-07 10:22:30","1","195","<p>On what thread are event handlers (like onAnimationEnd, onTouchEvent, onKeyEvent, onClick) executed? Are they called sequentially or can two handlers may execute simultaneously?</p>","6533","","","","","2010-11-07 10:26:10","On what thread are event handlers executed?","<android>","1","0","","",""
"4117360","1","4804454","","2010-11-07 10:45:45","4","1538","<p>I have built an android app which use Google Map feature. I want my app installed on phones which does not install Google Map, in that case, I would disable the map feature.</p><p>There is a ""uses-library"" tag in manifest file, what can I do with that?</p>","238061","","881229","","2013-12-30 07:57:25","2013-12-30 07:57:25","How to make ""uses-library"" optional in android","<android><google-maps>","3","0","","",""
"4117485","1","4117694","","2010-11-07 11:23:45","5","499","<p>I'm working on an Android App, and I want to provide a free demo and a paid full-version from the Android Market. However, I also want to provide the source code. I don't mind if people want to play with the code and install modified versions on their own devices.</p><p>However, I don't want to see any free full-version binaries on the web, and a license like the GPL would allow anyone to offer some, probably even making profit that way. If some people would rather build and deploy the app themselves instead of paying 1-5$, they can go ahead. But a convenient one-click-download button and other people making money from my efforts is not what I want.</p><p>Is there any pre-existing license I can use for something like that?</p><p>Furthermore, if I want to start an app as free and open source, but later decide that I want to make money from selling it, is there a FOSS license that allows me to move to the license I'm asking about above later?</p>","499795","","","","","2010-11-07 16:32:47","Which non-free open source license for an Android app?","<android><open-source><licensing>","3","2","2","",""
"4117565","1","4117583","","2010-11-07 11:51:51","4","2483","<p>I have a question that is driving me crazy.</p><p>I have a large number of buttons (10, more or less) on my screen, inside a TableRow.</p><p>I need to access them, and I had planned to perform through a loop.</p><p>Access to one, is very easy, adding this:</p><pre><code>boton7 = (Button) findViewById (R.id.Btn7)</code></pre><p>My question is, if you can dynamically set the id string (R.id.Btn7) to put in a can get the buttons for, and for example, change the color .... something like this:</p><pre><code>for (int i = 0; i &lt;10; i + +) {   Button eachBoton= (Button) findViewById (R.id.Btn + i);   eachBoton. setBackgroundColor (Color.Red);}</code></pre><p>That, of course, does not work .... my question is if anyone knows how exactly the chain can be mounted</p><pre><code>R.id.Btn + i</code></pre><p>to work.</p><p>Thanks a lot.</p>","499804","","265570","","2011-07-02 07:26:32","2011-07-02 07:26:32","Dynamic access to elements of the layout","<android>","2","0","4","",""
"4117658","1","","","2010-11-07 12:16:20","0","2994","<p>I tried to load a list of values from a table, but the cursor returns a length of -1?</p><p>Is there a possibility to view a sqlite database on a android emulator?</p><p>The Code which is buggy:</p><pre><code>final Cursor c = db.query(    ACCESS_TOKEN_TABLE,    new String[] { ACCESS_TOKEN_COL_ID, ACCESS_TOKEN_COL_VALUE },    ACCESS_TOKEN_COL_SERVER_ID + ""="" + serverId,    null,    null,    null,    null);public static final String COL_ID = ""_id"";public static final String ACCESS_TOKEN_TABLE = ""accesstoken"";public static final String ACCESS_TOKEN_COL_ID = COL_ID;public static final String ACCESS_TOKEN_COL_SERVER_ID = ""server_id"";public static final String ACCESS_TOKEN_COL_VALUE = ""value"";</code></pre><p>And there is one entry in the database. The value of ServerID is 1 and there exists one entry, where the ServerID is 1.</p><p>SincerelyxZise</p><p>PS: Two questions only to open the database.</p>","473890","","473890","","2010-11-07 14:46:38","2010-11-07 15:20:47","Cursor.getCount() is negative (= -1)","<android><sqlite>","4","1","2","",""
"4117691","1","4117938","","2010-11-07 12:25:19","0","501","<p>As usual in android, each time the screen is flipped to portrait/landscape mode an Activity runs through life-cycle from onSaveInstanceState to onDestroy and then is recreated.</p><p>In my Activity there's a ButtonText which can be changed by the user. It's reseted to the initial state, but I have to save the last state somehow. How can I achieve that, will I have to override onSaveInstanceState? Can someone show an example?</p>","474326","","","","","2013-05-14 21:05:25","Save and restore a ButtonText when screen orientation is switched","<android><save><orientation><state><flip>","2","0","","",""
"4117701","1","4117945","","2010-11-07 12:28:13","21","38561","<p>I have been trying to get <a href=""http://stackoverflow.com/questions/1944102/android-sms-receiver-not-working"">this</a> program to work but so far having no luck. I cannot find where I am doing wrong. I'm not sure if there's something wrong with the code, or debugging.</p><p>I'm trying to be notified if a new SMS arrives.</p><p>Here is my program:</p><pre><code>package Technicaljar.SMSBroadcastReceiver;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.SmsMessage;import android.util.Log;public class SMSBroadcastReceiver extends BroadcastReceiver {        private static final String SMS_RECEIVED = ""android.provider.Telephony.SMS_RECEIVED"";        private static final String TAG = ""SMSBroadcastReceiver"";        @Override        public void onReceive(Context context, Intent intent) {             Log.i(TAG, ""Intent recieved: "" + intent.getAction());                if (intent.getAction() == SMS_RECEIVED) {                    Bundle bundle = intent.getExtras();                    if (bundle != null) {                        Object[] pdus = (Object[])bundle.get(""pdus"");                        final SmsMessage[] messages = new SmsMessage[pdus.length];                        for (int i = 0; i &lt; pdus.length; i++) {                            messages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                        }                        if (messages.length &gt; -1) {                            Log.i(TAG, ""Message recieved: "" + messages[0].getMessageBody());                        }                    }                }           }    }</code></pre><p>And the 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=""Technicaljar.SMSBroadcastReceiver""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true"" &gt;        &lt;receiver android:name="".SMSBroadcastReceiver""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.provider.telephony.SMS_RECEIVED""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre><p>I am sending SMS through Telnet, and I cannot see any Intent received messages in the logcat. Here is my logcat from the time of installation.</p><pre><code>D/AndroidRuntime(  478): D/AndroidRuntime(  478): &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;D/AndroidRuntime(  478): CheckJNI is OND/AndroidRuntime(  478): --- registering native functions ---D/AndroidRuntime(  478): Shutting down VMD/dalvikvm(  478): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  478): NOTE: attach of thread 'Binder Thread #3' failedD/Mms:app (  220): getSmsNewMessageNotificationInfo: count=14, first addr=12345, thread_id=4D/dalvikvm(  151): GC_EXPLICIT freed 391 objects / 22552 bytes in 65msD/dalvikvm(  220): GC_EXPLICIT freed 926 objects / 44840 bytes in 73ms</code></pre><p>So the SMS seems to be received by the emulator, but looks like the no intents are firing.What am I doing wrong here? After installing, do I have to somehow 'start' this receiver?Because when I install, I get</p><pre><code> [2010-11-07 21:24:41 - SMSBroadcastReceiver] No Launcher activity found![2010-11-07 21:24:41 - SMSBroadcastReceiver] The launch will only sync the application package on the device!</code></pre><p>So I'm wondering if something's wrong here.</p>","455048","","114066","","2010-12-28 10:09:08","2014-01-15 19:49:49","Android - SMS Broadcast receiver","<android><sms><android-intent><broadcastreceiver>","7","1","12","",""
"4117758","1","4117880","","2010-11-07 12:45:56","0","838","<p>Can anybody tell me how to populate an Expandable List with Array List of Hash maps.Actually i have made a tree Data structure and i want to use my Data Structure to populate the Expandable List....</p>","397901","","244296","","2010-11-07 13:19:51","2010-11-07 13:20:41","populate an ExpandableList with ArrayList of hashmaps","<android><arraylist><hashmap><expandablelistview>","1","0","","",""
"4117806","1","4118957","","2010-11-07 13:01:31","0","625","<p>In my application I'm trying to create a mesh that is shaded by a single directional light. The problem I'm facing is that I can't seem to get the light to take my normals into account at all.</p><p>It works fine if I set the normals on a per-triangle-strip basis, but if I try to render a series of triangles with normals set using the <code>glNormalPointer</code> method the entire mesh is rendered using the same color (which is identical to the result I'm getting if I skip calling <code>glNormalPointer</code> all together). </p><p>My mesh render method looks like this:</p><p>public void render(GL10 gl) {  gl.glFrontFace(GL10.GL_CW);  gl.glNormalPointer(GL10.GL_FLOAT, 0, normalBuffer);  gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);  gl.glDrawElements(GL10.GL_TRIANGLES, indexBuffer.capacity(), GL10.GL_UNSIGNED_BYTE, indexBuffer); }</p>","499837","","111307","","2010-11-14 19:59:13","2010-11-14 19:59:13","How to create shaded mesh in opengles on android","<android><opengl-es>","1","0","2","",""
"4117848","1","4481454","","2010-11-07 13:11:55","1","1247","<p>Is there an Android based tablet which contains both an 3-axis gyro and a compass?</p><p>This maybe a silly question, but there are so many different android based devices out there that I don't really know where to start looking.</p><p>Thanks</p>","487848","","","","","2013-05-04 05:45:17","Android tablet with gyro and compass","<android><tablet>","2","0","","2013-05-04 07:51:46",""
"4117865","1","4574889","","2010-11-07 13:16:14","7","1098","<p>Just couldn't find anything regarding the purpose of <code>android.opengl</code> classes anywhere on the web: they seem to be copies of <code>javax.microedition.khronos.opengles</code> - just with static vs member methods.</p><p>So is there any special meaning in using them instead of J2ME classes: are they supposed to be faster, have additional functionality, simpler to work with?</p><p>I think of using them instead of passing that GL reference all the time.</p>","499848","","812149","","2012-07-20 10:24:03","2012-07-20 10:24:03","What is the difference between android.opengl and javax.microedition.khronos.opengles packages?","<android><opengl-es><java-me><packages>","3","1","","",""
"4117878","1","","","2010-11-07 13:20:20","2","1262","<p>I'm program an Android-App for blind people. So I'm using TTS on every Activity in my App.</p><p>I don't want to initialize TTS on every activity again because it takes time and resources, so I'm creating a TTS-Object in my application class and use it on the activitys. It works fine.</p><p>But documentation says you have to something like this:</p><pre><code>protected void onDestroy() {    super.onDestroy();    if (mTts != null) {        mTts.shutdown();    }}</code></pre><p>But I can't do this because i don't want to shutdown my shared object (each time a activity is destroyed) but if my programm get's distroyed it i should shutdown it. So: Where to call .shutdown() ? Or does anybody know a better way to ensure that TTS is loading quickly?</p>","499842","","168868","","2012-01-01 20:53:37","2012-02-10 23:44:34","Reusing TTS-Object on multiple, different activitys in my Android App","<android><text-to-speech>","3","0","2","",""
"4117903","1","4118125","","2010-11-07 13:26:30","0","1896","<p>I'm struggling to understand how I'd go about changing an ImageView's src at runtime in a ListActivity.</p><p>In a function I have this line which is where the custom file row is set for the ListView:</p><pre><code>  setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listrow, R.id.listtext, this.directoryEntries));</code></pre><p>In listrow.xml, I have an ImageView which I would like to set the src as a folder image or a file image (for my file browser).</p><p>I don't set the content view to listrow.xml so I can't simple go:</p><pre><code>ImageView img = (ImageView) findViewById(R.id.listicon); img.setImageResource(R.drawable.foldericon);</code></pre><p>So how can I do it?Sorry if I'm not making much sense.</p>","427234","","464988","","2011-04-22 01:56:49","2011-04-22 01:56:49","Android Development: Change ImageView Source in A ListView","<android><listview><runtime><imageview>","1","0","","",""
"4118032","1","4118068","","2010-11-07 13:59:06","0","2208","<p>I'm defining a class that sets a Drawable attribute in an object. The problem is that I can't access the <code>getResource().getDrawable(int resourceId)</code> method unless I have some <code>Context</code>.What I did was to send to that class an activity instance (let's call it ""act"") and then I did:</p><p><code>act.getResources().getDrawable(R.drawable.whellchair)</code></p><p>but, when executing that line it throws a <code>NullPointerException</code>.</p><p>When idea how to accomplish this?</p>","320586","","1101730","","2014-03-03 19:00:30","2014-03-03 19:00:30","Accessing Drawable resources from a non context class","<android><resources><nullpointerexception><drawable>","2","2","","",""
"4118062","1","4118205","","2010-11-07 14:08:01","9","11487","<p>How can i do this?</p><p>something:</p><pre><code>final View view=FLall.getChildAt(i);if (view.getType()==ImageView) {...}</code></pre>","472537","","343816","","2010-11-07 14:40:59","2014-03-25 09:08:21","Android get type of a view","<java><android><gettype>","4","0","1","",""
"4118092","1","5223069","","2010-11-07 14:16:51","0","1088","<p>I am using a class that handles async loading of images. During the load, the class loads a colordrawable (that will be later assigned to downloaded image). Instead of a color, I would like to use a drawable resource to implement the ""loading"" image. How is this possible? Doing it ""outside"" this drawable class would be easier, but as a limitation I have to do it inside the class. Can't figure a way how to reference a resource inside the class.</p><p>Currently:</p><pre><code>class myDrawable extends ColorDrawable {  public myDrawable () {     super (Color.BLACK);  }}</code></pre><p>Is using BitmapDrawable the right way?</p><pre><code>class myDrawable extends BitmapDrawable {  public myDrawable () {     super(); // something here to fetch the drawable?  }}</code></pre><p>BitmapDrawable constructor is as follows:</p><pre><code>    public BitmapDrawable(Resources res)</code></pre><p>If this can be used, how to get the right ""resourcees"" indentifier to be passed for it? E.g. super(R.drawable.stubImage);</p>","499839","","499839","","2010-11-12 17:57:43","2011-03-07 17:37:10","Creating a drawable inside class constructor (and by extending ?drawable class)","<android><drawable>","2","0","","",""
"4118126","1","4118788","","2010-11-07 14:24:34","-1","1283","<p>Basically what I am trying to accomplish is I want a canvas I can pass bitmaps to, to be displayed on the screen with the rest of my view objects (buttons, textviews, etc).</p><p>I created a class for the canvas view like so (it doesn't do much yet):</p><pre><code>public class Foo extends View {    public Foo(Context context) {        super(context);    }    @Override    public void onDraw(Canvas canvas) {        Paint paint = new Paint();        paint.setStyle(Paint.Style.FILL);        // draw a solid blue circle        paint.setColor(Color.BLUE);        canvas.drawCircle(20, 20, 15, paint);    }}</code></pre><p>Now here is my main activity:</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 switchLeft = (Button) findViewById(R.id.switch_left);        switchLeft.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {               //TODO             }        });        Button switchRight = (Button) findViewById(R.id.switch_left);        switchRight.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                //TODO            }        });        Foo myCanvas = new Foo(this);        setContentView(myCanvas);    }}</code></pre><p>When I call setContentView to the canvas view object, the rest of my views disappear from the screen.  How can I call up this view object without losing the rest of my views?</p><p>THanks.</p>","432209","","","","","2010-11-07 17:18:24","Using multiple views inside a single activity with a canvas","<java><android><views><activity>","1","0","","",""
"4118233","1","6215726","","2010-11-07 14:50:28","16","8455","<p>I'm not having too much success applying animations to views inside a <code>RemoteViews</code>. </p><p>For the sake of simplicity, let's say I have a widget with an <code>ImageView</code> and a <code>Button</code>. When clicking the button, I want to add a simple animation to the ImageView (a rotation for example).</p><p>Since I can't get a reference using <code>findViewById()</code> like in an <code>Activity</code> and <code>RemoteViews</code> doesn't have a setter for an animation, I'm not sure what should I do.</p><p>I'm thinking of replacing the RemoteViews for the widget with a new layout, similar to the original but this one has the animation already loaded. Can I do this? Is it possible to embed an animation in a layout?</p><p>Code would be something like this for the WidgetProvider:</p><pre><code>Intent intent = new Intent(context, RotateService.class);PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.a_widget);views.setOnClickPendingIntent(R.id.a_button, pendingIntent);appWidgetManager.updateAppWidget(appWidgetId, views);</code></pre><p>Then in RotateService:</p><pre><code>ComponentName myWidget = new ComponentName(this, MyWidget.class);AppWidgetManager manager = AppWidgetManager.getInstance(this);RemoteViews newViews = buildNewRemoteViewsWithAnimation();manager.updateAppWidget(myWidget, newViews);</code></pre><p>Any other suggestion?</p>","489765","","181535","","2012-12-28 10:06:35","2012-12-28 10:06:35","Android Widgets: Animations on RemoteViews ?","<android><animation><android-widget><widget>","3","2","3","",""
"4118335","1","4118379","","2010-11-07 15:18:37","1","352","<p>I tried to load a list of values from a table, but the cursor doesn't find the columns?The Code which is buggy:</p><pre><code>public final AccessToken[] fetchAccessTokenByServerId(final long serverId) {    final Cursor c = db.query(            ACCESS_TOKEN_TABLE,            new String[] { ACCESS_TOKEN_COL_ID, ACCESS_TOKEN_COL_VALUE },            ACCESS_TOKEN_COL_SERVER_ID + ""=?"",            new String[] { Long.toString(serverId) },            null,            null,            null);    AccessToken[] result = new AccessToken[c.getCount()];    for (int i = 0; i &lt; result.length; i++) {        long id = c.getLong(c.getColumnIndexOrThrow(ACCESS_TOKEN_COL_ID));        String value = c.getString(c.getColumnIndexOrThrow(ACCESS_TOKEN_COL_VALUE));        result[i] = new AccessToken(value, id, serverId);        c.moveToNext();    }    return result;}public static final String COL_ID = ""_id"";public static final String ACCESS_TOKEN_TABLE = ""accesstoken"";public static final String ACCESS_TOKEN_COL_ID = COL_ID;public static final String ACCESS_TOKEN_COL_SERVER_ID = ""server_id"";public static final String ACCESS_TOKEN_COL_VALUE = ""value"";</code></pre><p>But the first two statements in the for-loop fails:</p><blockquote>  <p>Index -1 is requested, with a size of  1</p></blockquote><p>The table exists with the columns: _id (= int), server_id (= int) and value (= string)</p><p>There is one entry: 1, 1, test</p><p>The parameter of the function is 1.</p><p>SincerelyxZise</p>","473890","","473890","","2010-11-07 15:23:49","2010-11-07 15:55:40","Cursor doesn't find columns?","<android><sqlite>","2","0","","",""
"4118436","1","4118448","","2010-11-07 15:48:33","10","4305","<p>On the first run of my app, I am downloading a pretty big file to /sdcard/</p><p>I already know this can fail if the internal SD card of the user's phone is full or not mounted (e.g. if the phone is connected to a PC as a mass storage device, or has not been properly disconnected from a PC).</p><p><strong>But are there any android devices with NO INTERNAL SD CARD</strong> ? (on which my app would definitely be unusable)</p>","479851","","","","","2011-06-14 21:22:04","Do ALL android devices have an internal SD card?","<android><android-sdcard>","3","0","5","",""
"4118463","1","4118476","","2010-11-07 15:53:33","3","3089","<p>I am pretty sure that a parameter will do the trick but I can't find the one I am looking for.</p><p>I am trying to display one TextView -file_type- below the file_title TextView.</p><p>What would be the parameter that I should add to the file_type TevxtView block to come under the file_title TextView block ?</p><p>There is what I am doing :</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;ImageView android:id=""@+id/file_type_logo""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:paddingLeft=""25px""      android:paddingTop=""25px"" /&gt;  &lt;TextView android:id=""@+id/file_title""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:paddingLeft=""30px""     android:textSize=""22sp""     android:background=""#FF0000""     android:textColor=""#FFFFFF"" /&gt;  &lt;TextView android:id=""@+id/file_type""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:paddingLeft=""30px""     android:paddingTop=""10px""     android:layout_gravity=""bottom""     android:textSize=""22sp""     android:background=""#FF0000""     android:textColor=""#FFFFFF"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Thank you ,</p>","290613","","","","","2012-05-15 15:19:00","How to display a TextView below an other one in Android with XML files?","<android><layout><relativelayout>","1","0","","",""
"4118509","1","","","2010-11-07 16:06:37","2","811","<p>I'm creating a simple application for Android which should display an image which is located on remote HTTP server. Which is the best way to do this: should it write the image to some temporary file, or just load it to RAM (in this case, how to load image to ImageView from byte array)?</p><p>Thank you all</p>","445077","","","","","2011-04-20 18:13:03","The best way for displaying a remote image on Android?","<android><image><imageview>","0","1","","",""
"4118751","1","4118917","","2010-11-07 17:11:49","45","37298","<p>Say I have some simple class and once it's instantiated as an object I want to be able to serialize its contents to a file, and retrieve it by loading that file at some later time... I'm not sure where to start here, <strong>what do I need to do to serialize this object to a file?</strong></p><pre><code>public class SimpleClass {   public string name;   public int id;   public void save() {       /* wtf do I do here? */   }   public static SimpleClass load(String file) {       /* what about here? */   }}</code></pre><p>This is probably the easiest question in the world, because this is a really simple task in .NET, but in Android I'm pretty new so I'm completely lost.</p><p>BTW, I'm sorry if this is a duplicate question, but I didn't see it anywhere on SO. Thanks for your help in advance.</p>","135786","","441574","","2014-01-30 09:03:07","2014-02-22 13:02:12","How do I serialize an object and save it to a file in Android?","<android><serialization><file-io>","3","0","34","",""
"4118808","1","","","2010-11-07 17:25:25","-1","183","<p>When I start my emulator whether in Eclipse or from command prompt, the emulator causes a buzzing sound, and will not exit, I MUST restart my computer.  When I add the -noaudio command line option, there is no buzzing, and the emulator will exit perfectly.  Any suggestions </p>","495263","","","","","2010-11-07 17:33:39","Emulator Buzzing Sound","<android>","1","1","","",""
"4118877","1","","","2010-11-07 17:44:53","0","121","<p>I have Asynch in a seperate class, and I need to change setText on some of the TextViews</p><p>How this possible? OR should I keep AsyncTask inside my Class? </p><pre><code>private class DownloadImageTask extends AsyncTask&lt;Object, Void, AdModel&gt; {    @Override    protected AdModel doInBackground(Object... params) {        return getAd();    }    protected void onPostExecute(AdModel result) {        textTitle.setText(result.getTitle());     } }</code></pre>","371301","","","","","2010-11-07 17:58:47","SyncTask in seperate class, reach my views","<android>","2","0","","",""
"4118951","1","4120775","","2010-11-07 18:02:05","-1","533","<p>I have built my first widget and want to use the standard Android 9-Patch drawable:<code>calendar_bgtop_blue.9.png</code></p><p>This drawable is in blue. But, I need the same in green.Can anybody transform this standard 9-Patch drawable to a green color?HTML code for green color is: <code>#99C000</code></p><p>The link to the drawable is <a href=""https://android.git.kernel.org/?p=platform/packages/providers/CalendarProvider.git;a=blob;f=res/drawable-mdpi/appwidget_calendar_bgtop_blue.9.png;h=af0f466c124dab03ae9c1bd2f00ec4d883850b61;hb=HEAD"" rel=""nofollow"">here</a>.</p><p>I hope, someone can help me.</p>","242070","","1904504","","2013-12-24 10:57:25","2013-12-24 10:57:25","Widget Background - Calendar Blue to Green","<android><widget>","2","4","","",""
"4118985","1","","","2010-11-07 18:11:41","0","408","<p>i am not very familiar with android coding so try to help me on a easy way.</p><p>The problem:I have 2 Listviews and a onClick event handler.How can i find out on which listview the user currently clicked?</p><pre><code>public void onListItemClick(ListView l, View v, int position, long id) {'Approach: if listview1 is clicked then FUNCTION1() else FUNCTION2()'}</code></pre><p>thx!</p>","500006","","409259","","2010-11-07 19:04:05","2010-11-07 19:12:22","Multiple ListViews and onClick problem by finding out which ListViews is clicked","<android><listview>","1","0","","",""
"4118989","1","4119221","","2010-11-07 18:12:22","0","1108","<p>I'm trying to create an appwidget with a customizable background. I use a NinePatchDrawable and I would like to change it's color (using the setColorFilter method). This is no problem in an Activity, but it does dot seem possible with the RemoteView object used for appwidgets.</p><p>Is there some way to get an ImageView in an appwidget to be updated with a new Drawable, not a Bitmap?</p><p>Or if not, perhaps it's possible to get the actual size of the appwidget and convert / save the colored NinePatchDrawable to a Bitmap and then update the ImageView with that?</p><p>I already searched quite a bit for a solution, but haven't found anything so far. I hope it's not impossible.Thanks,</p><p>Froghut</p>","398511","","","","","2010-11-11 14:20:01","AppWidget: Updating ImageView with drawables?","<android><drawable><appwidget>","1","0","","",""
"4119009","1","","","2010-11-07 18:17:57","4","19493","<p>I want to use a progressbar on my screen isntead of progressDialog.</p><p>I have inserted a progressBar on my XML-view file, and I want to make it show when it loads and when disable it when not loading, </p><p>so I was using visible, but it takes place, so rest of the data comes down, </p><p>How should I use progressbar in a asynctask, and how can I make it show, and disshow</p>","371301","","","","","2012-12-04 14:32:42","Progressbar togther with asyncTask","<android>","3","1","2","",""
"4119084","1","4127212","","2010-11-07 18:38:14","0","3921","<p>I know how to open a URL using Intents:</p><pre><code>Intent browserIntent = new Intent(""android.intent.action.VIEW"", Uri.parse(""http://www.lala.com""));startActivity(browserIntent);</code></pre><p>But how can I open multiple URLs, each on new window/tab???</p><p>Tried creating several Intents and opened each with different startActivity but it just opens the last one on the list;</p><pre><code>code code codestartActivity(Intent1); startActivity(Intent2); startActivity(Intent3); -&gt; only Intent3 is opened eventually (which of course make sense :)).</code></pre><p>Appreciate any help!</p><p><strong>UPDATE:</strong> still looking for an answer :/</p><p>I've come up with a possible solution, which indeed opens the URL in a new window.</p><pre><code>Intent intent = new Intent(""android.intent.action.VIEW"", Uri.parse(""http://www.go.com""));Bundle b = new Bundle();b.putBoolean(""new_window"", true); //sets new windowintent.putExtras(b);startActivity(intent);</code></pre><p><a href=""http://www.netmite.com/android/mydroid/2.0/packages/apps/Browser/src/com/android/browser/BrowserBookmarksPage.java"" rel=""nofollow"">BrowserBookmarksPage.java</a></p><p>Any way of somehow start the Activity to open several URLs at once? something with setResult() &amp; startActivityForResult() maybe?</p>","444324","","444324","","2010-11-17 07:21:47","2012-09-18 09:49:11","Android Browser: open several URLs, each on new window/tab (programmatically)","<android><android-intent><android-browser>","2","8","","",""
"4119099","1","4119283","","2010-11-07 18:41:10","0","620","<p>I have a button defined in my XML file.  The button works exactly like you would expect...that is until I add the line at the bottom (android:background=""drawable/leftarrow1"").  Then the button is no longer clickable in the activity, but the new background shows up like I want.</p><p>What gives?</p><pre><code>&lt;Button    android:id=""@+id/switch_left""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:layout_centerVertical=""true""    android:background=""@drawable/leftarrow1"" /&gt;</code></pre><p>Here is the click code for reference</p><pre><code>Button switchLeft = (Button) findViewById(R.id.switch_left);switchLeft.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {       Log.w(this.getClass().getName(), ""clicked left arrow"");    }});</code></pre>","432209","","","","","2010-11-07 19:33:07","Setting the background of a Button view in XML makes the button not-clickable","<java><android><xml><button><activity>","2","0","","",""
"4119224","1","4119409","","2010-11-07 19:15:37","0","684","<p>I am having a weird situation where a Service that is created is stopping - sometimes.  I have a entry Activity A that starts a service using bindService</p><pre><code>// if we now have an IP address then bind ourselves to the MessageServicebindService(new Intent(this, MessagingService.class),             onMessageService,            BIND_AUTO_CREATE);</code></pre><p>The MessageService handles kicking of Read and Send threads to handle message traffic with the app.  It basically handles polling for new messages at 1 second intervals using a StatusTask and it's timer using timer.scheduleAtFixedRate.</p><p>Activity A then kicks off another Activity B that displays info to the user.  For some reason that I yet to figure out, most of the time when I press the home button, the polling stops and the Service seems to have stopped.  Reslecting my app from the Home recent apps list or via a notification I post when not visible brings the Activity to the foreground, but the Service seems to be gone.  Making this harder to debug, about 10-20% of the time everything works great and the Message Polling service keeps plugging away.</p><p>Should I be using startService instead?  The only direct relationship that the second Activity B has with the Service is that registers itself as an observer of the Read thread in order to be notified about timeouts on Reads.  I am not calling stopService anywhere in my code. </p>","418714","","","","","2010-11-07 19:58:25","Android Service stopping without being told?","<android><service>","4","0","","",""
"4119237","1","","","2010-11-07 19:18:34","3","1174","<p>I used a linear gradient image for a background and in Photoshop (and everything else) it looks nice and smooth but when I displayed it in the emulator is was banded!   What's worse, it's banded on my actual phone - a Droid Incredible.    I'm running 2.2 both in emulation and on the phone.</p><p>Here's a sample -  original on the left, Android'ed version on the right:  <a href=""http://pnart.com/temp/AndroidMach.jpg"" rel=""nofollow"">http://pnart.com/temp/AndroidMach.jpg</a></p><p>This has the appearance of Android imposing some bit-depth limitation.   What's going on and how do I fix it?</p><p>Thanks in advance!</p>","424690","","","","","2012-04-26 18:32:06","Mach Banding images in Android","<android>","5","1","","",""
"4119314","1","","","2010-11-07 19:34:39","0","1459","<p>I have a question. I've done in XML ImageView. Unfortunately, the ""holds"" on the left side of the screen on the phone. I wish this picture could shift to the right place.I would like to point to the X and Y position of the image shifted to the indicated place.How do I do this?Please explain in detail because I am a novice programmer of Java.Sorry for the mistakes. I'm not saying every day in the English language.</p>","500054","","","","","2010-11-07 19:59:43","Moving image imageview","<android><image><move>","1","0","","",""
"4119325","1","","","2010-11-07 19:38:56","0","159","<p>I really need help with this listview. It's been fustrating for a few days now. I have tried everything but its not working properly. Values for one row keep getting copied to another row, just like how it was described in roman guy listview topic. I have checked examples on the net but sadly they are mostly implemented in the getView() method of an array adapter and none with a custom cursor adapter. Please could you guys look at it for me and see what I'm doing wrong. here's the code for the new view() and bind view():</p><pre><code>    public customCursorAdapter(Context context, int layout, Cursor c, String[]from, int[] to) {            super(context, layout, c, from, to);            this.layout = layout;            inflater = LayoutInflater.from(context);            LayoutInflater inflater;            this.context = context;        }     @Override  public void bindView(View view, Context context, Cursor c) {      //ViewHolder holder = null;    changeCursor(c);    if(view != null){                 holder = (ViewHolder)view.getTag();           }    int namecol = c.getColumnIndex(DBAdapter.NAME);     String name = c.getString(namecol);    holder.viewItemName.setText(name);    int priority = c.getColumnIndex(DBAdapter.PRIORITY);    String prioritystatus = c.getString(priority);    if(prioritystatus.equals(""High"")){                               holder.viewItemName.setTextColor(Color.RED);    }     if(prioritystatus.equals(""Low"")){                          holder.viewItemName.setTextColor(Color.BLUE);    }    if(prioritystatus.equals(""Medium"")){                           holder.viewItemName.setTextColor(Color.GREEN);    }   String startDate = c.getString(c.getColumnIndex(DBAdapter.START_DATE));   holder.viewStartDate.setText(startDate);   String startTime = c.getString(c.getColumnIndex(DBAdapter.START_TIME));     holder.viewStartTime.setText(startTime);    }       @Override     public View newView(Context context, Cursor cursor, ViewGroup parent) {    ViewHolder holder;    LayoutInflater inflater = LayoutInflater.from(context);    View  view = null;        view = inflater.inflate(layout, parent, false);        //view = inflater.inflate(R.layout.view_items, null);    holder = new ViewHolder();    holder.viewItemName = (TextView)view.findViewById(R.id.viewNameId);    holder.viewStartDate = (TextView)view.findViewById(R.id.viewDateId);    holder.viewStartTime = (TextView)view.findViewById(R.id.viewTimeId);    holder.viewPriority = (Spinner)view.findViewById(R.id.prioritySpinner);    holder.checkbx = (CheckBox)view.findViewById(R.id.checkbox_viewItems_Id);        holder.checkbx.setOnCheckedChangeListener(this);        view.setTag(holder);            return view;        }</code></pre>","447570","","23897","","2010-11-07 19:42:36","2010-11-07 19:42:36","Need help with this custom listview","<android>","0","15","","",""
"4119327","1","4119500","","2010-11-07 19:39:15","1","607","<p>In my program I have a custom view object.  Inside the view class is a method called foo.  For some reason when I call foo from my activity, it doesn't fire.  Here is the code:</p><p>XML of the custom view:</p><pre><code>&lt;com.company.application.MyView    android:id=""@+id/my_view""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;</code></pre><p>The activity code:</p><pre><code>public class Main extends Activity {    MyView mView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LayoutInflater li = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        View v = li.inflate(R.layout.main, null);           mView= (MyView) v.findViewById(R.id.my_view);        //A button to fire the method inside foo()        Button switchLeft = (Button) findViewById(R.id.switch_left);        switchLeft.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                callTest();            }        });    }    public void callTest() {        Log.w(this.getClass().getName(), ""clicked left arrow"");        mView.foo();        mView.postInvalidate();    }}</code></pre><p>Finally here is foo:</p><pre><code>public void foo() {    mBackground = mContext.getResources().getDrawable(R.drawable.temp_canvas);    Log.w(this.getClass().getName(), ""background set"");}</code></pre><p>The first log is always written when the button is pressed, but the second log is not because foo never fires.  What is the deal here?</p><p>Thanks in advance all.</p><p><strong>Edit: upon request, the full view</strong></p><pre><code>public class MyView extends View {    Drawable mBackground;    Context mContext;    public MyView (Context context) {        super(context);        mContext = context;        mBackground = mContext.getResources().getDrawable(R.drawable.leftarrow1);    }    public MyView (Context context, AttributeSet attrs) {        super(context, attrs);        mContext = context;        mBackground = mContext.getResources().getDrawable(R.drawable.leftarrow1);    }    public void foo() {        mBackground = mContext.getResources().getDrawable(R.drawable.temp_canvas);        Log.w(this.getClass().getName(), ""background set"");    }    @Override    public void onDraw(Canvas canvas) {        Paint paint = new Paint();        paint.setStyle(Paint.Style.FILL);        // draw a solid blue circle        paint.setColor(Color.BLUE);        canvas.drawCircle(20, 20, 15, paint);        // draw a test background        mBackground.setBounds(0, 0, 300, 400);        mBackground.draw(canvas);    }}</code></pre>","432209","","432209","","2010-11-07 20:11:32","2010-11-07 20:34:18","Can't call a method of a view object inside an activity","<java><android><methods><view><activity>","1","4","","",""
"4119363","1","4119445","","2010-11-07 19:46:33","0","1118","<p>I have popup in my android app. In popup I have button for closing popup with id=""imbClosePopUp"", but when I try to set to that button clickListener app crashs.</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:orientation=""vertical""    android:layout_height=""fill_parent""    android:background=""#AAAAAAAA""&gt;    &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""right""    android:layout_gravity=""right""    &gt;    &lt;ImageButton    android:id=""@+id/imbClosePopUp""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""right""    android:src=""@drawable/close""    &gt;&lt;/ImageButton&gt;    &lt;/LinearLayout&gt;    &lt;TextView        android:text=""CEKIRAJ OBAVEZNE KRITERIJUME""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;     &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""    &gt;        &lt;TableRow&gt;            &lt;CheckBox                android:id=""@+id/chkw""                android:checked=""true""                android:text=""cg""            &gt;&lt;/CheckBox&gt;            &lt;CheckBox                android:id=""@+id/chkq""                android:checked=""true""                android:text=""tv""            &gt;&lt;/CheckBox&gt;        &lt;/TableRow&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""right""        android:layout_gravity=""right""&gt;        &lt;Button            android:id=""@+id/btnSaveCrit""            android:text=""ok""            android:layout_width=""130dp""            android:layout_height=""wrap_content""        &gt;        &lt;/Button&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I set onclicklistener for button imbClosePopUp in function where I create Popup ( I create Popup on click some button ).</p><pre><code>  private OnClickListener AdditionalC = new OnClickListener() {        public void onClick(View v) {            LayoutInflater inflater = (LayoutInflater)            roomate.getSystemService(Context.LAYOUT_INFLATER_SERVICE);          pw = new PopupWindow(            inflater.inflate(R.layout.popup, null, false),             300,             300,             true);         // The code below assumes that the root container has an id called 'main'         pw.showAtLocation(roomate.findViewById(R.id.tbC), Gravity.CENTER, 0, 0);          ImageButton imbClosePopUp=(ImageButton)findViewById(R.id.imbClosePopUp);         imbClosePopUp.setOnClickListener(ClosePopUp);        }    };</code></pre><p>Does anybody know what is the ptoblem and how to colse popup ?</p>","486578","","","","","2010-11-07 20:06:00","Cannot add clickListener for button in Popup","<android>","2","2","1","",""
"4119405","1","14478182","","2010-11-07 19:57:59","13","12226","<p>I have an image cache in my application which is implemented using SoftReferences. Dalvik starts applications with relatively small heap, and then increases it in case of demand. But I'd like to have my heap size bigger from the beginning. That is because when I already have some images in the cache, and an activity starts (for example) or other peak memory demand occurs, my cache gets purged in order to let memory for that peak demand. As a result, after the peak is gone I still have 2-3 MB of free space but my cache is empty!</p><p>The solution I see for this trouble is pre-allocating a bigger heap forehand so even with the peak consumption of 2-3 MBs it still has some roomspace so my SoftReferences are not purged.</p><p>I found that <code>VMRuntime.getRuntime().setMinimumHeapSize(BIGGER_SIZE)</code> would be helpfull. In particular, Google uses that in their apps, as mentioned <a href=""http://stackoverflow.com/questions/1518154/what-is-the-objective-of-setting-the-minimum-heap-size-in-an-android-app"">here</a>. However, <a href=""http://developer.android.com/reference/dalvik/system/VMRuntime.html"">VMRuntime</a> class is marked depricated and said to be removed from the public API in a future release. So <code>setMinimumHeapSize</code> is not a permanent solution.</p><p><strong>How then I make Dalvik to grow my heap at startup?</strong> </p><p>Currently I use a really straight-forward and cheesy technique by just allocating a large array and releasing it. This makes Dalvik grow the heap as I want. However, I'm sure there must be more elegant way of doing that. Could you tell me that, please?</p>","457086","","","","","2013-10-16 17:04:23","Android: how to increase heap size at runtime?","<android><size><heap>","5","2","2","",""
"4119441","1","","","2010-11-07 20:04:32","22","22187","<p>For part of my app, the user is presented with a list of names and is asked to group them as they see fit. </p><p>(Note, the ListView code was copied verbatim from the Android Views tutorial.  I haven't yet customized it to my needs, I'm just trying to figure out how to make this work.)</p><p>The basic layout is a LinearLayout, containing a ScrollView (called ""groupsScrollView"" in the code below), containing a RelativeLayout.  I have some buttons and text, and then my ListView beneath that, which displays the list of names.  All this is taller than the visible screen area, so the user is allowed to scroll vertically to see it all.</p><p>This all works beautifully, except when the page loads it is always pre-scrolled to the top of my ListView - in the middle of the page.  The text and buttons I've created that tell the user what to do are not visible.  </p><p>I can grab the screen and scroll up, that works just fine, but I'd like the screen to load having already been scrolled to the top.  The user shouldn't have to scroll UP to see the top of a freshly loaded page.  But everything I've tried to programmatically scroll to the top of the screen has failed.</p><p>Here's my onCreate method:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.groups);    mainScrollView = (ScrollView)findViewById(R.id.groupsScrollView);    //get the Bundle out of the Intent...    Bundle extras = getIntent().getExtras();    mNames = extras.getStringArray(""mNames"");    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, mNames));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    //This is the line I'm having issues with    mainScrollView.pageScroll(View.FOCUS_UP);    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>The line ""mainScrollView.pageScroll(View.FOCUS_UP); is the problem.  It doesn't cause an error, but it doesn't seem to do anything.  I've tried scrollTo(0,0), scrollDirection(View.FOCUS_UP), and everything else I can think of.  </p><p>Since I don't get an error I have to assume that these scroll commands are actually working, but that they're scrolling to the top of the ListView, rather than the top of the ScrollView or RelativeLayout that contains it.  This seems to be confirmed by Google's own description of the scrollTo(int x, int y) method where they say ""This version also clamps the scrolling to the bounds of our child."".  </p><p>So to make a long question even longer, how do I load a bunch of views on the screen contained within a ScrollView, and then programmatically scroll the whole thing to the top of the page so the user can interact with it?</p><p>Thanks!</p>","500069","","","","","2014-02-26 12:46:51","How to scroll to top of long ScrollView layout?","<android><listview><scrollview>","6","0","4","",""
"4119580","1","","","2010-11-07 20:40:40","1","1134","<p>I am trying to achieve a random animation of from a set of images, where each frame is a random image from the image set. And for this I am using addFrame method of AnimationDrawable object but the animation is not working. I tried searching various tutorials, tried other things also but nothing helped. Below is my code of the program, can anyone please tell what I am doing wrong. In the layout there is an ImageView. But when I am trying animation from xml animation definition(which is not random), it works. Thanks and regards.</p><pre><code>import java.util.Random;import android.app.Activity;import android.graphics.drawable.AnimationDrawable;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.ImageView;public class MemoryGame extends Activity implements OnTouchListener{MemoryGameView mgv;ImageView memImg;int []seqimg = new int[15];AnimationDrawable animation; /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.memorylayout);    memImg = (ImageView) findViewById(R.id.mem_img);    memImg.setOnTouchListener(this);    //generate the random sequence of list    randomImgList();    defAnimation();  }//select the array of random sequence of images for viewingprivate void randomImgList(){    //initialize the sequece    for (int i = 0; i &lt; 15; i++) {        seqimg[i] = i+1;    }    Random rng = new Random();    // i is the number of items remaining to be shuffled.    for (int i = 15; i &gt; 1; i--) {        // Pick a random element to swap with the i-th element.        int j = rng.nextInt(i);  // 0 &lt;= j &lt;= i-1 (0-based array)        // Swap array elements.        int tmp = seqimg[j];        seqimg[j] = seqimg[i-1];        seqimg[i-1] = tmp;    }}//define the animation sequeceprivate void defAnimation() {    animation = new AnimationDrawable();    for(int i=0; i&lt;10; i++) {        String imgName = ""mimg"" + seqimg[i];        int id = getResources().getIdentifier(imgName, ""drawable"", getPackageName());        Log.d(""id"",""""+id);        animation.addFrame(getResources().getDrawable(id), 1000);    }    animation.setOneShot(true);}//define the touch event from the OnTouchListener interfacepublic boolean onTouch(View v, MotionEvent arg1) {    if(v.getId() == memImg.getId()) {        memImg.setBackgroundDrawable(animation);        animation.setVisible(true, true);        animation.stop();        animation.start();    }    return true;}}</code></pre>","365905","","","","","2010-11-09 19:24:34","random frame animation does not work android","<android><animation><random><imageview>","1","2","","",""
"4119728","1","4179899","","2010-11-07 21:13:31","0","213","<p>I have a custom view that draws to a canvas.  I am trying to invoke changes to the canvas when the user pushes a button from the activity that this view is tied to.  Currently, I am attempting to do this by calling a public method, called setNewDrawable, that I created inside the view.</p><p>The debugger is giving me different values for the view ID depending on whether I'm inside setNewDrawable or inside the Overridden onDraw method when I post an Invalidate.</p><p>For example the debugger variables show: (This - MyView id=830067720176) or (This - MyView id=830067712344) in setNewDrawable and onDraw respectively.  This makes me think I basically have two copies of the object and I am essentially interacting with the wrong one.</p><p>How can I get information to my custom View in order to determine what it draws?</p><p>Here is the code I am running.</p><pre><code>public class Main extends Activity {    MyView mView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LayoutInflater li = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        View v = li.inflate(R.layout.main, null);           mView= (MyView) v.findViewById(R.id.my_view);        //A button to modify what's drawn on the canvas        Button switchLeft = (Button) findViewById(R.id.switch_left);        switchLeft.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                mView.setNewDrawable();                mView.postInvalidate();                }            });        }    }</code></pre><p>Thanks all!</p>","432209","","432209","","2010-11-08 00:00:37","2010-11-14 21:50:24","How do I invoke changes to a custom view object from its activity","<java><android><view><activity>","1","0","","",""
"4119739","1","","","2010-11-07 21:14:58","0","572","<p>At the moment my base style inherits from <code>android:style/Theme.Light.NoTitleBar</code>. Is there any way I can change it to inherit from <code>Theme.Black.NoTitleBar</code> in code? I notice apps like Handcent has a settings option to do this, but I can't quite figure out how to do this.</p><p>Any suggestions would be greatly appreciated.</p><p>Thanks,D.</p>","150061","","","","","2010-11-07 22:16:33","Can I change Android style's parent in code?","<android><themes><styles>","1","2","","",""
"4119755","1","","","2010-11-07 21:19:37","3","6369","<p>The Android Developer guidance on <a href=""http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog"" rel=""nofollow"">Creating a Custom Dialog</a> specifies a layout that starts:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""          android:id=""@+id/layout_root""          android:orientation=""horizontal""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""10dp""          &gt;</code></pre><p>If I use this code I get a dialog that sits in the centre of the screen with about 40 pixels of the underlying view visible on each side.</p><p>What exactly does ""fill_parent"" mean (for the width and height)?</p>","250845","","","","","2012-09-06 08:30:12","Android: setting the dimensions of a Dialog (what does ""fill_parent"" mean?)","<android><layout><dialog>","2","0","","",""
"4119796","1","","","2010-11-07 21:28:49","0","452","<p>In my application I have 3 tabs that contain ListViews depending on what the selection was in the previous tabs. Basically, the 1st tab will list restaurants, 2nd tab will lists submenus of the selected restaurant, the 3rd menu will lists the items of that selected submenu, and then when an item is selected, it will display some nutritional info about that item. I don't know the best way to organize the restaurants/submenus/item, but the way I was thinking was a nested HashMap like the following.</p><pre><code>HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, Double[]&gt;&gt;&gt;</code></pre><p>What I don't know how to do, is efficiently build this map where it is easy to add/remove things in the future. I was looking at xml, but I could not figure out how to do it. If I did it this way, I would also need help writing the Java code to parse through the xml and put it all into the correct place in its map. I am not sure if you need to use tags or if you can just have an xml file that utilizes map and then just kind of 'import' it into your java project. I don't think that hard coding every single item in Java would be very efficient, so I was hoping I could get some help.</p><p>Possble, like this? Not exactly filled out, but I really didn't know what I was doing.</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;util:map name=""foodmapping""&gt; &lt;restaurant key=""McDonalds""&gt;  &lt;util:map&gt;  &lt;/util:map&gt;"" &lt;/restaurant&gt; &lt;restaurant key=""Starbucks""&gt;  &lt;value&gt;2  &lt;/value&gt; &lt;/restaurant&gt;&lt;/util:map&gt;</code></pre>","489304","","","","","2012-06-25 18:22:21","Nested HashMap Creation in Android","<java><android><hashmap>","1","2","","",""
"4119806","1","","","2010-11-07 21:30:48","6","417","<p>I need to have relatively slow moving image on home screen (some like live wallpaper) and I'm wondering, whether Android animation classes are good for that in terms of CPU load?</p><p>My concern is that android animation running constantly at the top frame rate and sometimes it produces the same X,Y coordinates several cycles in a row. And there is no way to slow down the animation frame rate.</p><p>Is there any recommendation from Google?</p>","349871","","1303116","","2012-06-18 10:47:37","2012-06-18 10:47:37","Is built-in Animation suitable for long-running slow animations?","<android><animation><performance>","1","0","","",""
"4119827","1","","","2010-11-07 21:36:14","11","3502","<p>I my application, I need to open a link in Android Browser. This page can receive some data just via POST. Could I add these parameters(data) to the intent which start the browser?</p><p>Do you know if this is possible? If it is, could you give my a hint?</p><p>Thanks.</p>","217360","","","","","2012-03-28 14:35:46","How can I open android browser with specified POST parameters?","<android><android-sdk-2.1>","2","4","4","",""
"4119842","1","","","2010-11-07 21:39:40","1","913","<p>I use a service to check for stuff on the server, and wanted to transition that to use the standard android sync capability.  However, the config file confuses me.</p><p>android:contentAuthorityandroid:accountTypeandroid:supportsUploading</p><p>I don't know what these represent and don't have any meaningful values for them.  It seems like I'll need a content provider to use the sync, but that's not how I implemented everything.</p><p>Any good links or info on implementing sync with your own code?</p>","227313","","","","","2011-01-04 00:10:05","Android sync without content provider","<android>","1","0","","",""
"4119942","1","","","2010-11-07 22:01:59","0","906","<p>If you declare a singleton inside an Activity, when you are on another Activity the static instance will be gone. The same thing happens if I declare the singleton in the OnCreate () of a service running on its own thread?</p>","500127","","","","","2010-11-07 22:01:59","Singleton and Services","<android><singleton>","0","2","","",""
"4120061","1","","","2010-11-07 22:31:27","1","263","<p>I'm writing an applications and I want two version's of it on the market, the first would be a trial version, and the second is a full version.</p><p>I wanted to ask what is the best way to have it as 2 package names?If I just change the package name in the manifest I also need to change all the references in my classes, which I rather not do</p><p>have anyone here done it before and have any recommendations for me?</p>","406682","","","","","2010-11-07 22:31:27","multiple package names for the market","<android><build><packaging>","0","3","","",""
"4120156","1","4120461","","2010-11-07 22:55:48","1","2380","<p>I'm trying to play a mp4 video in an app I'm developing however whenever I run the app in the emulator and on certain devices I get this error:</p><p>ERROR/MemoryHeapBase(34): error opening /dev/pmem_adsp: No such file or directory</p><p>I have no idea what this means and when I googled it all these responses came up that had to do with custom building the OS and things like this that I am not trying to do, nor want to do at all.  I just want to play an mp4 video in my app, any suggestions?? By the way it works fine on the Nexus one.</p><p>Here is the code:</p><pre><code>try {        AssetFileDescriptor fileDesc = getVideoFileDescriptor();        if (fileDesc != null) {            player.setDataSource(fileDesc.getFileDescriptor(), fileDesc.getStartOffset(), fileDesc.getLength());            fileDesc.close();            player.prepare();            player.setDisplay( holder );            player.setOnCompletionListener( this );            player.start();        }    }    catch (Exception e) {        Log.e( Constants.TAG, ""Unable to play intro movie"", e );    }</code></pre>","302925","","","","","2010-11-08 00:21:29","android mediaplayer issue playing mp4","<android><media-player><mp4><h.264><videoview>","1","0","","",""
"4120182","1","4120192","","2010-11-07 23:01:39","2","889","<p>I have an Android App that uses a TabHost layout; every tab calls the same Activity on which there is a ListView that loads data from a DB.Everything runs fine but the problem is that when the user click a ListView item and i call an intent to load, the new activity goes ""full screen"" and hides the TabHost.I call the new intent in this way:</p><pre><code>Intent i=new Intent(this, MyActivity.class);startActivity(i);</code></pre><p>I would like to maintain visibility of TabHost even if i change Activity, can anyone help me?</p><p>Thanks in advancec.</p>","339500","","","","","2010-11-07 23:04:21","Problem with Intents and TabHost in Android","<android><android-intent><android-tabhost>","1","0","2","",""
"4120232","1","4120629","","2010-11-07 23:13:51","0","275","<p>I'm writing a software that checks events in user's calendars and does some manipulations over them. But I would like to touch only those events which are present in synced calendars only. I'm using Google Calendar API, but don't know how to list only synced calendars and ignore others.</p><p>Thanks</p>","94892","","","","","2013-04-29 22:02:42","Android: how to detect which Google calendars are synced with the device?","<android><google-calendar>","3","0","","",""
"4120342","1","","","2010-11-07 23:52:39","4","1290","<p>Howdy,I am currently generating some textviews in a loop. It would be great if I could apply a style to those textviews.</p><p>This style already containts all attributes so I would not neet to set a Attribute, however if I do this</p><p><code>TextView counterTV = new TextView(activity,null, R.style.MenuField);</code></p><p>the TextView is created but there is are no styles applied to it :(.</p><p>It works flawlessly if I apply the same style to a textview in a XML File.</p>","498400","","498400","","2010-11-08 00:13:11","2011-05-20 05:55:31","Create TextView ( in the code ) with style but without attributes","<java><android>","2","0","3","",""
"4120503","1","5344169","","2010-11-08 00:35:01","9","6587","<p>I managed to figure out how to create a custom shape (with a dashed stroke) by creating a file called <em>dash.xml</em> inside of the <em>/app/res/drawable/</em> folder:</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=""line""&gt;    &lt;stroke        android:color=""#534b4b""        android:width=""1dp""        android:dashGap=""2dp""        android:dashWidth=""1dp""    /&gt;    &lt;size        android:height=""1dp""    /&gt;&lt;/shape&gt;</code></pre><p>Now I'm confused as to how to apply this shape to a ListView. I've tried the following, but no divider is displayed:</p><pre><code>&lt;ListView android:id=""@+id/android:list""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:cacheColorHint=""#00000000""    android:divider=""@drawable/dash""    android:dividerHeight=""1dp""/&gt;</code></pre><p>Wtf?</p>","204499","","204499","","2010-11-08 01:23:43","2012-01-18 01:19:10","How do I create a ListView with dashed / dotted line dividers in Android?","<android><xml><listview><android-layout><android-listview>","3","0","3","",""
"4120549","1","4120610","","2010-11-08 00:48:29","0","121","<p>I believe it's because of some power saving option or whatever but I cant debug it since it only fails when it's on battery </p><p>I have a service that checks on a webpage every 60 secondsI use an asyncTask in the service to do thisand I make it Thread.thisThread.sleep(60000); before checking </p><p>am I doing something wrong? could the sleep function cause the server to be stopped by android?</p>","219554","","","","","2010-11-08 01:08:13","android: service behaved differnat when not connected to pc","<android><service><sleep><battery>","1","3","","",""
"4120598","1","","","2010-11-08 01:05:22","0","1521","<p>I have map in m android app but it doesn't work well. I spent last two hours looking in code line by line but I don't know what is the problem. I done all like in tutorial <a href=""http://mobiforge.com/developing/story/using-google-maps-android"" rel=""nofollow"">http://mobiforge.com/developing/story/using-google-maps-android</a>. I set in manifest uses google maps. Map shows marker, doesn't show map ( instead in background is grid lines), zoom controls disappear after few seconds and not come back. What can be a problem ?<img src=""http://i.stack.imgur.com/3pcWj.png"" alt=""alt text""></p><p>This is activity class.</p><pre><code>package com.roomate.www;import java.util.List;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.MapView.LayoutParams;  import com.google.android.maps.Overlay;import android.view.View;import android.widget.LinearLayout;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Point;import android.os.Bundle;import android.util.Log;public class Location extends MapActivity{ MapView mapView;     MapController mc;    GeoPoint p;    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.marker);                        canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);                     return true;        }    }  @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.map_result);  mapView = (MapView) findViewById(R.id.mapView);  mapView.setStreetView(true);        LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);          View zoomView = mapView.getZoomControls();         zoomLayout.addView(zoomView,             new LinearLayout.LayoutParams(                LayoutParams.WRAP_CONTENT,                 LayoutParams.WRAP_CONTENT));         mapView.displayZoomControls(true);        mc = mapView.getController();        String coordinates[] = {""1.352566007"", ""103.78921587""};        double lat = Double.parseDouble(coordinates[0]);        double lng = Double.parseDouble(coordinates[1]);        p = new GeoPoint(            (int) (lat * 1E6),             (int) (lng * 1E6));        mc.animateTo(p);        mc.setZoom(17);         MapOverlay mapOverlay = new MapOverlay();        List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();        listOfOverlays.clear();        listOfOverlays.add(mapOverlay);                mapView.invalidate(); } @Override    protected boolean isRouteDisplayed() {        return false;    }}</code></pre><p>This is layout for map.        </p><pre><code>&lt;LinearLayout    android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  &gt;  &lt;LinearLayout  android:layout_gravity=""left""  android:gravity=""left""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;ImageButton   android:id=""@+id/imbReturnMap""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:fitsSystemWindows=""true""   android:src=""@drawable/close""   android:layout_gravity=""left""&gt;  &lt;/ImageButton&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:gravity=""right""  android:layout_gravity=""right""&gt;  &lt;ImageButton   android:id=""@+id/imbCloseM""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:fitsSystemWindows=""true""   android:src=""@drawable/close""   android:layout_gravity=""right""&gt;  &lt;/ImageButton&gt;  &lt;/LinearLayout&gt;   &lt;/LinearLayout&gt;&lt;RelativeLayout     android:id=""@+id/mainlayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.google.android.maps.MapView       android:id=""@+id/mapView""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:apiKey=""0WR3Cl0evv0U6G2xH9ZnvEFYbDiSDUu_GRovTUQ""                 /&gt;     &lt;LinearLayout android:id=""@+id/zoom""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""         android:layout_centerHorizontal=""true""         /&gt; &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","486578","","","","","2013-07-11 15:51:03","Map shows marker but doesn't show real map in background","<android>","3","0","","",""
"4120618","1","4121019","","2010-11-08 01:10:51","1","1862","<p>To preface my question, couple things to note.  I don't want to store said file on the sdcard in this case.  The file also cannot be storage directly in the apps local files directory.  It needs to be in a subdirectory, so it cannot write the file using openFileOutput() and MODE_WORLD_READABLE.</p><p>The app may download files small files like pdfs and store them locally in a subdirectory. I would like to be able to have the user open these files if they have an app that can open them.</p><p>For example here is an intent for sending a pdf:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(path), ""application/pdf"");startActivity(intent);</code></pre><p>path being something like:  /data/data/packagename/files/subdir/example.pdf</p><p>That intent will open a pdf viewer, but the viewer is unable to open the file.  I assume this is a permissions issue.  I tried Mark Murphy's suggestion here: <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/4e55d869213483a9/b7270078ac1a2744?lnk=raot"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/4e55d869213483a9/b7270078ac1a2744?lnk=raot</a> of using <code>Runtime.getRuntime().exec(""chmod 755 "" + fileName);</code> but it didn't make any difference.  He also suggested a Content Provider but I would like to avoid it if I can because it seems like a lot just to get this file over to another app.</p><p>If the content provider is the only option, do I have to save the file to the content provider or can I just use the content provider as a pass through to get it to the other app when I need to?</p><p>Thanks, let me know if I'm not being clear.</p>","445348","","","","","2011-10-18 16:24:58","How to open a local app file in another app via an intent?","<android><file><permissions><android-intent><local>","2","1","","",""
"4120676","1","","","2010-11-08 01:25:37","1","731","<p>I'm a visual designer creating a UI for an app for an android tablet. The resolution of the tablet is 1024x600 with a density of 160 - I'm building the UI in photoshop on a 1024x600 72dpi canvas - Is this right? I've seen some previews on the device and the graphics that are super crisp on my monitor are kinda fuzzy on the device. I would have expected them to be even crisper.</p><p>The app wont need to support any other devices so its not a question multiple resources - </p><p>Can anyone shed some light as to best way to approach? This is my first mobile project so still  learning the ins and outs ; )</p>","500230","","597607","","2011-09-12 19:20:21","2011-09-12 19:20:21","how to get crisp graphics on android device","<android><gui><graphics>","1","1","","",""
"4120689","1","4121667","","2010-11-08 01:29:41","4","7373","<p>I started an Android OpenGL application and I have the following classes:</p><pre><code>class A extends Activityclass B extends GlSurfaceView implements Renderer</code></pre><p>When class A's onCreate is called, it creates an object of type class B and calls:</p><pre><code>setContentView(Bobject)</code></pre><p>So far it works and I spent a few days on it. </p><p>Now I wanted to add buttons to my application and found the SurfaceViewOverlay example. That uses some XML to create a view hierarchy. I wanted to create something very similar to I simply cut and paste the XML code:</p><p></p><pre><code>    &lt;android.opengl.GLSurfaceView android:id=""@+id/glsurfaceview""            android:layout_width=""match_parent""            android:layout_height=""match_parent"" /&gt;    &lt;LinearLayout android:id=""@+id/hidecontainer""            android:orientation=""vertical""            android:visibility=""gone""            android:background=""@drawable/translucent_background""            android:gravity=""center""            android:layout_width=""match_parent""            android:layout_height=""match_parent""&gt;            ...</code></pre><p>Now keeping in mind my original class hierarchy, how would I initialize my views? What should I write in onCreate() of my class A?</p><p>I tried using:</p><pre><code>Bobject = new B(this);GLSurfaceView glSurfaceView =        (GLSurfaceView) findViewById(R.id.glsurfaceview);    glSurfaceView.setRenderer(Bobject);</code></pre><p>And it does draw the buttons and the GL view on the screen, but the GL view is unable to take in any input from taps/clicks. </p><p>This is likely because Bobject's onTouchEvent() is not called as it is only being used as a:</p><pre><code>Renderer</code></pre><p>and not a:</p><pre><code>glSurfaceView</code></pre><p>object. </p><p>Instead of the above code, what I really want is to have Bobject replace glSurfaceView. But I don't know how to do that. When I do findViewById(), it seems like the glSurfaceView is already created for now. How can I ask it to use an object of type B for the GL view?</p><p>Sorry about any newbie mistakes. Completely new to Android.</p><p>EDIT: I also tried this:</p><p>I also tried the following:In my XML file, I changed the GLSurfaceView to:</p><pre><code>&lt;com.bla.bla.B            android:id=""@+id/glsurfaceview""            android:layout_width=""match_parent""            android:layout_height=""match_parent"" /&gt;</code></pre><p>And in my A class constructor I am calling:</p><pre><code>// This returns nullBobject = (B) findViewById(R.id.glsurfaceview);// And this suspends the application. :(setContentView(R.layout.surface_view_overlay);</code></pre><p>How should I use my custom class that extends glSurfaceView in my XML file/Activity?</p>","470624","","470624","","2010-11-08 05:47:53","2012-01-13 14:55:50","Android glSurfaceView with overlay using XML/Java","<android><button><surfaceview><glsurfaceview>","2","1","","",""
"4120778","1","","","2010-11-08 01:56:01","0","275","<p>I was trying to create a new AVD using the ADK and AVD manager and chose to pick the file myself. While navigating to the directory of my choice in the file chooser I saw a flurry of ""fatal: Not a git repository (or any of the parent directories): .git"" in the console from which I had started the AVD manager and finally ""SD Card path isn't valid"" in the manager GUI (an error message for which there isn't a single Google match, incidentally).</p><p>So far I haven't come across anything in the docs to suggest that Git has anything to do with AVDs, so this is really puzzling.</p>","389020","","","","","2012-11-21 02:19:50","Git-related error message when trying to create an AVD","<android>","1","0","","",""
"4120824","1","5259995","","2010-11-08 02:14:58","12","5518","<p>I have an ImageView that gets animated when it is added to a layout.When it is removed, I want to reverse the same animation.</p><p>Is there a way to reverse an animation in android without recoding it and reversing the parameters?</p>","2011","","","","","2013-03-24 02:25:58","Android: Reversing an Animation","<android><animation>","4","1","7","",""
"4120827","1","4121660","","2010-11-08 02:15:19","3","1844","<p>We want to migrate a huge complex native program to Android system ,running it as a background service accepting command sent from Java Program using JNI along with IPC. However, the Android NDK state following words:</p><blockquote>  <p>Please note that the NDK does not enable you to develop native-only applications. Android's primary runtime remains the Dalvik virtual machine.</p></blockquote><p>Does that mean we have no way to run an standalone native-only application on Android as a background service? The native code can only exist in the form of library that will be loaded to the  virtual machine through JNI?</p>","115722","","115722","","2010-11-08 04:58:52","2012-02-01 16:08:29","can native only code run on android as standalone application","<android><jni><android-ndk>","3","0","0","",""
"4120841","1","","","2010-11-08 02:21:27","0","1174","<p>Been working on a custom tile overlay implementation for an android app. I'm having trouble with threading the image downloads in the background.</p><p>Quick overview:I have a class (MapOverlay) that extends Overlay. The draw method basically calculates the images (bitmaps) needed and the x,y position to draw them on the screen. I then have an AsyncTask that loops through each tiles and download the images if it doesn't exist on the storage card (local caching) then once the AsyncTask has completed I then loop through the images and draw them to the canvas object that is passed into the draw method of the MapOverlay. But the bitmaps are never getting drawn.</p><p>I have done some rudimentary debugging by logging the width and the height of the canvas element at the time the AsyncTask completes but it is returning 0 for them so I'm guessing that the canvas object is no longer available to the code running in AsyncTask's onPostExecute() after the draw method has completed</p><p>Without the threading I had this working pretty well, except for the ""freezing"" while panning while the image downloading blocks the UI thread. Now I'm totally suck trying to get threading to work</p>","323694","","73488","","2010-11-08 04:08:29","2011-11-20 17:36:03","Android Google maps - custom tile overlay","<android><google-maps><canvas>","1","1","","",""
"4121000","1","4121032","","2010-11-08 03:21:55","0","356","<p>My android program has 4 activities:A -> B -> C -> D</p><p>When activity C starts activity D, activity C closes. (The onStop() method is called).Is there a way to tell why it is closing?</p>","386764","","","","","2010-11-08 03:28:25","Android Activity Stack Question","<android>","1","2","","",""
"4121073","1","4150663","","2010-11-08 03:39:47","0","622","<p>I need to delete the user data (username, password) of both the native Facebook app (com.facebook.katana) and the stock browser on Android (com.android.browser) on a rooted phone via command line (which I call from my own app).</p><p>This is what I'm calling:</p><pre><code>rm /data/data/com.android.browser/cache/webviewCache/*rm /data/data/com.android.browser/databases/*killall -9 com.android.browserrm /data/data/com.facebook.katana/cache/webviewCache/*rm /data/data/com.facebook.katana/databases/*killall -9 com.facebook.katana</code></pre><p><strong>After I kill the facebook process, I check with ps and there is no FB process running anymore. I then restart FB via long-press on home and choosing the FB app. Previous username/password still show on the login screen (= same screen as I left it before I killed the app). When I then press 'back' on the device, and then start the app again via home long-press / select FB, the login screen is empty as it should. Where do the values for username/password come when I start FB again in the first place?</strong></p><p>I assume that the login activity still retrieves the <code>savedInstanceState</code>, but how could that be avoided - or else, where are those UI states actually stored, in order to delete them? But also, shouldn't the restarted app, after all it's processes are killed,  already be in a new lifecycle?</p><p>Same problem is with the stock browser: if i leave the browser and I'm on the login page of for example gmail.com where the username/password is entered (but form not submitted yet), then killing the browser process, the values (username) entered into the form will still be there after restarting the app again after it's been killed.</p>","241475","","213269","","2010-12-21 16:36:37","2010-12-21 16:36:37","UI state of activity not cleared when killing the activity while in background (on rooted phone)","<android><process><activity>","1","1","","",""
"4121138","1","4121199","","2010-11-08 03:56:02","0","74","<p>I write Windows/iPhone/Android apps that mostly display large documents (HTML) in an HTML container view.</p><p>What is a good strategy to determine where in a document the users has scrolled to so that when the app runs again, it goes to that location in the HTML document?</p><p>All of my software can 'listen' to javascript.</p><p>Is there a way to find in a HTML page, perhaps with javascript, where the visible section is?</p><p>Ian</p>","172861","","","","","2010-11-08 04:10:17","Design Strategy - Large HTML in apps bookmark location","<iphone><html><android><windows>","1","1","","",""
"4121181","1","5638695","","2010-11-08 04:06:48","0","239","<p>The <a href=""http://developer.android.com/"" rel=""nofollow"">Android developer documentation</a> has a very large header -- one that becomes obnoxious when I increase the font size in Chromium (because the whole things scales).</p><p>I <a href=""http://userscripts.org/scripts/review/82939"" rel=""nofollow"">found a UserScript</a> that reduces the size of the header. It works in Firefox, but I'm using Chromium (which has <a href=""http://www.chromium.org/developers/design-documents/user-scripts"" rel=""nofollow"">some support</a> for UserScripts). In Chromium, the script successfully reduces the height of the header, but doesn't extend the body. (There's a big blank area at the bottom of the screen.)</p><p>To get the script partially working in Chromium and I made two changes: change @include to @match and insert the @required javascript into my script. In the Chromium debugger, the last if (that does the resizing) is skipped.</p><p>I tried setting the height of the content in the script (after the if):</p><pre><code>$('#doc-content').height('auto');</code></pre><p>That looks right, but now there's no scrollbar. Adding overflow didn't help either:</p><pre><code>$('#doc-content').overflow('scroll');</code></pre><p>I don't really know what I'm doing (I'm new to js and jquery), but I hope that someone else will see <strong>why the Android docs body doesn't fill the empty space when I shrink the header</strong>.</p>","79125","","","","","2011-04-12 16:38:39","Chromium extension/userscript to shrink the Android Developer header","<android><userscripts><chromium>","1","0","","",""
"4121224","1","","","2010-11-08 04:16:29","0","277","<p>I need to be able to send my user to the default text messaging app's preferences to disable its vibration. How would I do this? I know I need an Intent but I do not know what parameters it needs.</p><p>If it's possible to change the vibration setting for the default text messaging app that'd be better, but I don't believe that's even possible with the security the way it is.</p>","166873","","166873","","2010-11-08 04:22:31","2010-11-08 04:22:31","Open Text Messaging Preferences in Android","<android><android-intent>","0","2","2","",""
"4121450","1","","","2010-11-08 05:16:32","8","10708","<p>I am getting an <code>ActivityNotFoundException</code> in the following code:</p><p>Main.java</p><pre><code>Intent intent = new Intent();     intent.setAction(""com.test.app.TEST"");     startActivity(intent); // ActivityNotFoundException</code></pre><p>Manifest.xml</p><pre><code>&lt;activity android:name="".MainActivity"" android:theme=""@android:style/Theme.Dialog""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.test.app.TEST"" /&gt;        &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","493363","","72882","","2012-12-19 10:15:58","2013-11-16 11:57:38","ActivityNotFoundException?","<android><android-intent>","7","0","2","",""
"4121508","1","5232809","","2010-11-08 05:30:17","23","22567","<p>I am creating the Android application where C2DM push notification is used. But i have a problem in creating the php code to use c2dm for sending messages. please guide me how to use the php code to send the messages. Actually there is a problem regarding this that how to get client auth token. I have seen the <a href=""http://code.google.com/android/c2dm/index.html#server"">http://code.google.com/android/c2dm/index.html#server</a> url but according to this i have created the android application and i got the registration id also and i also send to the user but how server uses this to send the application.</p><p>is there anything needed for the server from the android device to send the messages?.</p>","339116","","399890","","2010-12-09 16:50:18","2013-07-09 15:44:17","C2DM implementation PHP code","<php><android><push-notification><android-c2dm>","5","0","21","",""
"4121534","1","4124115","","2010-11-08 05:37:06","0","712","<p>my android application performance is low, it takes a long startup time. i have 5 buttons, one imageview, 3 textView, 2 editText and one listView initialized in onCreate() method. Is large number of ui object the reason for slow startup?? Is there any fault in 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.ars.application""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/lightvasicon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;activity android:name="".LightVas""              android:label=""@string/app_name""              android:screenOrientation=""portrait""               android:configChanges=""keyboardHidden|orientation"" &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-permissionandroid:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.ACCESS_MOCK_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.CONTROL_LOCATION_UPDATES""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre>","462695","","462695","","2010-11-08 12:29:50","2010-11-08 13:11:12","make android application performance better","<android>","1","9","","",""
"4121565","1","4125136","","2010-11-08 05:45:02","0","180","<p>I am implementing a language conversion tool, to convert Spanish to English, on a variety of smart phones: Android, BlackBerry, iPhone, Windows Phone 7.</p><p>How do I implement language conversions?  Searching, I am not finding a tutorial about this, and I don't having any experience with this.</p>","1746300","","75204","","2010-11-08 14:21:17","2010-11-08 15:18:18","Building a language translation tool for smart phones","<iphone><android><blackberry><windows-7>","1","1","","",""
"4121688","1","","","2010-11-08 06:21:50","0","256","<p>I want to open new child activity in the parent LinearLayout. Just similar like Tabs.</p><p>is this possible?</p>","309990","","302328","","2010-11-08 06:31:49","2010-11-08 06:31:49","May i open new activity in any layout","<android><activitygroup>","1","0","","",""
"4121757","1","","","2010-11-08 06:38:54","3","605","<p>I have this HTML.<pre><code>&lt;html>&lt;body>&lt;a href=""http://mydomain.com/video.mp4"">PLAY ME!!!!!&lt;/a>&lt;/body>&lt;/html></code></pre> So if somebody clicks on the link then native media player loads and browser goes into background and when video ends it comes to foreground with the same page. Is there a way to detect this i.e. browser going background and then coming foreground in the javascript?</p>","195802","","","","","2012-04-21 21:39:26","can javascript detect if android browser is in foreground or background?","<javascript><android><browser>","1","1","","",""
"4121957","1","4122565","","2010-11-08 07:23:04","1","3028","<p>I have two class as trial.java and ImageWoLab0.java(Image without lable 0).When I run my application I am getting error as : <strong>The application has stopped unexpectedly</strong>!!</p><pre><code>public void onClick(View v) {    switch (v.getId())     {    case R.id.btnSequence:        Intent intent1 = new Intent();        intent1.setClass(this,ImageWoLab0.class);       /*To open new Screen/Activity */        //intent1.putExtra(""String_key"", ""value"");  /*Passing a key/value(Condition) to Activity2.class*/        startActivity(intent1);                     /*open the new screen/Activity*/        break;    case R.id.btnVideo:        Intent intent2 = new Intent();        intent2.setClass(this,Activity2.class);        intent2.putExtra(""String_key"", ""value1"");        startActivity(intent2);        break;    case R.id.btnInfo:        Intent intent3 = new Intent();        intent3.setClass(this,Activity2.class);        intent3.putExtra(""String_key"", ""value2"");        startActivity(intent3);        break;    }</code></pre><p>othar class as: </p><pre><code>public class ImageWoLab0 extends Activity implements OnClickListener</code></pre><p>{    private static String TAG = ""tag"";</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    Log.i(TAG, ""abc"");    super.onCreate(savedInstanceState);    setContentView(R.layout.image0);    ImageButton o1 = (ImageButton) findViewById(R.id.next);    o1.setOnClickListener(this);}@Overridepublic void onClick(View v) {    switch (v.getId())     {    case R.id.next:        Intent intent1 = new Intent();        intent1.setClass(this,ImageWoLab1.class);        startActivity(intent1);        break;    }}</code></pre><p>}</p><p>I have clean again and again even rebuild again still the same messageis displaying. I am getting log as:sorry if I have not send log in right format(first time i am using logcat):</p><pre><code>11-08 12:48:55.084: INFO/tag(334): abc11-08 12:48:55.154: WARN/dalvikvm(334): threadid=1: thread exiting with uncaught exception (group=0x4001d800)11-08 12:48:55.204: ERROR/AndroidRuntime(334): FATAL EXCEPTION: main11-08 12:48:55.204: ERROR/AndroidRuntime(334): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.Trial/com.example.Trial.ImageWoLab0}: java.lang.ClassCastException: android.widget.ImageView11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.os.Handler.dispatchMessage(Handler.java:99)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.os.Looper.loop(Looper.java:123)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.ActivityThread.main(ActivityThread.java:4627)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at java.lang.reflect.Method.invokeNative(Native Method)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at java.lang.reflect.Method.invoke(Method.java:521)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at dalvik.system.NativeStart.main(Native Method)11-08 12:48:55.204: ERROR/AndroidRuntime(334): Caused by: java.lang.ClassCastException: android.widget.ImageView11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at com.example.Trial.ImageWoLab0.onCreate(ImageWoLab0.java:21)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)11-08 12:48:55.204: ERROR/AndroidRuntime(334):     ... 11 more11-08 12:48:55.264: WARN/ActivityManager(61):   Force finishing activity com.example.Trial/.ImageWoLab011-08 12:48:55.274: WARN/ActivityManager(61):   Force finishing activity com.example.Trial/.Trial</code></pre>","490953","","750987","","2011-06-17 00:04:17","2011-06-17 00:04:17","The application has stopped unexpectedly!","<android><android-intent>","2","0","","",""
"4121986","1","4636680","","2010-11-08 07:30:25","12","29158","<p>I come to you on bended knee, question in hand. I am relatively new to Android, so pardon any sacrilegious things I might say.  </p><p><strong>Intro:</strong> I have several layouts in the app, that all have to include a common footer. This footer has some essential buttons for returning to the home page, logging out, etc. </p><p>I managed to get this footer to appear in all the requisite pages with the help of the Include and Merge tags. The issue lies in defining on click listeners for all the buttons. Although I can define the listeners in every activity associated with screens that include the footer layout, I find that this becomes terribly tedious when the number of screens increases.</p><p><strong>My question is this:</strong> Can I define a button click listener that will work across the application, which can be accessed from any screen with the use of the <em>android:onClick</em> attribute of the Button? </p><p>That is to say, I would like to define the button click listener once, in a separate class, say <em>FooterClickListeners</em>, and simply name that class as the listener class for any button clicks on the footer. The idea is to make a single point of access for the listener code, so that any and all changes to said listeners will reflect throughout the application.</p>","151000","","","","","2011-01-08 23:05:51","Button Onclick Listener in included layouts","<android><layout><include><listeners><buttonclick>","3","0","4","",""
"4122008","1","","","2010-11-08 07:35:26","8","18383","<p>I followed these tutorials to set up a Hello World Android app. But when I create a new java project I can't select a build target. It just says no targets available in the target selection box. I have confirmed that I am not having the UI issue described here (http://blog.rowancrane.com/2009/12/27/eclipse-new-android-project-cant-select-build-type-target), I actually have a message in the box saying there are no targets instead of an empty box. I also am using 1920x1080 res.</p><p>I'm guessing that eclipse is just not aware of my Android Targets? I installed them in the android SDK manager and see them listed under installed packages in the Android SDK manager (1.1, 1.6, ..., 2.2)</p><p><a href=""http://fyi.oreilly.com/2009/02/setting-up-your-android-develo.html"">http://fyi.oreilly.com/2009/02/setting-up-your-android-develo.html</a>http://developer.android.com/resources/tutorials/hello-world.html</p><p>Any suggestions on how I can create the project and get started?Thanks in advance</p>","484444","","","","","2012-10-02 17:29:17","Android Build Target cant be selected in eclipse","<java><android><eclipse>","4","0","3","",""
"4122037","1","4122119","","2010-11-08 07:41:46","0","235","<p>I would like to create simple editor screen - similar to the ""Add Event"" screen on Samsung Galaxy S Calendar App. That screen looks totally like a PreferenceScreen, with each item (event name, event date etc.) in a separate row. But I'm pretty sure that all the data from that screen are not saved as a SharedPreferences.</p><p>So my question is: do you have any idea how to create screen that will look similar? Should I define ListView with custom view for each row in the list?</p>","500425","","","","","2010-11-08 07:58:59","Galaxy S - Calendar Add Event Screen","<android><android-layout>","1","0","","",""
"4122151","1","4122400","","2010-11-08 08:07:44","1","571","<p>I have a requirement where few of my image views form border areas of an application, and the application will be running on many screen sizes.I'll be creating a uniform image for the smallest size possible, which can be repeated as many times as needed, and still presents the same image.I want the image view to replicate the image contained whenever it is increased.</p><p>Is anything like this possible?</p><p>I tried 9-patch images, but I couldn't find nice articles on it which could explain how to create useful images with it which could suit my need.</p>","243709","","194309","","2011-07-07 08:40:32","2011-07-07 08:40:32","How to design ImageViews that stretch according to the screen-size","<android><android-imageview>","2","2","","",""
"4122226","1","","","2010-11-08 08:22:36","1","590","<p>my program is database program, when i run it,on consol i got message as follow, </p><pre><code>Uploading DataBase.apk onto device 'emulator-5554'[2010-11-08 13:48:03 - DataBase] Installing DataBase.apk...[2010-11-08 13:48:42 - DataBase] Success![2010-11-08 13:48:43 - DataBase] /DataBase/bin/DataBase.apk installed on device[2010-11-08 13:48:43 - DataBase] Done!</code></pre><p>but its not run, even its not shown android icon in emulator,so how come i run it, or how come i get icon on emulator</p><p>please help me,thanx in advance</p>","446298","","24054","","2010-11-08 08:32:46","2010-11-08 08:32:46","how to get activity icon in android mobile","<android><icons>","0","2","","",""
"4122346","1","4122380","","2010-11-08 08:49:32","0","879","<p>I want to change my Button shape to an oval like button. please Help me</p>","436765","","","","","2010-11-08 09:20:22","how to reshape the button android","<android>","2","1","","",""
"4122689","1","4132072","","2010-11-08 09:46:32","1","1464","<p>when tried to build a AIR application for android using flex builder  I did the following steps to do that .plz tell me where the error happened      </p><p>1.Created Air application using flex builder that produced two type of files .swf and .xml files and cetification file</p><p>2.Created apk file from the above files using ""Package assisstant pro""</p><p>3.then i installed AIR 2.5 run time in my emulator</p><p>4.after that  i tried to install the apk file that Created from the 'package assisstant pro' then i tried to install the apk file by  using command prompt then it show this error""INSTATTION FAILED INVALLID APK"" .And also i cann't install other apk file (Sample air for android application apk file that downloaded from the site) that shows the same error</p><p>I succeed to install other application's(Say for printing hello world) apk file</p><pre><code>enter code here</code></pre><p>package{    import flash.display.Sprite;    import flash.text.TextField;</p><pre><code>public class AndroidAndFlex extends Sprite{    public function AndroidAndFlex()    {        var textField:TextField = new TextField();        textField.text = ""Hello World"";        stage.addChild(textField);    }}</code></pre><p>}</p><p>xml file</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" standalone=""no""?&gt;</code></pre><p></p><pre><code>&lt;id&gt;AndroidAndFlex&lt;/id&gt;&lt;filename&gt;AndroidAndFlex&lt;/filename&gt;&lt;name&gt;AndroidAndFlex&lt;/name&gt;&lt;&lt;versionNumber&gt;1.0.0&lt;/versionNumber&gt;&lt;initialWindow&gt;    &lt;content&gt;AndroidAndFlex.swf&lt;/content&gt;     &lt;visible&gt;true&lt;/visible&gt;&lt;/initialWindow&gt;    &lt;supportedProfiles&gt;mobileDevice&lt;/supportedProfiles&gt;&lt;android&gt;     &lt;manifestAdditions&gt;    &lt;![CDATA[        &lt;manifest android:installLocation=""auto""&gt;            &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;            &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;            &lt;uses-configuration android:reqFiveWayNav=""true""/&gt;            &lt;uses-feature android:required=""false"" android:name=""android.hardware.touchscreen.multitouch""/&gt;            &lt;application android:enabled=""true""&gt;                &lt;activity android:excludeFromRecents=""false""&gt;                    &lt;intent-filter&gt;                        &lt;action android:name=""android.intent.action.MAIN""/&gt;                        &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;                    &lt;/intent-filter&gt;                &lt;/activity&gt;            &lt;/application&gt;        &lt;/manifest&gt;    ]]&gt;    &lt;/manifestAdditions&gt; &lt;/android&gt;</code></pre><p></p><p>some body plz help me out</p><p>thanks in advance</p>","482604","","482604","","2010-11-09 04:48:58","2013-07-16 01:31:45","error occured while installing AIR application for android using flex builder","<android><flex><flash><air><flash-builder>","1","1","1","",""
"4122814","1","4122884","","2010-11-08 10:02:54","0","777","<p>I want to show a ImageButton aligned left and a TextView aligned center in the same layout. But both are either appearing at the center or left. I have tried LinearLayout and RelativeLayout. Please suggest me the solution.Many thanks in advance.</p>","476747","","476747","","2010-11-08 10:13:02","2010-11-08 10:13:02","Alignment in Android","<android><layout><alignment>","2","0","","",""
"4122929","1","4998243","","2010-11-08 10:16:09","15","20377","<p>i want to disable the day selection option on the android sdk date picker. any easy xml configuration would be the best</p>","1460582","","","","","2014-03-23 05:44:19","How to display date picker for android with only month and year fields?","<android><sdk><datepicker>","6","2","7","",""
"4123015","1","4289464","","2010-11-08 10:27:46","4","883","<p>So I'm making a wallpaper and I want the user to select a folder. So Ihave a button in the preferences that launches an intent to open animage, but what I want is actually just a directory (I guess in theworst case i can strip the filename from the end). So that's my firstproblem: what's the best way to select a folder only?</p><p>The second problem is how do I get notified of when the intent iscomplete?</p><pre><code>public class FilePreference extends DialogPreference implements    View.OnClickListener{ public void onClick(View v) {  // open up a gallery/file browser  Intent intent = new Intent();  intent.setType(""image/*"");  intent.setAction(Intent.ACTION_GET_CONTENT);  getContext().startActivity(Intent.createChooser(intent, ""Select Folder"")); }</code></pre>","500564","","243245","","2010-11-08 10:31:23","2010-11-27 00:43:52","Select folder intent & Work out when intent complete?","<java><android>","2","0","","",""
"4123062","1","","","2010-11-08 10:36:16","0","922","<p>Hej, I'm trying to create an app that runs on a main thread, but also has a background loop running (to check for a connection).</p><p>I just want to call a certain function onCreate, and that function should run in the background...I've tried with the code below, but doesn't seem to work...any suggestions?</p><pre><code>    void doStuffBackground()    {      Thread testingForBluetooth = new Thread()     {      public void run()      {       try       {        for(int i = 0; i &lt; 100; i++)        {         writeTerminal('x');         sleep(100);        }       }       catch(Exception e)       {        Log.e(""Threading"", e.toString());       }       finally       {        finish();       }      }      };      }    }</code></pre><p>But again...not working?</p><p>Thanx in advance</p>","465721","","","","","2010-11-08 10:39:17","Android: how run simple background loop","<android><multithreading><loops><background>","1","0","","",""
"4123151","1","","","2010-11-08 10:50:44","1","174","<p>im writing a keyboard and there are a number of things i want to do:</p><p>1) i want to be able to dyamically resize the the keyboard view. Ihave a custom view for my keyboard, created by myInputMethodService.onCreateInputView</p><p>i've tried calling invalidate, requestLayout, forceLayout, on thekeyboard view, on its parent and on the view root but nothing seems tocall the onMeasure code again in my layout to allow it to resize.</p><p>2) i would also like to have a view group that goes over the editwindow and possibly over the rest of the screen. for example if theuser preses a button i want to draw above thier finger (which could beover the editor window) what the are pressing or some additionalinformation.</p><p>3) i would like to be able to disable the editor window and do this myself, so for example i can change how this functions</p>","500564","","","","","2010-11-08 10:50:44","keyboard - resizing viewgroup, overlaying viewgroups and custom editor view","<java><android>","0","0","","",""
"4123280","1","4123589","","2010-11-08 11:10:47","1","1177","<p>I want to write an app for my thesis that it will have some items/icons and i will drag'n'drop them in a box and then it will make a query in a database and return the result..but i can't find information on how to combine the drag'n'drop with the box...</p>","500604","","","","","2011-07-18 10:24:24","How to implement drag'n'drop app in Android","<android><drag-and-drop><ontouchlistener><android-image>","2","0","","",""
"4123317","1","","","2010-11-08 11:17:15","15","12357","<p>I have an app that uses cursor to select data via rawQuery from a sqlite db to populate a ListView in Android;. Every time the user clicks on a listview item I create a new instance of Activity to re-populate listview. Is it better to call <code>cursor.close()</code> and <code>db.close()</code> to avoid memory problems? I actually have <code>db.close()</code> in <code>OnDestroy()</code> of my activity.</p>","339500","","321731","","2014-03-19 05:02:26","2014-03-19 05:02:26","When to close cursor in Android?","<android><cursor>","2","1","1","",""
"4123333","1","4738996","","2010-11-08 11:21:09","1","795","<p>Not a total show stopper for my project, but I'm a little concerned at the performance of SQLITE when I am deleting a specific row from the database..  Sometimes it's taking up to 5 seconds which seems too long and I can imagine users may thing the application has crashed.</p><p>My code is very straightforward, the delete call is simply : </p><pre><code>boolean result;result = mDb.delete(ACCIDENTS_MEDIA_TABLE, ACCIDENTS_MEDIA_KEY_ROWID + ""="" + rowId, null) &gt; 0;</code></pre><p>So nothing odd there, the table is relative small in terms of fields (5) but 2 of those are blob fields so I'm wondering if that can be the reason.</p><p>If anyone has experience with this &amp; suggestions how to improve my performance so it's not taking up to 5 seconds to delete a row, that would be appreciated..  Thanks.</p><p>Rgds,</p>","333276","","","","","2012-01-18 12:08:55","Anyone found SQLITE 'delete' performance problems?","<android><sqlite>","2","3","","",""
"4123361","1","4123719","","2010-11-08 11:25:08","1","1818","<p>Whether i should should use sysout or Log.x en-order to debug an android project. I think both are writing to file. Me, commonly using sysout and use filter in LogCat to get it easily. But most of the tutorials and sample i see it is mainly using log.x    </p><p>What is its basic difference? any link or tutorial for that? Which is better to use?<br>Thanks</p>","477754","","477754","","2011-05-25 04:16:24","2011-05-25 04:16:24","android sysout and log","<android>","2","0","","",""
"4123420","1","","","2010-11-08 11:34:37","7","8280","<p>By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user).</p><p>I am able to see the file ""/data/data/package_name/files/ in file explore in DDMS, but when i attached the above file URI using imageUri in email , then i saw that attached file is of 0kb.i have used the default email APIs of Android.</p><p>Can anyone suggest me ,how to attach a file in email that is private to the application?</p><p>although i am successful able to save the file in SD card and attaching the file from SD card , this is working fine.</p><p>But if SD card is not available and saving the file to the internal storage , then how can i attach them in email.</p><pre><code>String FILENAME = ""hello_file.txt"";String string = ""hello world!"";FileOutputStream fos = openFileOutput(FILENAME,     Context.MODE_PRIVATE);fos.write(string.getBytes());fos.close();File imageFile = getFileStreamPath(FILENAME );Uri imageUri = Uri.fromFile(imageFile);final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""*/*"");emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,imageUri);this.startActivityForResult(Intent.createChooser(emailIntent, ""Send mail...""),SUB_ACTIVITY);</code></pre>","496856","","272824","","2010-11-08 11:42:07","2013-01-15 10:30:05","Android - not able to attach a file in email","<android><email><attachment>","6","5","4","",""
"4123505","1","5141112","","2010-11-08 11:45:32","5","1085","<p>I'm having a pig of a time creating a basic video capture feature in my application.  I want to call the default video capture tool my device and had the file saved to a specific location.</p><p>From the documentation this is achieved by providing a Uri in EXTRA_OUTPUT, however what's happening is this is completely being ignored and the video is actually being written to the usual media store location.</p><p>My code is very simple :</p><pre><code>      Intent i = new Intent( android.provider.MediaStore.ACTION_VIDEO_CAPTURE );      String SD_CARD_TEMP = Environment.getExternalStorageDirectory()         + File.separator + MEDIA_TEMP ;             i.putExtra( android.provider.MediaStore.EXTRA_OUTPUT, Uri.parse(SD_CARD_TEMP) );             startActivityForResult( i, ACTIVITY_CAPTURE_VIDEO );</code></pre><p>The constant MEDIA_TEMP is set to 'media_temp'.  I've also tried using a File rather than a string and using Uri.fromFile() but that made no difference.</p><p>If anyone has any ideas as to why this code isn't behaving as the docs say it should.. please tell me :-)</p><p>PS. Development is being carried out live on HTC Desire HD, not emulator..</p><p>Thanks,</p><p>Dave</p>","333276","","","","","2012-11-30 07:44:04","Video Capture ignoring EXTRA_OUTPUT dilemma","<android><video-capture>","3","1","","",""
"4123593","1","4123662","","2010-11-08 11:58:50","1","3322","<p>I'm using PhoneGap and Sencha Touch to display a form. I'm using an image as the button to submit it:</p><pre><code>&lt;img id='submit' src='button.png' /&gt;</code></pre><p>I'd like to then listen to it be clicked and validate the form. If I try the following it never seems to fire:</p><pre><code>Ext.get('submit').on('click', validateFn);</code></pre><p>Am I missing something obvious? Should I use <code>&lt;input type=""image"" ... /&gt;</code>?</p><p><strong>Update:</strong> For future viewers of this question it is worth noting that inconsistent click handling seems to be a bug or series of bugs in Android's WebView. There are <a href=""http://code.google.com/p/android/issues/detail?id=2887"" rel=""nofollow"">several</a> <a href=""http://code.google.com/p/android/issues/detail?id=8484"" rel=""nofollow"">unresolved</a> <a href=""http://code.google.com/p/android/issues/detail?id=8620"" rel=""nofollow"">bugs</a> on this topic.</p>","46768","","46768","","2010-11-09 08:47:40","2010-11-09 08:47:40","Does Android support click events in its WebView?","<android><phonegap><android-webview><sencha-touch>","1","3","","",""
"4123630","1","5910057","","2010-11-08 12:02:55","19","34475","<p>I am trying to put the zoom controls of the map on the bottom right corner of screen. I could do it with RelativeLayout using both <code>alignParentBottom=""true""</code> and <code>alignParentRight=""true""</code>, but with Framelayout I did not find any such attributes. How do I align it to the bottom-right of screen?</p>","481239","","","","","2013-07-20 12:00:13","Android: Align button to bottom-right of screen using FrameLayout?","<android><layout>","7","0","2","",""
"4123726","1","4123746","","2010-11-08 12:16:16","-1","99","<p>SDK-wise, which UI controls drive it</p>","30741","","918414","","2013-03-16 03:09:06","2013-03-16 03:09:06","How did Samsung implement the applications screen on the new Galaxy S phone?","<android><mobile>","2","1","","2013-03-16 03:59:37",""
"4123749","1","4124387","","2010-11-08 12:20:05","1","2386","<p>Here is the error I get:11-08 13:46:24.665: ERROR/Database(443): java.lang.IllegalStateException: /data/data/com.testproj/databases/Testdb SQLiteDatabase created and never closed</p><p>I can't find to manage a good reason for this, as it somethimes shows me the error sometimes not. Maybe I did something wrong in my code:</p><pre><code>public class SQLiteAssistant extends SQLiteOpenHelper{ public SQLiteAssistant(Context context)    {        super(context, DB_NAME, null, DB_VERSION_NUMBER);        this.myContext = context;    } public void openDataBase() throws SQLException{        String myPath = DB_PATH + DB_NAME;        myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);    }public void closeDataBase()    {        if(this.myDataBase != null)        {            if(this.myDataBase.isOpen())                this.myDataBase.close();        }    }   }</code></pre><p>In another class I do the queries, like:</p><pre><code>public class Db{      private static SQLiteAssistant sqlite;public static String getSomeString(Context ctx)    {        sqlite = new SQLiteAssistant(ctx);        sqlite.openDataBase();         Cursor cursor = sqlite.myDataBase.rawQuery(""SELECT someColumn from SomeTable"",null);         if (cursor != null) {            if (cursor.getCount()==1)            {                if(cursor.moveToFirst())                {                    String testString = cursor.getString(cursor.getColumnIndex(""someColumn""));                     cursor.close();                    sqlite.closeDataBase();                            sqlite.close();                                retunr testString                }            }         }         sqlite.closeDataBase();         sqlite.close();         return null;           }</code></pre><p>And now the problem, I start a new activity in which I get a AsyncTask. This task, gets data from a web service and accesses the database for the string. If I let the activity take its course, everything goes fine, if I don't and quickly press the back button, I get the leak found exception.</p><p>.... </p><pre><code>protected class BackTask extends AsyncTask&lt;Context, String, String&gt;    {        @Override        protected String doInBackground(Context... params)         {             try{                    //get requeste data from the database                        //access the web service            return result;                  } catch (Exception e) {                    return null;                  }                return null;        }</code></pre><p>Any ideas how to fix this ?</p>","379865","","","","","2010-11-08 13:56:11","Android SQLite database Leak Found","<android><database><sqlite>","2","0","0","",""
"4123759","1","","","2010-11-08 12:21:11","0","140","<p>While  Installing Android Packages i m getting This Error:: </p><p>XML verification failed for <a href=""http://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">http://dl-ssl.google.com/android/repository/repository.xml</a>.Error: schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema.</p><p>I am using JDK6update22 , ADT plugin 0.9.9 Eclipse 3.4 and android-sdk-windows r7... I Couldnt fix it ...Please Help me Out....</p><p>Thanx....</p>","392506","","392506","","2010-11-09 03:53:15","2010-11-09 03:53:15","Trouble installing Android on windows vista","<android>","0","2","","",""
"4123779","1","","","2010-11-08 12:24:22","0","549","<p>i have created an application and would like to provide a 30 days trial period for the same using licensing dll provided by android (http://developer.android.com/guide/publishing/licensing.html#support),but i cannot find how to restrict this licensing to 30 days from date of installation.</p><p>Thanks in advance.</p>","500659","","","","","2010-11-09 05:56:53","android how to implement licensing for 30 days using license dll?","<android>","1","0","","",""
"4123787","1","4123853","","2010-11-08 12:25:44","1","531","<p>Is there any way to get the user's email id from my app automatically.. instead of asking the user to register with his email id or something like that....</p><p>I want to know who all bought my app, and want their email-id's to send them more info via mail..</p><p>thanks in advance...</p>","367016","","","","","2012-05-21 09:22:46","Get users email id","<android>","2","1","","",""
"4123854","1","4124024","","2010-11-08 12:35:56","1","603","<p>I want to add some italic font and links into SMS using an android app. How would I achieve this?</p>","500674","","1108213","","2012-03-10 15:34:14","2012-03-10 15:34:14","Add italic font and link into a SMS using Android APP","<android><formatting><sms>","1","0","","",""
"4123858","1","4125206","","2010-11-08 12:36:18","1","1415","<p>im trying to make my android application send an email with an xml file as attachement. All is working fine except for the fact that the xml file I receive is empty. I checked to make sure the file isn't empty on my phone...</p><p>Here is the code I use to send the mail:</p><pre><code>Intent mailIntent = new Intent(Intent.ACTION_SEND);        mailIntent.setType(""text/Message"");        mailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {""someone@somewhere.com""});        mailIntent.putExtra(Intent.EXTRA_SUBJECT, ""MySubject"");        mailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file///sdcard/rapport.xml""));        startActivity(Intent.createChooser(mailIntent, ""Send it out!""));</code></pre><p>Thnx in advance!</p>","480536","","","","","2010-11-08 15:25:39","Send an xml file as attachment with android","<android><xml><email>","1","0","1","",""
"4123941","1","","","2010-11-08 12:47:10","0","710","<p>i am developing an Android App on which i get a list of events from DB and put them on a ListView; every item can be clicked to see event details and every detail can be clicked to see statistics on that detail ... what is the best approach for populating data? I have an activity that launches a new instance of the same activity to populate the new listview.</p><p>Is it the best thing to do or is it better to do in another way? I've done something similar in iPhone with the NavigationController and i would like to replicate the navigation forward-backward in Android</p><p>Thanks in advancec. </p>","339500","","","","","2010-11-08 13:03:47","Navigation app in Android","<android><navigation>","1","0","","",""
"4124097","1","","","2010-11-08 13:08:34","1","551","<pre><code>public static String openAssetFile(Context ctx) {BufferedReader br=new BufferedReader(new InputStreamReader(ctx.getResources().openRawResource(R.raw.hung)));String readLine;String sout="""";    try {        while ((readLine = br.readLine()) != null) {            sout+=readLine;        }    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }return sout;}</code></pre><p>this not work, its freezes, my xml file is about 300 kb. </p><p>how i can handle this?</p>","472537","","","","","2012-05-15 17:50:07","Android java open from assets->fast","<android><asset>","2","0","","",""
"4124205","1","4127898","","2010-11-08 13:23:50","5","1703","<p>I'm planning to develop a 2D game for Android devices without a dedicated GPU, like the HTC Wildfire. I remember from the PC that OpenGL is generally to be chosen over something like SDL for 2D graphics because of speed and features.</p><p>On Android, there are two APIs for graphics:</p><ul><li>A ""normal"" 2D API (does it have a name?)</li><li>OpenGL ES 2.0</li></ul><p>Which one should I favor for a 2D game that should run on Android devices without a dedicated GPU?</p>","500702","","44729","","2010-11-08 15:19:30","2010-11-08 20:45:25","2D API or OpenGL ES for an Android 2D game?","<android><graphics><opengl-es><2d>","1","0","1","",""
"4124229","1","","","2010-11-08 13:27:02","2","2138","<p>SQLite3 doesn't support stored procedures. Is it posible to write custom function on C/C++ and use it in SQL query?</p><p>Something like that</p><pre><code>SELECT * FROM table WHERE CUST_FUNCTION(name1, name2) = 1</code></pre><p>or</p><pre><code>SELECT CUST_FUNCTION(name1, name2) FROM table</code></pre><p>Maybe you have some good example how to do that.</p>","479211","","","","","2011-01-26 17:03:22","Android. Is it posible to write custom function on C/C++ and use it in SQL query?","<c++><sql><android><c>","3","2","2","",""
"4124357","1","4124397","","2010-11-08 13:43:03","1","548","<p>I'm developing an Android app for which we will be selling separate content in the Android Market.  Since Android lacks an in-app purchasing model as iOS has, I have come to understand that this is the ideal way of selling additional content (but NOT functionality) for Android apps.</p><p>So the question is, how do I actually load raw resources from other Android apps, assuming that I know the exact name of the resource, app ID, etc.?</p>","14302","","","","","2010-11-08 13:47:13","How can I load resources from another app?","<android><resources>","1","0","","",""
"4124368","1","4267213","","2010-11-08 13:43:51","3","1716","<p>I have my own <code>BroadcastReceiver</code> instance for <code>Intent.ACTION_HEADSET_PLUG</code> action. There is about 1-2 seconds delay between actual physical unplugging a headset and a moment when my <code>BroadcastReceiver</code> is notified about that.</p><pre><code>IntentFilter filter = new IntentFilter(Intent.ACTION_HEADSET_PLUG);filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY - 1);registerReceiver(new BroadcastReceiver() {  @Override  public void onReceive(Context context, Intent intent) {    // my code here  }}, filter);</code></pre><p>Any ideas how to decrease the delay?</p>","387710","","","","","2010-11-24 13:20:37","ACTION_HEADSET_PLUG broadcast delay","<android><broadcastreceiver><headset>","2","0","4","",""
"4124429","1","4589527","","2010-11-08 13:50:16","2","693","<p>I'm able to retrieve contact name and phone, but how to retrieve contact photo in one query?</p><pre><code>    String[] PROJECTION = new String[] { Contacts.People._ID, Contacts.PeopleColumns.NAME, Contacts.Phones.NUMBER };    Cursor c = a.managedQuery(Contacts.People.CONTENT_URI, PROJECTION, null, null, Contacts.People.DEFAULT_SORT_ORDER);    return (new SimpleCursorAdapter(a,             R.layout.list_row,             c,             new String[] { Contacts.PeopleColumns.NAME, Contacts.Phones.NUMBER  },             new int[] { R.id.toptext, R.id.bottomtext }));</code></pre>","296427","","","","","2011-01-04 00:00:27","How to bind contact name, phone and contact photo in SimpleCursorAdapter?","<android><contacts><adapter>","1","0","2","",""
"4124585","1","4124685","","2010-11-08 14:06:17","5","2754","<p>I have created a testing Google Analytics sample app as directed in on <a href=""http://code.google.com/mobile/analytics/docs/android/"" rel=""nofollow"">Google Analytics SDK for Android documentation</a> and I have initiated Tracking in my code using:</p><pre><code>tracker = GoogleAnalyticsTracker.getInstance();tracker.trackEvent(            ""Clicks"",  // Category            ""Button"",  // Action            ""clicked"", // Label            77);  </code></pre><p>And</p><pre><code>tracker.trackPageView(""/HomeScreen"");tracker.dispatch();</code></pre><p>I have created a Google Analytics account, In my account if go to Analytics setting tab. I am getting the status as ""Tracking Unknown""</p><p>I tried clicking on the edit and clicked check status, Then  too I am Getting <strong>""Tracking Not Installed""</strong></p><p>For Reference My code is:</p><pre><code>public class GAnalytics extends Activity {  GoogleAnalyticsTracker tracker;  @Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    tracker = GoogleAnalyticsTracker.getInstance();    tracker.start(""UA-19487404-1"",20, this);    setContentView(R.layout.main);    Button createEventButton = (Button)findViewById(R.id.NewEventButton);    createEventButton.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {        tracker.trackEvent(            ""Clicks"",  // Category            ""Button"",  // Action            ""clicked"", // Label            77);       // Value      }    });    Button createPageButton = (Button)findViewById(R.id.NewPageButton);    createPageButton.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {        tracker.trackPageView(""/HomeScreen"");      }    });    Button quitButton = (Button)findViewById(R.id.QuitButton);    quitButton.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {        finish();      }    });    Button dispatchButton = (Button)findViewById(R.id.DispatchButton);    dispatchButton.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {        tracker.dispatch();      }    });  }  @Override  protected void onDestroy() {    super.onDestroy();    super.onDestroy();    tracker.dispatch();    tracker.stop();  }}</code></pre><p>Please point me where I am doing wrong.</p>","28557","","309086","","2011-12-02 08:05:34","2012-07-12 07:58:53","Google Analytics - Tracking Unknown","<android><google-analytics><analytics><google-analytics-api>","3","0","","",""
"4124669","1","","","2010-11-08 14:19:33","0","1892","<p>I am new to Android, When I run the app it throws the following:</p><p>""The primitive type int of R.layout.main does not have a field out""</p><p>What am I doing wrong?</p><p>TIARicard</p>","500755","","91012","","2010-11-08 14:23:50","2010-11-08 17:50:56","The primitive type int of R.layout.main does not have a field out","<java><android><android-layout>","1","7","1","",""
"4124713","1","4124813","","2010-11-08 14:25:02","1","1585","<p>HI All,</p><p>I have Three activities . A, B &amp; C. Where A is a splash Activity and B Contains Login screen which consist of user Id and Password Text Field and one button to login. When i click on login it takes me to the welcome screen shows the user name on screen C.</p><p>Here i want to implement Shared Prefrence so that i can store the userid and password for the user so that user doesnt have to insert the userid and password again &amp; again and after spllash screen user directly go to welcome screen.</p><p>i read several documents about the shared prefrence and i came to know that there are two types of shared prefrence one is activity level and other one is appplication level.</p><p>PLease help me in this case how can i implement this...its very urgent pls..</p>","383597","","918472","","2012-01-21 12:35:42","2013-03-23 21:52:07","Shared Preference Android","<android>","2","0","","",""
"4124805","1","","","2010-11-08 14:38:05","7","16778","<p>Ive been looking for a week now...i need some help connecting to a remote database...i want my app to get data out of the database and update the database...ive tried this <a href=""http://www.helloandroid.com/tutorials/connecting-mysql-database"">http://www.helloandroid.com/tutorials/connecting-mysql-database</a> but i dont understand it.</p><p>Please help</p>","500770","","","","","2014-03-26 05:29:29","Connect to remote database...online database","<android>","4","0","3","",""
"4124861","1","","","2010-11-08 14:45:38","0","424","<p>I'm having some problem with screen resolutions in Android. </p><p>I found the problem when I first ran my application on a VGA AVD and the application's images did not occupy the % of the screen I was expecting them to. I tried to run it on HVGA and QVGA and found out that they all occupied the exact same % of the screen, as if the screen resolution was the same.</p><p>In fact, resolution was the same: I debugged my program and checked the width and height when onSizeChanged was called, and got the same values for all the AVDs (320 x 430, or 320 x 483 for wide resolutions). I created some AVDs and manually set their resolution, but the behavior did not change.</p><p>My activity's content view, that is giving me these wrong resolutions, is a class which inherits from View.</p>","500737","","","","","2013-01-09 09:31:55","Android - Strange behavior with different screen resolutions","<android><activity><screen><resolution><vga>","2","4","","",""
"4124886","1","4126019","","2010-11-08 14:48:24","1","4165","<p>Can anyone direct me to an tutorials which will help me in reading the tweets using android sdk for a  a specific user. </p><p>All I want to accomplish is read the tweets and display it preferably using JSON output of tweeter api.</p><p>I don't need to post any tweets. I am newbie to sdk. Any help on this is greatly appreciated.</p><p>Thanks in advance ....</p>","500783","","","","","2010-11-08 16:52:29","Android SDK Twitter client","<android><api><twitter><sdk>","2","0","","",""
"4124977","1","4126163","","2010-11-08 14:57:20","3","1226","<p>I'm just starting to get the hang of animations, tweened animations that is.I have made several imageviews with pictures rotating and moving, and its all very fun, but I don't know what the best approach for doing multiple animations is.</p><p>For example I created a LinearLayout and stuck some ImageViews in it and wrote this:</p><pre><code>RotateAnimation imgrotate = new RotateAnimation(0,360,           RotateAnimation.RELATIVE_TO_SELF,0.5f,           RotateAnimation.RELATIVE_TO_SELF,0.5f);           rotate.setDuration(2000);           someview.setAnimation(imgrotate);           someview.startAnimation(imgrotate);</code></pre><p>for each imageview. So they all spin. But now I want to step it up a gear. But reaidng other sources on the net it seems some people use canvas to do animations. What is the best way?</p>","485498","","","","","2010-11-08 17:16:06","Multiple animations in Android","<android><animation><canvas>","1","1","2","",""
"4125129","1","","","2010-11-08 15:17:05","0","590","<p>I'm trying to figure out, if it's possible to use GestureDetector for LinearLayout or just ScrollEvent?</p><p>Any Examples?</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2012-10-16 08:25:58","LinearLayout and GestureDetector","<android>","1","0","","",""
"4125171","1","","","2010-11-08 15:21:45","2","579","<p>Hi i have an AsyncTask in my application called in OnCreate() that retrieve some data over the web and display an indeterminate progress bar while downloading.</p><p>The problem is when i start the app the screen remain  blank until the AsyncTask is finished.The code is something like that.</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    loadData();    //Several UI Code       startAsyncTasks();} private void startAsyncTasks(){    new ConnectingTask().execute(); }</code></pre>","491535","","","","","2012-03-17 10:16:43","Android AsyncTask and","<android><android-asynctask><oncreate>","1","3","1","",""
"4125185","1","4142648","","2010-11-08 15:23:15","3","3224","<p>I have this Listview element:</p><pre><code>&lt;ListViewandroid:id=""@+id/category_list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_weight=""1""android:background=""@drawable/list_background"" android:layout_marginTop=""10sp"" android:layout_marginLeft=""10sp"" android:layout_marginRight=""10sp""android:drawSelectorOnTop=""false""android:listSelector=""@drawable/list_item_background""           android:cacheColorHint=""#FFFFFF""            android:clipToPadding=""true""android:focusable=""true""android:focusableInTouchMode=""true""     android:clickable=""true""    android:longClickable=""true""android:footerDividersEnabled=""true""android:headerDividersEnabled=""true""android:dividerHeight=""1px""/&gt;</code></pre><p>where list_background is:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;corners android:radius=""10dp"" /&gt;     &lt;solid android:color=""#FFFFFF""/&gt; &lt;/shape&gt; </code></pre><p>The list view loads itself with the rounded corners, but then, the items of the list hide the round corners.</p><p>What am I doing wrong?</p>","448660","","","","","2010-11-10 08:50:28","Android: ListView rounded corner hidden by list item","<android><listview><rounded-corners>","2","1","0","",""
"4125395","1","4125733","","2010-11-08 15:46:00","0","207","<p>How can i do that, from a simple way?</p>","472537","","","","","2010-11-08 16:22:51","Android/java cut all <pre>asdf</pre> from xml","<android><string><cut>","1","0","","2012-11-20 02:22:59",""
"4125524","1","4125591","","2010-11-08 16:01:29","1","5942","<p>I see there is a <code>TextAppearanceSpan</code> available but no examples on usage. I just want to make the text bold and leave everything else unchanged - is there perhaps a simpler way to do this programmatically?</p>","246793","","29995","","2012-05-05 15:33:28","2012-12-02 10:00:02","Way to set text style programmatically in Android widget?","<android><text><coding-style><widget>","2","1","","",""
"4125546","1","11488495","","2010-11-08 16:03:31","5","311","<p>How can I do that? My current code is shown below:</p><pre><code>final NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);Notification notification = new Notification(R.drawable.stat_sys_warning, System.currentTimeMillis());    notification.defaults |= Notification.DEFAULT_SOUND;notification.flags |= Notification.FLAG_AUTO_CANCEL;Intent notificationIntent = new Intent(Intent.ACTION_MAIN, Uri.EMPTY, context, Activity....class).putExtra(...);PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);notification.setLatestEventInfo(context, title, text, contentIntent);manager.notify(1, notification);</code></pre>","463304","","463304","","2012-05-04 01:05:03","2012-07-15 00:37:19","Android: Vibrate in accordance with selection checked in Sound Settings > General","<android><notifications><vibrate>","1","0","1","",""
"4125570","1","","","2010-11-08 16:06:14","1","702","<p>Hey guys,I've downloaded a Froyo Rom from the address below:<a href=""http://froyo-vodafone845.googlecode.com/files/Froyo%20ROM%20fastboot.rar"" rel=""nofollow"">http://froyo-vodafone845.googlecode.com/files/Froyo%20ROM%20fastboot.rar</a></p><p>for more information, visit here: <a href=""http://code.google.com/p/froyo-vodafone845/downloads/detail?name=Froyo%20ROM%20fastboot.rar&amp;can=2&amp;q="" rel=""nofollow"">http://code.google.com/p/froyo-vodafone845/downloads/detail?name=Froyo%20ROM%20fastboot.rar&amp;can=2&amp;q=</a></p><p>After downloading, I extracted it, then copied ""System.img"" file to my <code>.android/avd/${avd_name}</code> folder. But when emulator booted up, I found ""no service"" icon with a cross displayed on the top bar :(, I tried to reboot emulator several times but problem remained.</p><p>PS: It works fine if I use the official ROM in SDK.</p>","500840","","114770","","2010-11-08 16:08:52","2010-11-09 01:52:51","I got ""no service"" on android emulator when using a customized rom","<android><networking><emulator><disconnected>","0","1","","",""
"4125616","1","4127244","","2010-11-08 16:10:42","4","1805","<p>All the examples I've found online for displaying a gallery of images require creating a custom Adapter and doing a ton of manual work.  Is there not an Intent that I can simply pass a path or filter to in order to reuse the default image gallery functionality (display thumbnails, touch to view full pic, sharing options, etc) but limit the results to my application's storage directory?</p>","53501","","","","","2011-08-10 07:34:31","Reusing default Android image gallery?","<java><android><image><gallery>","2","0","1","",""
"4125774","1","4125877","","2010-11-08 16:26:09","14","74746","<p>Is there a way to specify an alternative background image/color for a Button in the XML file that is going to be applied <code>onClick</code>, or do I have to do a <code>Button.setBackground()</code> in the <code>onClickListener</code>?</p>","488054","","435093","","2012-11-29 06:46:19","2013-06-19 12:01:52","Make an Android button change background on click through XML","<android><onclick><android-button>","3","1","10","",""
"4125786","1","","","2010-11-08 16:27:38","2","749","<p>I have an application with a sliding drawer view. My problem is that in the drawer activity layout I have a list view that reaches the bottom of the screen where the sliding drawer handle is. so the last element in the list can not be seen, because the handle overlaps it. How could I fix this?</p><p>Thanks in advance!</p>","460611","","","","","2011-01-04 08:48:40","Place view above Sliding drawer handle","<android>","1","0","2","",""
"4125821","1","","","2010-11-08 16:31:47","21","12805","<p>I am currently working on an experimental camera app. I'm looking into implementing face detection at the moment and am currently weighing up my options.</p><p>I have considered the OpenCV port available for Android and using their face detection functions, but from demos I have seen of previous implementations, the camera seems to lag a lot.</p><p>Considering the camera on the HTC Desire has face detection support, I know it must be possible to get at least a semi-decent face detection system in place. I was just wondering if anyone had an opinion on how I could get the best results... Using an available library? Implementing a particular algorithm myself?</p>","500896","","496830","","2011-05-19 19:22:30","2011-05-19 19:26:07","Face Detection in Android?","<android><opencv><camera><face-recognition>","2","0","17","",""
"4126035","1","4375901","","2010-11-08 16:54:16","1","3220","<p>Android 2.3 is coming out soon. I was curious if anyone knew if android 2.3 will have support for adhoc networking without rooting or at least support it better with rooting? The list of stuff added for 2.3 just said bug fixes, i was wondering if anyone knew what bugs they were fixing or had a link to a list.</p><p>Thanks</p>","427763","","","","","2011-02-27 11:22:12","Android 2.3 and Adhoc","<android>","4","5","1","",""
"4126195","1","4128561","","2010-11-08 17:13:30","5","2083","<p>I have set up Eclipse to run as smoothly as possible because I was having a lot of problems with it running out of memory in my last machine. One of the configurations was to have it automatically refresh the workspace every time I save. I don't know if that is the problem but I thought I's mention it.</p><p>Here's a screenshot of the error:</p><p><img src=""http://i.stack.imgur.com/gw1IT.png""/></p><p>It happens every time I open Eclipse and save anything. I was also having another problem with  something to do with my workspace being compliant with Java 1.6 when I need 1.5. But then I switched and the problem went away. This problem then popped up.</p><p>Does anyone know any solution to this because it is really getting annoying now.</p>","348261","","231917","","2010-11-08 22:15:06","2011-10-22 06:08:06","Problem with Eclipse while programming for android - ""Refreshing external folders""","<android><eclipse><refresh><save>","5","1","","",""
"4126324","1","4126349","","2010-11-08 17:29:12","4","741","<p>When an Android device is tilted and goes from portrait to landscape mode, do the values returned in the DisplayMetrics object (i.e., from getDisplayMetrics()) reflect that in that widthPixels now has the larger dimension and heightPixels the smaller?</p>","446874","","","","","2010-11-08 17:32:24","Android Display Metrics in Landscape Mode","<android>","1","0","1","",""
"4126353","1","4126429","","2010-11-08 17:32:47","6","4317","<p>How do I set up an xml layout where an OpenGL view is part of it?  As I do now is set the OpenGL view as the only view with setContentView().  But I would like to create an xml layout that includes the OpenGL view.  Lets say I want to have the OpenGL view mainly and a small TextView at the bottom.</p><p>Is this even possible?  Or can an OpenGL view only be the one and only view?</p>","324943","","","","","2013-11-19 03:30:46","OpenGL view inside a layout","<android><opengl-es>","3","0","2","",""
"4126363","1","","","2010-11-08 17:33:43","1","367","<p>I am developing One Application,In my application,send mail with attachment image using Intent,That is working fine,but save as draft button disable in mail application,i want to enable save as draft button for every mail.</p><p>Thanks </p>","500595","","302328","","2010-11-08 17:36:15","2010-11-08 17:36:15","How can i enable save as draft button email usign android coding?","<android><android-intent>","0","5","","",""
"4126387","1","4126496","","2010-11-08 17:37:07","5","2667","<p>I need to be able to be able to call readAsset from outside of the main activity of my application.  I have heard people mention needing to pass the Context around, but the language has been very vague.  Can someone describe the steps necessary to add the ability to call readAsset to an existing class that is not the main activity?  Creating a public function in the main activity and having others call that will not work as the place I need to add readAsset to, is in a separate thread.  </p>","500964","","","","","2010-11-08 17:52:36","Android How to read an asset from outside of main activity","<android><assets>","1","2","1","",""
"4126544","1","","","2010-11-08 17:58:53","1","374","<p>I use a ProgressBar in one of my activities as this:</p><pre><code>&lt;ProgressBar android:id=""@+id/mProgressBar""  style=""?android:attr/progressBarStyleLarge"" android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" android:layout_gravity=""center"" /&gt;</code></pre><p>My problem is that when I leave the activity (for example press the back button or start a new activity) and return back, the progress bar is shown stopped.</p><p>I am using this library (http://code.google.com/p/mobyfactory-uiwidgets-android/) for hosting my activities into a tab host.</p><p>I suppose the UI thread pauses, so the progress bar animation stops too. Any ideas how to solve it? </p>","470006","","","","","2010-11-08 17:58:53","ProgressBar stops moving at activity resume using ScrollableTabHost","<android><progress-bar>","0","0","","",""
"4126590","1","","","2010-11-08 18:04:20","2","2525","<p>I have an Android app with a splash screen.</p><p>This splash screen pre-loads data and when finished starts the application's main activity and finishes (through a finish() call).</p><p>This works quite well as long as the application is not totally killed. So, I can usually switch back and forth between different tasks as usual: when I leave the app from a sub activity and return soon after I will be presented with this sub activity.</p><p>Now, when I leave this sub activity and do some other stuff for a while inevitably this application process is killed by the OS.</p><p>No problem so far. Now I would expect Android, being unaware of my preloading (if the data was not preloaded it would just take longer or not display some fonts, but Android cannot be aware of the fact that I am doing preloading somewhere), to restore the sub activity from a Bundle. However the splash screen activity is started.</p><p>So, I say, that's fine then... the splash screen activity is after all the launcher / main activity. Now, the actual mystery I have is as follows.</p><p>When I press the back-button from this newly loaded splash screen I will be presented with the sub activity I left the application from before it got killed. I really don't understand this. Apparently Android DID save the sub activity's state (and its history stack) to be reloaded but instead of reloading it chose to start the splash screen instead, with this sub activity (I left the task earlier before it got killed) one step back on the activity stack.</p><p>Why does this happen?</p><p>When the process is not killed I can switch back to where I left off. When it's killed I cannot (yet still have the whole earlier history of that app restored). I know that Android has to load state etc. in the latter case, but that shouldn't be a problem and is performed automatically by default (according to the docs).</p><p>P.S. I am not doing anything fancy. Default launch flags, no overwritten state restore methods etc.</p>","371306","","371306","","2010-11-08 18:09:22","2012-06-02 07:32:36","Android Activity with splash screen restart and the back button mystery","<android><activity><splash-screen><back>","2","1","1","",""
"4126625","1","4126746","","2010-11-08 18:08:39","20","24996","<p>In android, how to send a file(data) from mobile to server using http.</p>","412168","","296427","","2010-11-08 19:06:51","2014-02-06 07:20:37","How to send a file in Android from mobile to server using http?","<android><http><post>","4","1","24","",""
"4126647","1","","","2010-11-08 18:10:53","0","1687","<p>i'm working on a API, and i want to take the json data that is display in an adress like this : <a href=""https://api.empireavenue.com/profile/info/?apikey=YOURAPIKEY&amp;username=TICKER&amp;password=PASSWORD"" rel=""nofollow"">https://api.empireavenue.com/profile/info/?apikey=YOURAPIKEY&amp;username=TICKER&amp;password=PASSWORD</a></p><p>and take this data to display it on my app .Thanks.</p>","439058","","","","","2010-11-08 18:46:24","i want to retrieve json data via url with android","<android><json><http><url>","1","2","","",""
"4126726","1","4127255","","2010-11-08 18:20:04","0","805","<p>pretty clear fromt the title, so far I've tried different coordinates but here is an example of what happens:</p><pre><code>telnet localhost &lt;port&gt;Trying ::1...Trying 127.0.0.1...Connected to localhost.Escape character is '^]'.Android Console: type 'help' for a list of commandsOKgeo fix 46.498981 11.350230OK</code></pre><p>while in the logcat I found this couple:</p><pre><code>46.491002 11.351833366666664</code></pre><p>when I give this coordinate I read in the logcat from my class implementing location listener (and others for double check):</p><pre><code>public class LocationService implements LocationListener {private static final String TAG = ""LocationService"";public LocationManager lmr = null;private Navigation SystemService = null;public LocationService(Navigation sservice) {    this.SystemService = sservice;}public void startLocationService() {    Log.d(TAG, ""starting LocationService"");    this.lmr = (LocationManager) this.SystemService            .getSystemService(Context.LOCATION_SERVICE);    this.lmr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 3000, 5,            this);}public void stopLocationService() {    this.lmr.removeUpdates(this);}/* * (non-Javadoc) *  * @see * android.location.LocationListener#onLocationChanged(android.location. * Location) */@Overridepublic void onLocationChanged(Location location) {    location = this.lmr.getLastKnownLocation(LocationManager.GPS_PROVIDER);    try {      // this code is used to make a location used from the server I am communicating with out of a android.location        eu.fbk.dycapo.models.Location loc = new eu.fbk.dycapo.models.Location();        Log.d(TAG, ""longitude : "" + location.getLongitude());        Log.d(TAG, ""latitude : "" + location.getLatitude());        loc.setGeorss_point(String.valueOf((double) location.getLongitude())                + "" "" + String.valueOf((double) location.getLatitude()));        loc.setLeaves(Calendar.getInstance().getTime());        loc.setPoint(eu.fbk.dycapo.models.Location.POSI);     //send it to the server         LocationService.updatePosition(loc);    } catch (NullPointerException e) {        Log.e(TAG, e.getMessage());        e.printStackTrace();    }}/* * (non-Javadoc) *  * @see * android.location.LocationListener#onProviderDisabled(java.lang.String) */@Overridepublic void onProviderDisabled(String provider) {    // TODO Auto-generated method stub}/* * (non-Javadoc) *  * @see * android.location.LocationListener#onProviderEnabled(java.lang.String) */@Overridepublic void onProviderEnabled(String provider) {    // TODO Auto-generated method stub}/* * (non-Javadoc) *  * @see android.location.LocationListener#onStatusChanged(java.lang.String, * int, android.os.Bundle) */@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {    // TODO Auto-generated method stub}</code></pre><p>I think there's something it might be wrong somewhere but I don't understand where nor why, since I've followed android guidelines to implement location listeners <a href=""http://developer.android.com/guide/topics/location/obtaining-user-location.html"" rel=""nofollow"">here</a>.<br/>thanks</p>","201058","","","","","2010-11-08 19:27:13","android geo fix coordinate differs from the ones actually read","<android><maps><location>","1","0","","",""
"4126802","1","","","2010-11-08 18:29:57","0","136","<p>I am new to android and have been teaching myself how to create apps through the android developers website.  My app itself is like a recipe book.  It lets me add my favourite recipes to a database so therefore where ever I am I am able to see what ingredients and the method for creating my favourite dishes.  The list is getting rather long now so I was wondering if there was a way to search through a list like you do for contacts in your phone book. This would make things a lot easier for me.</p><p>Thanks in advance</p>","501014","","","","","2010-11-08 18:54:07","How do you search a list for recipe's in my application","<android>","2","1","","",""
"4126815","1","4126928","","2010-11-08 18:31:46","12","6524","<p>I'm having a little difficulty configuring Android logging. Here's what my code looks like:</p><pre><code>    if (Log.isLoggable(""MY_TAG"", Log.VERBOSE)) {        Log.v(""MY_TAG"", ""Here's a log message"");    }</code></pre><p>Pretty simple, right?</p><p>However, I'm having quite a bit of difficulty getting the <code>Log.isLoggable(""MY_TAG"", Log.VERBOSE)</code> to return true.</p><p>Per <a href=""http://developer.android.com/reference/android/util/Log.html"">http://developer.android.com/reference/android/util/Log.html</a>, I tried adding a local.prop file to the /data/ directory which looks like this:</p><pre><code>log.tag.MY_TAG=VERBOSE</code></pre><p>but no luck. I also tried:</p><pre><code>System.setProperty(""log.tag.MY_TAG"", String.valueOf(Log.VERBOSE));</code></pre><p>but that doesn't work either.</p><p>Any ideas on what I'm doing wrong here? I'm running Android 2.1-update1 on a Nexus 1 if that makes any difference.</p>","208427","","125389","","2013-01-02 22:22:01","2013-09-01 08:59:21","Android logging levels","<android><logging><nexus-one>","4","0","8","",""
"4126909","1","","","2010-11-08 18:44:59","0","637","<p>I seem to be having a problem with Android ListView. I'm trying to delete the selected item from ListView. The delete method is working and will allow me to delete as many items from my list as needed, but whenever I scroll to the bottom of the list (after atleast 1 item has been deleted) I get an Error that closes the Application. </p><p><strong>Here is my code:</strong></p><pre><code>public class MainActivity extends Activity {   private String[] mRoute;   @Override   public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     mRoute = getResources().getStringArray(R.array.countries);     ListView list = (ListView)findViewById(R.id.list);     ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.listitem,     mRoute);     list.setAdapter(adapter);     registerForContextMenu(list);  }  @Override  public boolean onContextItemSelected(MenuItem item) {        AdapterView.AdapterContextMenuInfo info  (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();        int menuItemIndex = item.getItemId();        String[] menuItems = getResources().getStringArray(R.array.menu);        String menuItemName = menuItems[menuItemIndex];        String listItemName = mRoute[info.position];        // Remove String From List          List&lt;String&gt; routeArrayString = new ArrayList&lt;String&gt;(Arrays.asList(mRoute));    routeArrayString.remove(listItemName);    mRoute = routeArrayString.toArray(mRoute);        //Generate new ListView        ListView list = (ListView)findViewById(R.id.list);    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.listitem, mRoute);    list.setAdapter(adapter);       registerForContextMenu(list);        return true;        }</code></pre><p>Any ideas? Thanks in advance.</p>","483185","","","","","2010-11-08 21:48:18","Problem with Android ListView after Items are removed","<android><listview>","2","2","","",""
"4127132","1","4127210","","2010-11-08 19:13:30","1","4556","<p>On clicking a certain MenuItem in a Options Menu in Android, I need to change the title of a different MenuItem in the same Menu. What is the way to do this?</p><p>When a MenuItem in an options menu is clicked, onOptionsItemSelected(MenuItem menuitem) is called.You can change the title of the MenuItem which is passed as a parameter in the onOptionsItemSelected(MenuItem menuitem), but not of any other MenuItem. I need to know how to change the title of a MenuItem that is not passed as parameter to onOptionsItemSelected(), but which belongs to the same Menu.</p><p>I did not find a way to get handle to containing Menu inside the onOptionsItemSelected method (which is called when any MenuItem is clicked).</p><p>Many Thanks.</p>","223363","","223363","","2010-11-08 19:55:12","2012-10-27 15:54:38","In Android, how to change the title of a different MenuItem inside onOptionsItemSelected()","<android>","5","0","","",""
"4127362","1","4128222","","2010-11-08 19:41:06","0","1285","<p>I'm trying to implement the LVL (Licensing Verification Library for Android), but running into a problem when the license check fails. I pop up a Dialog which explains that the license check failed and presents them with two buttons. One button is ""Retry"" which I want to immediately do another check or ""Purchase App"" which redirects them to buy the app on the App Market.</p><p>When I tap the Retry button, I can see from logging messages that my licensing check is called, I receive another ""dont allow"" callback and I try to show the above failure dialog again (I see onPrepareDialog() get called again).</p><p>The problem is the second dialog doesn't actually show. So the user can use the app even though the license check failed. Why isn't the dialog popping up again and again?</p><p>I believe this is all of the relevant code:</p><p><code><pre>private void checkLicense() {    Log.d(TAG, ""Checking License..."");    this.licenseChecker.checkAccess(this.licenseCheckerCallback);}</p><p>private class MyLicenseCheckerCallback implements LicenseCheckerCallback {    public void allow() { }</p><pre><code>public void dontAllow() {    Log.d(TAG, ""License resposne: Don't Allow"");    if (isFinishing()) {        // Don't update UI if Activity is finishing.        return;    }    // Should not allow access. In most cases, the app should assume    // the user has access unless it encounters this. If it does,    // the app should inform the user of their unlicensed ways    // and then either shut down the app or limit the user to a    // restricted set of features.    // In this example, we show a dialog that takes the user to Market.    Log.d(TAG, ""Showing No License Dialog"");    showDialog(DIALOG_NO_LICENSE_ID);}public void applicationError(ApplicationErrorCode errorCode) {    if (isFinishing()) {        // Don't update UI if Activity is finishing.        return;    }    // This is a polite way of saying the developer made a mistake    // while setting up or calling the license checker library.    showDialog(DIALOG_APPLICATION_ERROR_ID);}</code></pre><p>}</p><p>protected Dialog onCreateDialog(int id) {    Dialog dialog;    Log.d(TAG, ""Creating Dialog ""+id);    switch(id) {        case DIALOG_NO_LICENSE_ID:            dialog = this.makeRetryPurchaseDialog(getString(R.string.no_license));            break;        case DIALOG_APPLICATION_ERROR_ID:            dialog = this.makeRetryPurchaseDialog(this.applicationErrorMessageForDialog);            break;        default:            dialog = null;    }    return dialog;}</p><p>private Dialog makeRetryPurchaseDialog(String message) {    AlertDialog.Builder builder = new AlertDialog.Builder(CalculatorTabActivity.this);    builder.setMessage(message)           .setCancelable(false)           .setPositiveButton(""Retry"", new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int id) {                    CalculatorTabActivity.this.checkLicense();               }           })           .setNegativeButton(""Purchase App"", new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int id) {                    CalculatorTabActivity.this.openAppMarket();               }           });    return builder.create();}</pre></code></p>","416631","","","","","2010-11-08 21:25:09","Show one Dialog after another until License check passes","<android><licensing><dialog>","1","1","1","",""
"4127421","1","","","2010-11-08 19:48:31","2","692","<p>I come from a Ruby on Rails background and started doing some Android programming.</p><p>I'm looking for a way to get a list of all objects in a class using Java.</p><p>In Rails you can do something like Building.all  and it'll return an array of  all created buildings</p><p>Is there something like that in Java? </p><p>If so, can you post a little example that would return an array of building objects for a Building class?</p>","501085","","1420197","","2013-01-09 16:58:15","2013-01-09 16:58:15","Getting all objects belonging to a class","<java><android><reflection>","3","1","0","",""
"4127433","1","4127483","","2010-11-08 19:50:01","0","127","<p>So I was wondering where I could find a tutorial for how to have a user click on a button on the main page of my app, and pull up the camera to take a picture.  I then simply need the picture to save as a bmp and for the program to scan the picture and use the face recognition API to recognize the face taken, and return the parameters of it.</p><p>Could anyone please show me where to get started - first and foremost I need the code that will open the camera from a button click and have the user snap a pic and save the bmp.</p><p>Thanks!</p>","496686","","","","","2010-11-08 19:55:24","Need help Camera API help","<android><camera><bmp>","1","0","","",""
"4127446","1","","","2010-11-08 19:50:49","12","34292","<p>I am using tabs in my Android app, and I have run into this problem when running the app on HTC Sense phones:</p><p><a href=""http://stackoverflow.com/questions/3647821/android-highlighted-tab-of-tabwidget-not-readable-on-htc-sense"">Android: Highlighted tab of TabWidget not readable on HTC Sense</a></p><p>The solution suggested there (setting android:targetSdkVersion to 4) does not fix the problem for me, nor do I want to set the target sdk to 4.</p><p>I have instead tried solving this problem my creating my own tab widget style, and modifying the text color. The problem is that there is no noticable difference when I use my own style; i.e. the style does not appear to be applied to the tabs.</p><p>This is the code for the main activity, holding the tabs:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.tab);    tabHost = getTabHost();    tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""Tab 1"").setContent(new Intent(this, Tab1.class)));    tabHost.addTab(tabHost.newTabSpec(""tab2"").setIndicator(""Tab 2"").setContent(new Intent(this, Tab2.class)));    tabHost.setCurrentTab(0);}</code></pre><p>This is my tab.xml. Notice that I have specified MyTabStyle as style for TabWidget:</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            style=""@style/MyTabStyle""            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>And this is my definition of MyTabStyle, which I have defined in res/values/styles.xml:</p><pre><code>&lt;style name=""MyTabStyle"" parent=""@android:style/TextAppearance.Widget.TabWidget""&gt;    &lt;item name=""android:textColor""&gt;#5DFC0A&lt;/item&gt;&lt;/style&gt;&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            style=""@style/MyTabStyle""            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Why do no changes in MyTabStyle show up in my app? Any other solutions to solving the invisible text on selected tabs in HTC Sense?</p><p><strong>UPDATE 2011-06-02</strong></p><p>I managed to solve this in a sort of hacky way, by using the knowledge that the text on the tabs are actually TextViews. Add the following method to your activity:</p><pre><code>private void setTabColor(TabHost tabHost) {    try {        for (int i=0; i &lt; tabHost.getTabWidget().getChildCount();i++) {            TextView tv = (TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs            if (tv != null) {                tv.setTextColor(Color.parseColor(""#ffffff""));            }            TextView tv2 = (TextView) tabHost.getCurrentTabView().findViewById(android.R.id.title); // Selected Tab            if (tv2 != null) {                tv2.setTextColor(Color.parseColor(""#000000""));            }        }    } catch (ClassCastException e) {        // A precaution, in case Google changes from a TextView on the tabs.    }}</code></pre><p>Add the following in your onCreate() method in your activity:</p><pre><code>// Only apply the fix if this is a HTC device.if (android.os.Build.MANUFACTURER.toLowerCase().contains(""htc"")) {    // Set up the color initially    setTabColor(tabHost);    // Add a tab change listener, which calls a method that sets the text color.    tabHost.setOnTabChangedListener(new OnTabChangeListener() {        public void onTabChanged(String tabId) {            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);            imm.hideSoftInputFromWindow(tabHost.getApplicationWindowToken(), 0);            setTabColor(tabHost);        }    });}</code></pre>","445329","","445329","","2012-08-04 13:48:02","2012-12-25 23:26:50","Custom style for Android's TabWidget","<android><android-widget>","4","0","7","",""
"4127575","1","4127656","","2010-11-08 20:05:38","2","512","<p>In my project i am making big changes on pixels of a bitmap and i want to add undo redo feature to this project.Sincesaving several bitmaps on VM's memory is not a good idea i thought my only choice is storing history(bitmaps) as temp files.Before starting to implement i want to be sure i am doing something not stupid here.</p>","458678","","","","","2010-11-08 20:48:47","is it good idea to store bitmaps as temp files to implement undo and redo feature?","<android><memory><bitmap><virtual-machine><undo-redo>","3","0","","",""
"4127725","1","4127830","","2010-11-08 20:24:41","55","81594","<p>How can I remove a button in Android, or make it invisible?</p>","371301","","435093","","2012-10-24 12:23:50","2013-12-05 22:28:46","How can I remove a button or make it invisible in Android?","<android><android-button>","7","0","17","",""
"4127741","1","4128455","","2010-11-08 20:25:53","0","1545","<p>Hopefully, this is a newbie question with a quick answer...</p><p>I am attempting to add a simple preferences file in a new Android project (New -> Android XML File), but it doesn't appear to be working correctly.</p><p>There is no root element to choose from when I select the Preference type layout.  If I press Finish, it doesn't do anything.  See screenshot below.</p><p>Thanks,wTs</p><p><img src=""http://i.stack.imgur.com/2baHR.png"" alt=""alt text""></p>","285417","","","","","2010-11-08 21:55:08","Unable to add Preferences.xml (Android Preferences in XML)","<android><preferences><android-preferences><android-xml>","3","4","","",""
"4127803","1","","","2010-11-08 20:33:12","2","1159","<p>I'm not looking for exact code here, just a direction on what to look for and what I should be reading about so I can figure this out.</p><p>I have a layout that I would like to remain static, with only the listview changing depending on what's selected from the list.  I've reloaded data in the list, but I would like the fancy transition animations between choices, and would like the app to go to the previous menu when pressing back.</p><p>Someone suggested using a viewswitcher, which seems like it'd be great, but I am still unsure about how to fill a listview in a layout with a regular row layout, then on selection do an animated transition to a custom row.  Also, it seems the viewswitcher is limited to two views, so it may be a limitation when I want to go a few menus deeper.</p><p>Preferably, I'd like to put each menu in it's own class so that I can handle filling it in that class, if possible...</p><p>Hope this isn't too vague, but if it is I'll be more than happy to explain myself further.</p>","475901","","","","","2011-06-09 14:28:31","Android - switching between listviews without changing the layout?","<java><android><listview><viewswitcher>","1","1","","",""
"4127857","1","4127974","","2010-11-08 20:41:07","1","1409","<p>I have a few little questions regarding GPS in Android:</p><ol><li><p>How can I determine whether GPS is available on the device?</p></li><li><p>I found several links for determining the coordinates of the current location. Is there any way to determine the city/state/country based on these coordinates?</p></li></ol>","332311","","496830","","2011-11-08 13:11:58","2011-11-08 13:11:58","How can I determine whether GPS is available? Also, how can I determine city/state/country based on GPS coordinates?","<android><gps>","1","2","","",""
"4128013","1","","","2010-11-08 20:58:47","1","1526","<p>I have added a widget and instead of updating it every xxx minutes, I want to update it only if something is changed in my Activity.</p><p>But, how can I call the <code>onUpdate</code> routine of my widget from my activity?</p>","242070","","1951708","","2013-12-24 10:33:32","2013-12-24 11:07:27","Android Widget - Update from my Activity","<android><android-widget>","2","2","","",""
"4128111","1","","","2010-11-08 21:12:05","-1","924","<p>I have a layout with dynamic content. It has a variable number of textviews. On each textview I have to attach an event, a click event.</p><p>I have to pass to that event some kind of information to know what textview has been clicked exactly.</p><p>How can I pass this kind of information or how is the android way to do it?</p><p>Thanks</p>","306833","","","","","2010-11-08 21:17:11","android dynamic layout with variable textviews and events","<android><layout><dynamic><textview>","1","0","","",""
"4128129","1","","","2010-11-08 21:15:00","0","258","<p>I hav converted .png to .r file but i want to convert .r file to .565 file for android fastboot.</p>","412168","","","","","2010-11-08 21:15:00","How to convert .r file to .565 file in Android?","<android>","0","3","","",""
"4128151","1","4128704","","2010-11-08 21:17:18","0","307","<p>Hy my code:</p><pre><code>            WebView webView = new WebView(this);        webView.getSettings().setJavaScriptEnabled(true);        webView.loadUrl(""http://www.preisjaeger.at"");        setContentView(webView);</code></pre><p>The site the i downloaded appers on the Webview, but only the content for mobile devices.</p><p>So my Question: How to deactivate the mobile content?</p>","422039","","","","","2010-11-08 22:23:27","Deactivate Mobile Content from Website in WebView","<android>","1","0","","",""
"4128214","1","","","2010-11-08 21:23:36","1","65","<p>I'm working on an application for Samsung Galaxy 5 with Android 2.2-update1 that has various EditText fields and I noticed that all EditText fields below the middle of the screen is not repainted correctly when the user is typing: all the characters appear chopped, leaving their half top plain white. I've tested this on other devices and this problem does not happen on them.Any clues on why this happen and/or any workaround for this for the Galaxy 5?</p><p>EDIT: This issue happens with the API Demos that comes with the Android SDK. To reproduce this error execute the demo and then follow: App-> Search-> Invoke Search -> click on App Data and start writing, only the lower half of each character will be rendered on screen.</p><p>Thanks!</p>","501172","","501172","","2010-11-09 18:48:43","2010-11-09 18:48:43","EditText cropping characters while editing","<java><android>","0","8","","",""
"4128267","1","","","2010-11-08 21:32:23","1","5071","<p>I am trying to find out how I can add an item (from xml drawable/workaround_item.xml) in a LinearLayout that is vertically aligned.</p><p>  </p><pre><code>    &lt;LinearLayout        android:layout_width=""100dp""        android:layout_height=""fill_parent""        android:orientation=""vertical""        android:layout_alignParentLeft=""true""        android:gravity=""center_vertical""&gt;                    &lt;ImageView             android:id=""@+id/home_image""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true"" /&gt;                   &lt;TextView            android:id=""@+id/home_team""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""             android:gravity=""center_horizontal""            android:textStyle=""bold""            android:textSize=""12sp""            android:textColor=""#fff""/&gt;              &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:orientation=""vertical""        android:gravity=""center_vertical""        android:layout_centerHorizontal=""true""&gt;        &lt;TextView             android:id=""@+id/game_cship""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""             android:gravity=""center_horizontal|center_vertical""            android:textStyle=""bold""            android:textSize=""10sp""/&gt;                       &lt;TextView             android:id=""@+id/game_score""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""             android:gravity=""center_horizontal""            android:textStyle=""bold""            android:textColor=""#fff"" android:textSize=""24sp""/&gt;                  &lt;TextView             android:id=""@+id/game_date""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""             android:gravity=""center_horizontal""            android:textStyle=""bold""            android:textSize=""10sp""/&gt;               &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_width=""100dp""        android:layout_height=""fill_parent""        android:orientation=""vertical""        android:gravity=""center_vertical""        android:layout_alignParentRight=""true""&gt;                               &lt;ImageView             android:id=""@+id/away_image""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true"" /&gt;                   &lt;TextView             android:id=""@+id/away_team""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""            android:gravity=""center_horizontal""            android:textStyle=""bold""            android:textSize=""12sp""            android:textColor=""#fff"" /&gt;         &lt;/LinearLayout&gt;</code></pre><p></p><p>At the beggining I was trying to use a ListView but as far I as know there is a bug using listview inside a scrollview. I was doing this because i have more components on the view that should be scrolled together with the list view. So I decided to remove the listview and implement a simple linear layout where i will be adding each element bellow other and so on.</p><p>The layout for the activity is as folow (layout/workaround.xml) and i would like to start adding the elements below the top bar.</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:id=""@+id/linearid"" &gt;&lt;/LinearLayout&gt;</code></pre><p>Thats my java code:</p><pre><code>public class DemoActivity3 extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.workaround);    LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    LinearLayout ll = (LinearLayout) this.findViewById(R.id.linearid);    for(int i = 1; i&lt; 15; i++) {                View item = inflater.inflate(R.layout.workaround_item, null);        TextView x = (TextView) item.findViewById(R.id.game_score);        x.setText(""Score"" + i);        TextView ht = (TextView) item.findViewById(R.id.home_team);        ht.setText(""HomeTeam"" + i);        TextView at = (TextView) item.findViewById(R.id.away_team);        at.setText(""AwayTeam""+i);        ImageView hi = (ImageView) item.findViewById(R.id.home_image);        hi.setImageResource(R.drawable.gremio);        ImageView ai = (ImageView) item.findViewById(R.id.away_image);        ai.setImageResource(R.drawable.goias);        ll.addView(item,ViewGroup.LayoutParams.WRAP_CONTENT);    }       }</code></pre><p>Thats the result i am getting: <a href=""http://twitpic.com/3562yu"" rel=""nofollow"">http://twitpic.com/3562yu</a></p><p>Does android allow us to do this? If so, Hoe can I add the elements and set their values? (this layout will be dispalying results of soccer games).</p><p>Many ThanksT</p>","491604","","491604","","2010-11-08 23:58:53","2014-04-06 11:47:51","Adding item to view programatically in android","<android>","3","0","","",""
"4128331","1","","","2010-11-08 21:41:03","0","1862","<p>Hi again earlier i asked about adding images and text and i was told to put it in to a xml.  Now my text goes farther than the xml is there a way i can add a scroll to it or will i have to go about another route to get the effects i need. thanks again.</p>","496483","","","","","2010-11-08 22:09:16","scrolling a xml","<android><xml><scroll>","1","2","","",""
"4128493","1","4146900","","2010-11-08 22:00:31","1","12739","<p>I wrote an android app and so far it works perfect except for on one phone.  It is the exact phone that I have with 2.2 on both phones and mine works perfect.  The other phone is getting force close all the time but only when opening an activity that queries my image DB and tries to show a gallery.  Every activity crashes in the same place, the viewimages.  At first I thought it was the intent that was doing it but one of the activitys does not have the intent, it opens the images below the gallery.  This works on the emulator, on my moto droid and on a few other different droids.  Here is the code for the gallery and my bitmap decoder.  The error is below that.  If anyone can see anything that would make it crash I would really appreciate the help.  </p><pre><code>public void viewimages() {    String [] proj={ImageProvider._ID, ImageProvider.IMAGE, ImageProvider.TABLENAME,            ImageProvider.ITEMID, ImageProvider.IMAGEDATE};    cursor = managedQuery(ImageProvider.CONTENT_URI,        proj,        ImageProvider.TABLENAME + ""="" + ""'"" + Tablename + ""'""    + "" and "" + ImageProvider.ITEMID + ""="" + ""'"" + ID + ""'"",        null,        ImageProvider.IMAGEDATE);</code></pre><p>Line 182 ->       column_index = cursor.getColumnIndex(ImageProvider._ID);</p><pre><code>    g = (Gallery) findViewById(R.id.gallery);    g.setAdapter(new ImageAdapter(this));    g.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {            cursor.moveToPosition(position);            ImageID = cursor.getLong(column_index);            Intent i = new Intent(LivestockDetails.this, ImageViewer.class);            i.putExtra(""id"", ImageID);            startActivity(i);        }    });}private Bitmap decodeFile(String file){    Bitmap b = null;    //Decode image size    BitmapFactory.Options o = new BitmapFactory.Options();    o.inJustDecodeBounds = true;    BitmapFactory.decodeFile(file, o);    int scale = 1;    if (o.outHeight &gt; IMAGE_MAX_SIZE || o.outWidth &gt; IMAGE_MAX_SIZE) {        scale = 2 ^ (int) Math.ceil(Math.log(IMAGE_MAX_SIZE / (double) Math.max(o.outHeight, o.outWidth)) / Math.log(0.5));    }    //Decode with inSampleSize     BitmapFactory.Options o2 = new BitmapFactory.Options();     o2.inSampleSize = scale;     b = BitmapFactory.decodeFile(file, o2);     return b; }public class ImageAdapter extends BaseAdapter {    int mGalleryItemBackground;    public ImageAdapter(Context c) {        mContext = c;        TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);        mGalleryItemBackground = a.getResourceId(                R.styleable.Gallery1_android_galleryItemBackground, 0);        a.recycle();    }    public int getCount() {        return cursor.getCount();    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        if (convertView == null) {            String [] proj={ImageProvider._ID, ImageProvider.IMAGE, ImageProvider.TABLENAME,                     ImageProvider.ITEMID, ImageProvider.IMAGEDATE};            cursor = managedQuery(ImageProvider.CONTENT_URI,                proj,                ImageProvider.TABLENAME + ""="" + ""'"" + Tablename + ""'""                + "" and "" + ImageProvider.ITEMID + ""="" + ""'"" + ID + ""'"",                null,                ImageProvider.IMAGEDATE + "" DESC"");            column_path = cursor.getColumnIndex(ImageProvider.IMAGE);            column_index = cursor.getColumnIndex(ImageProvider._ID);            cursor.moveToPosition(position);            String filename = cursor.getString(column_path);            java.io.File file = new java.io.File(filename);            if(!file.exists()) {                ImageID = cursor.getLong(column_index);                getContentResolver().delete(ImageProvider.CONTENT_URI,                        ImageProvider._ID + ""="" + ImageID, null);                Toast.makeText(LivestockDetails.this,                        ""There are missing images.  They have been removed from the database."" ,                        Toast.LENGTH_LONG).show();                viewimages();            }            else {                                  Bitmap bitmapOrg = null;                bitmapOrg = decodeFile(filename);                Matrix matrix = new Matrix();                matrix.postScale(scale,scale);                resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,                        bitmapOrg.getWidth(), bitmapOrg.getHeight(), matrix, true);                Drawable delete = i.getDrawable();                if(delete!= null) {                    ((BitmapDrawable)i.getDrawable()).getBitmap().recycle();                    i.setImageBitmap(resizedBitmap);                }                else {                    i.setImageBitmap(resizedBitmap);                }                i.setScaleType(ImageView.ScaleType.FIT_XY);                i.setLayoutParams(new Gallery.LayoutParams(240, 180));                i.setBackgroundResource(mGalleryItemBackground);            }        }        return i;    }}</code></pre><p>Here is the error</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{myaquarium.logger/myaquarium.logger.LivestockDetails}: java.lang.NullPointerExceptionat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)at android.app.ActivityThread.access$2300(ActivityThread.java:125)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4627)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.NullPointerExceptionat myaquarium.logger.LivestockDetails.viewimages(LivestockDetails.java:182)at myaquarium.logger.LivestockDetails.onCreate(LivestockDetails.java:71)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)... 11 more</code></pre>","447560","","447560","","2010-11-09 22:33:50","2010-11-10 16:57:37","Android java.lang.RuntimeException: Unable to start activity ComponentInfo","<android><cursor><onclick><gallery>","1","4","","",""
"4128506","1","4136657","","2010-11-08 22:01:56","4","4567","<p>The webserver wants to get info like screen size from each mobile handset that browses a webpage.  The Javascript functions screen.width and screen.height return wildly inaccurate values.</p><p>Is there a way for the webserver to detect the screen size of the mobile handset?   The client browser is webkit on Android.</p>","253661","","","","","2012-10-19 00:30:32","Android how to sniff screen size from webkit browser?","<android><webkit><client><screen>","3","4","3","",""
"4128589","1","4128799","","2010-11-08 22:11:37","49","31053","<p>This has me stumped, I was using this in Android 2.1-r8 SDK:</p><pre><code>ProgressDialog.show(getApplicationContext(), ....);</code></pre><p>and also in </p><pre><code>Toast t = Toast.makeText(getApplicationContext(),....);</code></pre><p>using <code>getApplicationContext()</code> crashes both <code>ProgressDialog</code> and <code>Toast</code> .... which lead me to this question:</p><p>What is the actual differences between a activity context and application context, despite sharing the wording 'Context'?</p>","206367","","","","","2013-06-22 05:56:49","Difference between Activity Context and Application Context","<android><context>","1","2","21","",""
"4128633","1","4129165","","2010-11-08 22:15:59","0","335","<p>I would like to pass a value from the AppWidgetProvider to a service. How can I do that? This value is taken from the widget configuration. If this value changes (by going to the configuration again), how do I pass it back to the service? Is there another way to do this? </p><p>Thanks</p>","501223","","","","","2010-11-08 23:42:39","Android: How to pass a value from an AppWidgetProvider to a service?","<android><configuration><widget>","1","0","","",""
"4128660","1","4128736","","2010-11-08 22:19:13","3","2332","<p>I am prepared to be humiliated on this, but I am not sure what is wrong.  I am just playing around with Android development and am just making a simple application that will print out accelerometer to a TextView.  </p><p>When creating the SensorEventListener, I get a syntax error</p><p>(says ; is needed to finish statement)</p><p>exact code in question:</p><pre><code>    private SensorEventListener listener = new SensorEventListener() {    public void onSensorChanged(SensorEvent e) {        if (e.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {            xAxis = e.values[0];            yAxis = e.values[1];            zAxis = e.values[2];            if (xThreshold &gt; xAxis || yThreshold &gt; yAxis || zThreshold &gt; zAxis) {                alertUser(values);            }            else {                nonAlert(values);            }        }    }}</code></pre><p>here is full code if needed</p><pre><code>    import android.content.Context;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;public class TiltMeter {    private SensorManager mgr = null;    private double xAxis = 0;    private double yAxis = 0;    private double zAxis = 0;    private double xThreshold = 0;    private double yThreshold = 0;    private double zThreshold = 0;    public TiltMeter(Context context, double xThreshold, double yThreshold, double zThreshold, TiltMeter.Callback cb) {        this.xThreshold = xThreshold;        this.yThreshold = yThreshold;        this.zThreshold = zThreshold;        mgr = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);        mgr.registerListener(listener, mgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_UI);    }    private SensorEventListener listener = new SensorEventListener() {        public void onSensorChanged(SensorEvent e) {            if (e.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {                xAxis = e.values[0];                yAxis = e.values[1];                zAxis = e.values[2];                if (xThreshold &gt; xAxis || yThreshold &gt; yAxis || zThreshold &gt; zAxis) {                    alertUser(values);                }                else {                    nonAlert(values);                }            }        }    }    public void close() {        mgr.unregisterListener(listener);    }    public interface Callback {        double[] alertUser(double[] data);        double[] nonAlert(double[] data);    }}</code></pre><p>and here is the activity:</p><pre><code>   import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.TextView;public class TiltMeterActivity extends Activity      implements TiltMeter.Callback {    /** Called when the activity is first created. */    TiltMeter tiltMeter = null;    TextView tvXAxis;    TextView tvYAxis;    TextView tvZAxis;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        tvXAxis = (TextView)findViewById(R.id.txtXAxisValue);        tvYAxis = (TextView)findViewById(R.id.txtYAxisValue);        tvZAxis = (TextView)findViewById(R.id.txtZAxisValue);    }    @Override    public void onDestroy() {        super.onDestroy();        tiltMeter.close();    }    public double[] alertUser(double[] data) {        tvXAxis.setText(Double.toString(data[0]));        tvYAxis.setText(Double.toString(data[1]));        tvZAxis.setText(Double.toString(data[3]));        return null;    }    public double[] nonAlert(double[] data) {        tvXAxis.setText(Double.toString(data[0]));        tvYAxis.setText(Double.toString(data[1]));        tvZAxis.setText(Double.toString(data[3]));        return null;    }}</code></pre><p>thanks for any help.  this is my reference:  <a href=""https://github.com/commonsguy/cw-advandroid/tree/cfc3cd00626ace17f512d5b4a2975defcfd94029/Sensor/Shaker/src/com/commonsware/android/shaker"" rel=""nofollow"">reference project</a></p>","481030","","","","","2010-11-08 22:26:01","Android SensorEventListener syntax","<android><instantiation><sensor>","1","0","","",""
"4128733","1","4129020","","2010-11-08 22:25:39","0","681","<p>Is it possible to refer to an external file [not present in the res/raw folder of the app] in a WebView? The documentation [and the StackOverflow questions] I've read so far doesn't deal with this question.</p><p>Can I load an image on external storage, say /sdcard/abc.jpg using the img tag and the loadData() method of a WebView? I've tried doing that, but the image is not displayed. Another example would be a .js file on external storage being used with a WebView. Is this possible, or is WebView restricted to referring only to local files?</p><p>Thanks in advance</p>","293847","","750613","","2012-06-25 13:45:57","2012-06-25 13:46:07","Using external files in WebView","<android><file><webview>","1","0","","",""
"4128788","1","","","2010-11-08 22:32:38","0","658","<p>In my app I am playing some mp4 audio files. But sound quality is to bad. There are any ways to improve it programmaticaly? Maybe with help some native libraries or anything else. Now I am using google code from example</p><pre><code>MediaPlayer mp = new MediaPlayer();mp.setDataSource(PATH_TO_FILE);mp.prepare();mp.start();</code></pre><p>IF I playing this file on my computer with PC Audio Player quality is much better.Thanks.</p>","423868","","1228","","2013-11-14 21:29:41","2013-11-14 21:29:41","There are any ways to improve android media player audio quality?","<android><audio><media-player>","0","2","","",""
"4128877","1","","","2010-11-08 22:45:09","1","815","<p>Im trying to place an image and some text in my view, with the image being twice the height of the text so that the two rows of text can be placed next to the image, like so:</p><pre><code> _____|     |text here|_____|text here</code></pre><p>The way i try to do this is to put the two TextViews in a LinearLayout, then place the ImageView and the LinearLayout, containing the text, in a TableLayout with one row and two columns.</p><p>When i do this i only se the ImageView. In fact, even when i comment out the adding of the ImageView to the table the text inside the LinearLayout wont show up at all.</p><p>Any help with the code or different approaches to the layout is greatly appreciated.</p><pre><code>LinearLayout tempVindLayout = new LinearLayout(this);    tempVindLayout.setOrientation(LinearLayout.VERTICAL);    tempVindLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    TableLayout tabellLayout = new TableLayout(this);    tabellLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    tabellLayout.setPadding(0, 60, 0, 0);    TableRow row1 = new TableRow(this);    row1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    // Textview saturday    TextView tempSat = new TextView(this);    tempSat.setText(""+13"");    tempSat.setTextAppearance(this, R.style.RegularSmall);    tempSat.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    // Wind saturday    TextView vindSat = new TextView(this);    vindSat.setText(""5 m/s"");    vindSat.setTextAppearance(this, R.style.RegularSmall);    vindSat.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    //Image for weather icons    ImageView imgSat = new ImageView(this);    imgSat.setImageResource(R.drawable.solmoln);    imgSat.setAdjustViewBounds(true);    // Add to table    tempVindLayout.addView(tempSat);    tempVindLayout.addView(vindSat);    row1.addView(tempVindLayout);    row1.addView(imgSat);    tabellLayout.addView(row1);    setContentView(tabellLayout);</code></pre>","501260","","","","","2012-04-05 10:30:56","Problem with placing a LinearLayout inside a TableLayout","<android><android-layout>","2","1","","",""
"4129015","1","4129456","","2010-11-08 23:08:24","0","262","<p>I am trying to incorporate some sample code I pulled from a site into my existing project.  I click a button in my project, and I want that to link to the class file that I imported into my project.</p><p>Initially, the project I imported automatically launched their own file upon startup, whereas I need my project to automatically launch my main.xml file.  I changed around the manifest and the class file to point to a new .xml (rather than main) so as to not point to the wrong xml file.</p><p>The program runs fine but when I click the button that I want to open the imported .java file it tells me:  The application...has stopped unexpectadely.   Please try again.</p><p>Is there something I might be missing in fine tuning the code to have what I imported be a sub-class that can only be accessed on a click rather than the main class?</p><p>Thanks for any help.</p>","496686","","21234","","2010-11-08 23:25:58","2010-11-09 00:37:50","Linking a button click to existing class files","<android><button><linker>","1","1","","",""
"4129100","1","4129679","","2010-11-08 23:24:50","5","976","<p>I have been programming for Android with decent success, but one thing I have noticed is that when I get NullPointerExceptions the stack trace is worthless.  They are always of this format:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception NullPointerException))      ViewRoot.draw(boolean) line: 1431       ViewRoot.performTraversals() line: 1163     ViewRoot.handleMessage(Message) line: 1727      ViewRoot(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4627        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]      Method.invoke(Object, Object...) line: 521      ZygoteInit$MethodAndArgsCaller.run() line: 868      ZygoteInit.main(String[]) line: 626     NativeStart.main(String[]) line: not available [native method]  </code></pre><p>Usually stack traces tell you right where the code blew up, but I always seem to get the most generic one possible.  Am I missing something obvious?  Thanks.</p>","469106","","166712","","2010-11-08 23:27:07","2010-11-09 01:25:02","Android: Generic Null Pointer Exceptions","<java><android><stack-trace>","2","0","","",""
"4129143","1","4129289","","2010-11-08 23:35:52","3","8516","<p>I am running into a peculiar issue with an app which has multiple Activities.  I have a screen manager class that is bound to a service.  The service polls a server for data.  The screen manager starts Activity A, B, or C, based on the data. It will also allow the user to select to display the other Activities or it may swap out an Activity automatically based on new data from the service.  Currently all the navigation works great and if the user presses Home, the applicable Activity comes back to the foreground when the user presses the apps icon from the Android home screen or the recently run apps list.  </p><p>I then had to implement a new feature to display an icon and notification.  I first implemented this by only displaying the notification when the Activities were no longer visible by setting it in each Activities onPause.  Worked like a charm and gave the user a third option to redisplay the app after Home button press.  However if the data from the server (when the app is not displayed) causes the screen manager to update the Activity to be displayed I have issues.  I think my Activity stack is getting screwed up.  I have since tried a little different model where the screen Manager handles the notifications and always displays the notification, updating it with a new Intent whenever an Activity is updated, but its still not cutting it.</p><p>When the app is minimized and the data changes I can see the screen manager call the startActivityForResult on the new Activity and it seems like Android knows we are minimized and does not display the Activity.  I can then also the screen Manager call to finish on the old top Activity.</p><p>Each Activity currently has the flag set to singleTop in the manifest and FLAG_ACTIVITY_SINGLE_TOP in the code.  When the data hasn't changed on the server, I pull the app back up using any of the above I get what I expect and the Activity's onNewIntent is called.  However when the data has changed and the user calls up the app via the notification it calls the Activities onCreate.  The Activity does come up and runs, but then pressing back takes me to what seems like another instance of the same Activity instead of exiting.  I just took a closer look at my logcat and I see 2 calls to the Activity's onResume, but then no doubles after that.</p><p>I feel like maybe I'm just missing something simple like another intent flag on the notification's Intent?  Thanks for any ideas!</p>","418714","","418714","","2010-11-09 02:41:03","2010-11-09 02:41:03","Android, what Intent flags are recommended for Activities started by Notifications","<android><notifications>","1","0","2","",""
"4129195","1","","","2010-11-08 23:49:21","2","337","<p>I'm new to developing with Android, and the biggest new thing is the way the UI is rendered (relative to other views instead of absolute locations and sizes).  As a result, I've been experimenting a <em>lot</em> with layouts, and find myself changing 1 view or even just 1 property of a view, then having to recompile and launch it back into the emulator to see the result.  Is there a tool that quickly (or at least quicker) shows what a UI looks like give a layout xml file?</p>","501294","","","","","2010-11-09 01:53:42","Android layout render without compiling","<android><android-layout>","3","1","","",""
"4129333","1","","","2010-11-09 00:15:10","0","567","<p>I have an activity with an EditText on top and a ScrollView with a LinearLayout inside it.</p><p>The LinearLayout is populated in the onCreate method with a set of dynamic views based on an object passed with the initiating Intent.  This is typically a set of EditTexts.</p><p>The result is a list of EditTexts each corresponding to a different piece of data (and the dataset being edited is quite variable, so the list needs to be created dynamically like this).</p><p>The problem is, when one of these views has focus, and the orientation changes (say the user flips out the keyboard to type), the focus snaps to the EditText at the very top of the Activity.  This is certainly undesired behavior as the user didn't intend to type in the top EditText when he/she flipped out the keyboard.</p><p>How can I dynamically create my list of views like this and not have this undesirable focus changing behavior?</p>","131871","","","","","2010-11-09 16:17:29","How to keep dynamic views focused through an orientation change in Android?","<android><activity><android-layout><activity-lifecycle>","2","0","","",""
"4129344","1","4130612","","2010-11-09 00:20:15","0","1108","<pre><code>WebView webView = new WebView(this);            webView.getSettings().setJavaScriptEnabled(true);    webView.getSettings().setUserAgentString(""Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"");    webView.setWebViewClient(new HelloWebViewClient());    ProgressDialog dialog = ProgressDialog.show(this, """",                     ""Loading. Please wait..."", true);    setContentView(webView);    webView.loadUrl(""http://www.preisjaeger.at"");    dialog.cancel();</code></pre><p>Why does the <code>ProgressDialog</code> not appear?</p>","422039","","166712","","2010-11-09 00:21:54","2010-11-09 04:50:19","ProgressDialog does not appear","<android>","2","0","","",""
"4129411","1","4129502","","2010-11-09 00:31:53","0","2054","<p>I get always out of memory error. </p><p>my code was:</p><pre><code>public static String openAssetFile(Context ctx) {BufferedReader br=new BufferedReader(new InputStreamReader(ctx.getResources().openRawResource(R.raw.allx)));StringBuilder text = new StringBuilder();try {    String line;    while ((line = br.readLine()) != null) {        text.append(line);        text.append('\n');    }}catch (IOException e) {    Log.e(""IOErr"", ""IOErr"");}return text.toString();}</code></pre><p>it is good for little files, but what can i do when i d like to open a bigger file? like 3-6 mb. </p><p>thanks</p>","472537","","166712","","2010-11-09 00:35:32","2010-11-09 10:31:31","Android best way to open big files ~3-6 mb - out of memory","<android><memory>","2","0","","",""
"4129421","1","4129711","","2010-11-09 00:33:06","1","1863","<p>I have some EditViews in the rows of a ListView.  This works just fine except when the soft keyboard raises and lowers.</p><p>When I touch the EditView within the ListView with the soft keyboard down, focus jumps to the EditView, then the keyboard comes up, removes focus from the EditView and sets focus to the ListView, resulting in an odd user experience with the focus no-where visible.</p><p>Touching the EditViews with the keyboard already showing works as you would expect.  The problem seems to be with the soft keyboard lowering and raising and the ListView getting confused about where focus should be placed.</p><p>I do have listView.setItemsCanFocus(true) for the ListView</p>","473677","","707111","","2011-11-11 21:46:16","2011-11-11 21:46:16","EditView in ListView row: focus lost when soft keyboard shows","<android>","1","0","1","",""
"4129428","1","4148513","","2010-11-09 00:34:09","1","1418","<p>I have a layout with a ListView that contains EditText objects that can requestFocus() when the user chooses to edit the list item.  I make sure to call setSelection() on the ListView when this happens, and then have the EditText request focus and then use InputMethodManager.showSoftInput to show the soft keyboard.  However, when this happens, the list view is being resized correctly, but the selected list item remains below the fold and the user has to scroll up.  This is working properly on 2.2, but is failing on 2.1.  Any ideas for making sure the list selection remains visible?</p>","104918","","","","","2010-11-10 19:58:59","Android 2.1: windowSoftInputMode=""adjustResize"" not working properly with ListView","<android><listview>","2","0","2","",""
"4129469","1","4129561","","2010-11-09 00:39:35","1","207","<p>I'm doing something like the following:</p><p><code>Bitmap mBitmap;</code></p><pre><code>mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.myimage);</code></pre><p>In onDraw I'm doing this:</p><pre><code>canvas.drawBitmap(mBitmap,0,0,null);</code></pre><p>My Manifest looks like this:</p><p><code>&lt;supports-screens android:smallScreens=""false"" android:normalScreens=""true"" android:largeScreens=""true"" android:anyDensity=""false"" /&gt;</code></p><p>On Larger screens, my images shrink down to about a quarter the size of the large screen and sit in the upper left hand corner.</p><p>For the life of me, I cannot figure out how to get my images and screen coordinates to automatically adjust to the larger screens.</p><p>The thing is, the code above works great on most devices, like Droids and normal screens.  It's just tablets or slightly larger screen devices where this is happening.</p><p>What am I doing wrong where the images and coordinates on the screen don't just resize like they do on the Droid?</p>","179518","","","","","2010-11-09 00:59:38","Android ""squishing"" game graphics into upper left corner of large screen","<android>","1","0","","",""
"4129528","1","4129931","","2010-11-09 00:51:43","1","501","<p>Has anyone seen an issue where you can export your app to an .apk file and you can install it and everything looks ok but the app never shows up in the list of installed applications.  I have another app that installed and is running fine.  Totally stumped by what I could be doing wrong... I think it's signed correctly (I've tested the key on the working app... am I missing something really stupid?)</p><p>EDITI'm editing to add the solution. Android requires that the main Activity be called MAIN in the manifest. You can call your class anything you want but the XML has to include this:</p><pre><code>&lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>Not realizing this, I had named mine something else and rather than just failing outright, it worked perfectly in the emulator, but failed to open on the phone.</p>","59947","","59947","","2010-11-09 02:13:04","2010-11-09 02:17:22","Android app compiles and installs, but won't show up in my apps","<android>","1","7","","",""
"4129533","1","4129861","","2010-11-09 00:52:51","0","1210","<p>This is my main.xml that I use, and the two images in the myImage_Main and myImage_Main2 are messed up.<br>Is there a way to set the android:layout_width to the size of the bitmap? or do i just set it to 500px which is about the size of the screen?</p><p>Example what i want :</p><pre>Scroll view -------------------------------||               Image 1 Full Sized on Screen|||               Bottom of screen___________________________________________|              Not yet on screen, but  |           Scroll down to see Image 2    |||||_____________________________________________|</pre><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;     &lt;LinearLayout          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:orientation=""horizontal""          android:layout_gravity=""top""        &gt;        &lt;Button android:id=""@+id/myButton_Search""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/btn_search""    android:layout_gravity=""top""    /&gt;    &lt;Button android:id=""@+id/myButton_Save""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/btn_save""    android:layout_gravity=""top""    /&gt;    &lt;/LinearLayout&gt;     &lt;EditText     android:id=""@+id/myEdittext""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:layout_gravity=""bottom""     /&gt; &lt;ScrollView android:id=""@+id/ScrollView01"" android:layout_width= **Right here I want to get the size of the image i use as the width** android:layout_height=**Right here I want to get the size of the image i use as the height** android:fillViewport=""true"" android:scrollY=""100px"" &gt; &lt;LinearLayout android:id=""@+id/LinearLayout02"" android:layout_width=**Right here I want to get the size of the image i use as the width** android:layout_height=**Right here I want to get the size of the image i use as the height** android:orientation=""vertical""&gt;    &lt;ImageView android:id=""@+id/myImage_Main""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:scaleType=""fitCenter""   /&gt;   &lt;ImageView android:id=""@+id/myImage_Main2""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:scaleType=""fitCenter""   /&gt;   &lt;/LinearLayout&gt;   &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","499046","","499046","","2010-11-09 01:02:34","2010-11-09 02:02:26","Android Problem with scrollviews and image resizing","<android><xml><layout><scrollview>","1","1","","",""
"4129568","1","4129608","","2010-11-09 01:02:08","4","1041","<p>I have created a simple game for Android; I want to prevent users from sending the game to the background by pressing the home or back buttons accidentally. I planned on using a dialog to confirm the user's action. What I want is similar to what Sirius does with their app, if you need an illustration.</p><p>I tried adding this action to an overridden onPause(), but the activity vanishes right after the dialog is displayed, so I don't think I'm going about this the right way. How can I fix this?</p><p>Any help is appreciated.</p>","501333","","","","","2010-11-09 01:10:51","Allow dialog to be displayed before or during onPause()?","<android><activity><lifecycle>","1","0","1","",""
"4129642","1","","","2010-11-09 01:16:32","0","467","<p>I am creating an Android app that will calculate the interest on a loan. How do I store a date that is selected from a DatePicker, then calculate how many days have passed between the current date and the stored date?</p>","483790","","","","","2010-11-09 01:29:25","How do I store a date and find how many days have passed since that date?","<java><android><eclipse><date>","1","0","","",""
"4129655","1","","","2010-11-09 01:18:58","0","377","<p>I am developing an App for Android, in which I need an UI that requires following:</p><ol><li><p>Redraw at least 10fps</p></li><li><p>Buttons on screen, but not in rectangular shape</p></li><li><p>The whole screen (or at least the background, if its too heavy for the system) need to do some 'porter-duff' masking before render, on-the-fly</p></li></ol><p>I currently figured out two way to go, both have cons &amp; pros:</p><ol><li><p>Start off from existing View - ViewGroup in the framework. Overriding onDraw to add the masking to it. This is easier to implement, but I am not sure if calling 'invalidate' that often will cause any trouble?</p></li><li><p>Build an alternative View - ViewGroup structure, and do the rendering in SurfaceView. But then I realize I turn up a structure that looks quite close to the existing one in framework, which I feel doing something almost the same with the framework. </p></li></ol><p>Any suggestion? </p><p>(ps. in either way, I am not sure how should I catch the button 'click' event, which is in irregular shape)</p>","109112","","","","","2010-11-09 03:03:13","Developing alternative UI for Android. Which way I should go?","<android><animation><android-layout>","1","3","","",""
"4129777","1","","","2010-11-09 01:47:06","0","257","<p>What is the image size?</p><p>Resolution 1360 * 768, Density 240image loactation : res/drawable-hdpi/</p><p>real image size (pixel) ? 1360*768? 2040*1152?</p>","493363","","","","","2010-11-09 01:57:53","What is the Image size?","<android>","1","1","","",""
"4129837","1","","","2010-11-09 01:55:58","4","3260","<p>I'm using Android's MediaPlayer class to start playing a song from some offset. After specifying this offset in code, I play the song expecting to hear it from that offset position but rather I hear it play from the beginning. Please note the following code:</p><pre><code>    MediaPlayer mplayer = new MediaPlayer();    mplayer.reset();    try {        // For example's sake, specify some known song path        mplayer.setDataSource(""//media/external/audio/media/1"");        // call blocking prepare()        mplayer.prepare();    } catch (Exception e) {    // Keep try/catch simple for example's sake        e.printStackTrace();        return;    }    // seekTo is an asynchronous operation. Set it's complete callback to play the song once seekTo has completed    mplayer.setOnSeekCompleteListener(new MediaPlayer.OnSeekCompleteListener() {        @Override        public void onSeekComplete(MediaPlayer mp) {            // Start the song 30 seconds in            mp.start();        }    });    // Seek to 30 seconds into the song    mplayer.seekTo(30000);</code></pre><p>This code sample runs without errors in the emulator (tested against Android 1.6, 2.1, and 2.2); however, when run on some handsets, the song will play from the beginning. I know for sure this happens on my Droid Incredible (android 2.2). Also note that LogCat will always have some output from the MediaPlayer class stating the song's position has indeed been set to some offset. I've debugged this for hours and scoured forums and still have no solution. Please help.</p>","501368","","501368","","2010-11-09 02:29:15","2011-01-07 17:10:54","MediaPlayer seekTo inconsistently plays songs from beginning","<android><android-emulator>","1","0","1","",""
"4129945","1","4130074","","2010-11-09 02:21:51","0","1089","<p>I'm attempting to learn the ropes of Game Development and Android and it's been a great learning experience so far, but the Android Activity Lifecycle stuff has me a little stuck.  </p><p>Let's say I have three Activities - </p><ul><li>Game Menu</li><li>Level Select </li><li>The Actual Game (2d Game using the <code>SurfaceView</code>).  </li></ul><p>I would think I need to load all Bitmaps and Sounds outside the Actual Game Activity to prevent from having to unload and reload them everytime <code>onDestroy</code> and <code>onCreate</code> is called, for example, like when the phone goes to sleep, or everytime a new level is chose from the level select screen.  </p><p>This led me to the Singleton approach which makes sense and seems to be what I'm after, but I don't fully understand where I would need to unload the Singleton to make sure it gets GC'd, for example, could I release it in the Game Menu <code>onDestroy</code>, if so, how do I know if the Game Menu Activity will hang around indefinately.  I've also seen mention of Android being able to kill the singleton on its own.  I have also read some about using the Application Context that would give me lifecycle.</p><p>What would be the best way to approach this?  Do I really want to unload and reload all the resources in the Game Activity?  Am I going in the right direction with the Singleton or Application idea?  </p>","501365","","223391","","2010-11-09 02:27:40","2010-11-09 02:51:13","Android Game Singleton or Application or neither","<android><singleton><load><unload>","4","1","1","",""
"4130016","1","","","2010-11-09 02:37:58","1","1093","<p>I am trying to do something similar to that of the android lock screen pattern. I have a class that extends a view that I create multiple instances of. These appear on the screen all at once.</p><p>I need to be able to click on them individually and have each one turn green individually, however only one on touch listener is listening at once and it belongs to the last dot which appeared, so if I click anywhere on the screen the last appeared dot turns green no matter where I click.</p><p>Here is the code for my dot class:</p><pre><code>package com.ewebapps;import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;public class Dot extends View implements OnTouchListener {     private final float x;     private final float y;     private final int r;     private final Paint mBlack = new Paint(Paint.ANTI_ALIAS_FLAG);     private final Paint mWhite = new Paint(Paint.ANTI_ALIAS_FLAG);     private final Paint mGreen = new Paint(Paint.ANTI_ALIAS_FLAG);     private boolean touched;/*          public boolean onInterceptTouchEvent(View v, MotionEvent event) {   touched = true;      //mPaint.setColor(0xFF00FF00); // Turn dot green.      invalidate();   return true;  }*/     public Dot(Context context, float x, float y, int r) {         super(context);         mBlack.setColor(0xFF000000); //Black         mWhite.setColor(0xFFFFFFFF); //White         mGreen.setColor(0xFF00FF00); //Green         this.x = x;         this.y = y;         this.r = r;         this.setOnTouchListener(new OnTouchListener(){                @Override                public boolean onTouch(View v, MotionEvent event) {                 touched = true;                 //mPaint.setColor(0xFF00FF00); // Turn dot green.              v.invalidate();                return true;                }        });     } /*    @Override  public boolean dispatchTouchEvent(MotionEvent event) { // On touch.      touched = true;      //mPaint.setColor(0xFF00FF00); // Turn dot green.      this.invalidate();         return super.dispatchTouchEvent(event);     }  */     @Override     protected void onDraw(Canvas canvas) {         super.onDraw(canvas);         canvas.drawCircle(x, y, r+2, mWhite); //White stroke.         if(!touched)         {          canvas.drawCircle(x, y, r, mBlack); //Black circle.         }         else         {          canvas.drawCircle(x, y, r, mGreen); //Green circle.         }     } @Override public boolean onTouch(View v, MotionEvent event) {  // TODO Auto-generated method stub  return false; }/* @Override public boolean onTouch(View v, MotionEvent event) {   touched = true;     //mPaint.setColor(0xFF00FF00); // Turn dot green.     invalidate();     return true; }*/}</code></pre><p>And here is my main class:</p><pre><code>package com.ewebapps;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.Display;import android.view.WindowManager;import android.widget.FrameLayout;public class dots extends Activity{ public Boolean isRunning, isPaused; public int maxdots = 20; public int currentdotdraw = 1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void newdotdraw(){    Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();    int screenwidth = display.getWidth();    int screenheight = display.getHeight();    int x = (int) (Math.random() * screenwidth) + 1;     int y = (int) (Math.random() * screenheight) + 1;      FrameLayout main = (FrameLayout) findViewById(R.id.main_view);    main.addView(new Dot(this,x,y,25));    }}</code></pre><p>In the code I called newdotdraw multiple times.</p>","494151","","1921273","","2013-02-02 21:33:39","2013-02-02 21:33:39","Implementing an OnClickListener?","<android><class><ontouchlistener><implements>","1","2","","",""
"4130088","1","","","2010-11-09 02:53:51","1","383","<p>Ok, so I've made one app but know I'm getting all ambitious and want to make a game.</p><p>So first I want to start off with a menu.  I would rather draw this all myself instead of using the built in classes.  So should I then override the button class to change the look or should I use OpenGL or Canvas?  Any help?</p>","445342","","","","","2010-11-09 05:22:35","Making Android Games","<android><button><menu><canvas>","1","5","","",""
"4130099","1","4130120","","2010-11-09 02:55:27","3","5901","<p>I need some help. I have been searching for days trying to find solution to my problem. I would like to show a progress bar while downloading a file in Android. I found enough to download the file but have struggled to figure out how to display a progress bar.</p><p>Here is my download code:</p><pre><code>            String sURL = getString(R.string.DOWNLOAD_URL) + getString(R.string.DATABASE_FILE_NAME);        HttpClient  httpclient = new DefaultHttpClient();        HttpGet httpget = new HttpGet(sURL);        HttpResponse response = httpclient.execute(httpget);        HttpEntity entity = response.getEntity();        Header[] clHeaders = response.getHeaders(""Content-Length"");        Header header = clHeaders[0];        int totalSize = Integer.parseInt(header.getValue());        int downloadedSize = 0;        if (entity != null) {            InputStream stream = entity.getContent();            byte buf[] = new byte[1024 * 1024];            int numBytesRead;            BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file));            do {                numBytesRead = stream.read(buf);                if (numBytesRead &gt; 0) {                    fos.write(buf, 0, numBytesRead);                    downloadedSize += numBytesRead;                    //updateProgress(downloadedSize, totalSize);                }            } while (numBytesRead &gt; 0);            fos.flush();            fos.close();            stream.close();            httpclient.getConnectionManager().shutdown();</code></pre>","485438","","","","","2010-11-09 07:56:14","Android - Displaying a progress bar while downloading a file","<android><multithreading><progress-bar>","2","1","2","",""
"4130206","1","","","2010-11-09 03:16:42","0","777","<p>Here is my code.</p><p>When false is returned only ACTION_DOWN can be called and when true is returned all actions are okay, why?</p><pre><code>aView = findViewById(R.id.a1);aView.setOnTouchListener(new OnTouchListener(){      //@Override      public boolean onTouch(View v, MotionEvent event) {          // TODO Auto-generated method stub          System.out.println(""Gallery onTouch"");          if(event.getAction()==MotionEvent.ACTION_MOVE){              Log.e(""touchtest"", ""ACTION_MOVE"");            System.out.println(""ACTION_MOVE "");                 }else if(event.getAction()==MotionEvent.ACTION_UP){              Log.e(""touchtest"", ""ACTION_UP"");            System.out.println(""ACTION_UP "");         }else if (event.getAction()==MotionEvent.ACTION_DOWN){            Log.e(""touchtest"", ""ACTION_DOWN"");        }        return true;      }  }); </code></pre>","501425","","1921273","","2013-02-02 21:38:52","2013-02-02 21:38:52","I am confused with onTouch(),please take a look","<android>","1","0","","",""
"4130333","1","8088963","","2010-11-09 03:43:05","2","1180","<p>I added a SurfaceView into the Cube demo from the ApiDeoms.And tried to use a MediaPlayer to play with it.But it failed with low-level player error which is different on different devices.Is it possible to play videos on a GLSurfaceView or it's all about hardware support?</p>","428022","","","","","2012-01-09 21:50:37","How to play a video on a GLSurfaceView on Android?","<android><media-player><surfaceview><glsurfaceview>","2","0","","2012-03-01 06:20:25",""
"4130461","1","4130481","","2010-11-09 04:16:00","30","13348","<p>Scrollable views such as the ListView have a fade out of the content along the edges where there is more content in that direction.  How can I turn this fading off?  I know you can change the cacheColorHint as discussed here: <a href=""http://developer.android.com/resources/articles/listview-backgrounds.html"">http://developer.android.com/resources/articles/listview-backgrounds.html</a> but that is not what I am looking for and will not achieve what I am looking for in this case.</p><p>I want to disable the fade completely or be able to reduce the size and or transparency of it.  Is this possible?</p>","445348","","","","","2013-07-31 06:05:28","Is there a way to disable/edit the fading that a list view has at its edges?","<android><user-interface><listview><fade><scrollview>","4","0","4","",""
"4130497","1","","","2010-11-09 04:24:44","0","961","<p>hii am developing an application that read data from sensors and write those data to an XML file when you press a key. i have 2 activity one for button and another is an Activity who implements sensorEventListener.the problem is my main activity is button and couldn't get data from event listener activity.i think the listener activity is not active but when i create an intent and start activity with that intent the program stop working. the button is able to create XML file solely.so how could i read sensor data from sensors,and how to send them to XML file when the button got clicks ?</p><p>thanks</p>","501470","","","","","2010-11-09 05:09:32","writing android sensor data to XML file","<android><xml><events><activity><sensor>","1","1","","",""
"4130561","1","4130643","","2010-11-09 04:38:38","2","1190","<p>Is there a way to manually trigger the code inside a <code>LocationListener</code>'s <code>onLocationChanged</code> method? It should receive a <code>Location</code> object with the last known location, I guess.</p>","368864","","","","","2010-11-09 04:58:24","Triggering LocationListener's event manually","<android><android-location>","2","0","1","",""
"4130791","1","","","2010-11-09 05:29:07","2","428","<p>hi i want to ask that i use a broadcast receiver for incoming sms. but sometimes it is working and sometimes not. and because of this my app got force close. why my app got force close and is there any solution for this?and is there any solution if receiver not start?</p>","450601","","","","","2010-11-09 05:29:07","broadcast receiver not working and app got force close","<android>","0","4","","",""
"4130801","1","4130811","","2010-11-09 05:31:59","0","3460","<p>I create a TextView by using java code.I need to create textView with the width 50;If the textView has a lengthy text how to display the full text.Is there any marquee in android?If it exist how to apply it in textView???</p><p>Note:</p><p>i use more no of textview's and i add all textviews in to the table layout.I create all textView at runtime only(After read the data from the db)</p>","482568","","302328","","2010-11-09 05:49:56","2013-10-23 15:40:48","Show lengthy text in TextView?","<android><textview>","3","0","","",""
"4130908","1","4130949","","2010-11-09 05:58:23","0","2400","<p>i wanna create an emulator  looks like a ?Desire? screen ,</p><p>could someone tell me how to set those configuration ??</p>","422405","","249871","","2012-03-28 13:36:30","2012-03-28 13:36:30","Android emulator simulating HTC Desire screen","<android><emulator>","1","0","","",""
"4131026","1","4131281","","2010-11-09 06:22:15","0","532","<p>I need to develop an application with downloads the data at the background and update about the progress in the front.</p><p>I guess this can be achieved using services and activity and passing data in between the. But, what I need to do is even if I hit back button and then start the activity again. It should check if the service is running or not. If service is not running it should start one else it should display the data from running service.</p><p>Something like music player where music is played by a service at a background and activity displays the information. Even on browsing through other activities of the application or hitting back, state of the music player is maintained.</p><p>Cheers,Prateek</p>","481314","","","","","2010-11-09 07:16:32","Activity which downloads data in background with service and doesn't get destroyed on hitting back button","<android>","1","0","","",""
"4131088","1","4131214","","2010-11-09 06:36:30","0","2800","<p>im my application, it does not grant the permission for gps location update control. In logcat it shows                                                                                          11-09 12:00:45.496: WARN/PackageManager(86): Not granting permission android.permission.CONTROL_LOCATION_UPDATES to package com.ars.application (protectionLevel=3 flags=0x7e46)    </p><p>I have included the permission for this in manifest.xml as</p><pre><code>&lt;uses-permissionandroid:name=""android.permission.CONTROL_LOCATION_UPDATES""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS""&gt;&lt;/uses-permission&gt;&lt;uses-permissionandroid:name=""android.permission.ACCESS_MOCK_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;</code></pre><p>What is the mistake in this for not getting the permission??</p>","462695","","","","","2010-11-09 07:02:21","ANDROID not granting permission","<android>","1","0","1","",""
"4131139","1","","","2010-11-09 06:46:31","1","6927","<p>I'm trying to call a web server that is using relative URL redirects for some of the calls. This of course isn't working with DefaultHttpClient as it isn't treating it as a relative URL. I've gotten as far as implementing a RedirectHandler in an attempt to catch the redirect and add in the base call but I can't work out how to get the location of the redirect.</p><p>With the following method how do I go about finding out where I am being redirected to? I can't find any fields on either response or context that have what I need and I don't know where else to look.</p><pre><code>public URI getLocationURI(HttpResponse response, HttpContext context) </code></pre>","304795","","","","","2014-03-30 16:43:10","Httpclient redirect handler","<android><redirect><httpclient>","2","0","","",""
"4131142","1","4131183","","2010-11-09 06:46:46","0","500","<p>my actvity has 2 views. That means I am using 2 .xml files within one java class.</p><pre><code>       first_view.xml       second_view.xml</code></pre><p>First view (first_view.xml) contains one EditText and one  save button. when I click the EditText, the virtual keyboard is displayed on the view, and I can enter a value there.  In onClick() of save button, i want to display the second view. (that means the details of the enterd value). </p><p>So i use 'setContentView(R.layout.second_view);' on the onClick() of save button. </p><p>My problem is the second view is coming properly, but the virtual keyboard is still displayed on the view. I use LinearLayout in second view, and set its height and width as ""fill_parent"". but I can't solve the problem.</p><p>I hope you understand the question.. Please help me...Thank you...</p>","453607","","","","","2010-11-09 06:59:08","problem with virtual keyboard in android","<android>","2","0","","",""
"4131153","1","","","2010-11-09 06:49:21","0","3210","<p>Hi i want to create a web crawler in java in which i want to retrive some data like title, description from the web page and store the datas in database</p>","405388","","","","","2014-02-24 00:17:31","How to create web crawler in java?","<java><android>","3","2","1","",""
"4131255","1","","","2010-11-09 07:11:25","0","5809","<p>I wanna create an notification application/service, which should be accessable from other applications similar to android's Notification and NotificationManger.</p><p>As i m a newbie to android development, i wanna know how to develop an service running in background n how to access it from other applications?</p>","466549","","","","","2012-05-30 17:37:02","android:How to create an service running in background and enable it to access other applications","<android><service><background>","2","0","","",""
"4131370","1","","","2010-11-09 07:33:00","3","644","<p>I need to create tab View at runtime by using java code .</p><p>Thanks in advance</p><p>Note: without using xml design</p>","482568","","482568","","2010-11-09 08:48:05","2011-01-31 13:38:31","Create TabView at runtime?","<android>","2","0","1","",""
"4131410","1","","","2010-11-09 07:41:31","0","1041","<p>I m a newbie to android development and i wanna know a right way to get notification as an activity instead of statusbar notification.</p><p>To be clear, i wanna display an notification on screen instead of adding it to status bar.</p>","466549","","1921273","","2013-02-02 22:15:50","2013-02-02 22:15:50","Android: Display Notification as an activity instead of adding it to status bar","<android><notifications>","3","0","1","",""
"4131448","1","4136849","","2010-11-09 07:49:20","2","4481","<p>How do I turn off the IME-functionality of an <code>EditText</code>?</p><p>Or: How do I avoid the display of the IME-keyboard?</p><p>I have a layout where my special keyboard sits below the <code>EditText</code> so there's no need to show the IME. Please understand that I cannot implement my keyboard as IME as it is specific for this very <code>EditText</code> and using it in any other context would only cause problems.</p><p>I tried to use</p><pre><code>getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);</code></pre><p>in the <code>onCreate()</code> of the activity, but that doesn't seem to do anything in this situation.</p>","483113","","","","","2010-11-09 17:54:39","Android: How to turn off IME for an EditText?","<android><keyboard><android-softkeyboard>","2","2","1","",""
"4131585","1","4132571","","2010-11-09 08:12:06","7","27385","<p>While the application is running, I press the HOME button to close the application. When I start the application again, it resumes on the page displayed prior to clicking on HOME. I want the application to start with the initial display instead. I have used finish() to finish the activity but it is not working. Any suggestions?</p>","493193","","134841","","2012-06-26 21:11:52","2013-09-23 06:55:57","How to destroy an activity in Android?","<android>","6","4","5","",""
"4131619","1","4135248","","2010-11-09 08:17:12","1","2975","<p>I have a service running a background thread. What I'd like to do is to show an AlertDialog initiated from my background thread. I know that this is not the recommended way of notifying the user and that it interrupts the workflow (as they can pop-up in any application at any time) but it's a suitable way for my use case.</p><p>There is a handler registered with the background thread and showing a Toast notification withing the handler works fine. But after switching to an AlertDialog nothing happens anymore. My showDialog logic is silently ignored. No Dialog window appears, no log entry. It's a bit strange as I'd expect at least a log entry saying that I'm doing something wrong or whatever.</p><p>Are there any limitations for showing an AlertDialog initiated from a service background thread? Some people seem to recommend a Dialog themed Activity to get a similar behavior.</p><p>Any clarification or help making it work is greatly appreciated!</p><p>Yves</p>","363473","","","","","2011-02-09 17:07:51","AlertDialog.show silently ignored within a service","<android><multithreading><service><dialog>","2","0","","",""
"4131656","1","4131917","","2010-11-09 08:22:14","9","16828","<p>I set a image as Button backgroud,but Button has no highlight when click it.Is there any way to solve it.</p>","501614","","","","","2013-09-05 15:16:34","How to make Button highlight?","<android>","7","1","2","",""
"4131689","1","","","2010-11-09 08:27:15","0","941","<p>Some Android application restarts automatically when i kill process manually. How this can be possible? </p><p>Is there anyone who know how to do like this on Android platform?</p>","501619","","","","","2010-11-09 08:41:24","How can i restart my application or service automatically?","<android>","1","0","","",""
"4131762","1","4754659","","2010-11-09 08:37:02","2","571","<p>I have a list of text inputs that each contain numbers.  To the left of each is a button that says "" - "" to the right one that says "" + "".</p><p>So, it looks like this:</p><pre><code>[ - ] [ 1111 ] [ + ][ - ] [ 1112 ] [ + ][ - ] [ 1113 ] [ + ]etc...</code></pre><p>I want each [-] to alter the value of the field next to it, reducing it by 1, and each [+] to increment the value of the field left of it.</p><p>Is there a way that I can write a generic listener that would, upon instantiation, take as a param the id of the text field to be edited?setOnClickListener only takes a View.OnClickListener as a param, and that can't be given any extra params to hang onto either.  Do I have to extend View.OnClickListener with my own custom listener to do this? Or is there some obvious way to accomplish this task that I'm overlooking?</p><p>TIA.</p>","59947","","","","","2011-01-21 16:52:20","How to run a loop on a bunch of Android buttons that need to control their neighbors?","<java><android>","3","2","","",""
"4131833","1","","","2010-11-09 08:44:59","0","353","<p>Hi. I have directly copy and pasted this code but I'm getting casting error: cannot cast from view to viewflipper. </p><pre><code>public class ViewFlipper extends Activity implements OnClickListener {    Button next;    Button previous;    ViewFlipper vf;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        vf = (ViewFlipper) findViewById(R.id.ViewFlipper01);        setContentView(R.layout.main);        //vf = (ViewFlipper) findViewById(R.id.ViewFlipper01);        next = (Button) findViewById(R.id.Button01);        previous = (Button) findViewById(R.id.Button02);        next.setOnClickListener(this);        previous.setOnClickListener(this);    }    @Override    public void onClick(View v) {        // TODO Auto-generated method stub        if (v == next) {            vf.showNext();        }        if (v == previous) {            vf.showPrevious();        }    }}</code></pre>","490953","","317889","","2013-04-26 18:37:17","2013-04-26 18:37:17","Cannot cast from View to ViewFlipper","<java><android><android-view>","3","0","","",""
"4131892","1","4132210","","2010-11-09 08:55:32","0","1557","<p>Please take a look at the screenshot on the left:</p><p><a href=""http://bit.ly/a4F5Ln"" rel=""nofollow"">http://bit.ly/a4F5Ln</a></p><p>Could anyone tell me what view components are those with texts Notebook and Selected tags? Could it be TwoLineListItem? Any examples using it?</p><p>Basically, I'd like to replace Spinner components with something similar.</p><p>Thanks!</p><p>EDIT: Hmmm... how to reply to an answer?</p><p>Anyway, yes, thanks, this looks like a ListPreference. Does that mean that I can have a ListPreference in any Activity, or that sample I posted is actually PreferenceActivity with other, non-preference views?</p>","501638","","501638","","2010-11-09 11:41:44","2010-11-09 11:41:44","TwoLineListItem","<android><android-layout>","1","2","","",""
"4131906","1","","","2010-11-09 08:57:36","1","4061","<p>In my software im receiving a xml file that is containing some HTML entities like &amp; amp; or whatever.Im successfull decoding the xml but not the HTML entities. The strings are cutted when they meet an html entities... Anybody can help ? I have such code actually to decode the xml...</p><pre><code>            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();   DocumentBuilder builder = factory.newDocumentBuilder();InputStream inputStream = entity.getContent();Document dom = builder.parse(inputStream);   inputStream.close();   Element racine = dom.getDocumentElement();   NodeList nodeLst=racine.getElementsByTagName(""product"");</code></pre><p>Does anyone know how i can do the same job, decoding the xml as a dom object and also decoding HTML entities ?</p><p>Actually my dom object is not correct because its contain some strings that are cutted because of HTML entities... what can i do ?</p>","429222","","429222","","2010-11-09 09:14:54","2011-11-08 15:43:15","Android decoding html in xml file","<android><html><xml><decoding>","3","1","0","",""
"4132029","1","","","2010-11-09 09:15:24","0","639","<p>I'm trying to pulse my bluetooth dongle, to see if it is range.Every second my Android sends a char to the dongle, which then responds with a char. If there is no response, or the char is wrong, then it should conclude that there is no connection.</p><p>I'm able to send from Android to dongle (attached to MCU), and the dongle is able to respond.All I need is a simple way to read each char (when received) to compare it. I'm trying to do it in a seperate thread to make it run in its own loop.</p><p>Here is my code so far, but I think I might be off, so if you could give me a pointer!</p><pre><code>void readFromInputStream(){     Thread readFromInputStream = new Thread()    {        public void run()        {            String streng = """";            try            {                //just 100 times for now                for(int i = 0; i &lt; 100; i++)                {                     BufferedReader in = new BufferedReader(new InputStreamReader(inStream));                    if(in.read() == 'z')                    {                        //set variable or something                    }                    else                    {                        //do something else                    }                    writeTerminal('z');                    sleep(1000);                }            }            catch(Exception e)            {                Log.e(""Threading"", e.toString());            }            finally      {                finish();      }        }    };    readFromInputStream.start();    }}   </code></pre><p>But it seems every time I try and evaluate something it freezes!</p>","465721","","996493","","2012-09-22 03:16:15","2012-09-22 03:16:15","Android to external bluetooth polling","<android><multithreading><bluetooth><inputstream><polling>","1","4","","",""
"4132092","1","4134597","","2010-11-09 09:23:05","0","1583","<p>I am developing an android project. I am using dom parser to parse the xml file. Issue is my xml file contains html numbers like &amp;#189 (semicolon will come in the end of every char code)</p><p>for example</p><pre><code>&lt;quote&gt;We &amp;#8220;love&amp;#8221; our nation&lt;/quote&gt; </code></pre><p>which is nothing but</p><pre><code>&lt;quot&gt;We ""love"" our nation&lt;/quote&gt; </code></pre><p>I am not able to parse this html number in dom parse, when I try to get the node value, I am getting null.</p><p>Can anyone tel me how to parse this html character codes?</p><p>or</p><p>How to convert this html char code as either text char code or unicode char set in my xml feed?</p>","262523","","1921273","","2013-02-02 22:35:34","2013-02-02 22:35:34","Parsing html numbers like ""&#189"" in dom parser - android","<android><xml><parsing><dom><special-characters>","2","0","1","",""
"4132128","1","4132882","","2010-11-09 09:27:13","0","1319","<p>I'm creating the specification for a game I'm about to start creating on android, my main concern is how should I keep scores and settings on android? I assume they would be two different things.</p><p>The game has players that will have their settings and scores stored and then a settings menu (for the person setting up the game, not necessarily the player).</p><p>How would I go about storing these things? What type of data storage means should I be looking into?</p>","353674","","1921273","","2013-02-02 22:33:23","2013-02-02 22:33:23","How should I save scores and settings on android?","<android><database><settings>","3","0","","",""
"4132150","1","4132410","","2010-11-09 09:29:57","4","434","<p>I have an activity that starts a long-running service which in turn adds an icon to the status bar. When the activity gets invisible, e.g. by pressing the Home button, and the pressing the icon in the status bar a new activity is created instead of showing the already created activity. If you now press the back button the new activity is destroyed and the activity created in the first place gets visible. How do I make the invisible activity brought to front when pressing the icon in the status bar instead of creating a new activity?Thanks,Christian</p>","360674","","","","","2010-11-09 09:59:51","Launching activity from the status bar creates new activity even when one already exists","<android>","1","0","1","",""
"4132195","1","4133010","","2010-11-09 09:35:36","0","867","<p>HI, </p><p>I have implemented the example MapsDemo in my emulator. But i couldn't got any map instead of this i got empty map which doesn't contain anything, i have generated the map key also and given at menu.xml in layout section. Please help ?</p>","487604","","","","","2011-01-20 17:29:51","Android MapsDemo problem","<android><google-maps>","3","0","","",""
"4132243","1","4132450","","2010-11-09 09:42:02","0","363","<p>How to run android application on netbeans 6.5?</p><p>If i running the application means i got following error,</p><p>W/ResourceType( 1968): Bad string block: string #14 extends to 1847, past end at 60</p><p>How to resolve this issue?</p>","488433","","","","","2010-11-09 10:04:07","How to run android application on netneans 6.5?","<android><netbeans><netbeans6.5>","1","0","","",""
"4132362","1","4132452","","2010-11-09 09:54:44","30","12928","<p>I have lots of control repeated in my <code>xml</code> (a <code>Button</code> for instance). Is there any possibility to write the <code>Button</code> once in a <code>xml</code> and then import it in all the layout I need it?</p>","501696","","501696","","2014-01-30 13:25:15","2014-01-30 13:25:15","import xml into another xml","<android><xml>","2","0","11","",""
"4132404","1","","","2010-11-09 09:59:24","0","1669","<p>I have managed the get the auth Token from google and now I am trying to push the message to my android device. </p><pre><code>//code to fetch auth Token&lt;?php$url = ""https://www.google.com/accounts/ClientLogin"";$ch = curl_init();curl_setopt($ch, CURLOPT_URL,$url);echo $url;$post_fields = ""accountType="" . urlencode('HOSTED_OR_GOOGLE'). ""&amp;Email="" . urlencode('mail@gmail.com'). ""&amp;Passwd="" . urlencode('xxx'). ""&amp;service="" . urlencode('ac2dm');echo $post_fields; echo ""&lt;br/&gt;"";$data = array('accountType' =&gt; 'GOOGLE', 'Email' =&gt; 'mail@gmail.com', 'Passwd' =&gt; 'xxx', 'source'=&gt;'PHI-cUrl-Example', 'service'=&gt;'ac2dm');curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);//curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_setopt($ch, CURLOPT_HEADER, TRUE);curl_setopt($ch, CURLINFO_HEADER_OUT, true); // for debugging the requestvar_dump(curl_getinfo($ch,CURLINFO_HEADER_OUT)); //for debugging the request$response = curl_exec($ch);var_dump($response);curl_close($ch);echo ""&lt;br/&gt;&lt;br/&gt;"";?&gt;</code></pre><p>I get the AuthToken from google. Now I need to send my message to android deviceThis is the php code for that...</p><p>(second.php)</p><pre><code>&lt;?php$wannasay = array (""registration_id"" =&gt; ""APA91bH9SYn9Iru4Ddr87neqEh3OWaUhT8k_UUpxUZj7ORMLwFCiZ3qKm1yKWGFro47DNsk6CynvureInynXFqs1zEZ9xUwUlw"",""collapse_key"" =&gt; ""abcdef"");$dataels = array();foreach (array_keys($wannasay) as $thiskey) {array_push($dataels,urlencode($thiskey) .""="".urlencode($wannasay[$thiskey]));}$data = implode(""&amp;"",$dataels);// work out the request//auth token below is the one i got from above script$authToken=""DQAAAK0AAAABGiOYfUQfp_ZiDyZqErKOacSmgZCFvnogDUaVzSX9a6qh079XJblM63Z12JwOdRv8gDNCqLj80olSbFeqZFJpqXQDvmmW_PcyHUZPyDZIpZ0G0FRkV_sgqy06YM7r5zUnAggHA8hlmVM3AQBYNGcP_A2Ddq_pjm6cqaQBQH_dFaJgK6UfxNaNDK2jl78VWSU-ZMb-Q2zU1xMLbwYcWXuYIRqRxSlEN68N2M2u4Ub_AA"";$header =""POST http://android.apis.google.com/c2dm/send HTTP/1.1\n"" .""Host: yourhost\n"" .""Content-Type: application/x-www-form-urlencoded\n"" .""Authorization: GoogleLogin auth="" . $authToken . ""\n"" .""Content-Length: "" . strlen($data) . ""\n\n"" .$data . ""\n"";// establish the connection and send the request$s = socket_create(AF_INET, SOCK_DGRAM, 0);//AF_INET ipv4 internet based protocol$z = socket_connect($s, gethostbyname(""yourhost""), 80);socket_write ($s, $header, strlen($header));$header = """";while (true) {   if (strlen($c = socket_read($s, 1))) {  //this is line 20$header .= $c; }}socket_close($s);print nl2br(htmlspecialchars($header));?&gt; </code></pre><p>I am running both the code from localhost. I am having socket problem here I think. Either the page keeps loading forever or I gives me fatal error : maximum time exceeded 60 seconds at line 20 or so.</p><p>When I try the code at server I get the error as</p><pre><code>Warning: socket_read() [function.socket-read]: unable to read from socket [111]: Connection refused in second.php on line 20</code></pre><p>I dont know what is wrong here. Can someone tell me why am I getting this error. I have no idea how the socket thing works on Android as well. </p>","501582","","272802","","2011-02-09 13:04:19","2011-02-09 13:04:19","Push message in Android","<php><android><sockets><push><message>","1","1","1","",""
"4132425","1","","","2010-11-09 10:00:49","2","5451","<p>I've a simple Main Activity which has to stop till an SMS is received...How can I launch a Method from the MainActivity within the BroadCast Receivers onReceive() Method?</p><p>Is there away with Signal and Wait? Can I pass something with a pending Intent, or how can i realise this communication? </p><p>Thanks a lot for your help.</p>","501711","","683261","","2012-02-18 06:33:19","2013-12-17 13:03:37","Android Communication between Broadcast Receiver and MainActivity (Send data to activity)","<android><activity><sdk><broadcast>","5","0","1","",""
"4132495","1","4132612","","2010-11-09 10:10:19","0","498","<p>I have a html file saved in memory and this file have some images (tag ). I can't load these images because they are in the assets folder and I don't know the absolute path. What is the absolute path to assets folder? I think that with the absolute path of the images I could to load these images in my html file into my webview.</p>","495239","","","","","2010-11-09 10:24:53","Load images in html","<android><webview>","1","1","","",""
"4132522","1","4132692","","2010-11-09 10:13:21","1","777","<p>How will i go about saving the state of a listview item during scrolling, so that the recycler does not use it when displaying the next row being. i basically have a listview with 4 textviews and one of the textview is displayed based on a condition, derived from a database. For clarity sake, i will call that dependant textview ""A"".</p><p>my problem is that, simplest case: if ""A"" is being displayed for only the first item or any other row in the list and its not displayed anywhere else, when scrolling, ""A""  is displayed on other rows that should not have it. i understand the concept of listview reusing rows, but i can't figure out how to save it on an item, so it doesn't get used in another row.  Here is a simplified code with just 2 textview:</p><pre><code>  holder.viewItemName = (TextView)view.findViewById(R.id.nameId);  holder.viewdescriptionStatus = (TextView)view.findViewById(R.id.viewdescriptionId);    int namecolumn = c.getColumnIndex(DBAdapter.NAME);     String name = c.getString(namecolumn);    holder.viewItemName.setText(name);    int description = c.getColumnIndex(DBAdapter.description);    String descriptionstatus = c.getString(description);    /*problem am having here*/    if(description != null){    holder.viewdescriptionStatus.setText(""description available"");        holder.viewdescriptionStatus.setTextColor(Color.BLUE);    }</code></pre><p>as you can see, am using a viewHolder, but i have come to realise that viewHolder doesn't hold the logic as well. i don't know how to save the state of the holder.viewdescriptionStatus based on that condition. Most of the examples i have seen are based on checkboxes. Please anyone with ideas?.. it will be really appreciated.</p><p>P.S : i am using bindView() and newView() since i am using an SQLdatabase and SimpleCursorAdapter. i have the same issue with clicking, but i want to solve the scrolling part first. Thank you for your time.</p>","479908","","73488","","2010-11-09 10:21:47","2010-11-09 10:34:05","How to save the state of an item in a listview android","<android>","1","0","1","",""
"4132675","1","4133116","","2010-11-09 10:31:45","0","555","<p>I need a call back URL for registration  of my app in twitter. How to get it??</p>","489762","","3154233","","2014-01-13 07:00:10","2014-01-13 07:00:10","twitter in android","<android><twitter>","3","0","","",""
"4132697","1","","","2010-11-09 10:34:53","1","2136","<p>Can anyone kindly guide as to how can I invoke a context menu on the press of a menu item. I googled a lot for the same, but nothing turned up.Look forward for your valuable help.Regards,Rony</p>","264953","","","","","2013-06-26 06:48:35","Invoke android context menu on menu item press","<android><android-widget>","2","0","","",""
"4132699","1","4133245","","2010-11-09 10:35:04","9","4390","<p>Is there any way to show a modeless dialog--a dialog that allows the user to interact with whatever was on the screen before the dialog but also allows the user to interact with the dialog if pressed?</p><p>I know of Toasts, but they don't allow interaction with the popup.</p><p>I know of Dialogs, but they're modal and don't allow interaction with the background.</p><p>I know of Notifications, but I want something that is visibile on screen.</p><p>I basically want to be able to be playing a game or something and a popup appears that I have a new email or something. I can click it to view my email, but I can wait for it to go away if I just want to continue playing my game. Is this possible in Android?</p>","501754","","1921273","","2013-02-02 22:52:35","2013-02-02 22:52:35","timed modeless dialog","<android><dialog><modal-dialog><modeless>","3","2","9","",""
"4132729","1","4132777","","2010-11-09 10:37:51","1","244","<p>Currently I am working on audio streaming on android. All method I have written related to streaming and playing the audio is in the onCreate() method. The problem is when ever I change into portrait mode, all methods are called again. How can I prevent this?</p>","461972","","180538","","2010-11-09 10:44:25","2010-11-09 10:44:25","Orientation issue on android","<android><orientation><oncreate>","2","0","","",""
"4132812","1","4132873","","2010-11-09 10:47:46","2","4758","<p>What is the absolute path of the assets folder? I need it to reference some images saved in this folder from a html file saved in the memory device.</p>","495239","","","","","2013-06-03 16:53:57","What is the absolute path of assets folder?","<android>","1","0","3","",""
"4132889","1","","","2010-11-09 10:59:43","0","157","<p>I am downloading image from url and set to Imageview.but sometime the bitmap returns null?why this happened?..My code is</p><pre><code>Bitmap bm = null;URL myFileUrl =null;              try     {         myFileUrl= new URL(url);    }    catch (MalformedURLException e)     {         // TODO Auto-generated catch block         e.printStackTrace();    }    try     {         HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();         conn.setDoInput(true);         conn.connect();         int length = conn.getContentLength();         InputStream is = conn.getInputStream();         bm = BitmapFactory.decodeStream(is);    }     catch (IOException e)     {         // TODO Auto-generated catch block         e.printStackTrace();    }    return bm;</code></pre>","461972","","","","","2010-11-09 11:19:44","image issue on android","<android>","2","2","","",""
"4132954","1","4132977","","2010-11-09 11:10:12","1","446","<p>I have written an application which is working fine in Emulator . But when  I install the same in Android device Samsung Galaxy 2.1 , the fonts appear very small compared to the fonts in Emulator. How to solve this issue ? How to make my application to make it appear similar in both emulator and device. <br>can anyone help me in solving this issue ?</p>","429501","","1921273","","2013-02-02 22:58:13","2013-02-02 22:58:13","fonts appear small in samsung Galaxy Android 2.1","<android>","1","0","","",""
"4132985","1","","","2010-11-09 11:14:21","0","2150","<p>When i debug my android application on emulator i can connect to it with adb shell and view my database file with sqlite3 command. But on real device i can't do this because i haven't root permissions. There are any way to do this?</p>","410919","","","","","2010-11-09 16:16:19","watching sqlite db on device","<android><sqlite><device>","3","0","","",""
"4132996","1","4133102","","2010-11-09 11:15:31","1","8201","<p>I am trying to update a SQLite table in my Android application. Predicate for this update is built around a column which stores different resource URLs.   </p><p>These URLs might contain special characters such as /~?=; (and even &amp;).</p><p>My query looks like:</p><pre><code>update TableName where columnVal = '/some/fake/~/id?u=0&amp;amp;rl=url';</code></pre><p>The update query doesnt work; it does not identify the column satifying the condition.</p><p>How can I escape these characters?</p><p>Please advise.</p>","236128","","","","","2010-11-09 11:25:33","Escape special characters in sqlite","<android><sqlite3>","2","0","0","",""
"4133068","1","","","2010-11-09 11:21:59","2","431","<p>Hi<br>I have to upload different files (Images, Videos and Audio). But the system is crashing due to low memory.<br>I have a lot of controls and each have different listeners. Please point me the best way i need to go so that i use the memory efficiently.<br>When i checked using DDMS eclipse, the memory is creeping from screen to screen. And when i upload once that memory is not removing. I have stored every files in sdcard and at the time of upload this using</p><pre><code>FileBody bin = new FileBody(new File (path/filename) ,Fileformat); </code></pre><p>I think the memory used here are also unallocated. I have declared this in a local function scope hoping the GC will manage this when the scope is gone. But it is not happening for me.<br>Please help me, What i need to do here? Is there any way to explicitly call GC on some objects?  How to remove object data object? From DDMS eclipse, i got it is data object which is using main portion of my memory. Which all come under this?<br>Thanks</p>","477754","","477754","","2010-11-10 04:12:57","2011-03-06 00:18:13","Android memory problem","<java><android><memory-management><file-upload><memory-leaks>","2","5","1","",""
"4133137","1","4133229","","2010-11-09 11:28:41","1","356","<p>I am developing an application and I am displaying images from URl using xml parsing.When internet gets disconnected I pop up alert window.</p><p>Now I wan my current activity automatically reboot, when my device connect net.</p>","500595","","119895","","2010-11-09 11:39:51","2010-11-09 11:45:48","How to reboot my current activity,when i connect net?","<android>","1","0","","",""
"4133163","1","4634811","","2010-11-09 11:31:26","12","13885","<p>I want to get contacts saved in phone only not sim contacts using new api contactContracts</p><p>i am doing this by filtering Account type (not com.anddroid.contacts.sim),this work for one handset(HTC Desire) but there is no common account type found which can work for all handsetscan anybody tell me how to do that</p>","480420","","1921273","","2013-02-02 23:03:42","2014-03-17 20:47:15","How to get phone contacts in Android","<android>","5","1","7","",""
"4133262","1","","","2010-11-09 11:42:07","2","277","<p>I am doing an application in android which requires to know for how long the application is running. Do anyone know how to retrieve such information??. Is there any way where android provides the information about the running applications ,from how much time they are running??</p>","501824","","","","","2010-11-09 15:53:02","How to know for how much long the application is running in android?","<android>","3","1","1","",""
"4133303","1","4133802","","2010-11-09 11:48:10","0","585","<p>I have a task which I need to run in the background in my Android app. It reads data over the network and populates a database. It can take several minutes to run.</p><p>Once it's started, it needs to complete successfully without interruption. (Otherwise I'll end up with a broken half-populated database.) I realise I can never guarantee it will <em>always</em> complete, but I want to make it as hard as possible for the system to kill off this task. For safety I guess I will have it populate a temporary database, and then only swap out the old database for the new one on successful completion of the import.</p><p>It's a modal operation; it does not make sense for the user to be interacting with the app while the import is in progress.</p><p>My first attempt is using an ASyncTask with a Progress dialog to achieve the modality, but this obviously breaks the ""don't interrupt"" requirement. I could work around the screen-rotation issue with ASyncTasks, but I don't think that goes far enough.</p><p>At the moment I'm not sure if this should be an ASyncTask, a Service, an IntentService, some combination of these, or something else entirely. Can you help me decide?</p>","385478","","","","","2010-11-09 12:48:34","Android: can't decide how to manage background task","<android><service><background><android-asynctask>","2","0","0","",""
"4133435","1","4133472","","2010-11-09 12:06:49","10","8938","<p>i have an application with various tabs (on a tabhost), each tab is an activity that extends activity, and haves some textfields and things on it</p><p>now i need that my tabs have inside a listview, but in the example from android developer guide says that you have to extend ListActivity and not Activity</p><p>basically i need to merge these two tutorials:</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-listview.html</a></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 want to know how can i use a listview without extending listactivity on my class</p><p>someone knows?</p><p>MY XML FILE:</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""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp""/&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","479886","","1921273","","2013-02-02 23:09:31","2013-02-02 23:09:31","How can i use a listview without extending ListActivity in my class?","<android><listview>","2","0","1","",""
"4133454","1","","","2010-11-09 12:09:07","0","139","<p>i been creating my first application iam stuck with following problem</p><pre><code>  when clicking a particular button it will display flipping of </code></pre><p>current (rotate layout in the direction of the perpendicular to screen and about an axis parallel to to screen) ui and go to another ui that for setting preferences of the application how can i simulate effect of that flip</p><pre><code>    is there any better way for doing that</code></pre>","482604","","1921273","","2013-02-02 23:08:49","2013-02-02 23:08:49","how can i simulate fliping effect of image","<android><user-interface><android-layout>","1","2","","",""
"4133494","1","4133804","","2010-11-09 12:12:58","0","1716","<p>Greetings,</p><p>I'm trying to simply display a blank textfield (I know), but it's not working?</p><p>I must be making some simple error.</p><p>Here is my app.js:</p><pre><code>Titanium.UI.setBackgroundColor('#FFF');var win1=Titanium.UI.createWindow({      title:'Login',    backgroundColor:'#FFF'});var uname = Titanium.UI.createTextField({    color:'#336699',    height:35,    top:50,    width:250,    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED});win1.add(uname);</code></pre><p>Am I missing something? The above should work, right?</p><p>I'm using Android emulator on Ubuntu x86_64</p><p>When I use tabs the uname and label appear ok:</p><pre><code>Titanium.UI.setBackgroundColor('#000');var tabGroup = Titanium.UI.createTabGroup();var win1 = Titanium.UI.createWindow({      title:'Tab 1',    backgroundColor:'#fff'});var tab1 = Titanium.UI.createTab({      icon:'KS_nav_views.png',    title:'Tab 1',    window:win1});var uname=Titanium.UI.createTextField({    color:'#336699',    height:35,    top:50,    width:250,    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED});var label1=Titanium.UI.createLabel({    color:'#999',    text:'hello',    font:{fontSize:20,fontFamily:'Helvetica Neue'},    textAlign:'center',    width:'auto'});win1.add(uname);win1.add(label1);tabGroup.addTab(tab1);tabGroup.open();</code></pre><p>But how do I get rid of the tabs???</p><p>I've tried several versions of Android (1.6 API and 2.2 API)</p><p>Many thanks in advance,</p><p>Update: the solution is:Add the following line:win1.open({fullscreen:true});</p>","395974","","395974","","2010-11-09 13:13:11","2010-11-09 13:13:11","Appcelerator simple textfield not showing","<android><textfield><titanium><appcelerator>","1","0","","",""
"4133551","1","5255970","","2010-11-09 12:20:16","7","949","<p>While using Google Analytics for android, if i use</p><p><code>tracker.start(""UA-YOUR-ACCOUNT-HERE"", 20, this)</code></p><p>then every 20 seconds, events will be dispatched automatically even if i dont do it manually using</p><pre><code>tracker.dispatch()</code></pre><p>My Question is, what happens if the user quits my application within 20 secs?will it be dispatched?</p><p>or do i have to dispatch all the pending events manually when the user is trying to exit?</p>","367016","","","","","2012-07-12 08:06:23","Google Analytics for Android help","<android>","4","1","2","",""
"4133577","1","","","2010-11-09 12:24:15","0","673","<p>how to send xml as request like for user authentication, I am getting an error like</p><pre><code>""object reference not set to an instance of an object""</code></pre><p>my code is</p><pre><code>String myXml=""&lt;userName&gt;""+string+""&lt;/userName&gt;   ""&lt;Password&gt;""+string+""&lt;/Password&gt;   ""&lt;TokenID&gt;""+string+""&lt;/TokenID&gt;"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    myTextView = (TextView)findViewById(R.id.TextView01);    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);    request.addProperty(""Authendicate"", myXml);    SoapSerializationEnvelope mySoapEnvelop = new SoapSerializationEnvelope(SoapEnvelope.VER11);    mySoapEnvelop.dotNet=true;    mySoapEnvelop.setOutputSoapObject(request);    AndroidHttpTransport aht= new AndroidHttpTransport(URL);    try{        aht.call(SOAP_ACTION, mySoapEnvelop );        SoapPrimitive resultstring= (SoapPrimitive)mySoapEnvelop .getResponse();        System.out.println(resultstring);        myTextView .setText(""result:""+resultstring);    }     catch (Exception e) {            e.printStackTrace();    }}}</code></pre><p>and my Services.asmx is</p><pre><code>POST /Services.asmx HTTP/1.1Host: stinging.harani.orgContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: ""http://stinghero.com/AuthenticateUser""?xml version=""1.0"" encoding=""utf-8""?&gt;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;  soap:Body&gt;    AuthenticateUser xmlns=""http://stinghero.com/""&gt;      Authenticate&gt;        clsCredentials&gt;          userName&gt;string&lt;/userName&gt;          Password&gt;string&lt;/Password&gt;          TokenID&gt;string&lt;/TokenID&gt;        /clsCredentials&gt;      /Authenticate&gt;    /AuthenticateUser&gt;  /soap:Body&gt;/soap:Envelope&gt;</code></pre><p>is this the right way to do it?</p>","501859","","54200","","2010-11-09 12:36:55","2011-08-19 13:54:37","how to pass an object for using ksoap2 in android","<android>","0","2","","",""
"4133580","1","4133645","","2010-11-09 12:24:19","1","1658","<p>while i am doing work on android apps i didnt find library files to read svg files and rendering those files. can any one post me some library files which supports svg.</p><p>thank you in advanced!!!</p>","481455","","481455","","2010-11-23 05:05:39","2010-11-23 05:05:39","How to read and display SVG files in android","<java><android><svg>","1","0","","2010-11-09 15:09:58",""
"4133613","1","4133747","","2010-11-09 12:27:49","3","2547","<p>I wants to implement fading/floating of buttons like that of MediaController play/pause buttons if screen is not touched for 'n' sec.  Is it  possible for me to implement this on my custom image button?</p>","465834","","1921273","","2013-02-02 23:18:48","2013-02-02 23:18:48","Android Image button fade","<android><android-emulator><android-widget>","1","0","1","",""
"4133637","1","","","2010-11-09 12:29:22","5","1730","<p>I have a WebView that displays a Google Checkout payment button in an html form.</p><p>When I run it on the emulator it works, there is the payment button and I can press it and go to the google checkout webpage.</p><p>However, when I run it on an actual device running Android 2.2 it just shows the little blue box with a question mark.</p><p>what does this mean?</p><pre><code>            String header =                 ""&lt;html&gt;"" +                    ""&lt;head&gt;"" +                    ""&lt;script language=\""javascript\""&gt;""+                        ""function pass() {""+                            ""return checkboxState.checkboxPass();""+                        ""}""+                    ""&lt;/script&gt;"" +                    ""&lt;/head&gt;"" +                    ""&lt;body&gt;"";            String formData =             ""&lt;center&gt;""+            ""&lt;form onSubmit=\""return pass();\"" action=\""https://""+host+""api/checkout/v2/checkoutForm/Merchant/""+merchantId+""\"" id=\""BB_BuyButtonForm\"" method=\""post\"" name=\""BB_BuyButtonForm\"" target=\""_blank\""&gt;""+                ""&lt;input name=\""item_name_1\"" type=\""hidden\"" value=\""""+item_name_1+""\""/&gt;""+                ""&lt;input name=\""item_description_1\"" type=\""hidden\"" value=\""""+item_name_1+""\""/&gt;""+                ""&lt;input name=\""item_quantity_1\"" type=\""hidden\"" value=\""1\""/&gt;""+                ""&lt;input name=\""item_price_1\"" type=\""hidden\"" value=\""""+item_price_1+""\""/&gt;""+                ""&lt;input name=\""item_currency_1\"" type=\""hidden\"" value=\""""+item_currency_1+""\""/&gt;""+                ""&lt;input name=\""_charset_\"" type=\""hidden\"" value=\""utf-8\""/&gt;""+                ""&lt;input type=\""hidden\"" name=\""shopping-cart.items.item-1.merchant-private-item-data\"" value=\""""+private_item_data+""\""&gt;""+                ""&lt;input alt=\""Pay With Google Checkout\"" src=\""https://""+host+""buttons/buy.gif?merchant_id=""+merchantId+""&amp;amp;w=121&amp;amp;h=44&amp;amp;style=trans&amp;amp;variant=text&amp;amp;loc=en_US\"" type=\""image\""/&gt;""+            ""&lt;/form&gt;""+            ""&lt;/center&gt;"";            String footer = ""&lt;/body&gt;&lt;/html&gt;"";            if(Logging.DEBUG) Log.d(TAG, header+formData+footer);            browser = new WebView(ActivityActivate.this);            browser.setBackgroundColor(0);            browser.getSettings().setJavaScriptEnabled(true);            browser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);            browser.getSettings().setSupportZoom(false);            browser.addJavascriptInterface(new JavascriptInterface(), ""checkboxState"");            browser.loadData(header+formData+footer, ""text/html"", ""UTF-8"");            llPaymentButtons.addView(browser);</code></pre>","248521","","302328","","2010-11-09 12:35:14","2013-11-18 16:14:22","WebView displays a question mark in a blue box","<android><webview>","2","0","","",""
"4133731","1","","","2010-11-09 12:40:15","2","2649","<p>I'm trying to animate a ball image coming into the screen, shifting position within the screen and go back out of the screen. I want to do this in form of 3 animations; ball_in, ball_shift and ball_out, as well as being able to decide when to go from one animation to the other.</p><p>This is the code I got so far;</p><p><strong>Main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ImageView android:id=""@+id/ballImage"" xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:layout_alignParentRight=""true""android:layout_margin=""5px""android:src=""@drawable/red_ball""/&gt;&lt;/RelativeLayout&gt;</code></pre><p><strong>Main activity</strong></p><pre><code>public class AnimationTest extends Activity{    AnimationDrawable ballAnimation;    public void onCreate(Bundle savedInstanceState)    {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      final ImageView ballImage = (ImageView) findViewById(R.id.ballImage);      final Animation ballOutAnimation = AnimationUtils.loadAnimation(this, R.anim.ball_out);      final Animation ballShiftAnimation = AnimationUtils.loadAnimation(this, R.anim.ball_shift);      ballShiftAnimation.setAnimationListener( new AnimationListener()        {            @Override            public void onAnimationEnd(                    Animation animation) {                ballImage.startAnimation(ballOutAnimation);            }            @Override            public void onAnimationRepeat(                    Animation animation) {}            @Override            public void onAnimationStart(                    Animation animation) {}        });      final Animation ballInAnimation = AnimationUtils.loadAnimation(this, R.anim.ball_in);      ballInAnimation.setAnimationListener( new AnimationListener()        {            @Override            public void onAnimationEnd(                    Animation animation) {                ballImage.startAnimation(ballShiftAnimation);            }            @Override            public void onAnimationRepeat(                    Animation animation) {}            @Override            public void onAnimationStart(                    Animation animation) {}        });      ballImage.startAnimation(ballInAnimation);    }}</code></pre><p><strong>ball_in.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_decelerate_interpolator""&gt;&lt;translate    android:fromXDelta=""150""    android:toXDelta=""0""    android:fromYDelta=""0""    android:toYDelta=""0""    android:duration=""2000""    android:startOffset=""0""    /&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_decelerate_interpolator""&gt;            &lt;translate        android:fromXDelta=""0""        android:toXDelta=""0""        android:fromYDelta=""-150""        android:toYDelta=""0""        android:duration=""1500""        android:startOffset=""500""        /&gt;&lt;/set&gt;&lt;/set&gt;</code></pre><p><strong>ball_shift.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_decelerate_interpolator""&gt;&lt;translate    android:fromXDelta=""0""    android:toXDelta=""130""    android:fromYDelta=""0""    android:toYDelta=""220""    android:duration=""2000""    android:startOffset=""0""    android:fillAfter=""true""    /&gt;&lt;scale    android:fromXScale=""1.0""     android:toXScale=""0.623""    android:fromYScale=""1.0""     android:toYScale=""0.623""     android:duration=""2000""    android:startOffset=""0""    android:fillAfter=""true""    /&gt;&lt;/set&gt;</code></pre><p><strong>ball_out.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_decelerate_interpolator""&gt;        &lt;scale    android:fromXScale=""0.623""     android:toXScale=""0.623""    android:fromYScale=""0.623""     android:toYScale=""0.623""     /&gt;&lt;translate    android:fromXDelta=""130""    android:toXDelta=""330""    android:duration=""2000""    android:startOffset=""0""    /&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_decelerate_interpolator""&gt;            &lt;translate        android:fromYDelta=""220""        android:toYDelta=""370""        android:duration=""1900""        android:startOffset=""100""        /&gt;&lt;/set&gt;&lt;/set&gt;</code></pre><p>I originally had everything in one long animation, but wanted to split the animations up to be able to stop and continue at a given time in the code. Doing so, I realized that the position of the image was reset back to the starting position when the animation was finished and this of course gave me weird results when splitting up the animations.</p><p>I tried using fillAfter/fillBefore, which is described as applying transformations after/before the animation process, but they doesnt seem to do anything to the image. It still resets back to the starter position.</p><p>Any help or suggestions on how to do this is appriciated. Thanks.</p>","501884","","","","","2012-09-25 21:25:06","Applying transformation after animating an object on android","<java><android><eclipse>","3","1","0","",""
"4133844","1","4134327","","2010-11-09 12:53:45","1","882","<p>I have a use case in my application, where after certain point, I need to associate an data with an activity. So whenever an intent with an action and the data type is fired, my activity can be opened. I know that it is possible to associate a data type with an activity statically via AndroidManifest.xml. </p><p>Is it possible to register the data type for an activity dynamically and programatically ?Any pointers are appreciated.</p>","248132","","","","","2010-11-09 13:48:04","Android: Dynamically asscociating data type with an activity","<android><android-manifest>","1","0","1","",""
"4133874","1","4135597","","2010-11-09 12:57:18","1","900","<p>the camera of my mobile (running Eclair-update1) keeps being non-responsive in 90% of the time, so I assumed a hardware defect at first. After whiping the cache and the phone user data sereval times it worked again. At least for a while. Now it stopped working again. </p><p>Browsing the net I found quite some users who experience the same problem and had a hard time after whiping their user data off the device. </p><p>So my question would be: how close can I get to the hardware with the SDK? I'd like to write an app to influence hardware states (e.g. re-initializing the camera, remounting the SDcard aso.), but I'd prefer doing it - if possible - with the SDK instead of NDK.</p><p>Thanks in advance!<br>S.</p>","419501","","","","","2013-02-19 21:02:16","How close can we programmatically get to the hardware of an Android device?","<android><sdk><hardware>","2","0","","",""
"4133879","1","","","2010-11-09 12:57:51","1","45","<p>I need to know the details of the XML response when an Application is purchased via the Android Market.</p><p>I understand that it is impossible to recieve the notifications directly but you are able to get them via the history API.</p><p>does anyone have an example response from the Google Checkout server?In particular I need to know what is stored in item_name_1</p>","248521","","","","","2010-11-09 12:57:51","What notification is stored in GoogleCheckout when an application is purchased via the Android Market?","<android><google-checkout>","0","0","","",""
"4133912","1","","","2010-11-09 13:01:54","0","824","<p>i'm developing a Twitter client for Android and i would like to know which is the better way to build my app. I want to have a listview that, when clicked, calls another listview to see details and so on but i would also like to be able to go back in my previous list.</p><p>What is the best way to do this in Android? At every click i create a new intent associated to an activity and i do startActivity(intent) so that i can be able to go back with the Back button of Android.</p><p>Is it the good way or is there a better approach? I would like to navigate onward and backward of n-levels</p>","339500","","1921273","","2013-02-02 23:23:58","2013-02-02 23:23:58","Android way to navigate app","<android><navigation>","2","0","","",""
"4133945","1","","","2010-11-09 13:05:07","3","925","<p>I tried to change the padding of a TextView wich is placed on a widget.Direct via 'findViewById' it isn't possible because the class extends from AppWidgetProvider.</p><p>Therefore I tried to use remoteViews.setBundle with the followingcode. But this is not a solution.</p><pre><code>Bundle b = new Bundle(4);b.putInt(""left"", 5);b.putInt(""top"", 5);b.putInt(""right"",5);b.putInt(""bottom"", 5);remoteViews.setBundle(R.id.name1, ""setPadding"", b);</code></pre><p>Does anyone have a solution for me?</p>","501911","","441574","","2012-01-24 14:39:38","2012-04-13 00:55:36","Change TextView padding dynamic on widget","<android><dynamic><widget><textview><padding>","1","1","","",""
"4133960","1","4133975","","2010-11-09 13:07:02","1","490","<p>My question is the following: can I have one application on the market, but when the user downloads it, depending on what OS the user is running, she downloads different file - one file for 2.2, other for 2.1, third for 1.5, etc? </p>","232798","","","","","2012-05-29 22:20:52","Android - different OS, different versions","<android><google-play>","3","0","1","",""
"4134082","1","4165708","","2010-11-09 13:22:33","0","2907","<p>i have 5 mp3 files stored on the assets folder. The files are all 25 KB.<br/>I load the files using:</p><pre><code>manager = context.getAssets();this.inputStream = manager.openFd(fileName).createInputStream();</code></pre><p>Whenever i try to play the files, the sounds are all messed up like they were mixed or something. I've zipaligned the app already but with no results.<br/>anny help about this issue? Thanks in advance</p>","181915","","","","","2013-05-07 15:56:40","Android - Problem playing sounds from assets folder","<java><android><assets>","3","0","","",""
"4134094","1","","","2010-11-09 13:24:08","0","326","<p>I'm running ffmpeg on android.</p><p>What I want to do is take a video recorded on an android phone, overdub it with a wav pcm file and save it in a format suitable for youtube upload.the 3gp is:Metadata:major_brand : 3gp4minor_version : 768compatible_brands: 3gp4mp413gp6copyright :copyright-eng :Duration: 00:00:12.18, start: 0.000000, bitrate: 2002 kb/sStream #0.0(eng): Video: mpeg4, yuv420p, 800x480 [PAR 1:1 DAR 5:3], 1987 kb/s, 9.77 fps, 60 tbr, 1k tbn, 60 tbcStream #0.1(eng): Audio: amrnb, 8000 Hz, 1 channels, flt, 12 kb/s</p><p>The wav is plain simple wav file (although I might want to use mp3 also)</p><p>The output should be ""MPEG4 (Divx, Xvid) format at 640x480 resolution with MP3 audio"" as youtube recommends.</p><p>someone told me it is not legal to do. why?What are the alternatives?</p><p>Thankseli</p>","102092","","","","","2010-11-09 13:24:08","ffmpeg and the maze of formats and codecs","<android><ffmpeg><video-encoding>","0","2","","",""
"4134117","1","4151886","","2010-11-09 13:27:27","4","8854","<p>I am developing on Android 2.2 using Java. I put an editText on a PopupWindow and it's not working.It acts like a disabled edit text, clicking on the edit text won't show the soft keyboard.How can I add an edit text on a popupWindow?</p>","477758","","1921273","","2013-02-02 23:30:20","2013-02-02 23:30:20","EditText On A Popup Window","<java><android><edittext><popupwindow>","3","0","","",""
"4134128","1","4134172","","2010-11-09 13:28:56","4","7733","<p>Have anybody write some apps with using dropbox api? I want to write application, that will be able to read/write files into Dropbox Share folder...I've found this thread: forums.dropbox.com/topic.php?id=25486and this project: <a href=""http://bitbucket.org/dropboxapi/dropbox-client-java/overview"" rel=""nofollow"">http://bitbucket.org/dropboxapi/dropbox-client-java/overview</a>but I can't find any docs or tutorials to perform dropbox files manipulation or even adding api library...</p>","467750","","1228","","2013-08-14 12:47:37","2013-08-14 12:47:37","Dropbox api in android","<android><dropbox>","1","2","2","2013-08-14 14:31:05",""
"4134192","1","4134330","","2010-11-09 13:35:20","2","1189","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3536463/android-application-apk-maximum-size"">Android - Application (apk) Maximum size</a>  </p></blockquote><p>I want to install an APK file with 350 MB size in Android real devices.</p><ul><li>Is this possible? </li><li>What is the maximum size of an APK? </li></ul>","131062","","23199","","2011-09-06 03:24:00","2011-09-06 03:24:00","install large APK on Android device","<android>","2","0","","2011-09-06 16:28:19",""
"4134197","1","7632973","","2010-11-09 13:35:43","8","1380","<p>I am currently developing RPC services for developers to use, but would like to make sure that I can distinguish between another app's debug key and their public key. Is there a way to check another app's key and tell whether it is a debug key and NOT a published app key?</p><p>The purpose of this is to be able to tell when their app is in development or release status, as I need to be able to tell whether they should be accessing my dev server or my production server.</p>","501932","","1921273","","2013-02-02 23:28:59","2013-02-02 23:28:59","Is there a way to check if an app signature is debug or published?","<android><security><certificates><license-key>","2","1","3","",""
"4134203","1","","","2010-11-09 13:36:09","13","43121","<p>I want to use dynamically registered BroadcastReceiver that has a reference to an activity so it can modify its UI. I am using Context.registerReceiver method but receiver's onReceive method is never called.</p><p>Here is the sample code showing the problem:</p><pre><code>package com.example;import android.app.Activity;import android.app.IntentService;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;import android.util.Log;import android.view.KeyEvent;public class RegisterBroadcastReceiver extends Activity {    public static class MyIntentService extends IntentService {        public MyIntentService() {            super(MyIntentService.class.getSimpleName());        }        @Override        protected void onHandleIntent(Intent intent) {            Intent i = new Intent(this, MyBroadcastReceiver.class);            sendBroadcast(i);        }    }    public class MyBroadcastReceiver extends BroadcastReceiver {        @Override        public void onReceive(Context context, Intent intent) {            Log.i(MyBroadcastReceiver.class.getSimpleName(),                  ""received broadcast"");        }    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    MyBroadcastReceiver mReceiver = new MyBroadcastReceiver();    @Override    protected void onResume() {        super.onResume();        IntentFilter intentFilter = new IntentFilter();        registerReceiver(mReceiver, intentFilter);    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {        if (keyCode == KeyEvent.KEYCODE_MENU) {            Intent i = new Intent(this, MyIntentService.class);            startService(i);        }        return super.onKeyDown(keyCode, event);    }    @Override    protected void onPause() {        super.onPause();        unregisterReceiver(mReceiver);    }}</code></pre>","501940","","510491","","2013-04-30 09:20:52","2013-04-30 09:20:52","How to use registerReceiver method?","<android><broadcastreceiver>","2","0","5","",""
"4134278","1","","","2010-11-09 13:43:39","1","678","<p>The row of my listview has 3 texts. What I want to do is to align all the rows texts vertically. I tried that using the TableLayout view for the row, and I've set the width for the first and third cell's as a constant. I'm not very happy using constants because of the porting issues. Is it possible to align these texts without in another way? Here is the layout:</p><pre><code>&lt;LinearLayout     android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" &gt;    &lt;TextView            android:id=""@+id/ingredient_amount""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""1"" /&gt;    &lt;com.one2snap.littlechef.android.main.ui.views.AmienneTextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:id=""@+id/ingredient_title"" /&gt;&lt;/LinearLayout&gt;</code></pre>","460611","","436938","","2012-04-02 11:02:43","2012-04-02 11:02:43","Align row texts in a listview","<android><android-layout>","1","0","","",""
"4134290","1","4134477","","2010-11-09 13:44:42","0","416","<p>Is it possible to use Android 2.2 on Eclipse current version?And Is it working properly on Eclipse current version?</p>","488433","","","","","2010-11-09 15:30:23","Is it possible to use Android 2.2 on Eclipse current version?","<android><eclipse>","2","0","","",""
"4134546","1","","","2010-11-09 14:10:23","3","1001","<p>I'm using ASP.NET Forms Authentication with a simple way. The authentication use a cookie for store the credentials.</p><p>Works perfectly in browsers like:Desktop: Chrome, Safari, IE, ...Mobile: iPhone Browser, Opera Mobile ...</p><p>I press the button form's authentication and i redirect to the app page.</p><p>BUT, in Android browser i press the button and nothing.</p><p>The configuration of ASP.NET Forms Authentication is simple:</p><pre><code>&lt;authentication mode=""Forms""&gt; &lt;forms loginUrl=""MLogin.aspx""     timeout=""30""     name="".MOBAUTH""     path=""/""     defaultUrl=""Main.aspx""     cookieless=""AutoDetect""&gt;  &lt;credentials passwordFormat=""Clear""&gt;   &lt;user name=""dev"" password=""123456""/&gt;  &lt;/credentials&gt; &lt;/forms&gt;&lt;/authentication&gt;&lt;authorization&gt; &lt;deny users=""?"" /&gt;&lt;/authorization&gt;</code></pre><p>Does anyone have any idea what might be happening?</p><p>Complementing...</p><p>MLogin.aspx use a simple method for authenticate the user:</p><pre><code>private void authenticate(){    if (FormsAuthentication.Authenticate(""dev"", this.txtPass.Text.Trim()))        FormsAuthentication.RedirectFromLoginPage(""dev"", true);    Response.End();}</code></pre>","501962","","501962","","2010-11-09 15:30:45","2011-11-22 14:58:55","ASP.NET Forms Authentication with Android Browser","<asp.net><android><mobile><forms-authentication>","2","1","","",""
"4134582","1","4135506","","2010-11-09 14:13:15","12","34559","<p>I have an app that uses radio buttons. The default for this button is set in the main.xml file, ie: </p><pre><code>android:id=""@+id/rb_sat1E""android:checked=""true""</code></pre><p>In the Java file I have:</p><pre><code>final RadioButton radio1 = (RadioButton)findViewById(R.id.rb_sat1E);</code></pre><p>I have also created a 'Reset' button in the main Java file and can use the following code to reset TextView information ie.</p><pre><code>pos1_deg.setText(""0.0"");</code></pre><p>But how do I reset a radio button? I would have thought it to be something like</p><pre><code>radio1.setBoolean(""TRUE"");</code></pre><p>But that does not work at all.</p><p>Any help greatly appreciated. Thanks.</p>","497517","","366904","","2010-11-09 14:26:29","2013-06-19 23:06:16","How to set a radio button in Android","<android><button><radio>","3","0","1","",""
"4134699","1","","","2010-11-09 14:24:13","1","212","<p>I have a list of applications, and I want to weed out all the non launchable/non removeable ones. When I run my program on my phone, it gives me all the ones I dont want also, and yes i have:</p><pre><code>getInstalledApps(false); /* false = no system packages */ </code></pre><p>Any Ideas?</p>","481082","","481082","","2010-11-10 02:36:44","2010-11-10 02:36:44","Checking if an application is launchable","<android>","0","3","","",""
"4134762","1","","","2010-11-09 14:28:52","3","747","<p>I am developing an application which I need to test in Samsung I9000 whose resolution is 480*800. But when I try to  create a AVD Emulator with 480*800 resolution, I am getting a very big resolution. How to get the screen resolution of Emulator similar to Device.I will be waiting for valuable reply.</p>","429501","","1921273","","2013-02-02 23:41:53","2013-02-02 23:41:53","Not able to set actual device resolution in Emulator","<android>","2","0","","",""
"4134875","1","4148745","","2010-11-09 14:38:57","1","1988","<p>I have a ListActivity displaying a bunch of objects from a list. I want to change the background &amp; text color of the row based on the state of the two booleans in the MonitorObject.</p><p>Do I need to extend ArrayAdapter? If so, a code sample would be greatly appreciated as I have been trying to figure it out for a few days with no success. </p><pre><code>public class Lwm extends ListActivity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.list);    setListAdapter(new ArrayAdapter&lt;MonitorObject&gt;(this, R.layout.row, getMonitorObjects()));  }  private List&lt;MonitorObject&gt; getMonitorObjects() {    List&lt;MonitorObject&gt; mos = new ArrayList&lt;MonitorObject&gt;();    mos.add(new MonitorObject(15000, 20000, 25000));    mos.add(new MonitorObject(15000, 14000, 18000));    mos.add(new MonitorObject(15000, 12000, 14000));    mos.add(new MonitorObject(100, 200, 250));    mos.add(new MonitorObject(3000, 2500, 3500));    return mos;  }}</code></pre><hr><pre><code>public class MonitorObject {  private int mTimeTotal;  private int mWarningThreshold;  private int mAlarmThreshold;`enter code here`  private boolean mWarning;  private boolean mAlarm;  public MonitorObject(int timeTotal, int warningThreshold, int alarmThreshold) {    this.mTimeTotal = timeTotal;    this.mWarningThreshold = warningThreshold;    this.mAlarmThreshold = alarmThreshold;      mWarning = (mTimeTotal &gt; mWarningThreshold) ? true : false;    mAlarm = (mTimeTotal &gt; mAlarmThreshold) ? true : false;  }  /*getters, setters, tostring goes here*/}</code></pre>","434457","","","","","2010-11-10 20:26:25","Android ListActivity row color based on object state","<java><android><listview><android-arrayadapter>","1","0","1","",""
"4135195","1","","","2010-11-09 15:12:45","1","316","<p>I have a problem. I would like to load activity from another activity which is in TabWidget but once I am using </p><pre><code>startActivity(new Intent(this,SecondActivity.class)); </code></pre><p>secondActivity is loaded but it takes all screen and there are no more tabs. Is there a possibility to load secondActivity but into the active tab layout (TabWidget)?</p><p>cheers,/Marcin</p>","193400","","539542","","2012-01-15 06:49:29","2012-01-15 06:49:29","android - running activity within activity within tabwidget","<android><activity><tabwidget>","0","2","","",""
"4135273","1","","","2010-11-09 15:19:41","0","607","<ol><li>I have 4 tabs in activity group.  </li><li>In Each tab(Separate Activity group) there are around 5 activities and I'm switching   between the activities without any problem.                                                   </li><li>My problem is with the device Emulator device back button.</li><li>Suppose I'm on 4th tab when application launches. and when I click on back button I'm showing dialog box to exit app. and it showing me the dialog box as well. But when I move to some other activities in 4th tab I'm not able to maintain the stack of activities and whenever I press back button then my app is minimizing.this problem is occurring in all tabs.</li></ol>","383597","","1921273","","2013-02-02 23:58:34","2013-02-02 23:58:34","Android Tab Activity","<android>","1","0","","",""
"4135316","1","","","2010-11-09 15:24:05","0","777","<p>I did a simple animation: translation from A to B of a TableLayout which is inside a FrameLayout. The TableLayout contains an EditText and a Button. The animation is done OK but I can't move the EditText and the Button to that position. They remain in the same place but not visible. I tried setMargins, offsetTopAndBottom and declaring LayoutParameters. I wasn't able to do this. Maybe I am not using them right. Can anyone give me a code example?</p><p>Part of the code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final Button Btn01 = (Button) findViewById(R.id.Btn01);    final Button Btn02 = (Button) findViewById(R.id.Btn02);    final EditText ET01 = (EditText) findViewById(R.id.ET01);    final TableLayout TL01 = (TableLayout) findViewById(R.id.TL01);    final Animation src_slide = AnimationUtils.loadAnimation(this, R.anim.src_slide);    src_slide.setFillAfter(true);    Btn01.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            TL01.startAnimation(src_slide);     //TL01.offsetTopAndBottom(50);    //Btn02 and ET01 are in TL01                        }    });</code></pre><p>}</p><p>And the animation xml:</p><p>  android:toYDelta=""50""  android:duration=""400"" /></p><p>So I repeat, I cannot change the actual position of ET01 and Btn02.</p><p>Thank you very much!</p>","502064","","502064","","2010-11-10 07:33:50","2010-11-10 07:33:50","Android - TableLayout with EditText and Button - not working after animation","<android><animation><button><move>","0","2","","",""
"4135402","1","","","2010-11-09 15:32:11","4","3199","<p>I'm developing an android app that will play mp3 files.  However the mp3 files are encrypted on the sd card or sqlite.  Either ways, after decryption, i'll have a stream of bytes.  How do i play them? MediaPlayer does not take inputstream as parameter, so i cannot consider that.</p>","381203","","","","","2013-05-08 19:50:41","How to play an audio stream of bytes in android?","<android><audio>","3","2","3","",""
"4135471","1","4135971","","2010-11-09 15:37:42","0","305","<p>I'm trying to parse many string dates to Date(s), some with time part, others without, with the ""dd/MM/yyyy HH:mm"" format.</p><pre><code>public static Date StringToDate (String format, String theDate) {  SimpleDateFormat df = new SimpleDateFormat(format);  Date retDate = null;  try {   df.setLenient(true);   retDate = df.parse(theDate);  }   catch (ParseException e) {   e.printStackTrace();  }  return (retDate); }</code></pre><p>(here, format is always ""dd/MM/yyyy HH:mm"").</p><p>But this causes an exception, even with setLenient forced at true. Do you know how I may convert to Date a lot of strings formatted like ""dd/MM/yyyy HH:mm:ss"", but with someones without time, some others without secondes, and still other one with everything ?</p>","499417","","1921273","","2013-02-03 00:08:21","2013-02-03 00:08:21","Java : Impossible to parse ""23/10/1973"" with ""dd/MM/yyyy HH:mm"" format","<java><android><exception><date-format>","2","1","","",""
"4135521","1","","","2010-11-09 15:41:56","0","1540","<p>So, I am getting an error that I am updating the UI from the wrong thread.  This of course was not my intention.  My case is quite long, but I will try to do it justice with code snippets.  My end goal is to run an expensive task in a separate thread and post update that happen along the way and at the end to my listView.</p><pre><code>public class test extends Activity {   private ArrayAdapter&lt;String&gt; _mOutArrayAdapter;   private ListView _mOutView;   private EditText _mCmdEditText;   private Button _mRunButton;   private Interpreter _interpreter;   // Need handler for callbacks to the UI thread   public final Handler _mHandler = new Handler() {    public void handleMessage(Message msg) {        _mOutArrayAdapter.add(msg.getData().getString(""text""));    };   };   // Create runnable for posting   final Runnable mUpdateResults = new Runnable() {       public void run() {           updateResultsInUi();       }   };   /** Called when the activity is first created. */    @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);       _interpreter = new Interpreter(true);       _mOutView = (ListView)findViewById(R.id.out);       _mCmdEditText = (EditText)findViewById(R.id.edit_command);       _mRunButton = (Button)findViewById(R.id.button_run);       _mOutArrayAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.message);       _mOutView.setAdapter(_mOutArrayAdapter);       _mOutArrayAdapter.clear();       _interpreter.setOutputAdapter(_mOutArrayAdapter);       Thread t = new Thread() {            public void run() {               _mResults = _interpreter.executeExpression(""startup;"",_mHandler);               _mHandler.post(mUpdateResults);           }       };       t.start();   ); </code></pre><p>And then inside inpterpreter I do this:    </p><pre><code>public class Interpreter {    private static Handler _mHandler;    public String executeExpression(String expression, Handler handler)    {          _mHandler = handler;        //Do a bunch of stuff that sometimes calls displayText from this class or from others        return answer;    }    public void displayText(String text)    {        Message msg = new Message();        Bundle bndl = new Bundle();        bndl.putString(""text"", text);        msg.setData(bndl);        _mHandler.dispatchMessage(msg);    }}</code></pre><p>The display of the final answer works.  And the dispatchMessage is ending up triggering handleMessage, but it throw an error that I cannot modify the UI from outside of the UI thread which I know is illegal. So, what am I doing wrong?</p><p>Thanks!</p>","502090","","1904504","","2013-04-26 04:14:06","2013-04-26 04:14:06","How to update UI via Handler","<android><multithreading>","3","2","","",""
"4135699","1","","","2010-11-09 15:57:46","17","7516","<p>When I create an Options Menu the items seem to default to the native ""sans"" font.   When I look at commercial apps they mostly seem to do the same thing.   Is it possible to set the font size, color weight or typeface for Option Menu items?</p><p>Thanks in advance.</p>","424690","","","","","2014-04-14 15:09:03","How to set a font for the Options menu?","<android>","4","1","8","",""
"4135871","1","","","2010-11-09 16:13:18","1","4158","<p>I am making a math program that reads in numbers from an edittext box, and creates / LU factors a matrix. When a user clicks into this field, the regular keyboard shows. It would be easier for the user if it were a numeric keyboard. When I use android:inputStyle=""number"" the amount of numbers allowed to be entered into the field is 1. How do I bring up the numeric keyboard without limiting the ability to enter multiple numbers?</p>","502116","","21234","","2010-11-09 20:31:26","2012-08-27 12:58:06","How do I open numeric keypad when edittext selected and input multiple numbers? inputStyle=""number"" limits the quantity of numbers to one","<android><android-layout>","3","0","","",""
"4135927","1","4138235","","2010-11-09 16:18:36","1","5655","<p>How I copy a image to internal memory and recover after that? </p>","495239","","","","","2010-11-09 20:26:13","Copy image to internal memory","<android>","2","1","1","",""
"4136154","1","","","2010-11-09 16:42:32","3","3878","<p>I use my Android app's application Context as a storage area for ""current state"" information for my app.</p><p>I'm finding that in the field, there are cases when this information goes away on some people's devices causing various NullPointerExceptions since I expect the data to be there when the app resumes and starts rebuilding the necessary activities.</p><p>This usually happens when the user hits ""Home"", does something else, then eventually wanders back into the app - it attempts to go back to where it was before, but the application Context has mysteriously lost all its previously-saved state information (in my case, a few integers and a few Strings).</p><p>I know this is a very vague question, but are there any cases (other than the user using ""back"" to back completely out of the application) where the application Context gets completely destroyed even though the application is not terminated?</p><p>Is there a better way to maintain persistant state information?</p><p>Thanks!</p>","435210","","","","","2010-11-09 16:49:03","Does the Android Application Context ever get destroyed?","<android><context>","1","0","","",""
"4136161","1","","","2010-11-09 16:43:25","0","259","<p>I have a number (123456) converted to a hash key and stored in SharedPrefs using:</p><pre><code>String correctMd5 = passwdfile.getString(PhoneFinder.PASSWORD_PREF_KEY, null);</code></pre><p>I then retreive the number from a string:</p><pre><code>String[] tokens = msg.getMessageBody().split("":"");String md5hash = PhoneFinder.getMd5Hash(tokens[1]);</code></pre><p>and compare the two:</p><pre><code>if (correctMd5 == md5hash) {Toast.makeText(context, ""Hash OK: "" + md5hash, Toast.LENGTH_SHORT).show();}</code></pre><p>However, this check does not complete succesfully.</p><p>If I convert to strings and display them, the hashes are the same, however if I convert to bytes the 4 right most bytes are different. I assume some special character is hidden in there somewhere, how do I check and kill it?</p>","353674","","","","","2012-05-29 22:22:51","Android number comparison problem","<android><hash><comparison>","2","3","","",""
"4136362","1","4136897","","2010-11-09 17:03:33","20","20362","<p>How do disable and hide the address bar from a WebView?</p>","444668","","51759","","2011-06-13 02:07:04","2014-04-15 13:49:08","Disable address bar in Android webview","<android><webview>","4","5","2","",""
"4136399","1","","","2010-11-09 17:07:59","0","876","<p>I have some behaviour of my layout. I give two of them, very similar to each other. Only one difference is the width attribute of the textviews.</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""    android:gravity=""bottom""&gt;    &lt;LinearLayout          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:isScrollContainer=""true""        android:gravity=""center""        android:background=""@color/black""&gt;        &lt;LinearLayout            android:id=""@+id/tabs""            android:layout_width=""0dp""             android:layout_height=""fill_parent""            android:orientation=""horizontal""            android:background=""@color/black""            android:layout_weight=""1""&gt;                                  &lt;TextView                   android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Einstellungen""                android:drawableTop=""@drawable/selector_settings""                 android:id=""@+id/main_menu_button_connection""                 android:gravity=""center""                 android:textAppearance=""?android:attr/textAppearanceMedium""                 android:textSize=""10px""&gt;            &lt;/TextView&gt;                 ...            &lt;TextView                   android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Suche""                android:drawableTop=""@drawable/selector_search""                 android:id=""@+id/main_menu_button_connection""                 android:gravity=""center""                 android:textAppearance=""?android:attr/textAppearanceMedium""                 android:textSize=""10px""&gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;                 &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>If layout_width is set to wrap content, I get following layout results:<img src=""http://i.stack.imgur.com/Fj0yo.png"" alt=""alt text""></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""    android:gravity=""bottom""&gt;    &lt;LinearLayout          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:isScrollContainer=""true""        android:gravity=""center""        android:background=""@color/black""&gt;        &lt;LinearLayout            android:id=""@+id/tabs""            android:layout_width=""0dp""             android:layout_height=""fill_parent""            android:orientation=""horizontal""            android:background=""@color/black""            android:layout_weight=""1""&gt;                                  &lt;TextView                   android:layout_width=""70dp""                android:layout_height=""wrap_content""                android:text=""Einstellungen""                android:drawableTop=""@drawable/selector_settings""                 android:id=""@+id/main_menu_button_connection""                 android:gravity=""center""                 android:textAppearance=""?android:attr/textAppearanceMedium""                 android:textSize=""10px""&gt;            &lt;/TextView&gt;                 ...            &lt;TextView                   android:layout_width=""70dp""                android:layout_height=""wrap_content""                android:text=""Suche""                android:drawableTop=""@drawable/selector_search""                 android:id=""@+id/main_menu_button_connection""                 android:gravity=""center""                 android:textAppearance=""?android:attr/textAppearanceMedium""                 android:textSize=""10px""&gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;                 &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>If layout_width is set to a value instead (here 70dp), my layout looks so, I want it to have:</p><p><img src=""http://i.stack.imgur.com/gGZ0z.png"" alt=""alt text""></p><p>Can anybody explain me, why?!</p><p>Is there some solution avoiding to set a constant width and still having layout result like at the second picture?!</p><p>Thank you in advance</p>","408780","","","","","2011-03-18 13:12:28","Layout problems. Android","<android><layout>","2","0","","",""
"4136409","1","4136581","","2010-11-09 17:09:27","0","301","<p>In my app, I have to present a few numbers from a .csv file that's accessible from the web. Now, this .csv is quite big. I don't want to download and process the whole thing, there's no point. My numbers are always in the beginning of the file, in well specified positions - lets say position 5 to 10.</p><p>Could you give me some tips on how to implement this? I know how to download the whole thing, but don't know how to download only a part of it.</p><p>Thanks.</p>","446529","","","","","2010-11-09 17:27:10","How to download only the first part of a .csv file on Android?","<android><http><file><csv><download>","3","0","","",""
"4136548","1","","","2010-11-09 17:23:33","0","896","<p>I want each pixel on the screen to flash between red, blue, green, white, and black but independently of each other. Is this possible? I have been searching everywhere with out any luck. Any help on where to start would be greatly appreciated.</p>","455413","","","","","2010-11-09 17:57:57","how to randomly change the color of every pixel on the screen","<java><android>","1","1","3","",""
"4136553","1","","","2010-11-09 17:24:07","0","447","<p>When ever i change in to another orientation the Activity onCreate() method is called again?how ever i used <strong>android:configChanges=""orientation|keyboardHidden""</strong>but it prevent to change another orientation.how to block on calling the OnCreate() again?</p><p>Thanks in advance...</p>","461972","","","","","2012-05-25 14:44:06","Orientation on android","<android>","2","1","","",""
"4136569","1","4137032","","2010-11-09 17:25:40","7","4991","<p>In my XML, I've set the focusable, focusableInTouchMode, clickable, and longClickable variables to false, yet I can still click and move the SeekBar.  Do I need to actually change the listener events to do this?  That seems so unnecessary.</p>","255394","","10505","","2014-01-10 02:52:49","2014-01-10 02:54:14","How to Set an Android SeekBar to be unmoveable/frozen?","<android><focus><click><touch><seekbar>","2","0","1","",""
"4136690","1","4136769","","2010-11-09 17:36:21","5","3710","<p>Hey, I want to access the Android call list, so I can see the contact name, the hour of the calling, the duration, the hour of the calling and the date. Where is it, and how can I access it?</p><p>Thanks.</p>","399459","","","","","2010-11-09 17:46:30","How to access the Android call list?","<android><telephony><calling><telephonymanager>","2","0","","",""
"4136737","1","4137035","","2010-11-09 17:40:48","2","565","<p>I'm writing a small program, it can show and manager all files and folder in the android mobile. Now I get a problem need to help, when I click to a file icon, example a audio, i want the audio player can run and play it. Who can help me</p>","502214","","96780","","2013-09-02 15:41:58","2013-09-02 15:41:58","Android: How to run another program from my program and send argument to it","<android>","2","1","","",""
"4136810","1","4136884","","2010-11-09 17:51:00","3","367","<p>Hello is it possible to know if the user tries to uninstall an application and ask for password in order to continue? I have a security application and I would like to ask the user to authenticate before uninstalling the application is it possible and how?</p>","234898","","759866","","2014-02-05 15:35:14","2014-02-05 15:35:14","android know if an app is installed","<android>","2","0","2","",""
"4136891","1","4137881","","2010-11-09 17:59:55","0","546","<p>I am trying to write a simple android widget and I have the following problem.</p><p>I am trying to access a textView from the appWidgetProvider class in order to set the font to a custom typeface. The code looks like the following:</p><pre><code>TextView mytext = (TextView) findViewById(R.id.mytext); Typeface typeface = Typeface.createFromAsset(context.getAssets(), ""fonts/custom-font.ttf""); mytext.setTypeface(typeface);  </code></pre><p>The problem is that findViewById is not defined in the appWidgetProvider object. So how do I do this? I have found that you can do this by creating a canvas and drawing the custom font to an ImageView but this is not a good solution. Is there a way to do this with textView? If it can be done in an activity, why can't it be done in a widget?</p><p>Thanks</p>","501223","","212275","","2011-03-04 22:16:52","2011-03-04 22:16:52","Accessing view objects from appWidgetProvider","<android><widget>","1","0","","",""
"4137163","1","4143607","","2010-11-09 18:30:55","0","4802","<p>Greetings,</p><p>I'm trying to simply display an image using Appcelerator on Android.</p><p>I don't understand why it won't work.</p><p>Here is my code:</p><pre><code>var back=Titanium.UI.createImageView({ url:'images/back.png'});win.add(back);</code></pre><p>I've also tried putting the image inside a view:</p><pre><code>var view = Titanium.UI.createView({   borderRadius:10,   backgroundColor:'red',   left:10,     right:10});var back=Titanium.UI.createImageView({ url:'images/back.png'});view.add(back);win.add(view);</code></pre><p>I'm totally stuck and am hoping someone can point me in the right direction here.</p><p>Many thanks in advance,</p>","395974","","395974","","2010-11-09 18:47:35","2010-11-10 10:45:13","Appcelerator show an image","<android><image><titanium><appcelerator>","2","3","1","",""
"4137217","1","4137870","","2010-11-09 18:37:24","1","1406","<p>I'm developing an Android application with OpenGL and JNI (all OpenGL stuff is in C code).</p><p>Imagine I've drawn a cube. I want that user can push his finger over the cube and can rotate the cube and move it around the screen.</p><p>Is there any way to do that?</p><p>How can assign an event listener to touch and move events only when the user touch the cube?</p><p><strong>UPDATE</strong><br/> I want something like this:<br/><br/><a href=""http://www.youtube.com/watch?v=mmlbQJxX4I8"" rel=""nofollow"">Rotate cube with fingers</a></p><p>Thanks. </p>","68571","","68571","","2010-11-09 18:53:48","2011-03-29 12:33:21","Moving OpenGL objects with fingers","<android><opengl-es><event-handling><jni>","1","3","","",""
"4137261","1","4137343","","2010-11-09 18:44:17","0","368","<p>I have a service that will send out notifications with timed tasks.  I need this service to run outside the life of the application, but I only need to access the services functions during the lifespan of the app.  Is a local service enough or do I need to implement AIDL?Thanks.</p>","408079","","","","","2010-11-09 18:54:29","Do you need to implement AIDL for a service to run outside of your apps life?","<android><android-service><aidl>","2","1","","",""
"4137341","1","","","2010-11-09 18:54:23","0","2154","<p>I want to achieve a layout where screen is divided vertically in half, right half has 1 text field and left side has text and edit field. I want left text fiels to start from center and left side fields end at center. I tried to use below code but it does not work.</p><p>I used linear layout, how can i move the text box to left of center in below code</p><pre><code>&lt;LinearLayout android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:orientation=""vertical""    android:gravity=""center""&gt;    &lt;LinearLayout android:id=""@+id/calcInterestRateRow""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;        &lt;LinearLayout android:layout_marginRight=""3dip""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_gravity=""right""            android:orientation=""horizontal"" android:layout_weight=""1""&gt;            &lt;TextView android:text=""%"" android:textColor=""@color/white""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;            &lt;EditText android:id=""@+id/calcInterestRateLabel""                android:layout_height=""wrap_content"" android:layout_width=""90dip""                android:lines=""1"" android:inputType=""phone"" android:imeOptions=""actionNext"" /&gt;        &lt;/LinearLayout&gt;        &lt;TextView android:id=""@+id/calcSalesTaxLabel""            android:layout_marginLeft=""3dip"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:text=""Interest Rate %""            android:textColor=""@color/white"" android:layout_weight=""1"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","470682","","","","","2010-11-09 21:35:06","android table column sizing","<android><forms><layout>","1","0","","",""
"4137464","1","4138456","","2010-11-09 19:10:50","0","1622","<p>In my Android app, I have two custom view classes - PortraitClass and LandscapeClass. They both do the same thing. On running the app, the view class fetches some pictures from an SDCard and then maniputlates (skew etc) and displays them. The only difference between the two classes is that the layout of pictures is slightly different on the screen. </p><p>I have two display.xml files (one under layout folder and the other under layout-land). The one under the layout folder adds Portrait and the other adds the Landscape class. </p><p>On orientation change, I would like to send information (picture numbers and few bitmaps) from one class to another so I won't have to fetch all the bitmaps again and also so that I display the ones that were being displayed. </p><p>I find the parcelable thing kind of confusing. I tried following <a href=""http://stackoverflow.com/questions/3542333"">this_example</a>, but I noticed that in onRestoreInstance, the Parcelable has null for the ""mSuperState"" and I get a classCastException @ ""SavedState ss = (SavedState)state"". The integer (picture number) that I am trying to pass is there. I am not sure what I am doing wrong.</p>","296919","","296919","","2010-11-09 19:47:34","2011-12-09 18:15:45","Android: passing data between views","<android><view><parcelable>","3","0","1","",""
"4137476","1","4137756","","2010-11-09 19:11:55","0","262","<p>i have database with only a counter....i wanted to know how to increment it....i have seen this article<a href=""http://stackoverflow.com/questions/3427516/increase-the-value-of-a-record-in-android-sqlite-database"">Increase the value of a record in android/sqlite database</a>but dont really understand it....does someone have a code sample which might be useful?</p><p>i basically want to make a quotes application...in that say the user has seen 50 out of 100 quotes and exits the application...i want to restart from 50 next time the user starts up the application...is there any other way apart from databases to accomplish this task?</p>","502310","","","","","2010-11-09 20:33:12","how to increase the value of a counter in a database in android?","<android><database><increment>","3","0","","",""
"4137629","1","4137692","","2010-11-09 19:30:02","0","1567","<p>I'd like to set the ringer mode to silent for specific events in the future. It should only happen if a checkbox in the preferences is checked. I know that I have to update the manifest for the permissions and also that I can set the ringer mode with something like this:</p><pre><code>if (getPreferences(MODE_PRIVATE).getBoolean(PREFS_KEY_SILENTOPTION, false)) {   AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);   audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);}</code></pre><p>But how can I set (and reset) it for a space of time in the future?</p>","474326","","","","","2010-11-09 19:35:55","Setting silent mode at a specific date and time","<android><silent><audiomanager><quiet>","1","0","","",""
"4137758","1","","","2010-11-09 19:42:13","0","334","<p>Hello everybody :)I have a problem that couldn't be solved using google(!) so I turn fr your help!</p><p>I created an app with one activity, and it works just fine.Having though more about the app, I decided to add another activity which be the welcome screen of the app, with a nice logo and some buttons. This app should direct the user to the activity I mentioned before.The only trouble is - I can't find out where and how can I determine which activity should launch first, the moment the app loads.Do I need to create the entire app from scratch, but this time programing the home activity first? there must be a simpler way...</p><p>Thanks in advance,Shai:)</p>","502333","","21234","","2010-11-09 20:29:18","2011-03-22 11:43:39","Changing the starting activity","<android><activity><startup><launch>","2","4","","",""
"4137961","1","","","2010-11-09 20:02:18","1","293","<p>I have a ListView and each item contains a TextView displaying a number.  I'd like to give my users the ability to change this number while staying on the ListView (as opposed to drilling down into a detailed view by clicking on the list item).</p><p>What I'm looking to do is to slide in a layout from the bottom of the screen that covers about half of the screen.  I'd like this layout to be OVER the Activity behind it (as opposed to being part of that Activity's layout and simply showing it).  I'd also like it to be model (or seem modal).  Meaning the Activity behind it can not be focused and manipulated.  In this layout I will essentially create a calculator.</p><p>What I need help with right now is:1) How to display a layout over the current Activity2) How make the background (the Activity) modal</p><p>Could someone point me to some tutorials/resources and/or give me a few tips?</p>","406790","","","","","2010-11-09 20:14:29","Sliding in a layout for user input","<android>","1","0","1","",""
"4138001","1","4138080","","2010-11-09 20:05:23","4","1756","<p>This has been plaguing me for a few days now. Any time I try to use a breakpoint to debug into anything other than an activity (background service, broadcast receiver, input method) my breakpoint will be hit normally, but then about five seconds later the device will terminate the process and disconnect from the debugger. It isn't enough time to gather any meaningful information so debugging has proven extremely difficult.</p>","319506","","","","","2012-02-22 05:59:39","Android device disconnects from debugger a few seconds after breakpoint is hit","<android><debugging><breakpoints>","2","4","2","",""
"4138068","1","","","2010-11-09 20:10:52","1","827","<p>I'm making an Javascript web app and I can't for the life of me get the <code>touchstart</code> event to fire. I get the <code>touchmove</code> and <code>touchend</code> events no problem. This is a problem because as I see it the best way to distinguish between a tap and a scrolling motion is to zero a counter on the <code>touchstart</code> event, update it at <code>touchmove</code> and then compare it at <code>touchend</code>. I'm doing this so I can do some action at the end of tap but not a scroll. For instance, it would be very confusing if a page opened for an item in a listed after you finished scrolling down that list, but it would be nice to be able to tap on an item to open its page.</p><p>This is what I have:</p><pre><code>// FIXME: this doesn't seem to ever fireel.addEventListener('touchstart', function(e) {  // make sure that at the start of every touch we're not considered to be moving  alert(""Touch starting"");  app.__touchMoving = 0;}, false);el.addEventListener('touchmove', function(e) {  app.__touchMoving++;}, false);el.addEventListener('touchend', function(e) {  alert(""Touch ended. We moved beforehand this many times: "" + app.__touchMoving);  // if we are moving  if (app.__touchMoving &gt; 0) {    // stop, since we're dragging, not tapping      return false;  }  // else we're no longer moving, so it was a tap}</code></pre><p>I never see the <code>touchstart</code> alert. If I scroll the <code>touchend</code> will fire and app__touchMoving will have some sort of decent value. On a side note, I've noticed that sometimes the <code>touchend</code> will seem to fire multiple times.</p><p>Am I missing something basic here? Plenty of people say that this should work just fine on Android (and iPhone) yet the first listener never seems to fire.</p><p><strong>Update:</strong> I should mention that I've been testing on a Samsung Galaxy S running Android 2.1.</p>","46768","","46768","","2010-11-09 22:34:58","2010-11-09 22:34:58","How do I catch taps but not scrolling in Javascript in Android?","<javascript><android><javascript-events><touch-event>","1","2","","",""
"4138220","1","","","2010-11-09 20:25:05","1","785","<p>Is there any way to receive an event via a broadcast or any other way when new activity starts or any task in android?</p><p>Thx Mahmoud</p>","502385","","","","","2010-11-09 21:27:05","Listen to new task or activity in android","<android><activity><listener><task>","1","2","","",""
"4138307","1","4138857","","2010-11-09 20:34:05","1","2805","<p>I'm pretty new to Android development and would appreciate some help. All I want is to display a ListView showing a Twitter timeline. I do this in an iPhone app using MGTwitter but I've been trying and am not sure how to get the same effect on Android. I can use a list view, but I'm not sure how to get the updates. </p><p>In a nutshell all it has to do is display the updates at www.twitter.com/user (User will be hardcoded).</p><p>Thanks</p>","470763","","","","","2010-11-09 21:33:01","Display Twitter Timeline in Android ListView","<java><android><twitter>","1","2","","",""
"4138337","1","4138395","","2010-11-09 20:36:47","1","649","<p>The Android weather genie widget has <a href=""http://www.absolutelyandroid.com/wp-content/uploads/2010/03/screenshot5_thumb.png"" rel=""nofollow"">an awesome graph</a>. I want to add it to my app. </p><p>But I can't figure out how they did it! (they aren't releasing the source code). </p><p>Can someone please tell me where to find a nice polished graph like that I can drop into my app? </p><p>TanksBrad</p>","268803","","","","","2013-03-08 07:08:13","How do I add a graph to my app like the one in the Android weather genie widget?","<android><graphics><graph>","1","0","1","",""
"4138343","1","","","2010-11-09 20:37:19","5","1306","<p>Is a bluetooth connection between a android device and a laptop encrypted by default? The bluetooth server is started on the android smartphone and therfore, the connection is initiated by the laptop.</p><p>Thanks,Peter </p>","502396","","398460","","2011-08-30 13:02:31","2011-10-17 22:26:39","Android 2.1: Bluetooth Encryption","<android><encryption><bluetooth>","1","1","1","",""
"4138495","1","4138722","","2010-11-09 20:51:41","1","200","<p>I’m trying to understand how an application can take on some of the coloring responsibilities of an image through code to achieve a more flexible array of coloring options.  Let me explain.</p><p>Say you design a great looking image in photoshop, maybe an automobile.  You make the automobile red.  Then, using additional translucent layers, you add the brighter and darker spots to achieve stuff like shadowing or a sparkle in the sunlight.  Maybe then you add another layer that is the chrome trim.</p><p>I want to then be able to modify that “red automobile” layer without affecting the rest of the shadowing effects that really polish the image.  I want to, through code, change the automobile to say blue and have it sparkle and shine just like the red automobile.</p><p>First of all, is this possible? If so what do I need to start reading about in order to be able to dynamically adjust the color of an image like this.  What classes are available to use that can help me?  Are there any pitfalls I need to watch out for?</p><p>Secondly, and perhaps most importantly, what do I specifically need to tell my graphic designer I need in order to set me up properly.  If I can’t communicate what I need properly, it is unlikely I’ll ever be able to write the code to make it look great!</p><p>As always, thanks for reading and any help you can provide!</p>","432209","","","","","2010-11-09 21:17:28","Can an Android application take on the responsibilities of dynamically coloring image resources via code?","<java><android><colors>","1","0","","",""
"4138572","1","4139401","","2010-11-09 21:01:03","2","867","<p>Is it possible, if yes how, how do i go from progress 100 to 1 without the user doing anything.</p><p>Like for every .05sec seekbar.setProgress(-=1)So without the user doing anything the seekbar will go down until it reach 1.</p><p>Please anser how to do this</p><p>Thank-you</p>","502419","","","","","2010-11-10 21:47:39","Android Development: seekbar count down!","<android>","3","0","","",""
"4138845","1","","","2010-11-09 21:31:14","4","1575","<p>Hey there, I was wondering if it is possible to use the Android SoftKeyboard within an OpenGL rendered Application (Game)?</p><p>I ask this, because I want to have an ingame gui with self rendered text input fields and ofc with support of the soft keyboard. Is this possible or do I have to render the keyboard all by myself ? (This would be quite a hassle...)</p><p>Any suggestions?</p><p>Thanks in advance!</p><p>Mfg Imp</p>","323220","","44729","","2010-11-09 22:27:17","2012-03-15 05:08:38","Android SoftKeyboard","<android><opengl-es><keyboard>","2","0","1","",""
"4138906","1","4138966","","2010-11-09 21:38:18","1","166","<p>Is it possible to be notified in Android when the Audio system starts playing audio? it looks like i should wire up a BroadcastReceiver, but it's not clear what i would listen for. I could listen for the MediaPlayer intent, but that would only capture when that particular application was playing audio, not when a third party application played audio, etc.</p><p>Any ideas?</p>","339448","","","","","2010-11-09 22:47:04","Android: Getting Notified when Audio is Played","<android><audio>","2","0","","",""
"4138924","1","4139000","","2010-11-09 21:39:48","1","497","<p>When sending two intents (One through <code>startService</code> followed by another through <code>startActivityForResult</code> for the sake of an example), does Android guarantee that the first intent (service) is processed before the second (activity)? More specifically in this case, does it guarantee that the <code>Service.onStartCommand</code> is called before the <code>Activity.onCreate</code>?</p><p>This is assuming that everything runs within the same process so threading issues from several main threads don't interfere.</p><p>I know that Android doesn't guarantee the processing order for a single intent (The order of recipients isn't guaranteed but can be affected by the intent filter priority) but I couldn't find anything mentioning the order between intents.</p><p>Personally I would have thought that, given the single main application thread, the order would be maintained, but I'm facing some bugs that I have hard time explaining unless the order of intents changes.</p>","95157","","","","","2010-11-09 23:00:06","Does Android guarantee order of intents?","<android><concurrency><android-intent>","2","0","","",""
"4139004","1","","","2010-11-09 21:48:10","2","746","<p>I'm trying to implement The Android LicenseChecker in my app, and I've followed the instructions almost verbatim  from the developer site.  Everything seems hooked up correctly, but every single time I get the ""Check timed out."" message.</p><p>I increased the timeout value to 30 seconds, I'm logged into my device (which has the market app installed) with my publisher account login gmail address.  I set the test response to Licensed.  I saved (but didn't publish) a sample app to test with.  When that didn't work, I tried using an app that is already published and just rebuilding the apk locally to include the LVL implementation... what am I doing wrong?  </p><p>I definitely have 3g connectivity. I can browse the web on the device and other connected apps are working correctly.  Please help.</p>","502463","","","","","2011-08-06 18:51:45","Android License Server Check always times out","<android><licensing>","2","1","","",""
"4139149","1","4139593","","2010-11-09 22:04:19","1","808","<p>How can an Android listener be created to perform a task just before entering power save mode? Also: what are some of the low power options that can be controlled by this task?</p>","398460","","","","","2010-11-09 22:58:43","Android power save mode listener?","<android>","1","0","","",""
"4139168","1","4139216","","2010-11-09 22:06:28","5","12863","<p>Just did a fresh Install of Eclipse 3.5 and the Android Platform (SDK's and ADT). I've done this a few times on different machines and so I'm pretty sure I've got everything configured properly.</p><p>Tried importing an Android project and received the following error in the console window:</p><p><strong>""Android requires .class compatibility set to 5.0. Please fix project properties.""</strong></p><p>I've never seen this error before. The only thing I can think of is that its talking about the build target? I've got the project build target set to 1.6 (API Level 4), Which is where I want it. Seems silly that they would require me to change to a higher API level...</p><p>Anyone else see this error before?</p>","242426","","","","","2012-03-16 04:52:37","Android Console Error: ""requires .class compatibility set to 5.0. Please fix project properties""","<android><android-manifest><adt><android-build>","6","2","0","",""
"4139235","1","4139250","","2010-11-09 22:15:23","1","5964","<p>I have a textview in my XML layout file, but when I try to change its text value with code programatically (dynamically, depending on which button the user clicks) then the text of the textview doesn't change.</p><p>This is the code that I tried:</p><pre><code>TextView userText = (TextView) findViewById(R.id.User);userText.setText(bundle.getString(""user""));</code></pre><p>In debug mode, I can see that <code>usertext</code> has the changed text, but the change doesn't appear on my mobile window... I don't know why.</p><p>EDIT: SOLVED!!!! it was a problem with my relative layout, text is out of the window!!!</p>","479886","","479886","","2010-11-09 22:55:31","2010-11-09 22:55:31","Changing the text value of a textview dynamically","<android><textview>","1","0","0","",""
"4139284","1","","","2010-11-09 22:21:44","5","1526","<p>I'm developing a small android java app - i'm a real newbie with android.I'm looking for a way to create a symbolic link from my application on a certain directory.</p><p>I need to execute this as root - this assume the owner of the phone has root permissions on his file system.</p><p>Can someone pls help me?I couldn't find it... if there isn't an API for this is there an alternative, like running a native script or something? </p><p>Thanx!Gili</p>","359417","","","","","2012-12-03 12:40:45","Creating symbolic links from an Android java app","<android>","3","0","","",""
"4139288","1","12938787","","2010-11-09 22:22:40","60","73426","<p>I want my app to recognize when a user swipes from right to left on the phone screen.</p><p>How to do this?</p>","390323","","1765573","","2013-07-25 12:40:53","2014-04-07 06:27:37","Android: How to handle right to left swipe gestures","<android><swipe><gesture-recognition>","8","1","60","",""
"4139300","1","4140432","","2010-11-09 22:24:04","1","801","<p>I have got a new problem with my Android app. The <code>SocketChannel</code> tells me that it <code>isReadable()</code> but there is nothing to read.</p><pre><code>while(running)    {        int readyChannels = 0;        try {            readyChannels = selector.select();        } catch (IOException e) {            e.printStackTrace();        }        if(readyChannels == 0) continue;        Set&lt;SelectionKey&gt; selectedKeys = selector.selectedKeys();        Iterator&lt;SelectionKey&gt; keyIterator = selectedKeys.iterator();        while(keyIterator.hasNext())        {            SelectionKey key1 = keyIterator.next();            if(key1.isReadable())            {                publishProgress(1);            }            else if(key1.isWritable())            {                publishProgress(2);            }            else if(!key1.isValid())            {                Log.e(""State"", ""progress error"");                publishProgress(3);            }        }    }</code></pre><p>I call the needed functions in <code>onProgressUpdate</code>. It is a <code>WebSocket</code> app so I need to send and receive a handshake. Sending and receiving the handshake works with this while loop. First the <code>SelectionKey.isWriteable()</code> and the handshake is sent then the <code>SelectionKey.isReadable()</code> and the handshake is read. But then <code>SelectionKey.isReadable()</code> is still true. Now the normal read function (not the <code>readHandshake</code>) function is called. But there is nothing to read. Here is the code of my read function:</p><pre><code>public byte[] read(int nBytes){    Log.e(""State"", ""public byte[] read(int nBytes) start"");    byte[] resultData = new byte[1024];    ByteBuffer data = ByteBuffer.wrap(resultData);    int remainingBytes = nBytes;    while(remainingBytes &gt;= 0)    {        ByteBuffer buffer = ByteBuffer.allocate(1024);        int bytesRead = 0;        try {            bytesRead = channel.read(buffer);        } catch (IOException e) {            Log.e(""ERROR"", ""channel read"");        }        if(bytesRead &lt; 0)        {            sockState = WebSocketState.WebSocketErrorOccurred;        }        else        {            remainingBytes = remainingBytes - bytesRead;            data.put(buffer.array(), 0, bytesRead);        }    }    Log.e(""State"", ""public byte[] read(int nBytes) done"");    return resultData;}</code></pre><p>Now it gets stuck in an endless while loop. remainingBytes never gets &lt; 0 because there is nothing to read and bytesRead stays 0.</p><p>My question is why is isReadable true when there is nothing to read?</p>","492704","","2109070","","2013-12-31 18:14:10","2013-12-31 18:14:10","SocketChannel fires isReadable() but nothing to read","<java><android><sockets><nio><socketchannel>","1","0","","",""
"4139313","1","","","2010-11-09 22:25:54","5","3377","<p>I have an application which starts a service. The service has a timer and pops a notification every 30 seconds. I notice the following behavior:</p><ul><li>if the screen is on the notifications are shown ok (even if the app is in background)</li><li>if the screen is off (by power button or by itself) the notifications won't show</li><li>if the screen is off but I have the debugging running the notifications appear</li></ul><p>How can I make the service run with the screen off.</p><p>(The actual app only checks if a notification should be checked every 30 seconds, but for testing purposes, the above scenario is ok)</p><p>Thanks!</p>","502500","","","","","2011-09-28 13:03:29","Android service stops working when phone locked","<android>","3","0","1","",""
"4139450","1","7694656","","2010-11-09 22:41:21","1","2076","<p>HiI have downloaded the Source code of Android 2.2 . Where can i find the default app source code of Android(Calculator,Calender etc on pressing Home Button) </p>","412168","","648313","","2011-07-13 20:49:45","2014-01-29 14:17:16","where is the default app source code remain in Android 2.2 source code?","<android><android-source>","3","0","","",""
"4139644","1","","","2010-11-09 23:06:03","0","56","<p>Howdy,I was wondering which Widget ( or rather: on which basic Widets ) did Facebook build the fields in the event section of its App. I would really love to build some views which behave like them but I have no clue what the used - I would guess it's a fancy non-scrolling implemenation of the ListView but I would have no idea how to achieve that.I found some Snippets here on SA but they included to change it into an LinearLayout - which would mean that I lose the touch ability.</p>","498400","","498400","","2010-11-09 23:18:04","2010-11-09 23:18:04","widget used in the 'events' section in facebook app and how to do em","<android>","0","2","","",""
"4139806","1","4140748","","2010-11-09 23:31:04","0","573","<p>i populate a ListView from the result of a Sqlite query; one of the fields is the image file name that i would like to show as image into a listview.How can i do to show the image file?I use </p><pre><code>SimpleCursorAdapter(this, R.layout.list_name,cur,new String[] {""fields_list""}, new int[] { R.id.list...});</code></pre><p>Thanks in advanceGreetingsc.</p>","339500","","122313","","2010-11-10 02:15:35","2010-11-10 02:37:29","How to show images loaded from DB into a listView in Android","<android><listview>","1","1","","",""
"4139812","1","","","2010-11-09 23:31:47","3","2796","<p>I'm using the MergeAdapter to create a sectioned list where each section of the list contains a different type of underlying data.  All is working pretty much as expected.  However, the ListActivity's onListItemClicked method seems more complicated than it should be when it comes to determining the type of data underlying the selected list item.  This is the case because I can't find a good way to determine the type of object that underlies the selected item unless I keep a separate map of list position to object type.  I was hoping that I could use the getItemViewType method to return the same type for similar items, but if those items are in separate sections of the ListView, the MergeAdapter returns a type value that offset by the location of the section, i.e., the same type of item in a different section of the list gets a different type value.  I feel like I'm missing something obvious... Any help that anyone can provide would be greatly appreciated.</p>","502559","","260408","","2012-02-01 02:56:52","2012-02-01 02:56:52","Using MergeAdapter; looking for a way to determine a list item's data type in the ListActivity onListItemClicked method","<android><commonsware>","1","0","","",""
"4139844","1","4139903","","2010-11-09 23:36:28","1","2608","<p>Does anyone know of an intent I can use to open a raw mp4 resource in the phone's video player? I tried this code:</p><pre><code>    Uri video = Uri.parse( ""android.resource://"" + getPackageName() + ""/"" + R.raw.video );    Intent intent = new Intent(Intent.ACTION_VIEW);    intent.setDataAndType(video, ""video/*"");    startActivity(intent);</code></pre><p>This threw an ActivityNotFoundException, however this has worked for me when the URI was the sdcard and the video was located there.  Does anyone know how I can use the above code with a resource file in my app?</p>","302925","","","","","2010-11-09 23:45:31","Android intent to open video with raw resource?","<android><video><activity><android-intent>","1","0","","",""
"4140098","1","","","2010-11-10 00:20:45","0","577","<p>Greetings!</p><p>Okay, here is what I want to do.  I would like to tile my screen with ImageViews over a canvas  in the background.  How should I go about this.</p>","445342","","","","","2010-11-10 00:20:45","Tiling Image Views","<android><canvas><imageview><tile>","0","5","","",""
"4140392","1","4140409","","2010-11-10 01:14:01","4","1791","<p>I'm creating files in my Android application using:</p><pre><code>FileOutputStream fos = context.openFileOutput(fileName, Context.MODE_PRIVATE);fos.write(data);fos.flush();fos.close();</code></pre><p>Then later I'm trying to do some cleanup, so I'm comparing the last modified date to some threshold value, but the comparison is showing that the file's last modified date is tomorrow sometime. Keep in mind, when I say tomorrow, that is relative to today (the file modification date)... whichever day this may be that you're reading this.</p><p>So basically, if I create the file today, and check the file's last modification date, it says it was last modified tomorrow.</p><p>Is this something Java is doing, or Android, or something I'm doing?</p>","413414","","413414","","2010-11-10 23:07:30","2012-11-05 11:16:46","Why is Java (Android?) setting my file's last modified date to tomorrow?","<java><android><last-modified><modified-date>","4","2","2","",""
"4140497","1","","","2010-11-10 01:38:59","2","340","<p>I am trying to make a quick instructional video of my new app and I want to use a custom cursor in the shape of a finger in the avd so that the video makes sense to my users.  I can get a custom cursor to work in windows with no problems however the android avd uses a custom black cursor with a white outline that will not be replaced by my custom windows cursor.  Does anyone know how to solve this problem?</p><p>Thanks</p>","502637","","","","","2012-08-17 12:45:35","android avd cursor pointer image","<android><pointers><android-emulator><cursor><avd>","1","0","1","",""
"4140633","1","","","2010-11-10 02:07:58","0","4303","<p>I've tried to follow all the information I could find, but I am not having any luck finding the source of my texture problems and could really use a hand.</p><p>The following is piece of code in which I'm trying to draw 3 pieces of my background using glDrawTexfOES.  The 3 pieces should look like green grass.</p><pre><code>public void onDrawFrame(GL10 gl) {    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();    gl.glFrontFace(GL10.GL_CW);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glBindTexture(GL10.GL_TEXTURE_2D, grass);    gl.glColor4x(0x10000, 0x00000, 0x10000, 0x10000);    ((GL11Ext) gl).glDrawTexfOES(0.0f, 0.0f, -8.0f, 32, 32);    ((GL11Ext) gl).glDrawTexfOES(32.0f, 0.0f, -8.0f, 32, 32);    ((GL11Ext) gl).glDrawTexfOES(64.0f, 0.0f, -8.0f, 32, 32);}</code></pre><p>Instead of green grass however, I'm getting 3 brown squares:<a href=""http://img109.imageshack.us/img109/9670/84615249.jpg"" rel=""nofollow"">http://img109.imageshack.us/img109/9670/84615249.jpg</a></p><p>Any help in figuring out why my textures won't display correctly would be most appreciated!</p><p>On a related note, for building a simple 2D tiled game is glDrawTexfOES the most efficient method for generating the tiled background?</p><p>Thanks in advance,Harry</p>","502656","","44729","","2010-11-10 04:02:43","2012-02-22 14:42:57","Android: OpenGL texture and glDrawTexfOES problems","<android><opengl-es><textures>","2","2","","",""
"4140776","1","5915429","","2010-11-10 02:44:52","3","1154","<p>I have created an app that sends intents among multiple activities.  After doing some research I have found that the <code>ActivityUnitTestCase</code> class is designed for unit testing while the <code>ActivityInstrumentationTestCase2</code> is designed for functional testing.  I understand the use of methods such as <code>setUp()</code>, <code>tearDown()</code>, and <code>testPreConditions()</code>.  However I am having a little difficulty in trying to figure out what <em>user-defined-tests</em> to create in the previously mentioned classes.  I know that there are a few methods that cannot be called in certain classes.  </p><p>To be more specific, if I am in <strong>activity A</strong> and I click a button then it calls <code>startActivityForResult()</code> which starts <strong>activity B</strong>.  I then send an intent back to <strong>activity A</strong> which is handled in the <code>onActivityResult()</code> method.  How can i test that the actual result in <code>onActivityResult()</code> is equal to the expected result? </p><p>I have been looking extensively for any kind of examples that would help clear up this confusion.  If anyone could provide any assistance i would greatly appreciate it.  </p>","502671","","502671","","2012-11-05 20:59:15","2012-11-05 20:59:15","UnitTesting and Functional Testing on Android","<android><unit-testing><functional-testing>","1","0","5","",""
"4140963","1","4141443","","2010-11-10 03:24:50","1","5563","<p>Wondering what the differences between REST and JSON APIs are, how you interface with them, and how to go about parsing the results. My goal is to build a small application for my android phone to tell me when the next train will get to the subway station by my house, using the developer API provided by the transit agency. </p><p>I'm learning C++ in university, but hope to go about this in Java. I'm sorry if this is more of a discussion question rather than a black and white answer question, but I can't find any information elsewhere.</p><p><a href=""http://developer.wmata.com/"" rel=""nofollow"">APIs in Question</a></p>","173306","","173306","","2011-10-15 17:24:13","2014-02-27 00:58:29","Differences between REST and JSON APIs","<android><json><api><rest>","2","2","","",""
"4141124","1","4141325","","2010-11-10 04:02:20","3","12003","<p>I kind of have a 2 part question here.</p><p>1) How can I populate my ListView so that strings are what is displayed, but when items are selected, a non-visible id value (contact id from phone contacts) is the value that is actually used?</p><p>2) I have a ListView that's using multipleChoice mode for item selections. It's popluated with names from my contacts list. When I select an item in the ListView, I want that selected item to trigger a call to my SqLite routine to store the value into a database record. How do I make this event fire when an item is checked in the listview?</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=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;ListView    android:id=""@+id/lvContacts""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:choiceMode=""multipleChoice""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is the code I am using to populate my ListView;</p><pre><code>    private void fillData() {    final ArrayList&lt;String&gt; contacts = new ArrayList&lt;String&gt;();    // Let's set our local variable to a reference to our listview control    // in the view.    lvContacts = (ListView) findViewById(R.id.lvContacts);    String[] proj_2 = new String[] {Data._ID, Phone.DISPLAY_NAME, CommonDataKinds.Phone.TYPE};    cursor = managedQuery(Phone.CONTENT_URI, proj_2, null, null, null);    while(cursor.moveToNext()) {        // Only add contacts that have mobile number entries        if ( cursor.getInt(2) == Phone.TYPE_MOBILE ) {            String name = cursor.getString(1);            contacts.add(name);        }    }    // Make the array adapter for the listview.    final ArrayAdapter&lt;String&gt; aa;    aa = new ArrayAdapter&lt;String&gt;(this,                                  android.R.layout.simple_list_item_multiple_choice,                                  contacts);    // Let's sort our resulting data alphabetically.    aa.sort(new Comparator&lt;String&gt;() {        public int compare(String object1, String object2) {            return object1.compareTo(object2);        };    });    // Give the list of contacts over to the list view now.    lvContacts.setAdapter(aa);}</code></pre><p>I had hoped to be able to use something like the onClick event for each checked item, but have made not one bit of progress.</p><p>Any help would be so very appreciated. Thanks.</p>","485710","","","","","2010-11-10 04:50:26","Android ListView Checkbox Selection","<android><listview><checkbox>","1","0","1","",""
"4141150","1","4142155","","2010-11-10 04:09:42","4","3410","<p>Is there any way to convert a Bitmap to sepia?I know to convert to grayScale is to set the setSaturation in ColorMatrix.But what about Sepia?</p>","430926","","223391","","2010-11-10 04:20:47","2013-09-13 14:16:13","Convert bitmap to sepia in android","<android><android-image>","2","0","6","",""
"4141217","1","","","2010-11-10 04:30:39","0","196","<p>I have sqlite database in my system i need to add this data base to the device(in the application location).How to do this ????</p>","482568","","","","","2011-04-11 21:56:37","How to add database to device?","<android>","2","0","","",""
"4141369","1","","","2010-11-10 04:57:48","1","994","<p>I was trying to override the toString() function of a service. I have a service and I am using another app to access the toString(). However the output is not as expected, I suspect that the overriding of toString() has failed ! Can anyone help ? Thanks</p><pre><code>///////////////toString Function in the service !///////////////public String toString() {   return ""Hello World"";}//////////how I am calling the overridden function !////////////////////ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);List&lt;ActivityManager.RunningServiceInfo&gt; rs = am.getRunningServices(50);for (int i=0; i&lt;rs.size(); i++) {    ActivityManager.RunningServiceInfo rsi = rs.get(i);    Log.i(""Hello"",rsi.getClass().toString());    Log.i(""Service"", ""Process "" + rsi.process + "" with component "" +             rsi.service.getClassName());}</code></pre>","342925","","450398","","2010-11-10 07:05:07","2010-12-10 09:18:45","how to override toString() method in android service?","<java><android><tostring>","1","2","","",""
"4141378","1","4141398","","2010-11-10 05:00:33","0","2560","<p>As a noob I wrote an app with lots of layout screens and it worked OK in emulation but when I ran it on my Droid Incredible the soft keyboard popping up changed the layout of a LinearLayout I was using - shoving some elements aside and changing the height of others!   I fixed it by adding <em>android:windowSoftInputMode=""adjustPan”</em>  to the Activity element of the manifest but I really would have preferred to discover this problem in emulation and not on a real phone.</p><p>So, is there a popup soft keyboard in the Emulator and if so how do I invoke it?</p>","424690","","","","","2010-11-10 05:12:50","Is there a popup soft keyboard in the Android emulator?","<android><android-emulator>","1","0","","",""
"4141388","1","4141732","","2010-11-10 05:02:10","1","28511","<p>i would like to show my current position on an android phone using google maps. Would the code below be able to show my current pos on google maps?</p><p>MapsActivity.java</p><pre><code>package log1.log2;import log1.log2.MyLocation.LocationResult;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.MapView.LayoutParams;import android.location.Criteria;import android.location.Location;import android.location.LocationManager;import android.os.Bundle;import android.view.View;import android.widget.LinearLayout;public class MapsActivity extends MapActivity {        MapView mapView;     MapController mc;    GeoPoint p;    /** Called when the activity is first created. */    @SuppressWarnings(""deprecation"")    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapactivity);        mapView = (MapView) findViewById(R.id.mapView);        LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);          View zoomView = mapView.getZoomControls();         zoomLayout.addView(zoomView,             new LinearLayout.LayoutParams(                LayoutParams.WRAP_CONTENT,                 LayoutParams.WRAP_CONTENT));         mapView.displayZoomControls(true);    }    MyLocation myLocation = new MyLocation();    private void locationClick() {        myLocation.getLocation(this, locationResult);    }    public LocationResult locationResult = new LocationResult(){        public void gotLocation(final Location location){            //Got the location!            };        };    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }}</code></pre><p>MyLocation.java</p><pre><code>package log1.log2;import java.util.Timer;import java.util.TimerTask;import android.content.Context;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;public class MyLocation {    Timer timer1;    LocationManager lm;    LocationResult locationResult;    boolean gps_enabled=false;    boolean network_enabled=false;    public boolean getLocation(Context context, LocationResult result)    {        //I use LocationResult callback class to pass location value from MyLocation to user code.        locationResult=result;        if(lm==null)            lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);        //exceptions will be thrown if provider is not permitted.        try{gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception ex){}        try{network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception ex){}        //don't start listeners if no provider is enabled        if(!gps_enabled &amp;&amp; !network_enabled)            return false;        if(gps_enabled)            lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps);        if(network_enabled)            lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork);        timer1=new Timer();        timer1.schedule(new GetLastLocation(), 20000);        return true;    }    LocationListener locationListenerGps = new LocationListener() {        public void onLocationChanged(Location location) {            timer1.cancel();            locationResult.gotLocation(location);            lm.removeUpdates(this);            lm.removeUpdates(locationListenerNetwork);        }        public void onProviderDisabled(String provider) {}        public void onProviderEnabled(String provider) {}        public void onStatusChanged(String provider, int status, Bundle extras) {}    };    LocationListener locationListenerNetwork = new LocationListener() {        public void onLocationChanged(Location location) {            timer1.cancel();            locationResult.gotLocation(location);            lm.removeUpdates(this);            lm.removeUpdates(locationListenerGps);        }        public void onProviderDisabled(String provider) {}        public void onProviderEnabled(String provider) {}        public void onStatusChanged(String provider, int status, Bundle extras) {}    };    class GetLastLocation extends TimerTask {        @Override        public void run() {             lm.removeUpdates(locationListenerGps);             lm.removeUpdates(locationListenerNetwork);             Location net_loc=null, gps_loc=null;             if(gps_enabled)                 gps_loc=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);             if(network_enabled)                 net_loc=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);             //if there are both values use the latest one             if(gps_loc!=null &amp;&amp; net_loc!=null){                 if(gps_loc.getTime()&gt;net_loc.getTime())                     locationResult.gotLocation(gps_loc);                 else                     locationResult.gotLocation(net_loc);                 return;             }             if(gps_loc!=null){                 locationResult.gotLocation(gps_loc);                 return;             }             if(net_loc!=null){                 locationResult.gotLocation(net_loc);                 return;             }             locationResult.gotLocation(null);        }    }    public static abstract class LocationResult{        public abstract void gotLocation(Location location);    }}</code></pre><p>Thank you.</p>","358218","","","","","2012-05-30 01:11:10","Current position on google maps","<android><eclipse><google-maps>","2","3","1","2012-05-08 19:02:46",""
"4141393","1","","","2010-11-10 05:03:11","0","276","<p>What I would like to do is get the data from the built in battery usage indicator screen in Android. This is the screen that displays what has been using battery life in percentages, such as display, cell standby, wifi etc.</p><p>I've searched through the Android developer site and can't seem to find any information on this. I assume this data isn't accessible through an API. Has anyone been successful in getting this data?</p>","372114","","","","","2010-11-10 07:17:18","Getting information from the battery usage indicator","<android>","1","0","2","",""
"4141435","1","4141484","","2010-11-10 05:13:51","5","5428","<p>I have this database file under the usual databases folder and a bunch of tables inside it.</p><p>Please note that I don't want to retrieve under the command line. <b>I know I can use the "".tables"" command.</b></p><p>I want to retrieve a list of all tables in it, using code, so that I can execute some specific algorithms on each of them.</p><p>Also, I didn't find any questions with this problem on Android, so please forgive me if there is any. I was wondering if there is any function I can use under <code>DatabaseUtils</code>, but I didn't find any either.</p>","489607","","244296","","2011-03-04 16:45:11","2011-03-04 16:45:11","Retrieve a list of all tables in the database","<android><sqlite><table><sqlite3><retrieve>","1","0","2","",""
"4141459","1","4387036","","2010-11-10 05:19:26","0","786","<p>How should I call this Soap Webservice from an android</p><p></p><p></p><p></p><pre><code>&lt;AddCar xmlns=""http://abcd.com/""&gt;  &lt;clsAddCarRequest&gt;    &lt;clsCredentials&gt;      &lt;EmailAddress&gt;string&lt;/EmailAddress&gt;      &lt;Password&gt;string&lt;/Password&gt;      &lt;TokenID&gt;string&lt;/TokenID&gt;    &lt;/clsCredentials&gt;    &lt;clsCar&gt;      &lt;CarID&gt;int&lt;/CarID&gt;      &lt;UserID&gt;int&lt;/UserID&gt;      &lt;RegisteredOwner&gt;string&lt;/RegisteredOwner&gt;      &lt;Make&gt;string&lt;/Make&gt;      &lt;Model&gt;string&lt;/Model&gt;      &lt;Color&gt;string&lt;/Color&gt;      &lt;BodyType&gt;string&lt;/BodyType&gt;      &lt;PlateType&gt;string&lt;/PlateType&gt;      &lt;PlateNumber&gt;string&lt;/PlateNumber&gt;      &lt;State&gt;string&lt;/State&gt;      &lt;VINNumber&gt;string&lt;/VINNumber&gt;      &lt;YearOfRegistration&gt;int&lt;/YearOfRegistration&gt;      &lt;ExpiryDate&gt;string&lt;/ExpiryDate&gt;      &lt;IsAutoFightOn&gt;boolean&lt;/IsAutoFightOn&gt;      &lt;IsDeleted&gt;boolean&lt;/IsDeleted&gt;      &lt;DateAddedTimeStamp&gt;string&lt;/DateAddedTimeStamp&gt;      &lt;LastUpdatedTimeStamp&gt;string&lt;/LastUpdatedTimeStamp&gt;    &lt;/clsCar&gt;  &lt;/clsAddCarRequest&gt;&lt;/AddCar&gt;</code></pre><p></p><p></p><p>The class clsAddCarRequest as 2 properties clsCredentials x, clsCar c;</p><p>clsCredentials x;</p><p>x.getXML returns the below</p><pre><code>    &lt;clsCredentials&gt;      &lt;EmailAddress&gt;string&lt;/EmailAddress&gt;      &lt;Password&gt;string&lt;/Password&gt;      &lt;TokenID&gt;string&lt;/TokenID&gt;    &lt;/clsCredentials&gt;</code></pre><p>clsCar c;</p><p>c.getXML returns the below</p><pre><code>    &lt;clsCar&gt;      &lt;CarID&gt;int&lt;/CarID&gt;      &lt;UserID&gt;int&lt;/UserID&gt;      &lt;RegisteredOwner&gt;string&lt;/RegisteredOwner&gt;      &lt;Make&gt;string&lt;/Make&gt;      &lt;Model&gt;string&lt;/Model&gt;      &lt;Color&gt;string&lt;/Color&gt;      &lt;BodyType&gt;string&lt;/BodyType&gt;      &lt;PlateType&gt;string&lt;/PlateType&gt;      &lt;PlateNumber&gt;string&lt;/PlateNumber&gt;      &lt;State&gt;string&lt;/State&gt;      &lt;VINNumber&gt;string&lt;/VINNumber&gt;      &lt;YearOfRegistration&gt;int&lt;/YearOfRegistration&gt;      &lt;ExpiryDate&gt;string&lt;/ExpiryDate&gt;      &lt;IsAutoFightOn&gt;boolean&lt;/IsAutoFightOn&gt;      &lt;IsDeleted&gt;boolean&lt;/IsDeleted&gt;      &lt;DateAddedTimeStamp&gt;string&lt;/DateAddedTimeStamp&gt;      &lt;LastUpdatedTimeStamp&gt;string&lt;/LastUpdatedTimeStamp&gt;    &lt;/clsCar&gt;</code></pre><p>clsAddCarRequest myReq;</p><p>myReq.getXML returns the below</p><pre><code>  &lt;clsAddCarRequest&gt;    &lt;clsCredentials&gt;      &lt;EmailAddress&gt;string&lt;/EmailAddress&gt;      &lt;Password&gt;string&lt;/Password&gt;      &lt;TokenID&gt;string&lt;/TokenID&gt;    &lt;/clsCredentials&gt;    &lt;clsCar&gt;      &lt;CarID&gt;int&lt;/CarID&gt;      &lt;UserID&gt;int&lt;/UserID&gt;      &lt;RegisteredOwner&gt;string&lt;/RegisteredOwner&gt;      &lt;Make&gt;string&lt;/Make&gt;      &lt;Model&gt;string&lt;/Model&gt;      &lt;Color&gt;string&lt;/Color&gt;      &lt;BodyType&gt;string&lt;/BodyType&gt;      &lt;PlateType&gt;string&lt;/PlateType&gt;      &lt;PlateNumber&gt;string&lt;/PlateNumber&gt;      &lt;State&gt;string&lt;/State&gt;      &lt;VINNumber&gt;string&lt;/VINNumber&gt;      &lt;YearOfRegistration&gt;int&lt;/YearOfRegistration&gt;      &lt;ExpiryDate&gt;string&lt;/ExpiryDate&gt;      &lt;IsAutoFightOn&gt;boolean&lt;/IsAutoFightOn&gt;      &lt;IsDeleted&gt;boolean&lt;/IsDeleted&gt;      &lt;DateAddedTimeStamp&gt;string&lt;/DateAddedTimeStamp&gt;      &lt;LastUpdatedTimeStamp&gt;string&lt;/LastUpdatedTimeStamp&gt;    &lt;/clsCar&gt;  &lt;/clsAddCarRequest&gt;</code></pre><p>How do I call the SoapObject request = new SoapObject</p><p>the webservices returns</p><p></p><p></p><p></p><pre><code>&lt;AddCarResponse xmlns=""http://abcd.com/""&gt;  &lt;AddCarResult&gt;string&lt;/AddCarResult&gt;&lt;/AddCarResponse&gt;</code></pre><p></p><p></p>","501859","","","","","2010-12-08 11:46:48","How should I call this Soap Webservice from an android","<android>","2","0","2","",""
"4141492","1","4197502","","2010-11-10 05:28:01","0","95","<p>Well I have a concern, well talking to people on IRC Channel as well as seeing discussions on various android forums, I have been inclined towards the point that some of the android devices are vulnerable to outside intrusion because of some defects in Android OS (particularly because its open source and everyone is contributing to it). So its not better to use Android for Banking or similar applications . Is my perception right, or its otherwise and we can use it for such financial transaction like applications.</p>","435597","","","","","2010-11-16 18:16:14","Android -- Are Android applications safe from outside illegitimate intrusion?","<android><forum><financial><banking><onlinebanking>","1","0","","",""
"4141506","1","4141540","","2010-11-10 05:30:45","1","2498","<p>I saved some html pages in sdcard. so , i want to display those pages through webview . can any help to do this task ?</p><p>Thanking you ,Srinivas</p>","414777","","","","","2011-10-18 11:01:51","How to load Html page saved in sdcard on android?","<android><html><webview>","3","0","","",""
"4141527","1","","","2010-11-10 05:35:27","3","332","<p>I am developing an application to list out all the remote device file in my android app through bluetooth connectivity.One my devices is paired with the remote device how can i list out all the files from the remote device.And I am trying with OBEX.Is there any easiest way to do that.</p>","502750","","73488","","2010-11-10 05:42:18","2013-07-12 07:30:18","Listing the files of remote device through android bluetooth","<android><bluetooth>","0","0","3","",""
"4141544","1","4141570","","2010-11-10 05:39:04","5","4770","<p>I wrote a program in Android for setting different kinds of images as my background image, but it is not working with svg files. I am not getting any errors, it is not displaying any image and I'm getting a blank screen in my emulator when using svg files. Can any one suggest how to read and display svg files in Android with some code? Or should I convert xml code?</p>","493244","","493244","","2010-11-25 08:27:42","2013-02-04 12:54:36","svg files rendering in android","<java><android><svg>","3","1","1","",""
"4141555","1","4141627","","2010-11-10 05:40:58","23","27803","<p>I am building an application which triggers an alarm via AlarmManager.</p><p>I would like to be able to call the Alarm via it's own non-activity class, but since I am not extending Activity, I don't appear to have any 'context'. This concept confuses me, and I've read the sdk docs. </p><p>How would I go about using:</p><pre><code>alarmTest = (AlarmManager)getSystemService(Context.ALARM_SERVICE);</code></pre><p>in my non-activty class?</p><p>Also, I'm assuming getting context will allow me to use SharedPrefs and Intents in my non-activity class as well?</p>","502630","","2683","","2013-06-07 05:55:22","2013-06-07 05:55:22","How to use getSystemService in a non-activity class?","<android><android-context>","4","0","4","",""
"4141567","1","","","2010-11-10 05:43:08","2","1692","<p>I am writing an activity that speaks to the user and I'd really like to block on TextToSpeech initialization - or else time out.  How can I get my thread to wait?</p><p>I tried: </p><pre><code> while (! mIsTtsReady || i&gt;limit) try { Thread.sleep(100); i++; ... };</code></pre><p>along with:</p><pre><code> @Override public void OnInit() { mIsTtsReady = true; }   // TextToSpeech.OnInitListener</code></pre><p>But OnInit() never runs.  It seems that OnInit executes within my thread (via a message to my activities Looper?), which is in a tight sleep() loop.</p><p>It seems wrong to put the bulk of my code (the ""after init"" stuff) into OnInit itself.Moving it into a Runnable, then start()ing it, and sleeping as above within that runnable works.  But now my code is in a new thread and needs explicit syncing with the UI etc, and it all gets messy really quickly.</p><p>What is the right way - or at least one that works :) - to do this?</p><p>Thanks!</p>","294973","","168868","","2012-01-01 20:41:45","2013-08-04 09:13:54","How to wait for TextToSpeech initialization on Android","<android><text-to-speech>","2","1","","",""
"4141636","1","4141771","","2010-11-10 05:56:31","2","896","<p>This is a very simple question, and I apologize for being so noobish :/</p><p>I'm new(ish) to Java. I've got a game on the Market that works quite well, but the code is all rubbish. Basically, I wrote it like I was writing JavaScript. I'm trying to learn more about Object Oriented Programming. So, in my new game I've been creating Objects that extend from a custom class. For example (this isn't actually what I'm doing):</p><pre><code>public class Color{    public final int STROKE_WIDTH = 3;    public Color(){}}</code></pre><p><br></p><pre><code>public class Orange extends Color{    public int alpha = 30;    public Orange(){        super();    }}</code></pre><p>Now, say in my game's main thread I instantiate many Colors (Orange, Red, Purple) and I store them in an <code>ArrayList&lt;Color&gt;</code>. I iterate through this list at another point in the game, and I want to access the <code>Color</code>'s alpha. My problem is, since they're all wrapped into the superclass, I can't just say <code>colorObj.alpha</code>, but I do have access to <code>colorObj.STROKE_WIDTH</code>. Similarly, I wouldn't be able to access any methods in the Orange class.</p><p>There must be a way to do this, I'm just new. I don't expect anyone to sit here and type out an explanation.. I wouldn't want to waste your time. But if someone could just paste a link to some beginner's tutorial or something that would help me out with this, I'd appreciate it!</p>","408178","","109112","","2010-11-10 06:13:14","2010-11-10 06:43:25","Variable visibility in subclass","<java><android><oop><subclass><visibility>","3","0","","",""
"4141805","1","4142002","","2010-11-10 06:31:08","0","74","<p>I have entered a value to my database as <strong>$1000000000</strong>. it stored in Database also its looks like as same. when retrieve it from using the DB. Its converted to <strong>$1e+09</strong> automatically. how to restrict it.</p><p>thanks in advance.</p>","267269","","","","","2010-11-10 07:12:50","Restrict a cost conversion in android?","<java><android><sqlite><textview>","1","2","","",""
"4141874","1","4142114","","2010-11-10 06:42:31","1","758","<p>Can you please help me to solve the following problem.</p><p>I am running  a script to authenticate client from google and then i got the following error</p><pre><code>Resource id #4HTTP/1.0 302 Moved Temporarily Content-Type: text/html; charset=UTF-8 Location: https://www.google.com/accounts/ClientLogin Content-Length: 225 Date: Wed, 10 Nov 2010 06:33:40 GMT Expires: Wed, 10 Nov 2010 06:33:40 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Server: GSEMoved TemporarilyThe document has moved here. 0Array ( [authToken] =&gt; [error] =&gt; No Error )</code></pre><p>u can have a look of this error here<a href=""http://iphoneappcompany.com/fan_connect/test-c2dm.php"" rel=""nofollow"">http://iphoneappcompany.com/fan_connect/test-c2dm.php</a></p><p>Actually i am trying to use c2dm- cloud to device messaging on my android application</p><p>here is the script</p><p>$host = 'www.google.com';    $usepath = '/accounts/ClientLogin';</p><pre><code>// open socket to filehandle(epdq encryption cgi)$fp = fsockopen( $host, 80, &amp;$errno, &amp;$errstr, 60 );//check that the socket has been opened successfullyif( !$fp ) {    $returnArr = array();    $returnArr['authToken']=0;    $returnArr['error'] = ""$errstr ($errno)"";} else {    $params = ""accountType=HOSTED_OR_GOOGLE&amp;Email=myemail&amp;Passwd=mypassword&amp;service=c2dm&amp;source=appsource"";    //write the data to the request    fputs( $fp, ""POST $usepath HTTP/1.0\n"");    $strlength = strlen( $params );    fputs( $fp, ""Content-type: application/x-www-form-urlencoded\n"" );    fputs( $fp, ""Content-length: "".$strlength.""\n\n"" );    fputs( $fp, $params.""\n\n"" );    //clear the response data    $output = """";    //read the response from the remote cgi    //while content exists, keep retrieving document in 1K chunks    while( !feof( $fp ) ) {        $output .= fgets( $fp, 1024);    }</code></pre><p>echo $fp.""<br/>"";echo $output.""<br/>"";        $returnArr = array();</p><pre><code>    if(contains(""Error="", $output)){        $error = strstr($str, 'Error=');        $final_error = """";        if(contains(""BadAuthentication"", $output)){            $final_error = ""BadAuthentication - The login request used a username or password that is not recognized."";        }else if(contains(""NotVerified"", $output)){            $final_error = ""NotVerified - The account email address has not been verified. The user will need to access their Google account directly to resolve the issue before logging in using a non-Google application. "";        }else if(contains(""TermsNotAgreed"", $output)){            $final_error = ""TermsNotAgreed - The user has not agreed to terms. The user will need to access their Google account directly to resolve the issue before logging in using a non-Google application. "";        }else if(contains(""CaptchaRequired"", $output)){            $final_error = ""CaptchaRequired - A CAPTCHA is required. (A response with this error code will also contain an image URL and a CAPTCHA token.)"";        }else if(contains(""Unknown"", $output)){            $final_error = ""Unknown - The error is unknown or unspecified; the request contained invalid input or was malformed."";        }else if(contains(""AccountDeleted"", $output)){            $final_error = ""AccountDeleted - The user account has been deleted."";        }else if(contains(""AccountDisabled"", $output)){            $final_error = ""AccountDisabled - The user account has been disabled."";        }else if(contains(""ServiceDisabled"", $output)){            $final_error = ""ServiceDisabled - The user's access to the specified service has been disabled. (The user account may still be valid.)"";        }else if(contains(""ServiceUnavailable"", $output)){            $final_error = ""ServiceUnavailable - The service is not available; try again later."";        }        $returnArr['authToken']=0;        $returnArr['error'] = $final_error;    }else{        // we have an authToken        $toeknString = strstr($str, 'Auth=');        $token = substr($toeknString, 5);        setAuthToken($token);        $returnArr['authToken']= $token;        $returnArr['error'] = ""No Error"";    }}print_r($returnArr);return $returnArr;</code></pre>","395661","","395661","","2010-11-10 07:44:12","2010-11-10 07:44:12","PHP Moved Temporarily error? i am using c2dm in Android ","<php><android>","1","2","","",""
"4141944","1","4142083","","2010-11-10 06:54:05","5","8725","<p>I have an ArrayList of type GeoPoint.</p><pre><code>private List&lt;GeoPoint&gt; points = new ArrayList&lt;GeoPoint&gt;();</code></pre><p>I want to pass <code>points</code> to another Activity and retrive the data in that activity. How do I do it? I know I have to use the <code>parcelable</code> but I searched, but could not find a way to pass ArrayLists.</p>","481239","","","","","2013-03-04 12:57:42","Android: Pass List<GeoPoint> to another Activity","<android><activity><parcelable>","1","4","5","",""
"4141973","1","","","2010-11-10 07:00:50","1","241","<p>I want to send an image of a view to external storage so that it can be printed.  The view is a grid made up of a tablelayout, tablerows and textviews.  I write the view to the sdcard, then copy it to my HD using the DDMS file-explorer screen. But when I look at it in MS Paint, the image is only partially there.  </p><p>I have tested this two ways.</p><p>When I usied the xml version, the result was a small black square – no detail, no grid, nothing.  </p><p>Next I created a textview programmatically, with text using settext(“AAA”).  The resulting bitmap had the correct color and size, but the text was missing.</p><p>Would someone please tell me how to get my view correctly written to external storage so that it looks like it does on the android screen?</p><pre><code>//FYI.  Here are excerpts from my program://Test-1 used the xml version of the grid:TableLayout tl = (TableLayout) findViewById(R.id.board);View viewToBeConverted = tl;//Test-2 used a simple dynamically generated view: TextView tv = new TextView(this);tv.setBackgroundColor(Color.PINK);tv.setTextColor(Color.BLACK);   tv.setText(""AAA"");tv.setHeight(40);tv.setWidth(40);View viewToBeConverted = tv;//Both Tests used this code to write to external storage:try {  Bitmap returnedBitmap = Bitmap.createBitmap(40,40,  Bitmap.Config.ARGB_8888);  Canvas canvas = new Canvas(returnedBitmap);   viewToBeConverted.draw(canvas);    String path = Environment.getExternalStorageDirectory() +  File.separator + strPuzSolFilename;  FileOutputStream out = new FileOutputStream(path); } catch (Exception e) {     e.printStackTrace(); }</code></pre>","","greenset","","greenset","2010-11-10 15:19:22","2010-11-11 15:26:46","Why is part of my bitmap image missing when written to external storage?","<android><android-widget>","1","0","","",""
"4142090","1","","","2010-11-10 07:22:31","104","51821","<p>I have a view made up of tablelayout, tablrows and textviews to look like a grid.  I need to get the height and width of this grid.  The methods getheight() and getwidth() always return 0.  This happens when I format the grid dynamically or usie an xml version.  </p><p>Could someone please tell how to retrieve the dimensions for a view?  </p><hr><p>Here is my test program I used in Debug to check the results: </p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.TableLayout;import android.widget.TextView;public class appwig extends Activity {      @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.maindemo);  //&lt;- includes the grid called ""board""      int vh = 0;         int vw = 0;      //Test-1 used the xml layout (which is displayed on the screen):      TableLayout tl = (TableLayout) findViewById(R.id.board);        tl = (TableLayout) findViewById(R.id.board);      vh = tl.getHeight();     //&lt;- getHeight returned 0, Why?        vw = tl.getWidth();     //&lt;- getWidth returned 0, Why?         //Test-2 used a simple dynamically generated view:              TextView tv = new TextView(this);      tv.setHeight(20);      tv.setWidth(20);      vh = tv.getHeight();    //&lt;- getHeight returned 0, Why?             vw = tv.getWidth();    //&lt;- getWidth returned 0, Why?    } //eof method} //eof class</code></pre>","","greenset","321697","","2010-12-10 05:51:40","2014-01-23 17:10:59","How do you to retrieve dimensions of a view? Getheight() and Getwidth() always return zero","<android><layout><android-widget><lifecycle><measure>","13","2","72","",""
"4142091","1","5708168","","2010-11-10 07:23:37","3","244","<p>For example:</p><p><a href=""http://jqueryui.com/demos/progressbar/#animated"" rel=""nofollow"">http://jqueryui.com/demos/progressbar/#animated</a></p><p>The progress bar has it's progress increasing from 0 to 100 percent but it still has some animation to it.  This helps show the user something is still happening even if the bar is stopped at one point for a moment.</p><p>When I set the progress bar to indeterminate, it no longer shows the progress.</p><p>Is there a built in way to accomplish this or will I need to subclass ProgressBar?</p>","445348","","","","","2011-06-30 08:34:23","Is there a way to have a Progress Bar both progress and have the indeterminate animation?","<android><progress-bar>","1","0","0","",""
"4142474","1","4146373","","2010-11-10 08:24:47","0","453","<p>I have created a custom ArrayAdapter to display data within ListView items from an array ofdata structures and for some reason when I scroll up and down really quickly the display will do strange things.</p><p>Here is my getView function from the custom ArrayAdapter.   My first guess would be because of the if (d.highTemp != null) is causing lag or something?  What I want the adapter to do is only display a highTemp if the data structure has a value within it.  Otherwise it should display the lowTemp value;  The list is correct when initially drawn but if I scroll up and down really fast it will start displaying both high and lowTemp values even though I know each data structure only has one of those != null...</p><pre><code>   @Overridepublic 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_item, null);        }        DaysWeather d = daysWeather[position];        if (d != null) {                TextView tt = (TextView) v.findViewById(R.id.toptext);                TextView bt = (TextView) v.findViewById(R.id.bottomtext);                TextView trt = (TextView) v.findViewById(R.id.toprighttext);                TextView tbt = (TextView) v.findViewById(R.id.bottomrighttext);                if (tt != null) {                      tt.setText(d.name);}                if(bt != null){                      bt.setText(d.shortDescription);                }                if (d.highTemp != null){                    if (trt != null) {                        trt.setText(""Hi: "" + d.highTemp);                        tbt = null;                    }                } else {                    if (tbt != null) {                        trt = null;                        tbt.setText(""Lo: "" + d.lowTemp);                    }                }        }        return v;}</code></pre>","487840","","","","","2010-11-10 15:59:20","ListView items not refreshing correctly","<android><listview>","2","0","2","",""
"4142508","1","4142570","","2010-11-10 08:29:53","1","2813","<p>i am using following code to get GPS location.now i want to get GPS location without automatic updates.</p><p>for example i want to get latest location on button click only once not all the time.</p><p>so please tell what value should i use for minTime and Distancewhile getting location updates for once and without intervals and automatic updates?</p><p>and should i call location updates in that button instead of onResume ?</p><pre><code>onbutton click(){mlocManager = (LocationManager) getSystemService(LOCATION_SERVICE);                Criteria criteria = new Criteria();                bestProvider = mlocManager.getBestProvider(criteria, false);                loc = mlocManager.getLastKnownLocation(bestProvider);                   if(loc != null)                   {                   MyDeviceLatitude = loc.getLatitude();                   MyDeviceLongitude = loc.getLongitude();                   }elseshowError();}    @Override    public void onLocationChanged(Location argLocation) {        // TODO Auto-generated method stub        if (argLocation != null)         {            loc = argLocation;        }    }@Override    protected void onPause() {        super.onPause();        mlocManager.removeUpdates(this);    }    @Override    protected void onResume() {        super.onResume();        Criteria criteria = new Criteria();        mlocManager = (LocationManager) getSystemService(LOCATION_SERVICE);        bestProvider = mlocManager.getBestProvider(criteria, false);        mlocManager.requestLocationUpdates(bestProvider, 20000,1 , this);    }</code></pre><p>any help would be appreciated.</p>","249991","","","","","2010-11-10 08:38:38","how to get GPS location once and without automatic updates?","<android>","1","0","","",""
"4142571","1","4143489","","2010-11-10 08:38:40","4","3881","<p>I developed android application and put .apk on my website which runs on LAMP and I wish to enable somehow OTA (over the air) installation of my application, by simply providing URL to Android device.</p><p>How can I do it?</p><p>Scenario I wish to produce is (if someone didn't understand me correctly) that user scanns QR code of apk's URL and then install it seemlessly. Right now, user must download the file, then tap on it to install it.</p><p>Thanks in advance.</p>","292465","","","","","2012-08-29 06:26:35","OTA for Android","<android><installation><install><over-the-air>","2","3","1","",""
"4142573","1","","","2010-11-10 08:39:16","1","1049","<p>On Android platform, I wanna make myapp hidden on process killer and I wanna hide myapp on installed app list also.</p><p>Is it possible?</p>","501619","","","","","2010-11-10 09:00:41","Is there any way to hide my app's process and on installed list?","<android>","2","2","","",""
"4142699","1","4145715","","2010-11-10 08:57:16","2","4432","<p>Hai Freinds,             I had parsed the image from the url, and displayed in the webview, when i am displayed it in webview, a few images were streched, so i displayed the image with the help of Imageview, but the problem is the Images are not displayed in Imageview when they Color format is CMYK format, so pls tell me how to display the image in a webview without strecth of the image,or how can i display all format of images in ImageView.</p><p>My xml code 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:id=""@+id/LinearLayout02_img""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""&gt;                      &lt;WebView android:id=""@+id/ads_content""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;&lt;/WebView&gt;&lt;/LinearLayout&gt;</code></pre><p>and My java code is</p><blockquote>  <p>private WebView ads_content;  ads_content = (WebView)  findViewById(R.id.ads_content);  ads_content.loadUrl(url);</p></blockquote><p>Refer the screenshot which shows my output<img src=""http://i.stack.imgur.com/18MWe.png"" alt=""alt text""></p><p>i have to show the image upto the device level, thai is to block that white and black empty spacesThanks</p>","424413","","424413","","2010-12-16 14:17:37","2012-09-08 00:32:53","Need Help in Displaying Image correctly in WebView in Android?","<android>","2","1","","",""
"4142849","1","4143079","","2010-11-10 09:17:51","0","377","<p>I'm developing a site for the iPhone. Later for android.Now I have some links in that site. To see that it is a link I'd like to style the div-element like a button so that one can see that it is a link and clickable.</p><p>Is it better to use div- or button-elements here?Are there any information about which way is a better way?</p><p>In android I had the problem that clickable div-elements were not as sensitive as the button-elements. Do you have an idea why?</p><p>Thanks for your answers.</p><p>EDIT: I decided to use div-elements though I already worked with buttons. You can find <a href=""http://stackoverflow.com/questions/4216051/hovered-button-element-loses-style-after-changing-background-color"">the reason</a>here.</p>","375291","","375291","","2010-11-18 16:52:17","2010-11-18 16:52:17","Is it better to use div- or button-elements [iPhone][in android]?","<iphone><html><android><css>","1","2","","",""
"4142887","1","5676193","","2010-11-10 09:22:43","2","497","<p>we are implementing custom input method service and we are interestedin receiving cursor update events. The documentation ofInputMethodSession's updateCursor() says:""<em>This method is called when cursor location of the target input fieldhas changed within its window.  This is not normally called, but willonly be reported <strong>if requested by the input method</strong>.</em>""</p><p>How the input method can request this event?</p><p>Thanks in advance,</p><p>Andriy</p>","256644","","49246","","2010-11-13 10:14:33","2013-10-11 13:34:21","How the input method can request 'updateCursor' event?","<android><android-input-method>","1","0","1","",""
"4143015","1","4143253","","2010-11-10 09:37:22","-1","3119","<p>Here is what i have in my map.xml file:</p><pre><code>&lt;com.google.android.maps.MapView                 android:id=""@+id/mapView""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:enabled=""true""            android:clickable=""true""            android:apiKey=""0p8EoZESYekrClENQbOlN5EN16DgXv7Rx0CPTMg""                        /&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.apps.locid""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".LocID""                  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="".Map""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".web_view""                  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;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt; &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt;</code></pre>","2355649","","2355649","","2010-11-10 09:54:08","2012-10-16 11:14:16","What is the exact reason and resolution of ""Error inflating class com.google.android.maps.MapView""","<android>","3","1","","",""
"4143204","1","4143274","","2010-11-10 09:59:16","0","1166","<p>Hai Friends,          I want to invoke or fire the onclick event for Table Row when the user clicked a particular table row in the UI.This is my xml code </p><pre><code>  &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/table_bars"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent""android:background=""@drawable/corner"" android:stretchColumns=""1"" android:layout_margin=""10dp""&gt;  &lt;TableRow&gt;  &lt;TextView android:id=""@+id/barsp_baradd_value""  android:textSize=""15sp"" android:padding=""10dp"" android:layout_width=""wrap_content"" /&gt;   &lt;/TableRow&gt;   &lt;View android:layout_height=""1dp"" android:background=""#FF909090"" /&gt;   &lt;TableRow&gt;   &lt;TextView android:id=""@+id/barsp_barphone_value""             android:textSize=""15sp""    android:padding=""10dp"" android:layout_width=""wrap_content"" /&gt;    &lt;ImageView android:id=""@+id/san_arrow2"" android:src=""@drawable/newforward"" android:layout_alignParentRight=""true""android:adjustViewBounds=""true"" android:layout_marginTop=""10dp""android:layout_width=""30dp""  android:layout_height=""35dp"" android:paddingRight=""4dp"" /&gt; &lt;/TableRow&gt;  &lt;View android:layout_height=""1dp"" android:background=""#FF909090"" /&gt;  &lt;TableRow android:id=""@+id/barsite""&gt;   &lt;TextView android:id=""@+id/barsp_barsite_value""  android:textSize=""15sp"" android:padding=""10dp"" android:layout_width=""wrap_content"" /&gt;&lt;ImageView android:id=""@+id/san_arrow3"" android:src=""@drawable/newforward"" android:layout_alignParentRight=""true""android:adjustViewBounds=""true"" android:layout_marginTop=""10dp""android:layout_width=""30dp""  android:layout_height=""35dp"" android:paddingRight=""4dp"" /&gt;                  &lt;/TableRow&gt;                &lt;/TableLayout&gt;</code></pre><p>and my Java code is</p><pre><code>TableRow row = (TableRow)findViewById(R.id.row1);                row.setOnClickListener(new OnClickListener() {                                @Override                 public void onClick(View v) {                                // TODO Auto-generated method stub                                try {                                        //Log.v(TAG, ""try"");                                        uri = Uri.parse(""geo:0,0?q="" + VALUE_baraddress1[0] + "", ""                                                        + VALUE_baraddress2[0] + "", ""                                                        + VALUE_baraddress3[0]);                                        //Log.v(TAG, VALUE_baraddress1[0] + "", ""                                                //      + VALUE_baraddress2[0] + "", ""                                                //      + VALUE_baraddress3[0]);                                       startActivity(new Intent(Intent.ACTION_VIEW, uri));                                } catch (Exception e) {                                        //Log.v(TAG, ""catch"");                                        uri = Uri.parse(""geo:0,0?q="" + VALUE_baraddress1[0] + "", ""                                                        + VALUE_baraddress3[0]);                                        //Log.v(TAG, VALUE_baraddress1[0] + "", ""                                        //              + VALUE_baraddress3[0]);                                        startActivity(new Intent(Intent.ACTION_VIEW, uri));                                }                        }                });i had got null pointer exception in this lineTableRow row = (TableRow)table.getChildAt(0);</code></pre><p>Logcat Messages</p><pre><code>11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     ... 11 more11-10 15:47:04.164: ERROR/AndroidRuntime(12720): Caused by: java.lang.NullPointerException11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     at com.fsp.blacksheep.BS_Bars.onCreate(BS_Bars.java:546)11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     ... 19 more11-10 15:47:06.324: ERROR/JavaBinder(972): !!! FAILED BINDER TRANSACTION !!!</code></pre>","424413","","424413","","2010-11-10 10:36:18","2010-11-10 10:36:18","Need Help in Firing TableRow Event in Android?","<android>","1","0","","",""
"4143247","1","4174536","","2010-11-10 10:03:50","0","1958","<p>How do I access the SIM serial number and IMSI in Android?</p>","421372","","","","","2013-12-12 10:13:34","Accessing SIM details","<android><api><telephony>","2","0","","",""
"4143266","1","","","2010-11-10 10:05:09","0","476","<p>I have applied view flipper on images but they see to show an error while changing the orientation of device from landscape to protrait and vice versa..Can somebody help?</p>","424831","","424831","","2010-11-10 10:50:28","2010-11-10 10:50:28","View flipper doesnot work properly on changing orientation of device","<android><screen-orientation><viewflipper>","0","3","","",""
"4143362","1","4143400","","2010-11-10 10:18:30","0","1140","<p>I am developing one Android application which communicate with Wifi network. I want to know the name of the wifi socket in Android Device. i searched in google but nothing help me. I heard android device used RFCOMM socket for Bluetooth communication. Is RFCOMM socket used for Wifi communication?</p><p>Thanks in advance...</p>","405640","","265167","","2011-12-18 10:29:58","2011-12-18 10:29:58","Android WIFI Socket Name?","<android><wifi>","1","0","","",""
"4143364","1","8483685","","2010-11-10 10:18:56","2","1787","<p>as far as I know, there is no simple way in Android to generate a beep (equivalent to Console.Beep(int frequency, int length) in .NET). The only one that looked promising - <code>ToneGenerator</code> class, can generate only a limited selection of tones.</p><p>Do I have to generate a waveform by hand, push its data to AudioTrack and play it or is there a library or open source code that does it? </p>","72746","","","","","2011-12-13 02:38:15","Generate arbitrary beep in Android","<android><audio>","2","3","","",""
"4143436","1","","","2010-11-10 10:26:58","1","1167","<p>I have a Timer which executes a TimerTask every 30 seconds. I only want the timer to launch a new TimerTask if the Activity is displayed i.e. if the user receives a phone call or launches a new activity the Timer will stop. I then need the Timer to restart when the Activity is re-launched and comes into focus.</p><p>Now this should be easy, I override the ""<strong>onWindowFocusChanged(boolean hasFocus)</strong>"" method and either start or stop the timer depending on the value of <strong>hasFocus</strong>. The way I start the timer is to create a new Timer object and TimerTask each time and the way I stop the Timer is to call the <strong>cancel()</strong> method on the Timer object and set timer to null.</p><p>My problem is this doesn't always work, if I launch the activity which has the Timer and switch orientations quickly (to start/stop the Activity) I find the Timer is not always cancelled and I end up with multiple Timers launching TimerTasks at an ever increasing rate.</p><p>Am I missing something obvious here? Any help would be greatly appreciated.</p><p>Thanks</p>","503058","","","","","2011-12-08 00:43:18","Stop Timer when Activity loses focus","<android><timer><focus><stop>","2","0","","",""
"4143519","1","4144485","","2010-11-10 10:36:12","0","2314","<p>hello All I have been fed up of looking for a simple example of rest webservice connecting to Android Application. I know so many people have asked this question before, but there are so many different answers as a theory.I know I must use restful web-service, rather than SOAP for mobile applications. I need to create a webservice which is producing JSON, then in Android I can parse the JSON, but the problem is that as I am new to android I am looking for a simple example with both Server and client. A server : JAVA with Database connection and Restful WebService that produce JSONAndroid Client : which parse the JSON result from the webservice</p><p>please if somebody can provide such a example , please please help me.</p>","261002","","251173","","2010-11-10 10:51:09","2010-11-10 12:32:35","Android Client connecting to RestFul Webservice","<java><android><web-services><client>","1","0","","",""
"4143589","1","","","2010-11-10 10:42:48","0","807","<p>I'm developing an application which will use magnetometer data for interaction, by moving a magnet towards and away from the phone. This works fine (enough), but it seems like when I move the magnet too close to the phone, a noticeable lag occurs, and these messages are being spit out to the log:</p><p>Tag MessageAK8973 HRET = AKSC_HOF_DSS_STARTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_REQUESTAK8973 HRET = AKSC_HOF_DSS_COMPLETE</p><p>This can be also demonstrated for example in the app ""Compass 3D"" which is available on Market. It is enough to move a headphone in direct contact with the phone, it will produce a lag for at least 4-500 msec, and the messages above printed to Logcat. This is on my HTC Hero.</p><p>Any ideas as to what is causing this lag, or how to work around it? Does this occur on other phone models too?</p><p>All ideas and/or theories will be helpful!</p>","503074","","","","","2010-11-10 12:39:55","Magnetometer causing lag?","<android><compass-geolocation><sensor><magnetometer>","1","1","","",""
"4143600","1","4164628","","2010-11-10 10:44:09","1","6827","<p>i have a problem with displaying listview. i have tabbed activity and one of them contains listview. here's the code:</p><p>result.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  android:id=""@+id/Layout_result""  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""   android:background=""@drawable/papero3""&gt;       &lt;ListView       android:id=""@+id/resultListView""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""&gt;        &lt;TextView android:text=""@string/main_no_items""             android:id=""@+id/empty""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""&gt;        &lt;/TextView&gt;    &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>list_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/listItem""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""   android:orientation=""horizontal""   android:paddingLeft=""10px""   android:paddingRight=""10px""   android:paddingTop=""5px""   android:paddingBottom=""5px""&gt;    &lt;TextView android:text=""This is object's name""     android:id=""@+id/result_item_name_object""     android:layout_height=""wrap_content""     android:singleLine=""false""    android:gravity=""left""    android:textSize=""18sp"" android:layout_width=""260px""&gt;    &lt;/TextView&gt;    &lt;TextView android:text=""null""     android:id=""@+id/result_item_distance""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:gravity=""right""    android:textSize=""15sp"" android:paddingLeft=""10px""&gt;    &lt;/TextView&gt;         &lt;/LinearLayout&gt;</code></pre><p>main code:</p><pre><code>ListView resultList = (ListView)findViewById(R.id.resultListView);ItemAdapter m_adapter = new ItemAdapter(this, R.layout.list_item, itemsFound);  resultList.setAdapter(m_adapter);viewItems = new Runnable(){      @Override      public void run() {        searchItems();         }  }; Thread thread =  new Thread(null, viewItems, ""Searching"");  thread.start();private class ItemAdapter extends ArrayAdapter&lt;Item&gt;{        private ArrayList&lt;Item&gt; items;        public ItemAdapter(Context context, int textViewResourceId,                ArrayList&lt;Item&gt; objects) {            super(context, textViewResourceId, objects);            this.items = objects;        }        public View getView(int position, View convertView, ViewGroup parent){            View v = convertView;            if(v == null){                LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                 v = vi.inflate(R.layout.list_item, null);            }            Item item = (Item) items.get(position);            if (item != null){                TextView resName = (TextView) v.findViewById(R.id.result_item_name_object);                TextView resDistance = (TextView) v.findViewById(R.id.result_item_distance);                  if (resName != null){                    resName.setText(item.name);                }                if (resDistance != null){                    resDistance.setText(item.distance);                }                       }                   return v;                   }               }private Runnable returnRes = new Runnable() {    @Override    public void run() {        if(itemsFound != null &amp;&amp; itemsFound.size() &gt; 0){            m_adapter.notifyDataSetChanged();              int count = itemsFound.size();            for(int i=0; i &lt; count; i++)                  m_adapter.add(itemsFound.get(i));          }        m_ProgressDialog.dismiss();        m_adapter.notifyDataSetChanged();      }};</code></pre><p>for the first i get ""UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView"" in result.xml layout window, but when i clean up textview from listview in resut.xml that problem disappear, but comes new one:</p><pre><code>11-10 10:39:42.623: ERROR/AndroidRuntime(720): android.content.res.Resources$NotFoundException: String resource ID #0x30411-10 10:39:42.623: ERROR/AndroidRuntime(720):     at android.content.res.Resources.getText(Resources.java:200)/*and so on*/</code></pre>","485572","","491044","","2011-03-10 15:20:12","2011-03-10 15:20:12","Android: Custom ListAdapter","<android><listview><adapter><listadapter>","2","3","","",""
"4143613","1","4169110","","2010-11-10 10:46:17","0","398","<p>I'm developing an Android application. I'm very new on it.</p><p>I have the following classes:</p><pre><code>class CustomGLSurfaceView extends GLSurfaceViewclass CustomRenderer implements GLSurfaceView.Renderer</code></pre><p><code>CustomGLSurfaceView</code> uses <code>CustomRenderer</code> to render a cube on <code>onDrawFrame</code> method.</p><p>I've added an <code>onTouchEvent(MotionEvent event)</code> on <code>CustomGLSurfaceView</code> to manage touch events:</p><pre><code>class CustomGLSurfaceView extends GLSurfaceView {    // For touch inputs - previous touch (x, y)    private float previousX;    private float previousY;    private CustomRenderer myRenderer;    public CustomGLSurfaceView(Context context) {        super(context);        myRenderer = new CustomRenderer();        setRenderer(myRenderer);    }    @Override    public boolean onTouchEvent(MotionEvent event) {        float currentX = event.getX();          float currentY = event.getY();          switch (event.getAction()) {             case MotionEvent.ACTION_MOVE:                 myRenderer.handleMovement(currentY, currentY, previousX, previousY);          }          // Save current x, y          previousX = currentX;          previousY = currentY;          return true;  // Event handled    }}</code></pre><p>May I have to modify <code>onDrawFrame</code> to draw something new or to rotate the cube? I thing I must do it on <code>handleMovement</code>.</p><p>Thanks.</p>","68571","","","","","2010-11-12 21:34:16","Changing what I'm drawing with OpenGl when user touches screen","<android><opengl-es>","1","0","","",""
"4143810","1","4145230","","2010-11-10 11:08:43","2","2986","<p>in my project there are number of images having back and forward images and all images having common layout.on clicking back and next buttons new images should displayed.</p><pre><code>private int imageCounter = 0;private ImageView imageView;private int[] imageArray = {R.drawable.image_w_lbl_0, R.drawable.image_w_lbl_1,};private int index_count = 0;@Overridepublic void onCreate(Bundle savedInstanceState) {    setContentView(R.layout.frame0);//this one is the common parent layout for all imageviews    super.onCreate(savedInstanceState);    imageView = new ImageView(this);    ImageButton next = (ImageButton) findViewById(R.id.next);    ImageButton back = (ImageButton) findViewById(R.id.back);    next.setOnClickListener(this);    back.setOnClickListener(this);    //show the default image    this.loadImage(imageArray[0]);}@Overridepublic void onClick(View v) {    int imagePath = 0;    // TODO Auto-generated method stub    switch (v.getId())    {    case R.id.next:        if(imageCounter &lt; 25)        {            imagePath = imageArray[index_count];        }        imageCounter++;        break;    case R.id.back:        if(imageCounter &gt; 0)        {            //imagePath =        }        imageCounter--;        break;    }    this.loadImage(imagePath);}private void loadImage(int imagePath){    imageView.setImageResource(imagePath);}</code></pre><p>I am able to see my layout only in output having back and forward buttons with black background not any image from my drawable folder.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""android:gravity=""center""&gt;&lt;ImageButton android:id=""@+id/back"" android:src=""@drawable/btn_back""</code></pre><p>android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_gravity=""left""   /></p><pre><code>&lt;ImageButton </code></pre><p>android:id=""@+id/next""   android:src=""@drawable/btn_next""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_gravity=""right""   /></p><pre><code>&lt;/LinearLayout&gt;</code></pre>","490953","","490953","","2010-11-11 07:37:59","2011-12-11 15:52:20","dynamic set image path","<android>","3","2","","",""
"4143835","1","","","2010-11-10 11:12:34","0","58","<p>I am working on a project, I need to get an image from local server in the form of .jpg or .jpeg, and need to get its catalog from a .xml file which is in the same server... I need to display both in a single row of a list...</p><p>Please try to help me, I am really struggling to get this.</p>","487629","","496830","","2011-01-27 04:06:09","2011-01-27 04:06:09","How to get ProductImage and its catalog from local server","<android><xml><image>","0","4","","",""
"4143858","1","4144206","","2010-11-10 11:15:01","2","4871","<p>I followed <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">Hello Views, Google Map View</a> and now I want to add a <code>TextView</code> under below the <code>MapView</code>. I have only changed the layout file <code>main.xml</code> and placed the <code>MapView</code> and the <code>TextView</code> in a vertical <code>LinearLayout</code>. My Eclipse is set to build this automatically, but when I run the application in the emulator, I can only see the <code>MapView</code>.</p><p>How can I add a <code>TextView</code> below a <code>MapView</code>?</p><p>Here is my layout <code>main.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;     &lt;com.google.android.maps.MapView        android:id=""@+id/mapview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:clickable=""true""        android:apiKey=""my key""    /&gt;    &lt;TextView        android:id=""@+id/textview""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""My TextView""    /&gt;&lt;/LinearLayout&gt;</code></pre>","213269","","","","","2011-03-27 20:50:53","How can I add a TextView below a MapView?","<android><layout><android-mapview><android-linearlayout>","3","0","","",""
"4143863","1","4144302","","2010-11-10 11:15:25","2","439","<p>I have an androidapp with a background but I want to stay it in portrait always. So the activity can rotate, just the wallpaper can't. Is this possible?</p>","296293","","","","","2011-03-11 04:34:32","Android windowBackground turns with device","<android><background>","1","0","","",""
"4143907","1","","","2010-11-10 11:19:43","2","83","<p>I have an activity with MediaPlayer and Button. The MediaPlayer contains a VideoView (using MediaPlayer.getDisplay(VideoView.getHolder())). When the button is pressed it pause the MediaPlayer and open a browser. returning to app suppose to continue the video (MediaPlayer .start())</p><p>When the activity started the video is plays and shown as expected but when i press the button and then I press return to the app the video is not shown but the sound is working.</p><p>Any idea how to make the video visible?</p><p>-Z</p>","449466","","","","","2010-11-10 11:19:43","Video is not shown when returning to app","<android><media-player>","0","2","0","",""
"4143909","1","4578989","","2010-11-10 11:20:04","1","1541","<p>I have a simple Android activity that should present some status both on a mapview and in textual form.</p><p>I have done this as two layouts that i swap between with setContentView(). At start it works fine, display the map. I can then swap to the textstatus view by pressing menu button and selecting Text view. But when I want to swap back to map the setContentView(R.layout.main); (that layout holds only a MapView and a linear layout) throws the following exception:</p><pre><code>android.view.InflateException: Binary XML file line #7:   Error inflating class &lt;unknown&gt;</code></pre><p>Anyone got any ideas? I am quite new to Android development so I dont know for sure that this is the best way to solve the problem.</p><p><strong>Source listing:</strong></p><p>maptest.java:</p><pre><code>public class maptest 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); MapController mapController = mapView.getController(); mapController.setCenter(new GeoPoint((int)(65.319416667*1000000),          (int)(18.073833333*1000000))); mapController.setZoom(8);  }  @Override  public boolean onCreateOptionsMenu(Menu menu){    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.menu, menu); return true;  }      //@Override  protected boolean isRouteDisplayed() {    return false;  }  @Override  public boolean onOptionsItemSelected(MenuItem item) {    // Handle item selection    switch (item.getItemId()) {    case R.id.map_view:     try{      setContentView(R.layout.main);     }     catch (Exception e) {      System.out.println(""Error"");      System.out.println(e.toString());     }     return true;    case R.id.text_view:     setContentView(R.layout.statustext);     return true;    default:        return super.onOptionsItemSelected(item);    }  }}</code></pre><p>Main.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;</code></pre><p>    </p><p>statustext.xml</p><pre><code>&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/TextView01"" android:layout_width=""wrap_content""      android:layout_height=""wrap_content"" android:text=""Status text""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>manifest:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.csr.maptest""  android:versionCode=""1""  android:versionName=""1.0""&gt;</code></pre><p> </p><pre><code>  &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".maptest""              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><pre><code>&lt;/manifest&gt; </code></pre><p>menu.xml</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:id=""@+id/text_view""      android:title=""Text view"" /&gt;             &lt;item android:id=""@+id/map_view""      android:title=""Map view"" /&gt;&lt;/menu&gt;</code></pre>","503052","","","","","2011-01-02 15:30:43","Inflate mapview second time throws exception","<android><android-mapview><inflate>","1","1","1","",""
"4143918","1","4148021","","2010-11-10 11:21:14","0","12678","<p>rotate image on canvas around its center . i tried some example from net but i am failed </p><p>if i am using <code>bitmap.creatbitmap</code> with matrix i am getting error </p><p>Please suggest me which is better</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","603744","","2011-09-06 13:49:47","2012-06-20 06:45:53","rotate image in around its center point in canvas","<android>","1","0","3","",""
"4143926","1","4144203","","2010-11-10 11:22:23","12","3581","<p>A few questions :</p><ol><li><p>What implications does upgrading an app have on stored data i.e. Preferences and database? Does the system perform a clean install of the new version(i.e. remove the older version and then install the new) or something else?  </p></li><li><p>What if the user wants to retain the stored data- say values in the shared preference or a sqlite database?  </p></li><li><p>How can I emulate this app-update-install scenario? If I have a version 'x' installed on my emualator and I do a adb install of version 'x+1' I am getting <code>INSTALL_FAILED_ALREADY_EXIST</code> error. Should I try hosting the new apk on a Web server, will the Package Manager take this as an update and do the needful?</p></li></ol>","236128","","180538","","2010-11-10 11:40:41","2010-11-10 11:56:33","Questions about Android application update","<android><database><upgrade>","2","0","3","",""
"4143963","1","4144144","","2010-11-10 11:27:20","5","2422","<p>I'm trying to modify two TextViews in exactly the same way. I thought I can give them same id and with findViewById() and setText() methods change those TextViews in two lines. But it seems only one TextView is changed.</p><p>Is there a way to do this?Or I have to make different ids for every element, get every element by findViewById() method and set it's text?</p>","419308","","21234","","2010-11-30 17:31:43","2010-11-30 17:31:43","Two XML elements with same id","<android><textview>","3","6","","",""
"4143971","1","","","2010-11-10 11:28:50","1","890","<p>Greetings,</p><p>I'm trying to change the text on a button in appcelerator.</p><p>Now I can change it once, but I can't change the text back once some event occurs.</p><p>Here is the code:</p><pre><code>var login=Titanium.UI.createButton({   title:'Login',     width:250,     top:330});win.add(login);var xhr=Titanium.Network.createHTTPClient();login.addEventListener('click', function(e){     login.title=""Please wait..."";   //this line works fine     xhr.onload=function(){            login.title=""Login"";   //this line doesn't work            if(uname.hasText){                 uname.value=this.responseText;            }     };     xhr.onerror=function(){            login.title=""Login"";   //this line doesn't work            alertDialog.show();     };     xhr.open(""POST"",""http://www.asdf.com/ajax/login.php"");     if(uname.hasText &amp;&amp; pword.hasText){            xhr.send({""uname"":uname.value,""pword"":pword.value});     }else{            alertDialog.show();     }});</code></pre><p>I simply don't know what to do at this point!</p><p>Any insight greatly appreciated.</p><p>Many thanks in advance,</p>","395974","","","","","2010-11-10 12:46:53","Appcelerator change button text","<android><text><button><titanium><appcelerator>","1","0","","",""
"4143981","1","","","2010-11-10 11:30:02","0","112","<p>I am new to android and my task is to display <code>......</code> when entered more characters in <code>EditText</code>?</p><p>Thanks in advance</p>","486291","","486291","","2010-11-10 12:26:39","2010-11-10 12:26:39","How can I get ........ of extra characteres of edittext in android?","<android>","2","2","","",""
"4144080","1","4144218","","2010-11-10 11:40:16","4","635","<p>when the user taps a menu item i need to create a new Activity; this activity loads a lot of data then shows a map and takes some seconds to be shown ...How can i use ProgressDialog from an activity to another? I actually cannot see it if i call  </p><pre><code>ProgressDialog dialog = ProgressDialog.show(this, """", ""Loading. Please wait..."", true);</code></pre><p>Thanks in advance and greetingsc.</p>","339500","","","","","2010-11-10 11:58:19","ProgressDialog in Android for new Activity","<android><progressdialog>","1","0","1","",""
"4144131","1","4144195","","2010-11-10 11:46:17","2","248","<p>I develop an Android application using Eclipse and the Android emulator. Sometimes I don't know if I am running the latest version of my application in the emulator. Is there any way I can check if it is the latest version?</p><p>E.g. I do a change of the layout for my application, but when I run the application in the emulator and the change isn't visible. Then I don't know if it is an old version of the application that is running or if I have done something wrong in the new version so the change isn't visible.</p>","213269","","","","","2010-11-10 11:55:15","How do I know if it's the latest version of my application that is running on the emulator?","<android><android-emulator><version><apk>","1","0","","",""
"4144190","1","4145399","","2010-11-10 11:54:36","2","1145","<p>i am implementing  google translator similator to my app<br>      how can implemented some idea about this app forward       some similar source url or related  google api please forward advance thanks </p><pre><code>screenshot of this apphttp://www.freeimagehosting.net/uploads/73620ad386.pnginput:from any language &lt;-----translate-----------&gt;to any language output:translation of text and  voice of translate textthis app same as google translatorcheckIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);startActivityForResult(checkIntent,1);   private TextToSpeech mTts;    protected void onActivityResult(            int requestCode, int resultCode, Intent data) {        if (requestCode == 1) {            if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {                // success, create the TTS instance                mTts = new TextToSpeech(this, null);            } else {                // missing data, install it                Intent installIntent = new Intent();                installIntent.setAction(                    TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                startActivity(installIntent);            }        }        mTts.setLanguage(Locale.US);</code></pre>","254790","","254790","","2010-11-11 07:29:07","2012-08-05 13:44:45","how to implemented translator one language to another language in android","<android><google-translate>","1","0","4","",""
"4144192","1","","","2010-11-10 11:55:05","0","397","<p>Is there a way to determine the email address of an Android Market publisher given the package name of an app they own? </p><p>I.e. Given the package name <strong>com.acme.app</strong> I would get back <strong>dev@acme.com</strong>?</p><p>And before anyone asks, I don't want to spam devs, I just need a way to prove that if a dev says they own com.acme.app they really do own it by sending them an email linked to that app and getting them to click on a confirmation link etc.</p><p>Thanks</p>","503058","","","","","2010-11-10 14:16:40","Get email address of publisher given app package name","<android><email><google-play><publisher>","2","1","","",""
"4144193","1","4473464","","2010-11-10 11:55:08","-1","6417","<p>I am able to retrieve all contacts from android in .vcf file using following code.</p><pre><code>    ContentResolver cr = getContentResolver();    Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null);String lookupKey = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));                        Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey);                        System.out.println(""The value is "" + cr.getType(uri));                        AssetFileDescriptor fd = this.getContentResolver().openAssetFileDescriptor(uri, ""r"");                        FileInputStream fis = fd.createInputStream();</code></pre><p>I don't know how to use this .vcf file to import all these contacts using code. The .vcf file contains all the details of all contacts including photos etc.</p><p>Cheers,Prateek</p>","481314","","","","","2011-10-10 21:07:58","Import Contacts from .vcf file in Android 2.1","<android>","3","1","","",""
"4144244","1","4144327","","2010-11-10 12:02:44","0","943","<p>I am trying to build a tumblr client in android but am running into response code 403 - Forbidden. </p><p>The api docs suggest i use email and password parameters to validate credentials and get account information.I have tried out the following code but as specified get a 403 response code.can anyone suggest what i m doing wrong.</p><pre><code>    String url = ""http://www.tumblr.com/api/authenticate"";    HttpParams params = new BasicHttpParams();    HttpConnectionParams.setConnectionTimeout(params, 20000);    HttpConnectionParams.setSoTimeout(params, 20000);           DefaultHttpClient httpclient = new DefaultHttpClient(params);       UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(_username + "":"" + _password);     httpclient.getCredentialsProvider().setCredentials(new AuthScope(null,-123),credentials);           HttpPost method = new HttpPost(url);            HttpResponse response = httpclient.execute(method);    response.getStatusLine().toString(); // this gives me a 403 res code (Forbidden)..</code></pre>","327491","","","","","2010-11-10 12:15:27","tumblr authentication problem","<android><tumblr>","1","0","2","",""
"4144321","1","4144343","","2010-11-10 12:14:02","0","1166","<p>I have various activitys on my app. I have a configuration Activity, and i want to put a cancel button, that, when user press this button, the configuration window get's closed and turn back into the previous activity.</p><p>i search in google and i find something about calling cancel or dismiss functions, but i can't call them cause this is not a dialog, it's an activity</p>","479886","","","","","2010-11-10 12:16:40","Wich function i have to call on a Cancel button in a user inferface (activity)?","<android><activity><cancel>","1","0","","",""
"4144328","1","4146271","","2010-11-10 12:15:28","4","907","<p>Which of the following two should I be using to make sure that all the cursors are closed?</p><pre><code>    Cursor c = getCursor();     if(c!=null &amp;&amp; c.getCount()&gt;0){         try{             // read values from cursor         }catch(..){}         finally{             c.close();         }     }//end if    OR    Cursor c = getCursor();     try{         if(c!=null &amp;&amp; c.getCount()&gt;0){             // read values from cursor         }//end if     }catch(..){    }finally{         c.close();     } </code></pre><p><strong>EDIT:</strong><br>A few questions:<br>1. Do we need to call close() on a cursor which has count of 0?<br>2. Because in that case for the first idiom, close() will never be called. It assumes that for a cursor having no elements, cursor will never be opened. Is this a valid assumption?</p><p>Please advise.</p>","366053","","366053","","2010-11-10 13:00:02","2014-02-24 11:49:10","Idiom to close a cursor","<android><sqlite><cursor>","5","0","3","",""
"4144391","1","","","2010-11-10 12:21:43","-1","437","<p>Friends, My application has to get current gps position in every seconds and write this data as byte array to a file in files directory. To check the data in that file I tried to open mnually. But i couldn't open. How can i read the file. The file is a text file </p>","462695","","","","","2010-11-10 15:38:16","manually read a file in the files directory","<android>","1","3","","",""
"4144454","1","4144793","","2010-11-10 12:27:49","0","386","<p>I got the following error on error log,</p><pre><code>""conversion to dalvik format failed with error 1""</code></pre><p>How to resolve this issue?</p>","488433","","","","","2010-11-10 15:28:03","i got error while creating a android project in eclipse 3.6.1","<android><eclipse>","3","2","","",""
"4144546","1","","","2010-11-10 12:40:03","1","3104","<p>I'm attempting to create a method that will allow me to retrieve a value from the last row of a database, and then insert it into an EditText field. (This is a value that the user will not change all that often, so it would be helpful if when they do set it, it stays set when they come back to it).</p><p>My method, based on a similar method I have for getting the total of a specific column, is as such:</p><pre><code>public String getBase() { Cursor mCursor = mDb.rawQuery(   ""SELECT base FROM table constants ORDER ID desc limit 1"", null); if (mCursor.moveToFirst()) {  return mCursor.getString(0); } return mCursor.getString(0);</code></pre><p>Like I said, I based this on a similar method, which I found after searching around the Internet. I understand most of it, but I have no idea what the 0's in the return statements mean (or the moveToFirst method).</p><p>Anyway, in my OnClickListener (the button the user would press to save this value to db), I have the following (editBase is the EditText field I want to populate):</p><pre><code>editBase.setText(cDbHelper.getBase());</code></pre><p>If I run the program without this statement, it works fine and the value saves to the db. As soon as I try to run it with this, I get a force close. Any suggestions?</p><p>Thanks.</p><p>EDIT: Thanks for the responses. With some guidance from a friend, I ended up using ""ORDER BY... desc limit 1"" instead. This was the final method:</p><pre><code>public double getBase() {    final double DEFAULT_BASE = 0;    Cursor mCursor = mDb.rawQuery(            ""SELECT base FROM constants ORDER BY _id desc limit 1"", null);    if (mCursor.getCount() == 0)        return DEFAULT_BASE;    else        mCursor.moveToFirst();        return mCursor.getDouble(0);</code></pre>","503185","","503185","","2010-11-10 22:53:46","2010-12-20 11:45:42","Retrieving a single column of last row in sqlite/Android using ORDER ID desc limit 1","<java><android><sqlite>","2","1","","",""
"4144566","1","4144661","","2010-11-10 12:42:22","0","1164","<pre><code>   private static class asyncDownloadImage extends AsyncTask&lt;Object, Integer, Integer&gt;     {        Bitmap _image=null;        @Override        protected Integer doInBackground(Object... params) {            String _url=com.nag.online.utils.objectToString(params[0]);            byte tries=0;            do  {                _image          = com.nag.online.utils.downloadPicture(_url);                try {Thread.sleep(10);} catch (InterruptedException e) {    e.printStackTrace(); }                tries++; if (tries&gt;utils.TRIES) break;            } while (_image==null);            final Bitmap _imagex=_image;            Runnable r = new Runnable() {                   public void run() {                       ImageViewImage.setImageBitmap(_imagex);                    ImageViewImage.setScaleType(ScaleType.CENTER);                    ImageViewImage.refreshDrawableState();                }};            handler.post(r);              isReady=true;            return 0;      }        @Override        protected void onPostExecute(Integer result) {            /*if (!_image.isRecycled()) {                _image.recycle();                _image=null;                System.gc();            }*/            System.gc();        }    }</code></pre><p>i get:</p><p>11-10 13:32:07.057: ERROR/dalvikvm(4904): Out of memory: Heap Size=8455KB, Allocated=5755KB, Bitmap Size=7855KB</p><p>or when i put this into my code on ""onPostExecute"":</p><pre><code> if (!_image.isRecycled()) {                _image.recycle();                _image=null;                System.gc();            }</code></pre><p>then i get: </p><p>11-10 13:40:55.117: ERROR/AndroidRuntime(4981): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@44cadc98</p><p>what is the solution for this?</p>","472537","","","","","2010-11-10 12:53:46","Android AsyncTask download image errors","<android><image>","1","1","","",""
"4144569","1","","","2010-11-10 12:42:34","0","662","<p>when application installed and opend first time,and i pressed home key then application minimises normally.but when i starts same application(not minimised one),it shows me blank screen.this happens only first time.i am not getting what happens..can any body help</p>","503195","","503195","","2010-11-11 04:24:33","2010-11-11 04:57:23","minimise application in android problem","<android>","1","4","","",""
"4144687","1","","","2010-11-10 12:57:42","0","1159","<p>I tried connecting to MSN messanger using Smack library with follwiing code</p><pre><code>import org.jivesoftware.smack.ConnectionConfiguration;import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;import org.jivesoftware.smack.XMPPConnection;import org.jivesoftware.smack.XMPPException;ConnectionConfiguration configuration = newConnectionConfiguration(""messenger.hotmail.com"", 1863, ""hotmail.com""); configuration.setSecurityMode(SecurityMode.disabled);configuration.setCompressionEnabled(false);XMPPConnection connection = new XMPPConnection(configuration);try {    connection.connect();}catch (XMPPException e) {    Log.e(TAG, ""MSN connect Failed !!"");}</code></pre><p>I am getting "" connection failed, no response from the server""</p><p>I also tried using java msn library it is also not working.</p><p>I also tried using TJMSN library , but my application is crashing with Verify error :</p><p>Please help me in this...by suggestiing any method to connect to <strong>msn messanger in android</strong></p>","503200","","335418","","2011-12-15 16:51:59","2011-12-15 16:51:59","connection to MSN messanger in android","<android><xmpp><smack><msn-messenger>","2","0","","",""
"4144840","1","4144949","","2010-11-10 13:17:51","4","6390","<p>I've added an inserted in Gallery using android API as following:</p><blockquote>  <p>Images.Media.insertImage(ctx.getContentResolver(),  ""scard/test.jpg"", ""Hello"" ,  ""description"");</p></blockquote><p>Actually the image that I passed its full path (scard/test.jpg) is already successfully inserted in the DB, but when you open the gallery you can't see it unless you switch off/on the device or Mount/Unmount the external memory.</p><p>It there any way to refresh the gallery on demand?</p><p>Thanks</p><p>Bassel Kh.</p>","443034","","","","","2012-09-18 14:16:40","How can I refresh the Gallery after I inserted an Image in android?","<android>","4","0","1","",""
"4144926","1","","","2010-11-10 13:25:32","2","561","<p>I am trying to add a button to each line on a ListView. The button will then copy the row (that has been clicked) from the table and insert the row into another table. What I need to know is how to assign the clicked row rowId to my button method as I need to pass that over to the copyData method. Here is my main code and the button method is at the bottom.</p><pre><code>public class Favourites extends ListActivity {private static final int ACTIVITY_CREATE=0;private static final int ACTIVITY_EDIT=1;private static final int INSERT_ID = Menu.FIRST;private static final int DELETE_ID = Menu.FIRST + 1;private FavouritesDbAdapter mDbHelper;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.favourites_list);    mDbHelper = new FavouritesDbAdapter(this);    mDbHelper.open();    fillData();    registerForContextMenu(getListView());}private void fillData() {    Cursor notesCursor = mDbHelper.fetchAllNotes();    startManagingCursor(notesCursor);    // Create an array to specify the fields we want to display in the list     String[] from = new String[]{FavouritesDbAdapter.KEY_TITLE,FavouritesDbAdapter.KEY_ROWID};    // and an array of the fields we want to bind those fields to     int[] to = new int[]{R.id.text1,R.id.text2};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =         new SimpleCursorAdapter(this, R.layout.favourites_row, notesCursor, from, to);    setListAdapter(notes);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, INSERT_ID, 0, R.string.menu_insert);    return true;}@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {        case INSERT_ID:            createNote();            return true;    }    return super.onMenuItemSelected(featureId, item);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.add(0, DELETE_ID, 0, R.string.menu_delete);}@Overridepublic boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {        case DELETE_ID:            AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();            mDbHelper.deleteNote(info.id);            fillData();            return true;    }    return super.onContextItemSelected(item);}private void createNote() {    Intent i = new Intent(this, FavouritesEdit.class);    startActivityForResult(i, ACTIVITY_CREATE);}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, Favourites.class);    Intent i1 = new Intent(this, FavouritesEdit.class);    i1.putExtra(FavouritesDbAdapter.KEY_ROWID, id);    i.putExtra(FavouritesDbAdapter.KEY_ROWID, id);    startActivityForResult(i1, ACTIVITY_EDIT);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent intent) {    super.onActivityResult(requestCode, resultCode, intent);    fillData();}public void button(View view) {    mDbHelper.copyData(#ROWID of CLICKED BUTTON TO BE PASSED OVER#);    fillData();}</code></pre><p>}</p>","503253","","503253","","2010-11-10 14:04:40","2010-11-10 14:19:45","Passing rowId of ListView via a button","<android>","1","2","","",""
"4144931","1","4193677","","2010-11-10 13:26:33","1","748","<p>I'm developing an Android application that consists of:</p><ul><li>a lightweight background service that logs events to a DB</li><li>a heavier GUI application that summarizes these events and displays graphs.</li></ul><p>I'm having trouble creating the service part, though. The graphic application can use quite some RAM, and when it goes to the background, the OS closes it after some time of not being used.</p><p>The problem is, when the application gets shut down, so does the service. This is bad because this keeps me from recording further events. I don't care if the application gets terminated, but the service needs to keep on running.</p><hr><p>I have tried numerous ways to keep the service alive, like having it use threads or a differently named process than the main app. Nothing has worked, and I have found no help on any of the android developer pages or forums.</p><p>Thank you for your advice!</p>","503251","","","","","2010-11-16 11:35:06","Android: Creating a service that survives the application that started it","<android><service>","3","1","1","",""
"4144985","1","4145043","","2010-11-10 13:32:35","0","1308","<p>I have an Application which, reads files from Sdcard and does some intense processing.</p><p>To speed up the user experience </p><p>I created a subclass of Application object.  With in this i created a Thread where, i actually got a reference to the files on Sdcard   and did the startup activities so that once the activity is shown there is no lag to the user.</p><pre><code>public class GAppClass extends Application {    class setMapDirThread extends Thread {       public void run() {      setMapDir();       }   }  public void onCreate() {                 setMapDirThread objThread = new setMapDirThread();         objThread.start();       } private void setMapDir() {   Log.d(TAG, ""Inside initMapComponent"");   String extDirName = Environment.getExternalStorageDirectory()   .getAbsolutePath();                       /*                       some processing related to opening and reading files from Sdcard and                        allocating cache                       */        }}</code></pre><p>Is the above mentioned approach safe to use?i.e. creating thread in the application class to do some background processing is good approach or bad?Does it slow down application startUp?Is it safe to create a thread like this to read contents from Sdcard and allocate some memory for internal caching?</p>","503263","","319618","","2010-11-10 13:37:02","2010-11-10 13:40:24","Creating a thread in Application Object","<android><thread-safety>","2","0","","",""
"4145032","1","","","2010-11-10 13:39:12","0","1009","<p>I was following ""hello-android-introducing-googles-mobil… by Ed Burnette.. which was very useful for the basics. Morover using the basics I was able to create a small calculator application.</p><p>But when I wanted to work with activities(life cycle) I couldnt follow the book clearly..</p><p>So please suggest a book or site which explains the life cycle of android applications with simple easy to read (and workout) programs</p>","503267","","21234","","2010-11-10 14:03:39","2010-11-11 04:36:32","Where to get simple Android programs to illustrate the lifecycle?","<android><lifecycle>","2","2","","",""
"4145049","1","4146270","","2010-11-10 13:41:06","2","328","<p>I have an activity which has some text views and other data to be updated every second.</p><p>The performance is sluggish and when i capture the logs and view in TraceView.  I see at lot of calls been made to ViewRoot.draw() function.</p><p>25 calls in a short span of 4 seconds, almost 6 calls every sec.  Ideally speaking it should be once call every sec.</p><p>As per my initial speculation i beleive it is due to the bad layout of my xml, is this true?</p><p>How do i identify what is the reason for so many calls?  which is the best way to reduce these calls?</p>","503263","","","","","2010-11-12 12:10:35","Huge calls made to ViewRoot.draw()","<android><performance>","2","0","","",""
"4145060","1","","","2010-11-10 13:42:36","1","1985","<p>A short history. please bear with me :)</p><p>I have an Android project that uses JNI which works very good.</p><p>I've decided to create out of the source of this jni project an external jar (for distribution) </p><p>In order to create this jar I've taken the advice of others and created a new Java project that holds the few jni classes I need to store in the jar. I've exported this java project to a jar (not as a runnable jar)</p><p>I've created a new Android Project in which I try to use the jar file in question.</p><p>After I've played with this new android project I came to realize that the .so file which should accompany the jni classes can't reside inside the jar file itself (Eclipse complained about it..) So I've created a lib directory inside the new Android Project which holds the .so file.</p><p>When I run this new Android project I can't work with any of the classes which has native methods, And I can only work with those classes which are pure java implementation.</p><p>I keep getting ""ExceptionInInitializerError"" when trying to create an instance of one of jni based objects. </p><p>Update:It seems that the error comes from trying to load the jni library in line </p><pre><code>System.loadLibrary(""lib-jni"");</code></pre><p>Here is the logcat:</p><pre><code>&gt; ERROR/SightEngine(2479): About to load the lib-jni.soERROR/SightExample(2479): WARNING: Could not init SightEngine java.lang.ExceptionInInitializerErrorERROR/AndroidRuntime(2479): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(2479): java.lang.RuntimeException: Unable to start activity ComponentInfo{eyesight.android.example/eyesight.android.example.SightExample}: java.lang.NullPointerException: println needs a messageERROR/AndroidRuntime(2479):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)ERROR/AndroidRuntime(2479):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)ERROR/AndroidRuntime(2479):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)ERROR/AndroidRuntime(2479):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)ERROR/AndroidRuntime(2479):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(2479):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(2479):     at android.app.ActivityThread.main(ActivityThread.java:4363)ERROR/AndroidRuntime(2479):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(2479):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(2479):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)ERROR/AndroidRuntime(2479):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)ERROR/AndroidRuntime(2479):     at dalvik.system.NativeStart.main(Native Method)ERROR/AndroidRuntime(2479): Caused by: java.lang.NullPointerException: println needs a messageERROR/AndroidRuntime(2479):     at android.util.Log.println(Native Method)ERROR/AndroidRuntime(2479):     at android.util.Log.e(Log.java:208)ERROR/AndroidRuntime(2479):     at eyesight.android.example.SightExample.onCreate(SightExample.java:28)ERROR/AndroidRuntime(2479):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)ERROR/AndroidRuntime(2479):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)ERROR/AndroidRuntime(2479):     ... 11 moreERROR/dalvikvm(2479): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre><p>A few pointers:</p><ul><li>I can see the .so file inside the .apk file.</li><li><p>I've tried defining the external jar file in the JNI Android.mk but nothing exciting happened. here are the lines I used (it compiled without a problem..)</p><p>LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libtestjar:lib/testJar.jarinclude $(BUILD_MULTI_PREBUILT)</p></li><li><p>I'm able to work with regular java classes that exist only in jar file. (I know I'm repeating myself.. :) ) which means I've correctly defined this jar in the project. </p><ul><li>The java project that holds the jni based classes has a reference to the android.jar (sdk level 7)</li></ul></li></ul><p>Does anyone has any suggestions has to how this task can be accomplished? I feel like I'm almost there...</p><p>Thank you for your time and effort :)</p><p>Itamar </p>","189319","","1839241","","2012-11-30 13:22:09","2012-11-30 13:22:09","Mixing Android External JAR and JNI gone wild","<android><jar><jni><android-ndk>","2","4","","",""
"4145090","1","","","2010-11-10 13:45:32","38","21453","<p>In an <code>ExpandableListView</code>, is there a way to hide the group indicator for groups with no children?</p>","460611","","126039","","2011-01-04 08:03:43","2014-03-20 09:47:27","ExpandableListView - hide indicator for groups with no children","<android>","6","0","15","",""
"4145134","1","4145346","","2010-11-10 13:50:42","0","756","<p>i am doing an xml layout file, and i want to have my spinner in the right of a textview, but i am having problems... when i test the layout, my spinner is not in the correct possition, it's a little more down and it haves very small lenght, is not 180px as i said in the layout.</p><p>there is the xml:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/PermissionLabel""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/perlabel""    android:layout_marginLeft=""15dip""    android:layout_below=""@id/salto3""/&gt;&lt;Spinner     android:id=""@+id/Permission""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:prompt=""@string/perlabel""    android:layout_alignBaseline=""@id/PermissionLabel""    android:layout_alignParentRight=""true""    android:width=""180px""    android:layout_marginRight=""20dip""/&gt;&lt;TextView     android:id=""@+id/salto4""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/saltodelinea2""    android:layout_below=""@id/PermissionLabel""/&gt;&lt;TextView    android:id=""@+id/HoursRangeLabel""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/hoursrangelabel""    android:layout_below=""@id/salto4""    android:layout_marginLeft=""15dip""/&gt;&lt;EditText    android:id=""@+id/From""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""""    android:layout_alignBaseline=""@id/HoursRangeLabel""    android:width=""70px""    android:layout_alignLeft=""@id/Email""    android:layout_marginRight=""20dip""/&gt;&lt;TextView    android:id=""@+id/ToLabel""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/tolabel""    android:layout_alignBaseline=""@id/From""    android:layout_toRightOf=""@id/From""    android:layout_marginLeft=""-10px""/&gt;&lt;EditText    android:id=""@+id/To""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""""    android:layout_alignBaseline=""@id/From""    android:width=""70px""    android:layout_marginRight=""20dip""    android:layout_alignParentRight=""true""/&gt;</code></pre><p></p>","479886","","","","","2010-11-10 14:11:13","Problems with a spinner on relativelayout xml","<android><spinner><relativelayout>","1","0","","",""
"4145146","1","4145273","","2010-11-10 13:52:04","0","721","<p>I'm developing a simple arcade game and I'd like to paint the graphics onto a Canvas without regard for the device DPI, just the pixels.If I do some drawing in 240x320 pixels emulator, I'd like the Canvas to have 240x320 pixels. <code>Canvas.getWidth()</code> and <code>getHeight()</code> tell me that I have 240x320 pixels Canvas, but when I draw a line by <code>g.drawLine(0,0, 240, 320, activePaint);</code> a line gets drawn only to (180;240). It's scaled by DPI  somehow, but I'd like to draw to the exact pixels. Is there a simple fix to this? Thanks</p>","72746","","","","","2010-11-10 14:04:18","draw to canvas without regard to DPI","<android><graphics><scaling><dpi>","1","0","","",""
"4145302","1","","","2010-11-10 14:07:14","0","2955","<p>I am trying to write some simple data to External storage using the following code. I am missing something here but not sure what. Thanks</p><p>RobD</p><p>public class TimeCard 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>    final Button button = (Button) findViewById(R.id.Button01);    final EditText edittext = (EditText) findViewById(R.id.EditText01);    final EditText edittext1 = (EditText)findViewById(R.id.EditText02);    final EditText edittext2 = (EditText)findViewById(R.id.EditText03);    final EditText edittext3 = (EditText)findViewById(R.id.EditText04);    final String inputString = edittext + ""/n"" + edittext1 + ""/n""+  edittext2 + ""/n"" + edittext3;    button.setOnClickListener(new OnClickListener() {        public void onClick(View v) {                         //Do it          CreateFile(inputString);          //Let them know it          Toast.makeText(TimeCard.this, ""You are Clocked In"", Toast.LENGTH_LONG).show();        }    });}//Write to SD Card</code></pre><p>public void CreateFile(String InputString){        </p><pre><code> File SDCard = Environment.getExternalStorageDirectory();   String FILENAME = SDCard + ""/time_card.txt"";    FileOutputStream fos = null;    try {        fos = openFileOutput(FILENAME, Context.MODE_WORLD_READABLE);    } catch (FileNotFoundException e) {        e.printStackTrace();    }    try {        fos.write(InputString.getBytes());    } catch (IOException e) {        e.printStackTrace();    }    try {        fos.close();    } catch (IOException e) {        e.printStackTrace();    }    }</code></pre><p>}</p>","503312","","","","","2010-11-11 15:53:26","Problem Writing Files problem in Android Emulator","<java><android><io>","2","3","1","",""
"4145341","1","","","2010-11-10 14:10:42","0","665","<p>Tasker is an app in the app-market that enables one to define simple automation tasks.</p><p>I'm writing a task that announces the location coordinates.</p><p>However, the location is a built-in variable that is defined to about a dozen decimal places.</p><p>I want to round off the value before having it announced.</p><p>Any suggestions?</p>","434253","","434253","","2010-11-12 12:12:05","2010-11-12 12:12:05","Question about Android Tasker variables","<android>","1","0","","",""
"4145500","1","","","2010-11-10 14:29:49","1","531","<p>I'm starting to do a little game for Android.Recently I did have a reading where the user touches the screen;)I would like on the basis of these data, moving image.Displays an image in the XML (<strong>imageView</strong>). What to write <strong>java code</strong> to move at that image?I would like to rotate the image, move it anywhere on the phone screen or remove it.How something is done?I am interested in java code only because I know what to do in the XML.</p>","503344","","","","","2010-11-10 14:35:41","How to view Images in Android","<java><android><imageview>","2","0","","",""
"4145602","1","4146070","","2010-11-10 14:41:36","7","24787","<p>i am using a viewholder to display from a dynamic arrayadapter.it works but the data displayed changes irregularly when i scroll the List.<strong><em>i want my List View to be populated only once ,Not all the time when i scroll my list.</em></strong> Any suggestion? Here is my Code</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {               // A ViewHolder keeps references to children views to avoid unneccessary calls               // to findViewById() on each row.               ViewHolder holder;               // When convertView is not null, we can reuse it directly, there is no need               // to reinflate it. We only inflate a new View when the convertView supplied               // by ListView is null.               if (convertView == null) {                    convertView = mInflater.inflate(R.layout.sample, null);       // Creates a ViewHolder and store references to the two children views                    // we want to bind data to.                   holder = new ViewHolder();                    holder.name = (TextView) convertView.findViewById(R.id.text);                   holder.icon = (ImageView) convertView.findViewById(R.id.icon);                    convertView.setTag(holder);               } else {                    // Get the ViewHolder back to get fast access to the TextView                    // and the ImageView.    holder = (ViewHolder) convertView.getTag();   }               // Bind the data efficiently with the holder.    if(_first==true)   {   if(id&lt;myElements.size())   {      holder.name.setText(myElements.get(id));    holder.icon.setImageBitmap( mIcon1 );   id++;   }   else   {    _first=false;   }   }    //holder.icon.setImageBitmap(mIcon2);   /*try{    if(id&lt;myElements.size())     id++;     else     {      id--;     }    }   catch(Exception e)   {    android.util.Log.i(""callRestService"",e.getMessage());   }*/   return convertView;  }        static class ViewHolder {             TextView name;             ImageView icon;        }  </code></pre><p>when the list is loaded it looks like this : <a href=""http://i.stack.imgur.com/NrGhR.png"">http://i.stack.imgur.com/NrGhR.png</a> <img src=""http://i.stack.imgur.com/sMbAD.png"" alt=""alt text""> after scrolling some data  <a href=""http://i.stack.imgur.com/sMbAD.png"">http://i.stack.imgur.com/sMbAD.png</a> <img src=""http://i.stack.imgur.com/sMbAD.png"" alt=""alt text""> it looks like this, and again if i scroll to the beginning it looks  <a href=""http://i.stack.imgur.com/0KjMa.png"">http://i.stack.imgur.com/0KjMa.png</a><img src=""http://i.stack.imgur.com/0KjMa.png"" alt=""alt text""></p><p>P.S : my list have to be in alphabetic order</p>","430652","","430652","","2010-11-11 05:43:18","2012-08-01 17:37:12","How to implement a view holder?","<android><listview><view>","2","2","7","",""
"4145614","1","4154218","","2010-11-10 14:42:54","0","1128","<p>I need to consume a WCF webservice via SOAP under Android. I am doing this by using KSOAP2.5.2.Now as we are not allowed to edit the WCF in any way, I am currently not able to change the output which the WCF service returns. That is my main problem. To solve the problem, I need to take what I get from the WCF (workaround):</p><pre><code>anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType{element=anyType{complexType=anyType{sequence=anyType{element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{}; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{simpleType=anyType{restriction=anyType{maxLength=anyType{}; }; }; }; }; }; }; }; }; }; }; diffgram=anyType{DocumentElement=anyType{CL_9_2_4_DestInfo=anyType{DESTINATION=.... LOTs of other data.</code></pre><p>Now, as it seems this is some Microsoft propretary code which is in fact a full dataset/xsd(?) How can I parse this thing into a working dataset or at least make it somehow readable to my little Android?</p>","408659","","143979","","2010-11-11 12:15:24","2011-07-06 10:41:02","Parsing Complex WCF response in Android","<java><android><wcf><ksoap2>","2","3","","",""
"4145622","1","","","2010-11-10 14:43:30","1","526","<p>I have a scroll layout with a relative layout in each line. Now is there an image and a text, and I want to limit the height of each line to the text.</p><p>So if my image is higher than the text, that the image will be resized to the height of the text (proportional). How can I do this in XML?</p><p>At the moment the line definition looks like (copied from the mumble android implementation):</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/RelativeLayout01""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""&gt;    &lt;ImageView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:id=""@+id/userRowState""        android:src=""@drawable/icon"" /&gt;    &lt;TextView        android:layout_toLeftOf=""@+id/userRowStatus""        android:layout_height=""wrap_content""        android:text=""[Name]""        android:id=""@+id/userRowName""        android:ellipsize=""end""        android:layout_width=""wrap_content""        android:lines=""1""        android:singleLine=""true""        android:textSize=""25sp""        android:layout_centerVertical=""true""        android:layout_toRightOf=""@+id/userRowState"" /&gt;    &lt;!--        singleLine is deprecated but it is the only way to get ellipsize work        it seems. 'inputType text, maxLines 1' didn't work. It's a known issue        that Google has been unable to reproduce in 1½ years        http://code.google.com/p/android/issues/detail?id=882 Will see what        happens first, they remove support for singleLine or they manage to        reproduce the error. :p    --&gt;&lt;/RelativeLayout&gt;</code></pre><p>Sincerely xZise</p>","473890","","","","","2010-11-17 03:26:57","Limit height of a view to the height of the parent view","<android><android-layout>","1","2","1","",""
"4145814","1","4146128","","2010-11-10 15:02:51","9","15233","<p>I have this <code>EditText</code> and Button, and I have to reduce its height. I try with <code>android:height=""10px""</code> but it doesn't work. Btw <code>android:width=""180px""</code> works OK, then I don't know why I can't adjust the height.</p><p>Here is the code:</p><pre><code>&lt;EditText     android:id=""@+id/Movile""    android:layout_alignBaseline=""@+id/MovileLabel""    android:layout_alignParentRight=""true""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:width=""180px""    android:height=""10px""/&gt;&lt;Button        android:id=""@+id/inviteButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/invite""        android:width=""100px""        android:height=""5px""        android:layout_marginLeft=""40dip""/&gt;</code></pre>","479886","","213269","","2010-11-10 15:52:28","2014-04-16 12:51:39","How can I change the height of a EditText and a Button?","<android><height><edittext>","3","2","","",""
"4145964","1","","","2010-11-10 15:22:13","7","5279","<p>Has anyone tried to write his own implementation of <em>ViewGroup</em> with some TextViews in it?</p><p>I have a problem, that TextViews in such an implementation don't respect the gravity property <code>TextView.setGravity(Gravity.CENTER)</code> and text is positioned in the top left corner.</p><p>Can anyone help me find out why?</p><p><strong>EDIT:</strong></p><p>Ok. nevermind, I figured it out on my own already.</p><p>If enyone is interested, I just overwrote method <code>onMeasure()</code> (for all my TextViews) and changed call from <code>super.onMeasure()</code> to <code>setMeasuredDimension(int, int)</code> and gravity started to work normally.</p><p>Basically, in my custom layout I use the following class to display text:</p><pre><code>private static class GravityTextView extends TextView {      public GravityTextView(Context context) {          super(context);      }    @Override      protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {          setMeasuredDimension(widthMeasureSpec, heightMeasureSpec);      }}</code></pre>","495663","","418183","","2012-09-10 18:28:42","2012-09-10 18:28:42","TextView gravity","<android>","3","2","","",""
"4146037","1","","","2010-11-10 15:28:29","3","4884","<p>I have been trying to make a tabstyle that looks like this. But so far it doesn't workCan someone help me with this.. </p><p><a href=""http://www.technobuzz.net/wp-content/uploads/2010/02/seesmic-android-260-208.png"" rel=""nofollow"">http://www.technobuzz.net/wp-content/uploads/2010/02/seesmic-android-260-208.png</a></p><p>The style shows only the colors When selected. When I use a white icon is the text (text setindicator) white. This also applies to the gray icon.</p><p>When the icon color is white the text from the setindicator is then also white.. How can I fix this.</p><p>Thanks in advance! </p><p><strong>Main.java</strong></p><pre><code>intent = new Intent().setClass(this, Settings.class);         spec = tabHost.newTabSpec(""settings"").setIndicator(""Settings"",                res.getDrawable(R.drawable.tab_settings))                .setContent(intent);                tabHost.addTab(spec);                TabWidget tw = getTabWidget();                 for (int i = 0; i &lt; tw.getChildCount(); i++) {                         View v = tw.getChildAt(i);                         v.setBackgroundDrawable(getResources().getDrawable                         (R.drawable.custom_tab));                 } </code></pre><p><strong>tab_settings</strong></p><pre><code>  &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- PRESSED TAB --&gt;    &lt;item         android:state_pressed=""true""        android:drawable=""@drawable/artists_on""        android:color=""#bfbfbf""        /&gt;    &lt;!-- INACTIVE TABS --&gt;    &lt;item         android:state_selected=""false""        android:state_focused=""false""        android:state_pressed=""false""        android:drawable=""@drawable/artists_of""        /&gt;    &lt;!-- ACTIVE TAB --&gt;    &lt;item         android:state_selected=""true""        android:state_focused=""false""        android:state_pressed=""false""        android:drawable=""@drawable/artists_of""        /&gt;    &lt;!-- SELECTED TAB --&gt;    &lt;item         android:state_focused=""true""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@drawable/artists_on""        /&gt;</code></pre><p></p><p><strong>custom_tab.xml the tab style...</strong></p><pre><code>&lt;item android:state_pressed=""true"" &gt;    &lt;shape&gt;        &lt;gradient            android:startColor=""#ea9d32""            android:endColor=""#ffcc50""            android:angle=""270"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;!-- WHEN SELECTED --&gt; &lt;!-- HOW CAN I SAID WHEN NOT SELECTED? --&gt;     &lt;item android:state_focused=""true"" &gt;        &lt;shape&gt;            &lt;gradient                android:endColor=""#ffcc50""                android:startColor=""#ffcc50""                android:angle=""270"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;       &lt;item android:state_focused=""false"" &gt;        &lt;shape&gt;            &lt;gradient                android:endColor=""#ffffff""                android:startColor=""#AAAAAA""                android:angle=""270"" /&gt;            &lt;stroke                android:width=""1px""                android:color=""#000000"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre>","468003","","468003","","2010-11-11 13:06:57","2012-02-21 13:40:00","Android: Tabstyle","<android><xml><colors><tabs><tabwidget>","1","2","1","",""
"4146132","1","5169598","","2010-11-10 15:36:14","0","150","<p>Looking to replace a ZIRE31 Palm device I need a PalmReader equivalent for Android. Not having a new device yet (although thinking about the Archos43 model) I am running developer.android.com's SDK which has an emulator in it. Using the emulator I would like to try out ereader.com's application called ""eReader_android_1.0.39.apk"" from their site. But the download link they supply is actually a ZIP file with lots of little files. I need the simpler APK file to install with the 'adb' command. Does anyone know where I can find it?</p>","503420","","","","","2011-03-02 15:22:08","Can't find eReader_android_1.0.39.apk file to install to emulator","<android>","1","0","","",""
"4146156","1","","","2010-11-10 15:37:58","5","4611","<p>i am trying to play a media file(mp4) using android mediaplayer but getting error as </p><p>""error(1, -2147483648)"" ,i am able to play the same file from a url</p>","413770","","413770","","2010-11-10 15:57:07","2013-02-10 13:17:48","android mediaplayer error","<android>","4","3","1","",""
"4146182","1","","","2010-11-10 15:39:44","2","234","<p>I am making a little dice game and I have a problem animating my dices:I have 6 dices (My class Dice extends the TextView class) that I would like to make rotate.So far, I know how to make them rotate individually (or all together with 6 different animations).</p><p>Is it possible to regroup in one animation or in an animationset these rotations so that with an Animation.AnimationListener I would be able to wait the end of those animations to run further instructions?</p><p>Thank you by advance for your help.</p><p>Gontran</p>","503431","","","","","2010-11-10 15:39:44","How to regroup in an Animation/AnimationSet transformations that apply to different views","<android><animation>","0","0","","",""
"4146221","1","4146280","","2010-11-10 15:43:23","23","32086","<p>I'm making an activity to configure my app, and I have to divide the sections of my configuration window with a line. I used this: <code>divider_horizontal_bright</code>, from this example:</p><p><a href=""http://android.cryx.li/doku.php?id=know:settings:start"">http://android.cryx.li/doku.php?id=know:settings:start</a></p><p>However it doesn't work! When I test on my android phone, it doesn't show a horizontal line. Why?</p><p>I am using Android 2.1</p>","479886","","10259","","2013-02-26 08:59:53","2013-09-06 08:49:31","How to put a horizontal divisor line between edit text's in a activity","<android><user-interface>","3","0","5","",""
"4146328","1","4146430","","2010-11-10 15:54:11","2","1264","<p>Can I use DrawBitmap with display independant pixels on android?</p><p>If not, is there a suitable alternative?</p><p>Thanks.</p>","353674","","","","","2010-11-10 16:06:05","Android DrawBitmap in DIP?","<android><pixels>","1","0","1","",""
"4146395","1","4146943","","2010-11-10 16:01:22","7","9110","<p>Is there a way i can set a minimum zoon level for my MapView?. I don't know if you've realized the map looks really ugly when zoom level is one. You see the whole world map replicated. I would like to avoid that zoom level no matter if user is zooming in through gestures or zoom controls. I've looked at different alternatives, but none seems to work. Does somebody have a good idea about this?</p><p>Ger</p>","367029","","","","","2012-01-31 12:00:25","Set minimum zoom level for MapView","<android><zoom><android-mapview><level>","3","0","3","",""
"4146414","1","","","2010-11-10 16:04:10","0","129","<p>HI all,</p><p>i want to ask can i save an array in shared prefrence(Default Shared Prefrence)...if yes then pls help me to save the array in shared prefrence..Any code would b great if available.</p><p>thanks in advance.</p>","383597","","","","","2010-11-10 16:20:48","Android shared Prefrence problem","<android>","2","1","","",""
"4146435","1","4146459","","2010-11-10 16:06:38","0","704","<p>I have a activity on my app, that shows a lot of options that can be configurated (textviews and textedits on a linearlayout)</p><p>But I have a problem, there are more items that my windows can show, and I can't go down doing down movement with my finger on the screen.</p><p>i am trying to do it with scrollview, but i can't my screens appears black and all mny items dissapear</p><p>here is my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&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:padding=""10px""&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/MovileLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""13px""        android:text=""@string/movilephonelabel""/&gt;    &lt;EditText         android:id=""@+id/Movile""        android:layout_alignBaseline=""@+id/MovileLabel""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:width=""180px""/&gt;&lt;/RelativeLayout&gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""5pt""    android:text=""If you want to send SMS invitation"" /&gt;&lt;View    android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:layout_height=""1dip""    android:background=""#808080""    android:layout_marginTop=""5px""    android:layout_marginBottom=""8px""/&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/EmailLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/emaillabel""        android:layout_marginTop=""13px""/&gt;    &lt;EditText         android:id=""@+id/Email""        android:layout_alignBaseline=""@+id/EmailLabel""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:width=""180px""/&gt;&lt;/RelativeLayout&gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""5pt""    android:text=""If you want to send Email invitation"" /&gt;&lt;View    android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:layout_height=""1dip""    android:background=""#808080""    android:layout_marginTop=""5px""    android:layout_marginBottom=""8px""/&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/PermissionLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/perlabel""        android:layout_marginTop=""13px""/&gt;    &lt;Spinner       android:id=""@+id/Permission""      android:prompt=""@string/perlabel""      android:layout_alignBaseline=""@+id/PermissionLabel""      android:layout_alignParentRight=""true""      android:entries=""@array/permissions_array""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content"" /&gt;&lt;/RelativeLayout&gt;&lt;View    android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:layout_height=""1dip""    android:background=""#808080""    android:layout_marginTop=""5px""    android:layout_marginBottom=""8px""/&gt;&lt;TextView        android:id=""@+id/HoursRangeLabel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/hoursrangelabel""        android:layout_marginRight=""35dip""        android:layout_marginTop=""13px""/&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/FromLabel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/fromlabel""        android:layout_marginRight=""35dip""        android:layout_marginTop=""13px""/&gt;    &lt;DatePicker        android:id=""@+id/From""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignBaseline=""@id/FromLabel""        android:layout_toRightOf=""@id/FromLabel""        android:layout_marginRight=""5dip""/&gt;    &lt;TextView        android:id=""@+id/ToLabel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/tolabel""        android:layout_alignBaseline=""@id/From""        android:layout_toRightOf=""@id/From""/&gt;    &lt;EditText        android:id=""@+id/To""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""""        android:layout_alignBaseline=""@id/From""        android:width=""70px""        android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/weekendlabel""        android:id=""@+id/weekendLabel""        android:layout_marginTop=""15px""/&gt;    &lt;CheckBox        android:id=""@+id/settingsCheckBox""        android:layout_alignBaseline=""@+id/weekendLabel""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;&lt;/RelativeLayout&gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""5pt""    android:text=""These fields are only necessary for Per Hours permission"" /&gt;&lt;View    android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:layout_height=""1dip""    android:background=""#808080""    android:layout_marginTop=""5px""    android:layout_marginBottom=""8px""/&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button        android:id=""@+id/inviteButton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/invite""        android:width=""100px""        android:layout_marginLeft=""40dip""/&gt;    &lt;Button        android:id=""@+id/cancelbutton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/cancel""        android:width=""100px""        android:layout_alignBaseline=""@id/inviteButton""        android:layout_alignParentRight=""true""        android:layout_marginRight=""40dip""/&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","479886","","479886","","2010-11-10 16:53:58","2010-11-10 17:36:42","Problems with scrollview","<android><scrolling>","2","2","","",""
"4146494","1","4146962","","2010-11-10 16:14:09","0","503","<p>I have a text file that I am pulling from my SD card which contains an array in plain text format.  Here are the contents of that file ...</p><pre><code>http://www.oddree.com/rayhaque/android1.jpg,http://www.oddree.com/rayhaque/android2.jpg,http://www.oddree.com/rayhaque/android3.jpg,http://www.oddree.com/rayhaque/android4.jpg,http://www.oddree.com/rayhaque/android5.jpg</code></pre><p>I am trying to import that text file into a String, convert that String to an array, and then load that array into a list adapter.  If I try to split up readString or a trimmed result of readString, I get a forced close every time.  If I copy the contents of the file into a String and then use that ... everything works as expected.  </p><p>So what is the difference between loading this stuff from a text file, and loading it from an included string?  Is it a byte conversion issue?</p><p>Here is my code.  I have noted what works and what fails.</p><pre><code>public class MainActivity extends Activity {ListView list;LazyAdapter adapter;List&lt;String&gt; strings = new ArrayList&lt;String&gt;();String readString = new String();String arrayNBOW;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    try{     File f = new File(Environment.getExternalStorageDirectory()+""/LazyList/gkindex.txt"");     FileInputStream fileIS = new FileInputStream(f);     BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));     while((readString = buf.readLine())!= null){      String arrayNBOW = readString.trim();      Toast.makeText(MainActivity.this, ""STARTUPPULL: ""+arrayNBOW, Toast.LENGTH_LONG).show();     }  } catch (FileNotFoundException e) {   Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();   e.printStackTrace();  } catch (IOException e){   Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();   e.printStackTrace();  }    setContentView(R.layout.main);    list=(ListView)findViewById(R.id.list);    String testArray = ""http://www.oddree.com/rayhaque/android1.jpg,http://www.oddree.com/rayhaque/android2.jpg,http://www.oddree.com/rayhaque/android3.jpg"";    // THIS FAILS    // String[] testArraySplit = TextUtils.split(arrayNBOW, "","");    // THIS WORKS    String[] testArraySplit = TextUtils.split(testArray, "","");    adapter=new LazyAdapter(this, testArraySplit); list.setAdapter(adapter);    Button b=(Button)findViewById(R.id.button1);    b.setOnClickListener(listener);    Button c=(Button)findViewById(R.id.button2);    c.setOnClickListener(loadtext);}</code></pre><p>Thank you in advance for any advice or assistance you can offer me!  :-)</p><p><strong>SOLUTION CREATED FROM EMANNUEL'S SUGGESTION:</strong></p><pre><code>public class MainActivity extends Activity {ListView list;LazyAdapter adapter;List&lt;String&gt; strings = new ArrayList&lt;String&gt;();String readString = new String();String arrayNBOW;String[] nardsArray;String nards;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);</code></pre><p>// New Solution</p><pre><code>  File sdcard = Environment.getExternalStorageDirectory();  File file = new File(sdcard,""/LazyList/gkindex.txt"");  StringBuilder text = new StringBuilder();  try {      BufferedReader br = new BufferedReader(new FileReader(file));      String line;      while ((line = br.readLine()) != null) {          text.append(line);          text.append('\n');          nards = text.toString();          nardsArray = TextUtils.split(nards, "","");      }  }  catch (IOException e) {      Toast.makeText(MainActivity.this, ""FAIL: ""+e, Toast.LENGTH_LONG).show();  }</code></pre><p>// End New Solution</p><pre><code>    Toast.makeText(MainActivity.this, ""FILE-READ: ""+nardsArray, Toast.LENGTH_LONG).show();    setContentView(R.layout.main);    list=(ListView)findViewById(R.id.list);    adapter=new LazyAdapter(this, nardsArray);    list.setAdapter(adapter);    Button b=(Button)findViewById(R.id.button1);    b.setOnClickListener(listener);    Button c=(Button)findViewById(R.id.button2);    c.setOnClickListener(loadtext);}</code></pre>","493706","","493706","","2010-11-10 18:59:31","2010-11-10 18:59:31","Android: Trouble with array that's imported from a file and converted from String","<android>","1","2","","",""
"4146563","1","4146614","","2010-11-10 16:21:28","2","3156","<p>My Google-Fu is failing this Android newbie today.</p><p>Does anybody know of a good example showing how to launch an intent from a PreferenceScreen?</p><p>Something like:</p><pre><code>    &lt;PreferenceScreen        android:key=""preference_some_new_layout""        android:title=""@string/pref_some_title""&gt;            &lt;intent android:action=""????"" /&gt;     &lt;/PreferenceScreen&gt;</code></pre><p>I want to show a custom LinearLayout that allows me to set some semi-complex preferences.</p><p>What is the best way to go about this?</p><p>Thanks,wTs</p>","285417","","","","","2013-05-02 23:50:52","Intent with PreferenceScreen in preferences.xml","<android><android-preferences><preferencescreen>","1","1","4","",""
"4146587","1","","","2010-11-10 16:23:49","1","356","<p>I am building an android application and have the following problem. When I want to open a file from the sdcard using FileInputStream and if the file name contains a blank character, I get the FileNotFoundException. If there are no blank characters, everything works fine. So, if I am to open for example: ""My file.ext"" it raises an exception, and if the file name is ""Myfile.ext"" everything is fine.</p><p>Any clues on how to resolve that will be much appreciated.</p><p>Regards</p>","483375","","","","","2012-10-04 19:01:31","Android - FileNotFoundException when opening file with blank characters in the name","<android><filenotfoundexception>","2","3","","",""
"4146703","1","","","2010-11-10 16:36:04","2","1134","<p>I made an app that plays back audio files, and has an option to switch the audio path between the headset, speaker, and a BT headset. However, I can't figure out a way to have the app detect if there is a BT headset connected. I can check if BT is enabled or disabled, and I can check if there are any devices paired, but not if any are connected. The only thing I can do for now is use a BroadcastReceiver to see when the ""android.bluetooth.headset.action.STATE_CHANGED"" broadcast is made and check if it's connected. However, this only work when the headset is connected or disconnected. I'd like a solution that would let my app check th BT headset state whenever it needs to. How can this be done?</p>","496854","","","","","2012-02-15 15:51:17","How to detect if BT headset is connected in Android SDK?","<android><sdk><bluetooth><headset>","0","2","1","",""
"4146775","1","","","2010-11-10 16:43:48","0","636","<p>I've been following this tutorial closely.</p><p><a href=""http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/"" rel=""nofollow"">http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/</a></p><p>After some set of problems, I got it to work on my T-mobile G1.</p><p>Now I have 4-5 objects(balls) drawn on the screen. I have the balls spawn around the middle of the screen and start to fall.</p><p>Problem: The game stutter every few seconds. I examined the Logcat and believe that the GC is the culprit.</p><p>However, I've seen many games using box2D and produce smooth gameplay(Forexample, Andengine demo). </p><p>How did they do that? How did they stop the GC from kicking in?(assuming the GC is really the culprit)</p><p>Any opinions are welcome.</p><p>Thank you in advance!</p>","461783","","","","","2010-12-13 15:29:59","Stutter every few seconds. How to fix this?","<android><garbage-collection><performance><physics><box2d>","2","0","","",""
"4146795","1","4146809","","2010-11-10 16:46:38","13","28855","<p>I want to set the background of a Relative or LinearLayout to a custom drawable. I want the shape to draw two horizontal lines across the bottom, leaving the central part transparent (empty).</p><p>The following draws the horizontal lines centered vertically, where as i need them to be aligned to the bottom of the shape. (If you add a rectangle as an item you can see the shape expands to the dimenstions of the parent, but the lines are still centrally aligned).</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 android:shape=""line""&gt;      &lt;stroke android:width=""1dip"" android:color=""#99b8b9bd"" /&gt;      &lt;size android:height=""1dip"" /&gt;  &lt;/shape&gt; &lt;/item&gt; &lt;item&gt;  &lt;shape android:shape=""line"" android:top=""1dip""&gt;      &lt;stroke android:width=""1dip"" android:color=""#FFFFFFFF"" /&gt;      &lt;size android:height=""1dip"" /&gt;  &lt;/shape&gt; &lt;/item&gt;&lt;/layer-list&gt;</code></pre>","468195","","","","","2010-11-10 16:48:11","Android: How can i use the layer-list and shape elements to draw a horizontal rule when set as background?","<android><shape>","1","0","5","",""
"4146848","1","4147116","","2010-11-10 16:52:48","4","8977","<p>Hi i would like to make my map zoom into my current location.This current location is defined currently by sending lat and long to the emulator.How would i go about doing this?</p><p>My current mapactivity.java</p><pre><code>public class MapsActivity extends MapActivity {    private MapView mapView;    private MyLocationOverlay myLocOverlay;    MapController mc;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapactivity);        initMap();        initMyLocation();    }    /**     * Initialise the map and adds the zoomcontrols to the LinearLayout.     */    private void initMap() {        mapView = (MapView) findViewById(R.id.mapView);        View zoomView = mapView.getZoomControls();        LinearLayout myzoom = (LinearLayout) findViewById(R.id.zoom);        myzoom.addView(zoomView);        mapView.displayZoomControls(true);        mapView.getController().setZoom(17);    }    /**     * Initialises the MyLocationOverlay and adds it to the overlays of the map     */    private void initMyLocation() {        myLocOverlay = new MyLocationOverlay(this, mapView);        myLocOverlay.enableMyLocation();        mapView.getOverlays().add(myLocOverlay);    }    @Override    protected boolean isRouteDisplayed() {        return false;    }</code></pre><p>Thank you.</p>","358218","","842697","","2013-07-09 13:11:34","2013-09-04 12:22:53","How would i make my google map zoom in to my current location?","<android><google-maps-android-api-1>","3","0","1","",""
"4146861","1","4147247","","2010-11-10 16:54:12","25","12637","<p>I have an Android application with multiple intents.</p><p>The first intent is a login form, subsequent intents rely on cookies provided from the login process.</p><p>The problem that I am having is that cookies do not appear to be persisting across the intents. I am creating new HttpClients in each intent (I initially tried to Parcelable transmit it across to each intent, which did not work so well).</p><p>Does anyone have any tips for making cookies persist across intents?</p>","503508","","759866","","2013-05-05 23:33:45","2013-05-05 23:33:45","Android HttpClient persistent cookies","<java><android><cookies><httpclient>","4","2","11","",""
"4146906","1","4147199","","2010-11-10 16:58:02","0","1672","<p>Ok, currently I have a view in my android app that displays a list of contacts for our agents that is retrieved via a web service.</p><p>I have built a simple array adapter that binds my contact objects to the listactivity and just uses a contactrow.xml template to display anywhere from 1 to 1000 contacts.</p><p>This works fine but is <em>lacking</em> at best.  I want to replicate the way that contacts are scrolled in the android contact app.  Is there is way to have the ABC's indexed to the right and help the end user navigate this contact list the same way they would expect?</p><p>Does the CursorAdapter help accomplish this?  What is the best approach?</p>","503511","","","","","2012-08-30 05:29:16","Contact View Styling on Android","<android><android-widget><android-layout>","1","0","","",""
"4146909","1","4147105","","2010-11-10 16:58:24","1","610","<p>i'm working on maps on Android; i create at runtime overlays and, when clicked, i show a dialog that, when clicked, goes to a new activity; i don't like so much the dialog so i would like to show a smaller clickable object (like in foursquare or in photos application for iphone) ... has anyone done something similar?</p><p>Thanks in advance and greetings !c.</p>","339500","","","","","2010-11-10 18:02:42","How to show a small clickable item on Android map","<android><google-maps>","1","0","","",""
"4147046","1","4147121","","2010-11-10 17:11:10","10","7781","<p>I want to show <em>24 hours</em> clock instead <em>12 hours</em> using TimePicker,and I dont need the AM/PM buton, Simply want to show 24 hours clock.</p><p>Is this possible?</p><p>I used <code>setIs24HourView(true)</code> but it is is not working.</p><p>Suggest me How can I show 24 hours clock?</p>","479886","","646806","","2012-06-04 06:36:16","2013-08-16 14:07:04","Is it possible to remove AM/PM button from TimePicker?","<android><timepicker>","3","1","4","",""
"4147244","1","4147768","","2010-11-10 17:32:05","1","118","<p>I have a layout with a spinner and a lot of textboxes and buttons.</p><p>I need to make appear some elements of the layout when one of the options of the spinner is selected and to make dissapear when other is selected. ----> PROBLEM SOLVED!!!</p><p>But also, i need to desativate some elements of the layout. I mean that they have to be visible, but the user can't press buttons or edit edittext's  </p><p>Is it possible to do that?</p>","479886","","479886","","2010-11-10 18:42:05","2010-11-10 18:47:26","Can i desactivate buttons/edittexts from my layout? (visibles but desactivated)","<android><layout>","3","0","1","",""
"4147441","1","","","2010-11-10 17:53:12","1","1725","<p>I am looking for a class that implement a horizontal slider bar like the one on the ""lock"" screen.  In other words, user must slide the bar from left to right to run an activity.  Thank you so much for your time.</p>","503563","","","","","2011-03-15 20:07:31","horizontal bar slider","<android>","3","0","1","",""
"4147740","1","","","2010-11-10 18:25:53","0","835","<p>I need to update a contact name but i didn't way the way to do that with the old contact api (my application must work in 1.5,1.6 AND 2.X)</p>","164460","","164460","","2010-11-10 18:52:18","2010-12-16 17:41:27","android update contact name","<android><contacts>","1","0","","",""
"4147809","1","4147859","","2010-11-10 18:34:35","2","738","<p>Hey I'm trying to get the date from the CallLog.Calls in Android. I'm doing like this:</p><pre><code>import org.apache.http.impl.cookie.DateUtils;import android.database.Cursor;Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC ""); int dateId = cursor.getColumnIndex(android.provider.CallLog.Calls.DATE); String callDate = cursor.getString(dateId); String dateString = DateUtils.formatDate(callDate);</code></pre><p>But the formatDate method doesn't allow String as parameter, it needs a Date parameter. I've tryied to make a Cast, but it shows an error. So, someone have an idea of how to do that?</p><p>Thanks.</p>","399459","","","","","2012-03-20 14:02:53","Error when trying to get the date on Android CallLog.Calls","<android><call><android-contentprovider><calllog>","1","0","1","",""
"4147899","1","4183556","","2010-11-10 18:47:17","1","1669","<p>How to force data synchronization (calendar, contacts) from own program? </p><p>The internet connectivity is not stable, so when a WiFi connection occurs, I want to force the sync. I've googled sth about synchronization manager, but there is not much info how to use it.</p>","503626","","","","","2010-11-16 15:26:08","Android synchronization manager","<android><synchronization><calendar><contacts>","2","1","3","",""
"4147916","1","7472150","","2010-11-10 18:49:13","1","800","<p>I have to use two timepickers on my app, but they are so many big</p><p>there is a way to reduce the size of timepickers?</p>","479886","","764846","","2011-09-19 16:34:05","2011-09-19 16:34:05","It is possible to reduce the size of a timePicker?","<android><timepicker>","1","3","1","",""
"4148094","1","","","2010-11-10 19:10:15","0","3909","<p>I have an onLongClickListener that resets some values when called.I would like to ad an alertDialog to check if the user really does want to reset all the values. However I am having no joy making it work.</p><p>The reset section works fine on it's own but if I try to add the AlertDialog I get the following error:</p><p><strong>Multiple markers at this line - The constructor AlertDialog.Builder(new View.OnLongClickListener(){}) is   undefined - Line breakpoint:SatFinder [line: 174] - onLongClick(View)</strong></p><p>What exactly does this mean and how can I fix it?Many thanks.</p><p>Below is the section of code. Please note that the alert does nothing useful in this example. I will change that after I get past the error above.</p><pre><code>    resetAll = new OnLongClickListener() {   @Override   public boolean onLongClick(View v) {    AlertDialog.Builder alertbox = new AlertDialog.Builder(this);       // set the message to display       alertbox.setMessage(""This is the alertbox!"");       // set a positive/yes button and create a listener       alertbox.setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {           // do something when the button is clicked           public void onClick(DialogInterface arg0, int arg1) {               Toast.makeText(getApplicationContext(), ""'Yes' button clicked"", Toast.LENGTH_SHORT).show();           }       });       // set a negative/no button and create a listener       alertbox.setNegativeButton(""No"", new DialogInterface.OnClickListener() {           // do something when the button is clicked           public void onClick(DialogInterface arg0, int arg1) {               Toast.makeText(getApplicationContext(), ""'No' button clicked"", Toast.LENGTH_SHORT).show();           }       });       alertbox.show();    // Resets all values and radio buttons    pos1_deg.setText(""0.0"");    pos2_deg.setText(""0.0"");    pos1_az.setText(""0.0"");    pos2_az.setText(""0.0"");    targetDeg.setText(""0.0"");    blurg.setText(""----"");    radio1.setChecked(false);    radio2.setChecked(false);    radio3.setChecked(false);    radio1E.setChecked(true);    radio2E.setChecked(true);    radio3E.setChecked(true);    Toast.makeText(getApplicationContext(),       ""Reset"", Toast.LENGTH_LONG).show();    return true;   }};</code></pre>","497517","","497517","","2010-11-13 23:44:07","2010-11-14 00:44:57","Can't get an AlertDialog to work","<android><alertdialog>","2","1","","",""
"4148163","1","4150774","","2010-11-10 19:17:20","1","1233","<p>I have an Android service that's responsible for firing notifications at certain points in time. I use an android.OS.CountdownTimer for this. An activity creates and starts the service. If the phone is locked, notifications that are within let's say 1min are shown. Notifications that are much later are never shown. The service is unbound from the activity when the activity is onpause. </p><p>As long as the phone doesn't lock the notifications are generated, even if the activity is stopped and unbound from the service. </p><p>It seems to me that the service is stopped/killed. When I make the application debuggable and debug it on target, it works fine, also when the activity is stopped and the service is unbound.</p><p>The app is developed for v1.5 and runs at Galaxy S with 2.2.</p><p>Service is started as shown below</p><pre><code>serviceIntent = new Intent().setAction(""com.mytest.MyService"");startService(serviceIntent);bindService(new Intent(context,          MyService.class), mConnection, 0 /*Context.BIND_AUTO_CREATE*/);</code></pre>","503659","","","","","2010-11-11 01:48:13","Android service killed unexpectedly","<android><service>","1","0","2","",""
"4148184","1","","","2010-11-10 19:19:47","6","290","<p>I have been using google maps in my application for some time. The application allows users to write a review for somewhere they have visited. They can add a location to the review, and view the place the wrote their review as an overlay showing the other reviews in the area.</p><p>I want to allow a user to syncronise with their google account and add the saved locations as stars to their map. I have seen a few applications which allow this, but have been looking and can't find any information at all on how to do this, can anyone point out some guides?</p>","503653","","881229","","2013-09-16 16:35:59","2013-09-16 16:35:59","Android add to a users stared locations (Google maps)","<android><google-maps><google-places-api>","2","1","2","",""
"4148378","1","4148515","","2010-11-10 19:41:27","1","341","<p>When I compile my Android Project I always get this Error:</p><blockquote>  <p>Error generating final archive: duplicate entry: about.html</p></blockquote><p>But I can't find any about.html in my Project.Does anyone know how to solve the error?</p>","441354","","","","","2011-11-14 11:47:02","Android packaging error","<java><android>","3","0","","",""
"4148510","1","4148733","","2010-11-10 19:58:31","1","113","<p>i have a element, that i want to be disabled in a situation.</p><p>ok. i do it with this:</p><p>Weekend.setEnabled(false);</p><p>ok, but it still remains focusable, i mean that when user press down/up keys or moves the scroll, the element still can get the focus (orange colour).</p><p>i tryed with this:</p><p>Weekend.setEnabled(false);Weekend.setFocusable(false);Weekend.setFocusableInTouchMode(false);</p><p>but doesn't works!!!! it still can be oranged when user press up/down keys and moves the windows with the scrollbar</p>","479886","","1921273","","2013-02-03 21:36:03","2013-02-03 21:36:03","How can i do unfocusable a element of my user interface?","<android><focus>","1","3","","",""
"4148568","1","","","2010-11-10 20:06:02","4","836","<p>So I've been searching for some time on how to either replace the incall screen or put something on top of it....the only solution I havefound thus far is to make my own ROM, which doesn't make sense forsuch a small portion of an OS.  however I found these two apps (FullScreen Caller Pictures and Full Screen Caller ID) that are able to puta contact image and button on top of the standard in call screen.</p><p>I don't know exactly what either of these developers have done, buthope someone on the forums does.</p><p>Any ideas?</p>","503696","","","","","2012-01-30 03:36:27","Full Screen Caller Pictures & Full Screen Caller ID","<android><screen><call>","1","0","2","",""
"4148667","1","4149152","","2010-11-10 20:17:56","10","1634","<p>First off, sorry if this is too subjective, I just didnt know how else/where to ask.</p><p>Anyway, in the light of all my recent questions, I'm getting ready to release an Android app soon, and most of the testing has been done on my phone, the Droid. I really dont have the money to test on ""multiple"" devices, nor do I know anyone with an older phone that I could ask for help that would possibly get any kind of bug. Not to mention, when I do get a bug report, how would I go about fixing it for that particular phone without having to buy it to make sure it actually gets fixed, or that the person didnt just came across a one-time freakish accident of a glitch?</p><p>How do you guys solve these kinds of issues? </p>","325400","","","","","2010-11-11 04:30:07","How does a solo/small group of developers test on multiple devices?","<android>","4","1","4","",""
"4148670","1","","","2010-11-10 20:18:29","7","1611","<p>When I press the sleep button on my Droid, my activity's oncreate is getting called. Why is that happening? Why would the OS want to call OnCreate when the device is going to sleep? Is there any way to stop it, or at least know it's because the phone was put to sleep?</p>","495330","","","","","2012-03-26 21:19:48","Activity OnCreate called when phone goes to sleep","<android>","1","7","1","",""
"4149032","1","","","2010-11-10 21:00:35","2","4024","<p>This question has been asked [numerous times] before, but I have not seen any definitive answers, or examples of code that actually works.</p><p>I would like to associate an Activity with a particular file type.</p><p>For discussion, assume that I want my Activity to be associated with PDFs.</p><p>Here is what I currently have. I have experimented with many different values and combinations of values in the intent-filter, but I have yet to get my Activity to start when a PDF is selected.</p><pre>&lt;activity name=""com.mycompany.MyActivity""&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=""application/pdf"" /&gt;        &lt;data android:pathPattern=""\\*\\.pdf"" /&gt;        &lt;data android:host=""*"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</pre><p>Does anyone know how to actually make this work?</p>","503741","","503741","","2010-11-10 21:05:47","2011-10-18 16:18:30","Correct Android intent-filter configuration to associate a file type with an Activity?","<android><activity><android-intent><intentfilter>","2","0","2","",""
"4149085","1","4149108","","2010-11-10 21:07:50","0","319","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/40480/is-java-pass-by-reference"">Is Java pass by reference?</a>  </p></blockquote><p>As I understand it, in Java there is no pass by reference, always pass by value.  Does this mean that an object passed as an argument will be copied, everytime?  Or is this some sort of pass by value but Java isn't so stupid that it copies the entire object?</p><p>I'm working on a fairly dense OpenGL project on Android.  And the object holding all the scene data is not exactly small in size.  That object is passed down from one function to another.  So basically, if Java has no pass by reference it will be many copies of a big object.</p>","324943","","122207","","2010-11-10 21:16:18","2010-11-10 21:20:17","I need pass by reference please","<java><android>","5","3","","2010-11-12 11:30:10",""
"4149265","1","","","2010-11-10 21:29:58","1","1669","<p>I'm creating an app that has an ""export"" feature which converts the user's data into a CSV file, and allows the user to send it as an attachment to somebody (presumably themselves).</p><p>The CSV file is created successfully, but when I try to send the email, I encounter a problem. The device looks like it is going to send the email with the appropriate attachment, but when the email is received... there is no attachment at all...</p><p>Here is the code I am using to send the email:</p><pre><code>final Intent email = new Intent(android.content.Intent.ACTION_SEND);  email.setType(""text/html"");  email.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.email_subject));  email.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(getString(R.string.email_1)));  email.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file:///"" + getString(R.string.csv_title)));  startActivity(Intent.createChooser(email, ""Send mail...""));</code></pre>","382252","","","","","2013-04-01 13:50:21","Sending an email with an attachment from an application","<java><android><android-intent><email-attachments>","3","2","","",""
"4149303","1","","","2010-11-10 21:34:37","1","1347","<p>I am wondering how to set a background in Live Wallpaper for Android. It seems the only options I have are to create it using a canvas which I don't want. I want to be able to set up a time lapse of a tree that goes through the seasons. I'm assuming I'll be able to set the coordinates for the leaves and then just have different times to fall, but is it possible to have them expand or even change colors? Any help would be appreciated. Thanks.</p>","503801","","19750","","2011-03-31 15:36:03","2011-03-31 15:36:03","Live wallpaper on Android question","<android><live-wallpaper>","1","2","","2012-09-28 02:00:14",""
"4149313","1","","","2010-11-10 21:36:11","5","482","<p>We have several Android apps and found that the process of uploading apps for each release via Android Developers website slow and ineffective.  We like to automate the process.  To be more clear, we have automation for compiling and building the apps, it's a matter of uploading them to Android Market and fill in the app details for publishing.  This is where we are left with manual publishing.</p><p>I am interested to learn how people automate the processing?  </p><p>Does Google have a web service of some sort for publishing Android App on Android Market?  </p>","503803","","","","","2010-11-11 01:44:25","Automate the process of publishing Android app","<android>","1","4","1","",""
"4149371","1","","","2010-11-10 21:42:16","0","3853","<p>I open a webview page that page have </p><pre><code>&lt;script type=""text/javascript""&gt;  var addToBasketDisabled=false;  var iPhoneStatus="""";   function GetStatus()  {    return iPhoneStatus;//Master Pagelerde tanimli  }  var path = ""http://www.yemeksepeti.com/App_Themes/Default_tr-TR/images/IPhone/"";               function PreLoadDisabledButton()  {    var image = new Image();       image.src=path + ""Iphone-button-ekle-pasif.png"";  }  function DisableAddButton()  {    addToBasketDisabled= true;    var buttonObject = document.getElementById(""ctl00_AddToBasket"");    buttonObject.src = path + ""Iphone-button-ekle-pasif.png"";  }  function EnableAddButton()  {    addToBasketDisabled= false;    var buttonObject = document.getElementById(""ctl00_AddToBasket"");    buttonObject.src = path + ""Iphone-button-ekle.png"";  }  function OnAddButtonClick()  {    if(addToBasketDisabled)    {      return false;    }    DisableAddButton();    var validateValue= ValidateInput();     if(!validateValue)    {      EnableAddButton();      return false;    }  }  PreLoadDisabledButton();&lt;/script&gt;</code></pre><p></p><p>these javascript When I press a button on the webview I have to read the ""iPhoneStatus"" value and close the webview screen and decide the result.</p><p>I wrote these codes in my .java class</p><pre><code>mWebView = (WebView) findViewById(R.id.webview);WebSettings webSettings = mWebView.getSettings();webSettings.setSavePassword(false);webSettings.setSaveFormData(false);webSettings.setJavaScriptCanOpenWindowsAutomatically(true);webSettings.setJavaScriptEnabled(true);webSettings.setSupportZoom(false);mWebView.setWebChromeClient(new MyWebChromeClient());mWebView.addJavascriptInterface(new DemoJavaScriptInterface(), ""demo"");mWebView.loadUrl(feedurl);final class DemoJavaScriptInterface{  DemoJavaScriptInterface()  {  }  public void clickOnAndroid()  {    mHandler.post(new Runnable()    {      public void run()      {        mWebView.loadUrl(""javascript: GetStatus()"");      }    });  }}final class MyWebChromeClient extends WebChromeClient{  public void onCloseWindow(WebView window)  {    window.destroy();  }  public boolean onJsAlert(WebView view, String url, String message, JsResult result)  {    Log.i(""log "", message);    result.confirm();    return true;  }}</code></pre><p>But it never go in the onJsAlert method, is there any way to evaluate the value of GetStatus()</p><p>Thanks</p>","503812","","111712","","2012-08-05 00:38:01","2012-08-05 00:38:01","Evaluate javascript value on WebView, Android","<javascript><android><webview><handler><android-webview>","1","0","","",""
"4149415","1","4150363","","2010-11-10 21:46:25","17","7568","<p>When my Activity with a <code>ScrollView</code> layout and <code>EditText</code>s starts, the <code>EditText</code>s get focus and the Android OnScreen keyboard opens.</p><p>How I can avoid that?</p><p>When I was using <code>LinearLayout</code> and <code>RelativeLayout</code> without the <code>ScrollView</code> it doesn't happen.</p><p>I've tried it this way, and it works, but it's not a good way to do it:</p><pre><code>TextView TextFocus = (TextView) findViewById(R.id.MovileLabel);TextFocus.setFocusableInTouchMode(true);TextFocus.requestFocus();</code></pre><p>Next you have an example of some of my layouts with this problem, when this Activity starts, focus goes to the first <code>EditText</code>, <em>Description</em> and the Android keyboard opens automatically, this is very annoying.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView android:id=""@+id/ScrollView01""    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:layout_width=""fill_parent""        android:layout_height=""fill_parent""         android:padding=""10px""&gt;        &lt;RelativeLayout            android:gravity=""center_vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;TextView                android:id=""@+id/UserLabel""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_marginTop=""13px""                android:text=""@string/userlabel""/&gt;            &lt;TextView                android:id=""@+id/User""                android:layout_alignBaseline=""@id/UserLabel""                android:layout_alignParentRight=""true""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""test""/&gt;        &lt;/RelativeLayout&gt;        &lt;View            android:layout_gravity=""center_horizontal""            android:layout_width=""fill_parent""            android:layout_height=""1dip""            android:background=""#808080""            android:layout_marginTop=""5px""            android:layout_marginBottom=""12px""/&gt;        &lt;RelativeLayout            android:gravity=""center_vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;TextView            android:id=""@+id/DescriptionLabel""             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/desclabel""            android:layout_marginTop=""13px""/&gt;            &lt;EditText             android:id=""@+id/Description""            android:layout_alignBaseline=""@id/DescriptionLabel""            android:layout_alignParentRight=""true""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:width=""180px""/&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout            android:gravity=""center_vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;TextView                android:id=""@+id/EmailLabel""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""@string/emaillabel""                android:layout_marginTop=""13px""/&gt;            &lt;EditText                 android:id=""@+id/Email""                android:layout_alignBaseline=""@+id/EmailLabel""                android:layout_alignParentRight=""true""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:width=""180px""/&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout            android:gravity=""center_vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;TextView                android:id=""@+id/MovilePhoneLabel""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""@string/movilephonelabel""                android:layout_marginTop=""13px""/&gt;            &lt;EditText                 android:id=""@+id/MovilePhone""                android:layout_alignBaseline=""@+id/MovilePhoneLabel""                android:layout_alignParentRight=""true""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:width=""180px""/&gt;        &lt;/RelativeLayout&gt;        &lt;View            android:layout_gravity=""center_horizontal""            android:layout_width=""fill_parent""            android:layout_height=""1dip""            android:background=""#808080""            android:layout_marginTop=""5px""            android:layout_marginBottom=""10px""/&gt;        &lt;RelativeLayout            android:gravity=""center_vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;Button                android:id=""@+id/applybutton""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""@string/apply""                android:width=""100px""                android:layout_marginLeft=""40dip""/&gt;            &lt;Button                android:id=""@+id/cancelbutton""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""@string/cancel""                android:width=""100px""                android:layout_alignBaseline=""@+id/applybutton""                android:layout_alignParentRight=""true""                android:layout_marginRight=""40dip""/&gt;        &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","479886","","418183","","2011-07-13 11:19:47","2013-03-03 19:28:03","OnScreen keyboard opens automatically when Activity starts","<android><keyboard><focus><scrollview>","4","1","3","",""
"4149549","1","4150999","","2010-11-10 22:01:53","2","3060","<p>My app that I am trying to create is a board game. It will have one bitmap as the board and pieces that will move to different locations on the board. The general design of the board is square, has a certain number of columns and rows and has a border for looks. Think of a chess board or scrabble board.</p><p>Before using bitmaps, I first created the board and boarder by manually drawing it - drawLine &amp; drawRect. I decided how many pixels in width the border would be based on the screen width and height passed in on ""onSizeChanged"". The remaining screen I divided by the number of columns or rows I needed.</p><p>For examples sake, let's say the screen dimensions are 102 x 102.</p><p>I may have chosen to set the border at 1 and set the number of rows &amp; columns at 10. That would leave 100 x 100 left (reduced by two to account for the top &amp; bottom border, as well as left/right border). Then with columns and rows set to 10, that would leave 10 pixels left for both height and width.</p><p>No matter what screen size is passed in, I store exactly how many pixels in width the boarder is and the height &amp; width of each square on the board.  I know exactly what location on the screen to move the pieces to based on a simple formula and I know exactly what cell a user touched to make a move.</p><p>Now how does that work with bitmaps?  Meaning, if I create 3 different background bitmaps, once for each density, won't they still be resized to fit each devices screen resolution, because from what I read there were not just 3 screen resolutions, but 5 and now with tablets - even more. If I or Android scales the bitmaps up or down to fit the current devices screen size, how will I know how wide the border is scaled to and the dimensions of each square in order to figure out where to move a piece or calculate where a player touched. So far the examples I have looked at just show how to scale the overall bitmap and get the overall bitmaps width and height. But, I don't see how to tell how many pixels wide or tall each part of the board would be after it was scaled. When I draw each line and rectangle myself based in the screen dimensions from onSizeChanged, I always know these dimensions.</p><p>If anyone has any sample code or a URL to point me to that I can a read about this with bitmaps, I would appreciate it.</p><p>BTW, here is some sample code (very simplified) on how I know the dimensions of my game board (border and squares) no matter the screen size. Now I just need to know how to do this with the board as a bitmap that gets scaled to any screen size.</p><pre><code> @Override   protected void onSizeChanged(int w, int h, int oldw, int oldh) {      intScreenWidth = w;      intScreenHeight = h;      // Set Border width - my real code changes this value based on the dimensions of w      // and h that are passed in. In other words bigger screens get a slightly larger      // border.      intOuterBorder = 1;      /** Reserve part of the board for the boardgame and part for player controls & score          My real code forces this to be square, but this is good enough to get the point          across.      **/      floatBoardHeight = intScreenHeight / 4 * 3;      // My real code actually causes floatCellWidth and floatCellHeight to      // be equal (Square).      floatCellWidth = (intScreenWidth - intOuterBorder * 2 ) / intNumColumns;      floatCellHeight = (floatBoardHeight - intOuterBorder * 2) / intNumRows;      super.onSizeChanged(w, h, oldw, oldh);   }</code></pre><hr><p>I think I found the answer. I might not be able to find the exact width/height and location of each playable square within a single scaled bitmap, but by looking at the Snake example in the SDK, I see it doesn't create 1 bitmap for the entire board and scale it based on the screen dimensions - instead it creates a bitmap for each tile and then scales the tile based on the screen resolution and the number of tiles wanted on the screen - just like I do when I draw the board manually. With this method, I should be able find the exact pixel boundaries for all of the playable squares on the board. I just have to break the board into multiple bitmaps for each square. I probably will have to do a similar approach for the borders, so I can detect their width/height as well after scaling.</p><p>Now I will test it to verify, but I expect it to work based on what I saw in the Snake SDK example.</p><p>--Mike</p><hr><p>I tested a way to do what I was asking and it seems to work. Here is what I did:</p><p>I created a 320 x 320 bitmap for a board. It was made up of a border and squares (like a chess board). The border was 10 pixels in width all the way around the board. The squares were 20 x 20 pixels.</p><p>I detected the width and height of the screen through onSizeChanged. On a 480 x 800 display, I would set the new width for the board to be 480 x 480 and use the following code to scale the whole thing:</p><pre><code>protected void onSizeChanged(int w, int h, int oldw, int oldh) {            floatBoardWidth = w;    floatBoardHeight = floatBoardWidth;    bitmapScaledBoard = Bitmap.createScaledBitmap(bitmapBoard, (int)floatBoardWidth, (int)floatBoardHeight, true);              super.onSizeChanged(w, h, oldw, oldh);}</code></pre><p>Now in order to detect how many pixels wide the border was scaled to and how many pixels in height &amp; width the squares were scaled to, I first calculated how much the over all image was scaled. I knew the bitmap was 320 x 320, since I created it. I used the following formula to calculate how much the image was scaled:</p><p>floatBoardScale = floatScreenWidth / 320;</p><p>In the case of a 480 width screen, floatBoardScale equals: 1.5. Then to calculate what my border within the full bitmap was scaled to, I did:</p><p>floatBorderWidth = 10 * floatBoardScale; </p><p>10 was the original border width in my 320 x 320 bitmap. In my final code I won't hardcode values, I will use variables. Anyway, in the case of this formula, the new calculated border width should be: 15</p><p>When I multiplied the same scale factor to the board squares (that were 20 x 20 in the original bitmap) I got new values of 30 x 30. When I used those values in my formulas to calculate what square a person touched, it worked. I touched every corner of the squares and in the center and it always calculated the right location. Which is important, so no matter what the screen resolution, I know where the user wanted to move a piece and visually it shows up in the right location.</p><p>I hope this helps anyone who may have had the same question. Also, if anyone has a better method of accomplishing the same thing, please post it.</p>","503760","","321731","","2014-03-11 18:15:46","2014-03-11 18:15:46","Android - determine specific locations (X,Y coordinates) on a Bitmap on different resolutions?","<android><bitmap><scaling><image-scaling>","1","0","","",""
"4149597","1","","","2010-11-10 22:07:37","0","2157","<p>In the following code I am setting up a spinner, listening and detecting selections from the spinner.</p><p>The problem is I am trying to save the previously selected value so it is persistent between activity reloads, but when I reload the activity, the previously selected value is not set as the spinner value. The code is as follows :</p><pre><code>final Spinner spinner = (Spinner)findViewById(R.id.Spinner_gender);  ArrayAdapter&lt;?&gt; adapter = ArrayAdapter.createFromResource(this, spinnerID, android.R.layout.simple_spinner_item);  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);  spinner.setAdapter(adapter);  spinner.setOnItemSelectedListener(    new AdapterView.OnItemSelectedListener() {     public void onItemSelected(AdapterView&lt;?&gt; parent, View itemSelected, int selectedItemPosition, long selected){      Editor editor = mGameSettings.edit();      editor.putLong(GAME_PREFERENCES_GENDER, selectedItemPosition);      editor.commit();     }  @Override  public void onNothingSelected(AdapterView&lt;?&gt; arg0) {   // TODO Auto-generated method stub  } }  );  //if( mGameSettings.contains(GAME_PREFERENCES_GENDER) ){   Toast.makeText(QuizSettingsActivity.this, ""Detected(again): "" + spinner.getSelectedItemPosition(), Toast.LENGTH_SHORT).show();   spinner.setSelection( spinner.getSelectedItemPosition() );  //}</code></pre><p>I am using <code>spinner.getSelectedItemPosition()</code> to get the spinner selected index. Can anyone please tell me what I am doing wrong?</p>","503837","","698590","","2013-01-13 08:08:22","2013-04-18 13:52:03","Persisting spinner selected value","<android><persistence><spinner>","2","2","","",""
"4149764","1","4156663","","2010-11-10 22:30:44","0","4224","<p>I have a main Activity A that can kick off sub-Activities B, C, or D.  I start them using startActivityForResult(newIntent, REQUEST_CODE);</p><p>The user can choose to navigate between B, C, and D once one is displayed.  Activity A controls that navigation.  When they choose swap between screens 'A' first calls finishActivity(REQUEST_CODE); on the one displayed and then call startActivityForResult(newIntent, REQUEST_CODE); for the next one.</p><p>In my onActivityResult I've got</p><pre><code>    protected void onActivityResult(int requestCode, int resultCode, Intent data)   {      // these logs are just for my debugging      Log.w(this.toString(), ""onActivityResult returned to by "" + requestCode);      Log.w(this.toString(), ""result code = "" + resultCode );      // the Activity set this value if it was returning normally      if (RESULT_OK == resultCode)      {         Log.i(this.toString(), ""---- the sub-activity returned OK ----"");          // do some stuff          }// end if (RESULT_OK == resultCode)      // Else we got here because the user hit the back button or something went      // went wrong (RESULT_CANCELED).  Either way we do not want to display this      // blank screen to the user.  Take them back to the device connection screen.      else if (RESULT_CANCELED == resultCode)      {             finish();      }    }</code></pre><p>For some reason I'm getting back a zero or RESULT_CANCELED everytime even though in my sub-activities B,C,D I only set that result if the user chooses to hit the back button (I display an ""are you sure"" dialog and they choose to exit.  In B,C,D I have the following in onPause.  The userExiting is a flag I set from the Exit dialog.</p><pre><code>protected void onPause()   {      Log.i(this.toString(), ""onPause"");      // hack to try to setResult for an activity whose finishActivty was called      if ( !this.exiting )       {         Log.i(this.toString(), ""======== RESULT_OK ========"");          Intent returnIntent = new Intent();         setResult(RESULT_OK, returnIntent);         finish();      }      displayed = false;      super.onPause();   }</code></pre><p>Any ideas? </p><p>Edit - to be clear the issue is that after calling finishActivty on the old Activity, since a result was never set, Activity A always thinks it should exit.  One weird side items.  This doesn't happen until the user navigates two times.  In other words B is displayed and they choose to go to C.  Works, but I can see in the log that onActivityResult hasn't been called.  User selects to go from C to D,  boom, I see two calls to onActivtyResult, 'A; exits and D is left displayed and the user is unable to nav away.</p><p>Update:  Since this has been getting a lot of views I thought I'd post this update.  The project evolved such that sometimes a single Activity is displays and sometimes a group are displayed as tabs.  When the user packs out of the tab in some cases data needed to be returned to the Activity that kicked off the tabs.  Before I added the code below RESULT_CANCELED would always be returned.  Also make sure that setResult is called before finish.     </p><pre><code> if (getParent() == null) {    setResult(Activity.RESULT_OK, intent); } else {    getParent().setResult(Activity.RESULT_OK, intent); }</code></pre>","418714","","418714","","2011-09-05 15:34:56","2011-09-05 15:34:56","Android finishActivity always causing onActivityResult to get RESULT_CANCELED","<android><activity>","2","3","","",""
"4149844","1","","","2010-11-10 22:44:05","2","572","<p>I need to profile several functions in my java code for Android. </p><p>I do know about traceview. And I actually found which functions to investigate using this tool. But it gives no information that can help in investigations inside specific functions.</p><p>So, is there any way I can get per-instruction profiling information for Java code on Android?</p>","69802","","16828","","2010-11-10 22:48:45","2011-01-07 06:14:51","Is there an instruction-oriented profiling tool for Android?","<java><android><profiler><profiling>","1","8","","",""
"4149953","1","","","2010-11-10 23:00:05","12","9375","<p>My app has a tabhost with four tabs, and now I'm trying to make nice layouts for landscape mode. In order to make use of additional horizontal space I want to put TabWidget at the right side of the screen, and of cource all tabs must be one under another (like in a column).But when switching to landscape mode all tabs get aligned in a row, it looks quite ugly. How to fix that?</p><p><img src=""http://i.stack.imgur.com/l4Fp5.png"" alt=""Screenshot""></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""         &gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:layout_weight=""1""&gt;            &lt;include layout=""@layout/filter_wizard""/&gt;            &lt;include layout=""@layout/filter_wizard""/&gt;            &lt;include layout=""@layout/filter_wizard""/&gt;            &lt;include layout=""@layout/filter_wizard""/&gt;            &lt;/FrameLayout&gt;             &lt;TabWidget            android:background=""#75ffffff""            android:id=""@android:id/tabs""            android:layout_width=""wrap_content"" android:orientation=""vertical""             android:layout_height=""fill_parent"" android:layout_weight=""0"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","461774","","84042","","2011-12-04 01:08:33","2011-12-04 01:08:33","android:orientation=""vertical"" does not work for TabWidget","<android><tabwidget>","3","5","6","",""
"4150446","1","4151670","","2010-11-11 00:33:00","0","288","<p>it's my first question.</p><p>I have built a custom component: a <code>RelativeLayout</code> with a <code>TextView</code> on the bottom and two <code>ImageView</code> above that, acting as a 2-columns clickable element of an histogram. To set the height of a bar, i get the ""available height"" in <code>onLayout()</code>, as container's height minus label's one:</p><pre><code>@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {    super.onLayout(changed, l, t, r, b);    mAvailHeight = getHeight()-findViewById(R.id.label).getHeight(); // it works</code></pre><p>and then assign it (multiplied by a 0.-1. value) as a layout parameter to the ImageView:</p><pre><code>    View bar = findViewById(R.id.bigBar);    RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) bar.getLayoutParams();    rlp.height = Math.round((float)mAvailHeight * mBigBarHeight);}</code></pre><p>The <code>mBigBarHeight</code> variable (0.-1.) can be set via this function:</p><pre><code>public void setBigBarHeight(float value, float max) {    mBigBarHeight = value / max;        requestLayout(); //    invalidate();    // do these help? i find no difference}</code></pre><p>Now. When i add one of these ""HistogramBar"" in <code>onCreate()</code> and set the heights and label everything works as I expect. If i try to modify them later, say onClickSomething:</p><pre><code>bar.setBigBarHeight(25, 100);bar.setSmallBarHeight(50, 100);bar.setLabel(""jjk"");</code></pre><p>only the label changes. I checked with Hierarchy Viewer and actually the LayoutParams did change. If i click again changes appear.</p><p>The funny thing is that <em>even if i do ""Load View Hierarchy""</em> from the tool <em>changes get displayed</em> (on the emulator)!! What happens? Is it strange? I want to do that in my code so that it works!</p><p>I couldn't find any similar question. Thanks.</p>","503900","","503900","","2010-11-11 17:54:05","2010-11-11 17:54:05","hierarchy viewer makes height changes appear","<android><android-layout><custom-component><android-custom-view>","1","1","0","",""
"4150462","1","4150823","","2010-11-11 00:36:18","0","1730","<p>(this is about the <code>LocationManager</code> class in android).</p><p>Is there a way of using <code>requestLocationUpdates</code>, but in some way that allows it to give me results for the best active provider every time? I could pass it the result of <code>getBestProvider</code>, but then it will always return results from that provider, and it wouldn't work as I expect if the user turns the gps on/off.</p><p>My code is in a background service.</p>","368864","","","","","2013-02-18 13:36:06","Using requestLocationUpdates for more than one provider","<android><android-location>","2","0","","",""
"4150614","1","","","2010-11-11 01:10:42","0","254","<p>I'm working on a small Android database application (I'm an Android newbie).  I have an existing sqlite3 database created on a different platform.  When I use it my SQLiteOpenHelper always calls OnCreate (which of course fails).  When I let Android create the Database all works just fine - OnCreate is called for the first time, but not subsequently.</p><p>The android_metadata table is present with local=en_US.</p><p>What's going on?</p>","48445","","","","","2010-11-11 06:36:29","Android always wanting to create database","<android><database>","1","2","","",""
"4150766","1","","","2010-11-11 01:45:39","0","242","<p>I've been running the Android Emulator plugin on Hudson. It appears that every few runs, the DNS on my emulator (Google Inc.:Google APIs:8) appears to die. It generally only lasts for a run or two, then will go back to passing. The tests that fail due to this always fail together, as though the DNS started failing for the entire call to ant run-tests.</p><p>This is all taking place on a Windows VM, but I have experienced it at least once on my Linux box. I tried hard-coding the IP addresses to avoid DNS and they appear to successfully hit my app (and then fail on the SSL cert due to a difference CN). Any ideas?</p>","208457","","","","","2010-11-11 01:45:39","Tests on Android emulator sporadically receive host resolution errors","<android><hudson><dns><android-emulator><adb>","0","3","","",""
"4150824","1","5585544","","2010-11-11 02:00:44","0","911","<p>I want to specify my own custom layout for the drawer handle, but it keeps centering it, and I don't want it centered!</p>","413414","","","","","2011-04-07 18:06:49","Android: How do I keep SlidingDrawer from centering my handle?","<android><layout><slidingdrawer>","1","2","","",""
"4150827","1","","","2010-11-11 02:01:12","2","1136","<p>If I have a service running in my Android phone and I shutdown, will the service call <code>onDestroy</code>? I want the service to perform a task just before the phone shuts down. Although the Google Droid guide says not to put such code in <code>onDestroy</code>, I do not know what else can be done.</p>","503985","","937870","","2011-12-03 21:12:11","2013-01-04 09:50:16","calling onDestroy in android shutdown","<android><service>","1","0","","",""
"4150876","1","","","2010-11-11 02:15:23","6","1004","<p>This makes no sense to me, coming from CSS. In CSS, if you specify a margin and then margin-left, the left margin will assume the more granular value.</p><p>In Android, it is the opposite. Same goes for android:radius, and I'm sure other values.</p><p>My question is: why?.. It makes no sense. Is there a single reason for doing it this way?</p><p>Edit: prompted by trying to find a solution to yet another Google ADT/Android bug <a href=""http://code.google.com/p/android/issues/detail?id=7588"">http://code.google.com/p/android/issues/detail?id=7588</a></p>","47680","","","","","2010-12-08 12:15:39","Why does margin override marginLeft in Android (same with radius, etc)?","<android><coding-style><margin><android-layout>","1","5","2","",""
"4150904","1","4157800","","2010-11-11 02:25:22","0","1572","<p>If you using Twitter for Android you can see that clicking on phone's hard search button brings fully customized quick search-like control. Now I'm not saying that it IS stock Android customized quick search but how would one build something like that? I want quick search box behavior but I also want add some additional selectors (think Firefox search where on the left there's a dropdown to select search engine)I suspect that clicking search brings another activity that just looks like a quick search. Now I know how to trigger search activity from the quick search but how to intercept quick box call and display your activity instead?Where would I start with something like that? Any hints and pointers will be greatly appreciated </p>","135946","","","","","2010-11-11 18:14:34","Android - custom quick search box","<android><customization><quick-search>","1","0","","",""
"4150907","1","","","2010-11-11 02:25:58","3","714","<p>I've been trying to reproduce what my QA team calls the ""Random Pausing Bug"" for some time.  Today, I reproduced it three times while debugging with logcat on.  It appears intermittently and only in poor network.</p><p>The user experiences audio pause, until they go touch their phone (press the power or trackball) and it immediately starts playing again.  This is because I call start in the onPrepared callback, and start is never called in these cases.  This is our most severe bug.</p><p>What I Know:</p><p>1) This happens intermittently on the Nexus One with 2.2.1 (not sure if it's on other devices)</p><p>2) I call prepareAsyc() from a PlaybackService while the device screen is off.  Sometimes, onPrepared() is never called, so my subsequent mediaplayer.start() call is never fired.  I can see with network sniffers and the buffering callback that buffering is happening.</p><p>3) If I touch the devices power or trackball to wake it up, onPrepared() is immediately called (already buffered) and my callback starts playback.</p><p>Here are logs with time stamps showing the issue three times:</p><p>FIRST EXAMPLE (no callback for 20s until I hit power button): </p><pre><code>11-10 16:10:55.966 I/AwesomePlayer(   59): calling prefetcher-&gt;prepare()11-10 16:11:15.511 D/KeyguardViewMediator(   94): wakeWhenReadyLocked(26)11-10 16:11:15.511 D/KeyguardViewMediator(   94): handleWakeWhenReady(26)11-10 16:11:15.511 D/KeyguardViewMediator(   94): pokeWakelock(5000)11-10 16:11:15.511 I/power   (   94): *** set_screen_state 111-10 16:11:15.561 D/SurfaceFlinger(   94): Screen about to return, flinger = 0x1fe30011-10 16:11:15.701 D/AK8973  (   64): Compass Start11-10 16:11:15.701 D/WifiService(   94): ACTION_SCREEN_ON11-10 16:11:15.711 I/Prefetcher(   59): [0x602d80] cache below low water mark, filling cache.11-10 16:11:15.821 I/AwesomePlayer(   59): prefetcher is done preparing11-10 16:11:15.831 W/MogMediaPlayer.onPreparedListener( 2968): onPrepared, calling notifyPrepared()</code></pre><p>TWO MORE EXAMPLES (the first time 3s before I hit power, the next was 8s):</p><pre><code>11-10 16:14:54.649 I/AwesomePlayer(   59): calling prefetcher-&gt;prepare()11-10 16:14:57.500 D/KeyguardViewMediator(   94): wakeWhenReadyLocked(26)11-10 16:14:57.500 D/KeyguardViewMediator(   94): handleWakeWhenReady(26)11-10 16:14:57.500 D/KeyguardViewMediator(   94): pokeWakelock(5000)11-10 16:14:57.500 I/power   (   94): *** set_screen_state 111-10 16:14:57.560 D/SurfaceFlinger(   94): Screen about to return, flinger = 0x1fe30011-10 16:14:57.580 D/WifiStateTracker(   94): Reset connections and stopping DHCP11-10 16:14:57.580 D/WifiService(   94): ACTION_SCREEN_ON11-10 16:14:57.670 I/Prefetcher(   59): [0xa990] cache below low water mark, filling cache.11-10 16:14:57.700 D/AK8973  (   64): Compass Start11-10 16:14:57.800 I/AwesomePlayer(   59): prefetcher is done preparing11-10 16:14:57.800 W/MogMediaPlayer.onPreparedListener( 2968): onPrepared, calling notifyPrepared()11-10 16:39:03.608 I/AwesomePlayer(   59): calling prefetcher-&gt;prepare()11-10 16:39:11.506 D/KeyguardViewMediator(   94): wakeWhenReadyLocked(26)11-10 16:39:11.506 D/KeyguardViewMediator(   94): handleWakeWhenReady(26)11-10 16:39:11.506 D/KeyguardViewMediator(   94): pokeWakelock(5000)11-10 16:39:11.506 I/power   (   94): *** set_screen_state 111-10 16:39:11.566 D/SurfaceFlinger(   94): Screen about to return, flinger = 0x1fe30011-10 16:39:11.586 D/WifiStateTracker(   94): Reset connections and stopping DHCP11-10 16:39:11.586 D/WifiService(   94): ACTION_SCREEN_ON11-10 16:39:11.716 D/AK8973  (   64): Compass Start11-10 16:39:11.766 I/Prefetcher(   59): [0x59ac18] cache below low water mark, filling cache.11-10 16:39:11.856 I/AwesomePlayer(   59): prefetcher is done preparing11-10 16:39:11.946 W/MogMediaPlayer.onPreparedListener( 2968): onPrepared, calling notifyPrepared()</code></pre><p>Does anyone know anything about this bug or how to work around it?</p><p>Thanks in advance,Ben</p>","503993","","","","","2013-11-18 20:16:09","Sometimes MediaPlayer prepareAsyc() doesn't call onPrepared() until POWER pressed","<android>","1","0","1","",""
"4150954","1","5294545","","2010-11-11 02:38:14","5","4920","<p>i found sample plugin in android source code. let's say i can write a plugin using the sample, how would i get my emulator to run the plugin that i wrote? Do i need to recompile the source code? if yes, how is that possibly done?</p><p>thanks:)</p>","1063062","","302328","","2010-11-11 04:21:19","2013-03-06 12:24:05","Android browser plugin","<android><plugins><android-emulator>","2","3","3","",""
"4151013","1","","","2010-11-11 02:55:19","4","415","<p>Does anyone know why the search text remains on the bottom of screen (as shown in image below).  Steps to get there:</p><ul><li>Choose to search for location</li><li>qwerty keyboard comes up</li><li>auto complete bar appears above qwerty</li></ul><p><img src=""http://i.stack.imgur.com/9qvY8.png"" alt=""alt text""></p><ul><li>hit ""Done"" and the auto complete text remains on screen and relocates to bottom, but search is called</li></ul><p><img src=""http://i.stack.imgur.com/fBd0L.png"" alt=""alt text""></p><p>.  This does not happen all the time.</p><ul><li>With KeyEvent.ACTION_UP the search text ""sticks"" to screen when clicking ""Done"" ... goes directly to search</li><li>With KeyEvent.ACTION_MULTIPLE, ""Done"" closes the qwerty and user must click search button to begin search</li></ul>","2186261","","2186261","","2010-11-15 19:11:09","2011-08-31 20:33:20","Auto complete text remaining on screen","<android><autocomplete><android-sdk-2.1>","1","1","","",""
"4151102","1","4427145","","2010-11-11 03:18:59","2","6949","<p>I want to know how to center a GUI widget programmatically.Kindly help me. I am using a LinearLayout.</p><p>Many Regards.</p>","476747","","302328","","2010-11-11 04:19:34","2010-12-13 08:54:50","Center Alignment in Android","<android><alignment><android-linearlayout>","2","0","1","",""
"4151103","1","4151728","","2010-11-11 03:19:10","0","633","<p>Hey, I want to get the hour of the calling from the Android CallLog. It is, the exactly hour that the user start the calling and if possible when he finishes the calling. Someone knows how to?</p><p>Thanks!</p>","399459","","","","","2012-05-12 07:55:56","Get the hour of the calling from Android CallLog","<android><call><android-contentprovider>","1","0","","",""
"4151293","1","","","2010-11-11 04:08:06","0","548","<p>Ok, so the application I've written has a service (that tracks GPS data) with a single main activity that binds to it with bindService in it's onStart() method, and unbinds from the service in it's onStop() method using unbindService( ServiceConnection ).  </p><p>I also have an activity which is an options screen, that is launched by pressing a button on the main activity. On this options screen, I have a checkbox that says ""Run in background"", which, if set to true, means that when the user exits the application with either the Home or Back buttons, the service will continue running, not turning the GPS off. I do this by calling this.startForeground onUnbind, and this.stopForeground onRebind, if the setting is set to true, and stopping and starting my location reader onUnbind and onRebind respectively if the setting is false. If the service is running in the background, it also displays a notification to ensure the user understands that the GPS is still running and draining their power. This notification is displayed and stopped by relying on the startForeground and stopForeground methods.</p><p>So the problem lies in the fact that whether or not this setting is true, if I'm viewing the options screen, I want the service to keep going, and I do not want that notification to appear. So I set a flag that is set to true if I've hit the button to go to the options screen, and do not call unbindService if the flag is true. </p><p>This works, except for one slight problem. If the user hits the home button while viewing the options screen, the service is not stopped if it is supposed to be (because it's still bound to the main screen), and if it is supposed to keep running, it does not display the warning notification (and of course, this means that the service is still considered to be in the background). </p><p>How should I go about getting this application to behave the way I want it to?</p>","504055","","","","","2011-05-22 20:01:56","Android: service still bound to main activity when pressing home button, when viewing different activity","<android><service><home>","1","0","","",""
"4151385","1","4582899","","2010-11-11 04:35:15","7","6416","<p>I am trying to detect a fling event on a simple Android application, but the first <code>MotionEvent</code> argument is always null. Why is the onFling method being called with a null argument? The <a href=""http://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener.html"">Android documentation</a> says that it gets called when a fling event occurs with the initial on down MotionEvent and the matching up MotionEvent.</p><pre><code>class MyGestureDetector extends SimpleOnGestureListener {    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        // e1 always == null, return early a null reference exception        if (e1 == null) {            return false;        }        if (e1.getY() - e2.getY() &gt; 120) {            handleFlingEvent();            return true;        }        return false;    }}</code></pre><p>The main Activity has this onTouchEvent method:</p><pre><code>GestureDetector flingDetector = new GestureDetector(new MyGestureDetector());@Overridepublic boolean onTouchEvent(MotionEvent event) {    if (flingDetector.onTouchEvent(event)) {        return true;    }    return super.onTouchEvent(event);}</code></pre>","17287","","","","","2013-10-16 09:00:07","Android SimpleOnGestureListener.onFling getting a null MotionEvent","<android><touch>","5","0","1","",""
"4151407","1","4152610","","2010-11-11 04:40:12","0","348","<p>This is my code that i have, the onActivityResult is capturing an intent that i created butmy problem is that setContentView(R.laout.waiting) is not being used. R.layout.waiting is not been Display on android. Instead the screen will just go completely dark for a couple of seconds until it finish the rest of the code but it will display  setContentView(tv);.how can i force android to display the layout before moving to the rest of the code.</p><pre><code>public void onActivityResult(int requestCode, int resultCode, Intent intent) {      super.onActivityResult(requestCode, resultCode, intent);             setContentView(R.layout.waiting);      SystemClock.sleep(100000);      IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);                            displayScanResults(scanResult.getContents());     }</code></pre><p>public void displayScanResults(String upc)   {</p><pre><code>   item.scanItem(upc );   tv = new TextView(this);   tv.setText( """" + item.getResults().get(0));   setContentView(tv);    </code></pre><p>}</p>","323834","","","","","2010-11-11 08:38:35","android layout wont show,how to force it do display?","<android><layout>","1","0","","",""
"4151410","1","4151429","","2010-11-11 04:41:11","3","4479","<p>I'm opening an <code>Activity</code> using this:</p><pre><code>startActivity(new Intent(Parent.this, Child.class));</code></pre><p>And on the child, I have this code on the <code>onCreate</code> function (the <code>if</code> contains more than just <code>true</code>, of course):</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    if (true) {        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setPositiveButton(""OK"", null);        builder.setTitle(""Error"");        builder.setMessage(""Connection error, please try later."")            .show();        finishActivity(0);        return;    }}</code></pre><p>Why is the activity not closing? I get the alert box, but then I have to tap the ""back"" button to go back.</p>","368864","","302328","","2010-11-11 04:43:24","2012-09-27 05:53:12","Closing an activity on onCreate","<android><activity>","2","5","1","",""
"4151412","1","4151624","","2010-11-11 04:41:40","3","684","<p>In my android application i would like to set scheduler for the user for particular time with details like on 3'watch movie"" even if the application is not open at that time.</p><p>Is there any way that i can get it done in android?</p>","420261","","73488","","2010-11-11 05:22:28","2011-03-18 18:13:39","set scheduler programmatically in android","<android>","2","0","","",""
"4151499","1","4159934","","2010-11-11 05:05:01","3","6119","<p>I'm using a barcode scanner which inserts barcode string into an EditText in this format ""12345\n"". Instead of using a search button, I want to trigger the search event by the ""\n"" character. I used TextEdit's addTextChangedListener and inside that function I'm doing:</p><pre><code>protected TextWatcher readBarcode = new TextWatcher() {  @Override public void onTextChanged(CharSequence s, int start, int before, int count) {  // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s, int start, int count,   int after) {  // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) {  // TODO Auto-generated method stub  char lastCharacter = s.charAt(s.length() - 1);  if (lastCharacter == '\n') {   String barcode = s.subSequence(0, s.length() - 1).toString();   searchBarcode(barcode);  } }};</code></pre><p>It works pretty good for the first time, but I also want to clear the EditText after each scan. But it's not possible to do that inside afterTextChanged event because it's going into a recursive loop or something.</p><p>Here is the other solution, which is working pretty good:</p><pre><code>editBarcode.setOnKeyListener(new OnKeyListener() {@Overridepublic boolean onKey(View v, int keyCode, KeyEvent event) {    // TODO Auto-generated method stub    String barcode = editBarcode.getText().toString();    if (keyCode == KeyEvent.KEYCODE_ENTER &amp;&amp; barcode.length() &gt; 0) {        editBarcode.setText("""");        searchBarcode(barcode);        return true;    }    return false;}});</code></pre><p>Actually I'm not sure what is the right way to do it it. Maybe I can use EditText's OnKeyListener event. Any suggestions?</p><p>Thanks</p>","304796","","1408212","","2012-07-26 23:06:09","2012-07-26 23:06:09","EditText, OnKeyListener or TextWatcher (barcode scanning)","<android><barcode><edittext><barcode-scanner>","2","2","","",""
"4151593","1","4233638","","2010-11-11 05:25:33","61","14397","<p><strong>google maps api</strong> is great for developing location based services for mobile phones. But for some reason the use of it is restricted for me in a special project.</p><p>E.g. if your project is in conflict with the general terms and conditions of google it is not recommended to use google maps api.</p><p>In my app, both android and iOS, I want to display a location on a map by retrieving gps information. Overall the api should offer a <strong>similar scope of operation</strong> like google maps api.</p><p>Which <strong>alternatives</strong> do you know? Maybe there are <strong>open source api's</strong>? Any other suggestions?</p>","401025","","401025","","2011-02-17 18:12:14","2014-04-17 18:58:05","Alternatives to google maps api","<iphone><android><google-maps><geolocation><google-maps-api-3>","16","6","76","","2010-11-19 09:56:52"
"4151634","1","4170975","","2010-11-11 05:35:26","1","4721","<p>In my android application i am implementing map functionality. it has a tab bar when i jump one activity to another activity through tab its working perfectly. but when i come on map activity and try to move from it through ""Back key of device"" the entire application freezes and after a couple of seconds I get the dreaded force close dialog appearing and i got error. </p><pre><code>11-11 10:53:26.083: ERROR/ActivityManager(85): ANR in com.project.activity (com.project.activity/.MapActivity)11-11 10:53:26.083: ERROR/ActivityManager(85): Reason: keyDispatchingTimedOut11-11 10:53:26.083: ERROR/ActivityManager(85): Load: 2.64 / 1.75 / 1.6411-11 10:53:26.083: ERROR/ActivityManager(85): CPU usage from 8749ms to 209ms ago:11-11 10:53:26.083: ERROR/ActivityManager(85):   dianic.activity: 18% = 16% user + 1%  kernel / faults: 1938 minor11-11 10:53:26.083: ERROR/ActivityManager(85):   mediaserver: 14% = 14% user + 0% kernel11-11 10:53:26.083: ERROR/ActivityManager(85):   system_server: 4% = 2% user + 1% kernel / faults: 167 minor11-11 10:53:26.083: ERROR/ActivityManager(85):   dhd_dpc: 1% = 0% user + 1% kernel11-11 10:53:26.083: ERROR/ActivityManager(85):   android.vending: 0% = 0% user + 0% kernel / faults: 57 minor11-11 10:53:26.083: ERROR/ActivityManager(85):   synaptics_wq: 0% = 0% user + 0% kernel11-11 10:53:26.083: ERROR/ActivityManager(85):   e.process.gapps: 0% = 0% user + 0% kernel / faults: 3 minor11-11 10:53:26.083: ERROR/ActivityManager(85):   wpa_supplicant: 0% = 0% user + 0% kernel11-11 10:53:26.083: ERROR/ActivityManager(85):   logcat: 0% = 0% user + 0% kernel11-11 10:53:26.083: ERROR/ActivityManager(85): TOTAL: 41% = 36% user + 5% kernel + 0% softirq</code></pre><p>please guide me why this is occurring.. thanks in advance  </p>","304961","","342925","","2011-09-29 00:17:36","2011-09-29 00:17:36","Android keyDispatchingTimedOut problem","<android>","1","0","","",""
"4151767","1","","","2010-11-11 06:02:04","0","884","<p>How can i add button as items in a ListView?</p>","504117","","504117","","2010-11-11 06:08:45","2011-04-29 08:37:10","How to insert Buttons within a ListView in Android","<android>","1","0","","",""
"4151842","1","","","2010-11-11 06:16:36","0","543","<p>I am new to android.I have Downloaded the android-sdk and i have installed it.it is working good.now I what to now where we can locate the android Frame work code.I searched all through the android sdk I am not adle to find it.Can any one help me where the android framework code is located in my system.</p>","366916","","1921273","","2013-02-04 00:38:26","2013-02-04 00:38:26","Android-Framework Code","<android>","1","0","","",""
"4151878","1","4152127","","2010-11-11 06:22:52","1","169","<p>I am just starting on Android development. To my nascent knowledge, it seems that anybody can grab any personal info and modify it or phone it home. Like with ContactContentProvider. I know these(permissions) have to be specifically declared in application manifest and the user would be presented with this info during installation. But still how would you you know the application handling your private data is not going to go rouge on it?</p><p>Example:</p><blockquote>  <p>Suppose I create an app with internet  and contact-reading permissions. It  claims that it will backup contacts on  a server specified by user. While  secretly it also copies them to your  own server.</p></blockquote>","219899","","","","","2010-11-11 07:14:14","How Android ensures security?","<android><security>","1","1","","",""
"4152041","1","4181848","","2010-11-11 06:56:38","1","23470","<p>I require an animation for an image in my application.The image should start coming from the top left corner till the middle of screen. The image size will be smaller at the initial stage. While coming to the middle of the screen, its size should increase(i.e. scaling should take place). Image should not go back to its original position. It should be placed at the middle of the screen itself after the animation.</p><p>Can anyone please help.</p>","504162","","795446","","2011-08-15 07:30:48","2013-10-22 10:11:32","Scale & Translate animation","<android><android-animation>","1","0","5","",""
"4152053","1","","","2010-11-11 06:58:29","2","3433","<p>Inside my app, I need a way to turn off the lights on the standard Android phone keys (Home, Menu, Back, and Search) - how can I do this programmatically?</p>","504159","","496830","","2011-11-02 20:05:09","2011-11-02 20:05:09","Android - turn off hardware key lights","<android><hardware><lights>","1","0","2","",""
"4152119","1","4153642","","2010-11-11 07:11:58","1","3739","<p>I want to show my next activity withing my previous activity layout ""LinearLyout"". But it is not working. Can any one help?</p><p>I put my last activity layout reference to a global class in an static variable. My code in next activity is as follow</p><blockquote>  <p>public onCreate(){</p>    <p>View view = findViewById(R.layout.topstory_detail_layout);  setContentView(view);  // My code</p>    <p>Global.mainActity.contentViewLayout.removeAllViews();  Global.mainActity.contentViewLayout.addView(this.getWindow().getDecorView());</p></blockquote><p><strong>Here is exception</strong></p><blockquote>  <p>11-11 11:41:07.330: ERROR/AndroidRuntime(559): Uncaught handler: thread main exiting due to uncaught exception  11-11 11:41:07.460: ERROR/AndroidRuntime(559): java.lang.RuntimeException: view com.android.internal.policy.impl.PhoneWindow$DecorView@44c3cc70 being added, but it already has a parent  11-11 11:41:07.460: ERROR/AndroidRuntime(559):     at android.view.View.assignParent(View.java:5721)</p></blockquote>","486139","","486139","","2010-11-11 07:48:14","2010-11-12 07:37:49","how to get Activity View inside that activity?","<android><activity><android-intent>","2","0","","",""
"4152208","1","","","2010-11-11 07:31:19","0","5000","<p>I would like to know sim type(2G or 3G) inserted in android phone.</p><p>If I insert 2G only SIM card in android phone, which api used for knowing sim card type.In this case, I have to get return value as a 2G Sim.</p><p>best regards</p>","368916","","","","","2010-11-11 12:06:10","How to know sim type(2G, 3G) in android phone","<android>","2","1","1","",""
"4152254","1","","","2010-11-11 07:37:40","16","56284","<p>I'm trying to implement the ""hyperspace"" tween animation described at <a href=""http://developer.android.com/guide/topics/resources/animation-resource.html"">http://developer.android.com/guide/topics/resources/animation-resource.html</a> (""Animation Resources"") - however it does not seem to work as written. When I run the application, I just get a blank view below the application title bar. What am I doing wrong? </p><p>Per the example, here is my code. I've created res/anim/hyperspace_jump.xml:</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""    android:shareInterpolator=""false""&gt;    &lt;scale        android:interpolator=""@android:anim/accelerate_decelerate_interpolator""        android:fromXScale=""1.0""         android:toXScale=""1.4""         android:fromYScale=""1.0""         android:toYScale=""0.6""         android:pivotX=""50%""        android:pivotY=""50%""        android:fillAfter=""false""        android:duration=""700"" /&gt;    &lt;set        android:interpolator=""@android:anim/accelerate_interpolator""        android:startOffset=""700""&gt;        &lt;scale            android:fromXScale=""1.4""             android:toXScale=""0.0""            android:fromYScale=""0.6""            android:toYScale=""0.0""             android:pivotX=""50%""             android:pivotY=""50%""             android:duration=""400"" /&gt;        &lt;rotate            android:fromDegrees=""0""             android:toDegrees=""-45""            android:toYScale=""0.0""             android:pivotX=""50%""             android:pivotY=""50%""            android:duration=""400"" /&gt;    &lt;/set&gt;&lt;/set&gt;</code></pre><p>I've also created a layout/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;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>Finally I have an activity:</p><pre><code>package com.tomoreilly.geology;import android.app.Activity;import android.os.Bundle;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.ImageView;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);        ImageView image = (ImageView) findViewById(R.id.ImageView01);        Animation hyperspaceJump =             AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);        image.startAnimation(hyperspaceJump);    }}</code></pre><p>Yet I do not see any animation when I run the app. Am I missing some detail that is not covered in the ""Animation Resources"" example?</p><p>Thanks,Tom</p>","504192","","180538","","2010-11-24 01:05:22","2013-04-08 09:50:23","Simple tween animation example","<android><animation>","4","0","10","",""
"4152373","1","","","2010-11-11 08:00:41","1","9848","<p>I would like to know Location Area Code and Cell ID saved in sim card.</p><p>How to get Location Area Code and Cell ID in android phone.</p><p>best regards.</p>","368916","","","","","2012-09-01 05:49:44","How to know Location Area Code and Cell ID in android phone","<android>","3","0","","",""
"4152569","1","4166399","","2010-11-11 08:33:24","5","8020","<p>One of my problem is of changing the format of chronometer in android.i have the problem that chronometer shows its time in 00:00 format and i want it to come in 00:00:00 format.does anyone knows the answer?</p>","493193","","493193","","2010-11-12 12:16:25","2013-11-07 11:24:59","how to change format of chronometer?","<android>","5","0","1","",""
"4152604","1","4152618","","2010-11-11 08:37:45","2","1206","<p>i am having a problem whereby when i open my app from the main screen, whether for the first time or not, when i click one of the buttons to show a toast message, the first time i click the button the toast message doesnt appear but it does appear for the 2nd and every subsequent click. if i then go home and launch my app again i have to wait for the 2 click to see a toast. does anyone know why this may be?</p><p>this is how i am using the toast class..</p><pre><code>Context context = getApplicationContext();int duration = Toast.LENGTH_SHORT;Toast toast = Toast.makeText(context, msg, duration);toast.show();</code></pre>","96854","","","","","2010-11-11 08:39:52","Android Toast message not appearing on first request","<java><android><eclipse><mobile-phones><toast>","1","1","","",""
"4152705","1","4155058","","2010-11-11 08:55:28","0","378","<p>My app requires the ability to add several views on one line in a user selected order.</p><p>I found this tutorial which seems to accomplish what I want with a bit of modification.</p><pre><code>http://www.androidpeople.com/android-custom-listview-tutorial-example/</code></pre><p>Having followed the tutorial and made the required changes, the code works except for one strange issue. The position increments but when it hits ~9 it returns to zero and then re-adds views that are already in the list and thus never reaches the >9 ones.</p><p>Also, if I scroll down to the bottom and then back up the very first entry has changed! It may change more but I haven't checked that.</p><p>Through some tests I have discovered that the textSize has some effect. If I set it small enough so that all 'rows' will show on screen at once then they appear fine.</p><p>This is my listview layout that gets inflated into the main 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=""wrap_content""  android:minHeight=""60dip""  style=""@style/DefaultTheme""&gt;    &lt;TextView       android:id=""@+id/Line01""      android:layout_width=""5dip""      android:layout_height=""fill_parent""      android:background=""#F00"" /&gt;    &lt;TextView      android:id=""@+id/Line02""      android:layout_width=""5dip""      android:layout_height=""fill_parent""      android:background=""#0F0"" /&gt;    &lt;TextView      android:id=""@+id/Line03""      android:layout_width=""5dip""      android:layout_height=""fill_parent""      android:background=""#00F""      android:layout_marginRight=""5dip""/&gt;    &lt;LinearLayout      android:id=""@+id/LinearLayout""      android:layout_weight=""1""      android:layout_width=""wrap_content""      android:layout_height=""fill_parent""      android:orientation=""vertical""      android:padding=""2dip""&gt;        &lt;TextView android:id=""@+id/Name""          android:text=""Name""          style=""@style/Name"" /&gt;        &lt;TextView           android:id=""@+id/Status""          android:text=""Status""          style=""@style/Status"" /&gt;    &lt;/LinearLayout&gt;    &lt;ImageView       android:id=""@+id/StatusImage""      style=""@style/StatusImage"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I change background colours and text but that is all. Any ideas what is the problem?</p><p>Thanks!</p>","67419","","","","","2013-02-24 05:45:02","ANDROID: Adapter position returns to zero and re-adds views to ListView","<java><android><android-layout><android-listview>","2","0","","",""
"4152726","1","4152774","","2010-11-11 08:58:05","9","16891","<p>friends,</p><p>i am using following textview to display some data in it.</p><pre><code>&lt;TextView android:id=""@+id/notificationText"" android:layout_height=""wrap_content""android:layout_width=""fill_parent""        android:textSize=""18sp""        android:inputType=""textMultiLine""        android:maxLines=""2""android:layout_paddingRight=""20dip""        android:textColor=""#ffffff""     /&gt;</code></pre><p>now i want to wrap text to next line any one guide me what is the solution?</p><p>any help would be appreciated.</p>","249991","","71059","","2010-11-11 14:54:46","2013-04-30 22:53:03","how to wrap text to next line in android textview?","<android><textview><textwrapping><android-sdk-2.1>","2","0","","",""
"4152770","1","4153586","","2010-11-11 09:04:50","0","62","<p>can any body tell how many caharacter we can seen in the log file?</p><p>Thanks</p>","426344","","","","","2010-11-11 10:46:45","How many character see in the log in android","<android>","1","0","1","",""
"4152780","1","4674114","","2010-11-11 09:06:08","7","6624","<p>I want to make user inputted phone number in an editText to dynamically change format every time the user inputs a number. That is, when user inputs up to 4 digits, like 7144, the editText shows ""714-4"".I would like the editText to be dynamically updated to format ###-###-#### whenever the user inputs a digit. how can this be done? also, I am handling more than one editTexts.</p>","447217","","","","","2011-01-17 04:58:38","Mask an EditText with Phone Number Format NaN like in PhoneNumberUtils","<android><formatting><edittext><masking>","1","0","4","",""
"4152794","1","","","2010-11-11 09:08:04","3","1059","<p>I am trying to develop an app for which I want multiple screen support. I have read the Android article on Best practices for Multiple Screen Support. As per the article we have to follow 3 important things:</p><ol><li>Mention support for different screen sizes(large, medium and small) and any density in AndroidManifest.xml. </li><li>Place images of 3 dpi's (120, 160, 240) in 3 folders res/ldpi, res/mdpi and res/hdpi.</li><li>In layout's the dimension should be mentioned in ""dip"" units. Then Android will take care of the scaling on its own. </li></ol><p>I have implemented all these points in my project. The images are picked up correctly from the appropriate folders. But the arrangements of the controls in not same.</p><p>e.g. I ran the app on three emulators </p><p><br>1. Resolution 240*320 dpi 120.<br>2. Resolution 240*320 dpi 160.<br>3. Resolution 240*320 dpi 240.<br>(All the emulator have same resolution but different density. )</p><p>The problem is the position of the controls is not same on all the three emulator. As per my understanding if the android:layout_marginLeft and android:layout_marginTop are mentioned in ""dip"" then this problem should not occur. As the density of the emulator increases the controls get placed more towards the right.</p><p>Is it absolutely necessary that i provide layouts for all combination's of screen dimension and density even if the layout is same for all the devices?</p><p>Am I missing some important point?</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;  &lt;ImageView android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:src=""@drawable/bgd"" android:scaleType=""fitXY""&gt;    &lt;/ImageView&gt;   &lt;ImageView android:id=""@+id/wtButton""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:src=""@drawable/button"" android:layout_marginLeft=""170dip""        android:layout_marginTop=""9dip""&gt;&lt;/ImageView&gt;    &lt;ImageView android:id=""@+id/htButton""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:src=""@drawable/button2"" android:layout_marginLeft=""220dip""        android:layout_marginTop=""90dip""&gt;&lt;/ImageView&gt;&lt;/RelativeLayout&gt;</code></pre><p>Images:</p><p><img src=""http://i.stack.imgur.com/9NQc8.png"" alt=""https://docs.google.com/leaf?id=0By3GYC3k5AMDNzUwNjkwMWEtOGQzZC00MjQ0LWE2OTgtYjFhYzZmM2ExOGVl&amp;hl=en&amp;authkey=CLOEsZsI""></p>","370075","","321731","","2014-03-21 20:42:15","2014-04-06 07:44:23","Layout issues related to Multiple Screens Support","<android><layout><screen>","3","3","","",""
"4152830","1","","","2010-11-11 09:13:16","0","1074","<p>HI All,</p><p>In my activity i have used default shared prefrence to store some data..and it is stored also.But when i want to access the shared prefrence outside the class(Simple class without activity) my project is showing errors.</p><p>Code:</p><pre><code> SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(this);     user = p.getString(""Username"", null);         pass=p.getString(""Password"", null);</code></pre><p>its showing redline on getDefaultSharedPreferences and when i mouse over it then it is showing</p><p>The method getDefaultSharedPreferences(Context) in the type PreferenceManager is not applicable for the arguments (Myclassname)</p><p>Can anybody pls help me...i want to access my shared prefrence outside the activity class which is not an activity.</p><p>Thanks in advance.</p>","383597","","918472","","2012-01-21 12:35:27","2012-01-21 12:35:27","Android shared preference Issue","<android>","1","0","","",""
"4152892","1","4153095","","2010-11-11 09:22:47","0","1216","<p>This is the first http programming i've done and I'm self-taught so this may be a stupid question...</p><p>edit:Ultimately my question boils down to: What's a good way to get access to all of the contents of an HttpResponse (i.e. headers + entity) but in my own sweet time? i.e. Download and then let the client process.</p><p>I've made a method which places an http GET request to a server. That all works fine, and I use the <a href=""http://developer.android.com/reference/org/apache/http/client/HttpClient.html#execute%28org.apache.http.client.methods.HttpUriRequest%29"" rel=""nofollow"">HttpClient.execute()</a> function to send it off and it returns an HttpResponse object with my XML content in the entity body. My concern is that the official Apache tutorial cites the importance of 'consuming' the response entity content in order to free up the connection used to communicate the response. Why wouldn't it be free? Does this mean that after execute has returned the HttpResponse but before I have done anything with it, that the client hasn't actually received the entity body, and that only when I explicitly access the input stream that comes from it that my client actually receives the body, on some connection that has been waiting around for me to ask?</p><p>I have been using BufferedHttpEntity objects to immediately buffer the response entity to make sure that there are no timeout issues from my client not handling the response quickly enough but i'm not sure if this is necessary. When SHOULD I be using a BufferedHttpEntity?</p>","434731","","434731","","2010-11-11 10:28:06","2010-11-11 10:47:20","I want an HttpResponse object (or similar) that I can read in my own program's time without having to worry about server timeouts","<java><android><apache>","1","1","","",""
"4152947","1","4153072","","2010-11-11 09:30:53","1","2897","<p>i am developing game.i am displaying gun object center bottom of the screen.when user tap on screen i need to rotate gun that direction.i done rotating image.but when user tap on screen i need to rotate image that direction.can you please help me</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","1746300","","2010-11-11 09:56:49","2011-12-15 05:40:21","rotate image depending on user touch on screen","<android>","2","1","2","",""
"4152957","1","4163205","","2010-11-11 09:32:04","3","411","<p>hi i have audio recording in my i use mediarecorder class for recding audio but i have out of memory exception when i reach 2 m , that my limit. i given my code below.</p><p>time</p><p>private static void audiorecding()    {        if (audio_recding_stop_flag == 0) {            audio_recding_stop_flag = 1;</p><pre><code>        recorder.stop();        recorder.reset();        recorder.release();        recorder=new MediaRecorder();        int maxtime = audio_seekbar_play_indication.getMax();        audio_seekbar_progress = 0;        audio_seekbar_incr = maxtime/ AngiesData.gettotalaudiorecdingtimeinseconds(audio_recding_time.getText().toString());        audio_recding_time.stop();        recd_stop_audio.setBackgroundResource(R.drawable.rec_btn);        audio_play_pause.setEnabled(true);        delete_recding.setEnabled(true);       AngiesData.angiesListContext.setAudioRecd(true);       AngiesData.angiesListContext.setAudioRecdingTime((String) audio_recding_time.getText());    }     else {        audio_recding_stop_flag = 0;        try {            audio_play_pause.setEnabled(false);            delete_recding.setEnabled(false);            recd_stop_audio.setBackgroundResource(R.drawable.recording_stop);            audio_recding_time .setBase(SystemClock.elapsedRealtime());            audio_recding_time.start();             recorder = new MediaRecorder();            recorder.setAudioSource(MediaRecorder.AudioSource.MIC); // AudioSource            recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); // OutputFormat            recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);            path = InitialValueLoader.sanitizePath(""Audio/VoiceReport"");            InitialValueLoader.filecheck(path);            recorder.setOutputFile(path);            recorder.setMaxDuration(120000);            recorder.prepare();            recorder.start();        } catch (Exception e) {            e.printStackTrace();        }   }</code></pre>","487219","","487219","","2010-11-13 12:07:14","2010-11-13 12:07:14","Audio Recording and Out of memory Exception","<android><out-of-memory>","3","0","","",""
"4153022","1","4157659","","2010-11-11 09:38:58","13","13306","<p>I don't want to code things that already exist...</p>","433718","","","","","2011-12-04 06:17:43","Is there a OAuth2 library for Java / Android already?","<java><android><authentication><oauth><oauth-2.0>","7","4","10","",""
"4153208","1","4153413","","2010-11-11 10:01:41","5","2480","<p>We've upgraded yesterday our App (easy.go) on the Android Market and after that we have got several messages from HTC Tattoo and Sony Ericsson XPeria mini users, that they can't see application on Android Market.</p><p>We are not you using Copy Protection when uploading to the market, so I guess, it couldn't be a problem.</p><p>The first assumption is that the problem was beacause of small screens. I took a look in manifest.xml. There is written:</p><pre><code>&lt;supports-screens   android:largeScreens=""true""   android:normalScreens=""true""   android:smallScreens=""true""   android:anyDensity=""true""/&gt;</code></pre><p>And here are all permissions:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""&gt;&lt;/uses-permission&gt;&lt;uses-sdk android:minSdkVersion=""3""/&gt;</code></pre><p>Any suggestions?!</p><p>There are some big images with resolution 320x480 and no alternatives for them in resolution 240x320. Could it be the problem?!</p><p>Is there some preview before upgrading an app to know for which devices it will be invisible on the market?</p>","408780","","436938","","2012-04-19 16:32:14","2012-04-19 16:32:14","App doesn't show up on the Android Market","<android><android-manifest><android-market-filtering>","2","0","","",""
"4153235","1","4153312","","2010-11-11 10:05:56","0","817","<p>I have the following code in Objective-C for the iPhone, using NSDateFormatter:</p><pre><code>    NSDate *today = [NSDate date];NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init]autorelease];[dateFormat setDateFormat:@""yyyy-MM-dd""];NSString *dateString = [dateFormat stringFromDate:today];if ([dateString isEqual:@""2010-11-12""]) {</code></pre><p>What would be the equivalent to the NSDateFormatter used there in Java on Android?  I'm still fairly new to Java and Android development.</p>","450487","","19679","","2010-11-11 14:00:14","2010-11-11 14:00:14","What is the Java (Android) equivalent for Cocoa's NSDateFormatter?","<java><iphone><android><objective-c>","2","4","","",""
"4153246","1","4427082","","2010-11-11 10:07:09","9","4335","<p>I want to check, whether a file exists or not in the /assets/ folder.How could I do it? Please help.</p>","476747","","476747","","2012-01-18 03:27:19","2012-01-18 03:27:19","How to check Android Asset resource?","<android><resources><assets>","4","0","","",""
"4153299","1","4153464","","2010-11-11 10:13:12","2","369","<p>When using a custom dialog in an Android App how is it then possible to let the user know, that he/she has entered a wrong argument, e.g. a wrong password or username?</p><p>Possible an AlertDialog or just a Toast_Message?</p><p>Thank you</p>","449649","","449649","","2010-11-11 10:18:57","2010-11-11 11:04:14","android dialog problem","<android><error-handling><dialog><alertdialog><customdialog>","2","0","","",""
"4153300","1","4154090","","2010-11-11 10:13:12","2","8241","<p>How do I reference the assets from phone memory? I need it to write the absolute path into a html file to load some images which are in assets folder. This html is saved in the phone memory but I can't to save these images in the memory phone because these are very big.</p>","495239","","","","","2010-11-11 11:52:03","Absolute path of assets folder","<android>","1","0","","",""
"4153432","1","4153453","","2010-11-11 10:27:59","0","946","<p>I need to do that, like when you put the PIN code in your phone, the numbers transforms into stars (<em>*</em>*).</p><p>Is there a way to do that in the layout xml file? If not, is there a way to do it with java?</p>","479886","","211840","","2011-10-07 12:22:03","2011-10-07 12:23:42","How to transform text introduced in a edittext into password style (*****)?","<android><passwords><edittext>","4","0","","",""
"4153445","1","","","2010-11-11 10:29:48","0","940","<p>I found the GC kicks in frequently freeing memory in my map activity, I couldn't trace out the reason and this happens when map start constructing titles i.e when we slide the map. And eventually the activity stops to force quit due to memory out of bound exception. The activity points the geo points of various location stored in the arraylist. The image enclose show this. </p><pre><code>public class DetailMapTab extends MapActivity{private MapView map=null;private MyLocationOverlay me=null;private SitesOverlay sites=null;String placename;int position;String lat;String lon;ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist =new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.mapdetail);//position -&gt; is the selected record of the list //mylist -&gt; contains record sets to display like name , lat and lon of various locationplacename=mylist.get(position).get(""Name"");lat=mylist.get(position).get(""Latitude"");lon=mylist.get(position).get(""Longitude"");map=(MapView)findViewById(R.id.map);map.getController().setCenter(getPoint(Double.valueOf(lat),Double.valueOf(lon)));map.getController().setZoom(17);map.setBuiltInZoomControls(true);sites=new SitesOverlay();map.getOverlays().add(sites);me=new MyLocationOverlay(this, map);map.getOverlays().add(me);}//oncreate@Overridepublic void onResume() {    super.onResume();    me.enableCompass();}       @Overridepublic void onPause() {    super.onPause();    me.disableCompass();}       @Overrideprotected boolean isRouteDisplayed() {    return(false);}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode == KeyEvent.KEYCODE_S) {        map.setSatellite(!map.isSatellite());        return(true);    }    else if (keyCode == KeyEvent.KEYCODE_Z) {        map.displayZoomControls(true);        return(true);    }    else if (keyCode == KeyEvent.KEYCODE_H) {        return(true);    }    return(super.onKeyDown(keyCode, event));}private GeoPoint getPoint(double lat, double lon) {    return(new GeoPoint((int)(lat*1000000.0),(int)(lon*1000000.0)));}private class SitesOverlay extends ItemizedOverlay&lt;CustomItem&gt; {    private List&lt;CustomItem&gt; items=new ArrayList&lt;CustomItem&gt;();    public SitesOverlay() {        super(null);        //show selected record geo-point with a new map pin1        items.add(new CustomItem(getPoint(Double.valueOf(lat),Double.valueOf(lon)),"" "", placename,getMarker(R.drawable.pin1)));          //show the geo-points names with pin2            for(int i=0;i&lt;mylist.size();i++)            {                if(position!=i)                {                items.add(new CustomItem(getPoint(Double.valueOf(mylist.get(i).get(""Latitude"")),Double.valueOf(mylist.get(i).get(""Longitude""))),"""",mylist.get(i).get(""Name""),getMarker(R.drawable.pin2)));                }            }        }    }    populate();    }    @Override    protected  CustomItem createItem(int i) {        return(items.get(i));    }    @Override    public void draw(Canvas canvas, MapView mapView,boolean shadow) {        super.draw(canvas, mapView, shadow);    }    @Override    protected boolean onTap(int i) {        //OverlayItem item=getItem(i);        Toast.makeText(getApplicationContext(),items.get(i).getSnippet(),Toast.LENGTH_SHORT).show();        return(true);    }    @Override    public int size() {        return(items.size());    }    private Drawable getMarker(int resource) {        Drawable marker=getResources().getDrawable(resource);        marker.setBounds(0, 0, marker.getIntrinsicWidth(),marker.getIntrinsicHeight());        boundCenterBottom(marker);          return(marker);    }} class CustomItem extends OverlayItem {    Drawable marker=null;    CustomItem(GeoPoint pt, String name, String snippet, Drawable marker) {        super(pt, name, snippet);        this.marker=marker;    }    @Override    public Drawable getMarker(int stateBitset) {        Drawable result= marker;        setState(result, stateBitset);        return(result);    }}  public void onDestroy(){         super.onDestroy();        map=null;        me=null;        sites=null;        gr=null;        placename=null;        lat=null;        lon=null;        mylist =null;         System.gc();     } }</code></pre><p>I am glad to know the reason. The log shown as when I slide the map </p><pre><code> 11-11 15:39:55.072: DEBUG/dalvikvm(222): GC freed 439 objects / 83360 bytes in 106ms 11-11 15:39:56.052: DEBUG/dalvikvm(107): GC freed 3568 objects / 197464 bytes in 138ms 11-11 15:39:57.451: DEBUG/dalvikvm(222): GC freed 135 objects / 41456 bytes in 101ms 11-11 15:39:59.891: DEBUG/dalvikvm(222): GC freed 94 objects / 42112 bytes in 134ms 11-11 15:44:27.481: DEBUG/dalvikvm(104): GC freed 7472 objects / 406240 bytes in 140ms</code></pre><p><img src=""http://i.stack.imgur.com/QlB1r.png"" alt=""alt text""></p>","286044","","107009","","2010-11-11 11:25:02","2010-11-11 11:49:25","Reason for High Memory usage in Android MapView","<android><google-maps><android-mapview>","1","0","","",""
"4153517","1","4153842","","2010-11-11 10:38:59","87","84312","<p>From that I've read you can assign a <code>onClick</code> handler to a button in two ways.</p><p>Using the <code>android:onClick</code> XML attribute where you just use the name of a public method with the signature<code>void name(View v)</code> or by using the <code>setOnClickListener</code> method where you pass an object that implement the <code>OnClickListener</code> interface. The latter often requires an anonymous class which personally I don't like (personal taste) or defining an internal class that implements the <code>OnClickListener</code>.</p><p>By using the XML attribute you just need to define a method instead of a class so I waswondering if the same can be done via code and not in the XML layout.</p>","323148","","418183","","2011-02-28 12:11:34","2014-02-24 10:50:08","How exactly does the android:onClick XML attribute differ from setOnClickListener?","<android><onclick>","6","1","34","",""
"4153547","1","","","2010-11-11 10:42:59","0","155","<p>I'm facing a very strange problem related to the soft keyboard in my application and I don't know even where I could start to fix it. I have a text field where the user may input samething. The soft keyboard on my device has in the bottom left a button ""BPMF"" which pressed changes the keys on the keyboard into simplified chinese (I guess) . In the bottom left there is now a key called ""CANG"" which pressed changes again the keys. Again there is a bottom left button called ""STROKE"" whic can be pressed to change the keys again. After that in the left bottom there is a button calle ""HW"" which pressed exist my activity to the previous one and causes my head aches . So a sequence of ""BPMF"" - ""CANG"" - ""STROKE"" -""HW""  has the effect of closing my activity.This problem manifests itself only on a Samsung GT-I9000 device . If anyone faced such an issue or has any idea please let me know.</p><p>Thanks !</p>","304866","","","","","2011-06-26 05:00:32","Soft keyboard issue","<android>","1","0","","",""
"4153560","1","4183918","","2010-11-11 10:43:54","2","6132","<p>Greetings,</p><p>i want to transform some xml using an xsl-file and output the result somehow (I'm using Android Api Level 8)</p><p>my current activity looks like this, but the transformer stays null.LogCat throws an System.err with org.apache.harmony.xml.ExpatParser$ParseException, saying the xml is not well-formed, but i made sure it is.</p><p>I found a hint in LogCat that says: SystemId Unknown just before the above error message.</p><p>What am i doing wrong?</p><pre><code>import java.io.OutputStream;import javax.xml.transform.Source;import javax.xml.transform.Transformer;import javax.xml.transform.TransformerConfigurationException;import javax.xml.transform.TransformerException;import javax.xml.transform.TransformerFactory;import javax.xml.transform.TransformerFactoryConfigurationError;import javax.xml.transform.stream.StreamResult;import javax.xml.transform.stream.StreamSource;import android.app.Activity;import android.os.Bundle;public class XsltTester extends Activity {    private static String TAG = XsltTester.class.getSimpleName();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            Source xmlSource = new StreamSource(this.getResources().openRawResource(R.xml.source));            Source xsltSource = new StreamSource(this.getResources().openRawResource(R.xml.products));            TransformerFactory transFact = TransformerFactory.newInstance();            Transformer trans = transFact.newTransformer(xsltSource);            OutputStream output = new StringOutputStream();            StreamResult result = new StreamResult(output);            trans.transform(xmlSource, result);        } catch (TransformerConfigurationException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (TransformerFactoryConfigurationError e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (TransformerException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre><p>This is the xml-file to be transformed (source.xml)<code>&lt;?xml version=""1.0""?&gt;    &lt;!-- &lt;?xml-stylesheet href=""beatle.xsl"" type=""text/xsl""?&gt; --&gt;    &lt;person&gt;     &lt;name&gt;      &lt;firstname&gt;Paul&lt;/firstname&gt;      &lt;lastname&gt;McCartney&lt;/lastname&gt;     &lt;/name&gt;     &lt;job&gt;Singer&lt;/job&gt;     &lt;gender&gt;Male&lt;/gender&gt;    &lt;/person&gt;</code></p><p>And this is the corresponding xsl (products.xsl)        </p><pre><code>&lt;xsl:template match=""child::person""&gt; &lt;html&gt;  &lt;head&gt;   &lt;title&gt;    &lt;xsl:value-of select=""descendant::firstname"" /&gt;    &lt;xsl:text&gt; &lt;/xsl:text&gt;    &lt;xsl:value-of select=""descendant::lastname"" /&gt;   &lt;/title&gt;  &lt;/head&gt;  &lt;body&gt;   &lt;xsl:value-of select=""descendant::firstname"" /&gt;   &lt;xsl:text&gt; &lt;/xsl:text&gt;   &lt;xsl:value-of select=""descendant::lastname"" /&gt;  &lt;/body&gt; &lt;/html&gt;&lt;/xsl:template&gt;&lt;/xsl:stylesheet&gt;</code></pre>","500558","","500558","","2010-11-14 18:45:40","2012-05-23 12:47:44","Android: Convert xml using xslt","<java><android><xml><xslt>","2","1","7","",""
"4153599","1","4602832","","2010-11-11 10:48:47","1","1679","<p>I need to work with LWUIT and android 2.2.And I'm using eclipse 3.6.1 for this purpose. </p><p>Anyone having the experience related this?</p>","488433","","","","","2012-01-11 01:01:53","How to use LWUIT with android application?","<android><eclipse><java-me><lwuit>","2","3","0","",""
"4153716","1","4159430","","2010-11-11 11:03:15","4","2410","<p>I have a spinner and its adapter.I have a customized the list and an the spinner view.</p><p>The value of the spinner can be modified by 2 ways :- by a user choice- programaticaly</p><p>When the user makes a choice, and only if this choice is different from the selected value, I may (or not) want to show a second activity to make him choice a completing value.</p><p>If the user cancels this second activity, I want the spinner choice not being validated and stay on its original position.</p><p>But I don't want to catch, or be able to identify, programmaticaly changes not to annoy the user with useless choice to do.</p><p>But I don't find any way to do this.</p><p>Do you have an idea ?</p><p>The best I could do is :- remember somewhere the value of the spinner in my class attributes, - trigger and itemSelected event and compare the selected value with the remembered one,- empty the spinner view so the new choice is not visible (because it may not be complete lacking the second choice)- go through the second activity- depending one the result on this second activity, force the old value in the spinner or bring the spinner value visible and this time complete</p><p>Doing this, and to filter the user click, I may ALWAYS force the old spinner value memorized to the new one I want to put in programaticaly. If I don't do this, the event is triggered and I don't have any way to prevent the user to go through the second activity.</p><p>Do you see a better way to do my stuff ?</p><p>Thank you for your help.</p><p>Oliver</p>","499417","","499417","","2010-12-29 00:56:28","2010-12-29 00:56:28","Android - How may I change a spinner value without triggering setOnItemSelectedListener","<android><activity><spinner><choice>","1","1","","",""
"4153909","1","","","2010-11-11 11:27:35","0","63","<p>I am developing image editor. Through which ill be able to edit the pics. Am stuck some where in between.1) I am using arraylist. whenever shifting b/w screen occurs that arraylist gets refreshed.I have used static keyword.2) Or any one can tell me plz how can i create objects at run time...   </p>","504426","","","","","2010-11-11 11:27:35","Android Application","<android>","0","2","","",""
"4153943","1","","","2010-11-11 11:32:25","2","374","<p>in my application i have a activity wich opens ontop of the current activity when i press the menu button.In this overlay i want my views to fade in when the activity appears and fade them out again befor it closes.Here is my code:</p><pre><code>public class OverlayActivity extends Activity {TextView t;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.overlay);    t = (TextView) findViewById(R.id.view_overlay_text);    t.setAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_in));}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    boolean r = false;    switch (keyCode) {    case KeyEvent.KEYCODE_BACK:        finishOverlay();        r = true;        break;    default:        r = super.onKeyDown(keyCode, event);        break;    }    return r;}private void finishOverlay() {    Animation a = AnimationUtils.loadAnimation(this, R.anim.fade_out);    a.setAnimationListener(fadeOutComplete);    t.setText(""TEST""); // &lt;--- if i add this line the code suddenly works    t.setAnimation(a);}Animation.AnimationListener fadeOutComplete=new Animation.AnimationListener() {    public void onAnimationEnd(Animation animation) {        finish();    }    public void onAnimationRepeat(Animation animation) {        // not needed    }    public void onAnimationStart(Animation animation) {        // not needed    }};</code></pre><p>}</p><p>Somehow the fadeOut-Animation only works if i do something like t.setText(""sometext""). If i leave out that line it does not animate and therefore the AnimationListener ist not triggered.</p><p>Can anybody explain to me where i went wrong?Thanks!</p><p>UPDATE:Some more Information do clearify the problem:onCreate: TextView fades in and i can see it on the screenonKeyDown ""BACK"": finishOverlay is called. (it actually does)finishOverlay: Animation is not applied to the view i want to fade. Why? Its the same reference. Could it be a scoping Problem of some kind?</p>","457378","","457378","","2010-11-11 13:10:58","2010-11-11 13:10:58","Animate View befor closing Activity","<android><animation><view><translate>","1","0","1","",""
"4153987","1","4154017","","2010-11-11 11:36:54","14","5403","<p>I am writing a custom adapter for use with a <code>ListView</code>.</p><p>The <code>Adapter</code> interface includes a <code>getItem()</code> method which returns, according to the docs, an <code>Object</code> as  </p><blockquote>  <p>the data item associated with the specified position in the data set.</p></blockquote><p>What's this object supposed to be? I can only imagine the <code>ListView</code> wants to call either <code>toString</code> or <code>equals</code> on it, since there's not much else you can do with a raw <code>Object</code>. But I don't have a convenient <code>Object</code> I can return, and in any event I'm overriding <code>getView</code> so the ListView has no need for a String from my dataset anyway.</p><p>Can I just return <code>null</code> or something else completely irrelevant?</p>","385478","","385478","","2013-12-05 10:27:24","2013-12-05 10:27:24","What's Adapter.getItem() for?","<android><adapter>","1","1","2","",""
"4154023","1","","","2010-11-11 11:41:28","5","2851","<p>I've got an interesting idea for an outside of the box use of the mic port on an android phone.  I'm brainstorming ways to use an android phone to log roast temperatures inside my coffee roaster.  The thought popped into my head.  A microphone is a low-voltage and so is my thermocouple.  So I started looking through the android methods to see if there was anything that might allow me to get the actual millivolt reading from the port.  The GetMaxAmplitude function is the only thing I found.  Does anyone know the range of values that are returned by the GetMaxAmplitude function?</p><p>If you know that this will not work, just let me know.</p><p>Thanks in advance,</p>","504445","","","","","2014-03-26 08:23:55","Range of values for GetMaxAmplitude","<android>","1","0","3","",""
"4154193","1","","","2010-11-11 12:04:10","4","2512","<p>What is this widget called (the one with the three buttons), anyone knows?</p><p><img src=""http://i.stack.imgur.com/qi8ko.png"" alt=""Android browser screenshot""></p>","102092","","28169","","2010-11-11 12:13:56","2011-12-21 19:19:42","How is this floating menu implemented?","<android><android-custom-view>","5","0","1","",""
"4154210","1","4154331","","2010-11-11 12:06:09","0","2898","<p>What happens here is I call the crop image activity and then the camera activity runs in background. When I finish this activity, the camera is still alive at the background. So how can I kill programmatically the camera activity running in background?</p><p><code>Intent newIntent = new Intent();newIntent.setAction(""com.android.camera.action.CROP"");<br>newIntent.setClassName(""com.android.gallery"", ""com.android.camera.CropImage"");<br>newIntent.setData(selectedImage);startActivityForResult(newIntent, IMAGE_CROP</code></p>","504470","","","","","2011-06-21 22:57:20","Android : How to kill programmatically the camera activity running in background?","<android><background><camera><kill>","3","2","","",""
"4154215","1","4154294","","2010-11-11 12:06:57","3","3806","<p>i am trying to get an image from a https url but it doesnt seem to display and get the image correctly but works fine on my computer browser.</p><p>i have tested out a http url pointing to a different image and it works fine.</p><p>my code is below:</p><pre><code>public Bitmap getContactPhoto(String url) {        Bitmap pic = null;        try {            pic = BitmapFactory                    .decodeStream((InputStream) new URL(                            ""https://mail.google.com/mail/photos/static/AD34hIjbK2m-Lj333E4nBcCkBC3MYl2tTs0xizuSqUOP3-Jd6DOrpFg1M5HG8jXh0MuPbeFepInZZDu92Dx8ST4b59EbOKmfYTortuuO3P1_Ohyu7b7a3gc"")                            .getContent());        } catch (MalformedURLException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return pic;    }</code></pre><p>here is the code from the activity class that calls the method above:</p><pre><code>private ImageView mContactPhoto;private ContactDetailsViewHelper mViewHelper;mContactPhoto = (ImageView) findViewById(R.id.contact_photo);mViewHelper = new ContactDetailsViewHelper(mContext);mContactPhoto.setImageBitmap(mViewHelper.getContactPhoto(mDetail.getImageRef()));</code></pre><p>ignore the mDetail.getImageRef, that passes the real url value but for this case i tried hard coding the url as you can see from the getContactPhoto method.</p><p>thanks</p>","444668","","","","","2010-11-11 12:16:55","Android get Image source from an https url?","<android>","1","0","2","",""
"4154272","1","4160397","","2010-11-11 12:14:44","5","5175","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2487710/how-do-i-determine-what-is-touched-in-3d-space-from-the-screen"">How do I determine what is touched in 3D space from the screen?</a>  </p></blockquote><p>I'm developing an Android application. I'm also working with OpenGL graphics.</p><p>I have a square drawn on the screen and I want to let user move it when he touches over it. In other words, user should be able to move square when he puts his finger on the square. If he touches outside the square nothing happens.</p><p>How can I detect when user touches over square?</p><p>Thanks.</p>","68571","","","","","2012-04-26 12:14:10","Detect user's touches over an OpenGL square","<android><opengl-es><touch>","3","0","5","2012-04-26 15:16:38",""
"4154321","1","4154423","","2010-11-11 12:20:23","3","2743","<p>I am doing some heavy network tasks - downloading pictures (previews) -For my main UI to not be blocked it did that in an AsyncTask, I want to put them in a GridView but I set the adapter before the AsyncTask finishes. Some code will be more helpfull</p><pre><code>    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.gridview);            new LoadAllPictures().execute();            GridView g = (GridView) findViewById(R.id.gridview);            g.setAdapter(new ImageAdapter(this));}</code></pre><p>So at the end the Logcat shows that everything had been dowloaded but nothing on my screen.I tried doing the setAdapter part in my AsyncTask but it tells me that: <code>Only the original thread that created a view hierarchy can touch its views.</code></p><p>What should I do ?</p>","290613","","379693","","2010-11-11 12:47:37","2010-11-11 12:47:37","AsyncTask and setAdapter in onCreate methods","<android><android-asynctask><android-sdk-2.1><android-gridview>","2","0","","",""
"4154394","1","4156404","","2010-11-11 12:30:28","1","494","<p>i am providing copy protection for Android paid applications by using Android Market Licensing mechanism. But it supports only for the paid applications. How can i provide copy-protection to Free application. Is there any alternatives ? Please help me.</p><p>ThanQ.</p>","247921","","","","","2010-11-11 16:03:37","How to provide copy-protection for Android free apps","<android><copy-protection>","1","3","2","",""
"4154554","1","6991998","","2010-11-11 12:52:21","3","396","<p>Do you know any tools that may help to implement basic SQLite-based persistence in an Android app? Or even tools that may ease the process of building content providers? </p><p>I've had quite a few projects, most of them saved persistent data into SQLite tables, some thru content providers. Mostly I needed basic CRUD operations, so the task to implement all this stuff was quite repetitve, and slow. I wondered if there are any eclipse plugins / standalone tools that could help with this? </p><p>By tedious tasks I mean things like:- Writing db schemas by hand- Administration when you need to put a new attribute into a table's schema (new string constants for the names, updating the modifier methods, etc.)- Generating basic CRUD methods for the db- Supporting these operations in a Content Provider- and so on</p><p>I think it'd be nice to have some graphical tool/wizard to help generate all this stuff. </p><p>Thanks</p>","446529","","","","","2011-08-09 06:03:12","Tools to help implementing SQLite based persistence for Android?","<android><sqlite><android-contentprovider>","1","1","1","",""
"4154561","1","4154732","","2010-11-11 12:53:31","3","1445","<p>i have this android application that requires to load data from a remote server via the internet. this update-functionaliy obviously requires the device to not only be connected to some kind of network, but also to the internet.</p><p>so: is want to schedule the update-service to some date and when it starts, it should determine whether it actually CAN reach the target server or not. therefore, a simple ""is the device connected to wifi?"" does not suffice, as the device may be connected to a wireless network that does not offer internet access. something like a PING is required...</p><p>whats the easiest /  best way to determine, if there is an internet connection is available i.e. server is reachable?</p>","370969","","","","","2012-01-03 15:40:28","how to determine, if an internet connection is currently available and active on an android device?","<java><android><connection><internet>","4","0","3","",""
"4154639","1","4154669","","2010-11-11 13:02:04","1","801","<p>I need to change installed on Android emulator fonts. E.g. I would like to install TrueType font which covers some other locales like Arabic, Chinese or so. I just wonder is it possible or not?</p>","472270","","","","","2010-11-11 13:05:18","Is it possible to change Android emulator fonts?","<android><localization><fonts><emulator>","1","0","0","",""
"4154744","1","4155104","","2010-11-11 13:13:37","2","2512","<p>I am particulary interested in the following suggestion from the <a href=""http://developer.android.com/guide/appendix/faq/framework.html"" rel=""nofollow"">official android FAQ</a>.</p><blockquote>  <p><strong>A HashMap of WeakReferences to Objects</strong></p>    <p>You can also use a HashMap of WeakReferences to Objects with Long keys. When an activity wants to pass an object to another activity, it simply puts the object in the map and sends the key (which is a unique Long based on a counter or time stamp) to the recipient activity via intent extras. The recipient activity retrieves the object using this key.`</p></blockquote><p>I haven't found a way how to properly implement this. And I'm not sure why WeakReferences are preferred here and why not use hard references.</p><p>My implementation (I would like to send an instance of <strong>class XY</strong> from the <strong>activity A</strong> to the <strong>service B</strong>):</p><ul><li><p>the receiving service has a static HashMap of Objects.</p><pre><code>public static HashMap&lt;Long, Object&gt; parameters = new HashMap&lt;Long, Object&gt;();</code></pre></li><li><p>code for the sending part (activity A)</p><pre><code>long key = SystemClock.elapsedRealtime();B.parameters.put(key, new XY());Intent i = new Intent(this, B.class);i.putExtra(""PARAM_UPLOAD"", key);startService(i);</code></pre></li><li><p>code for the receiving part (service B)</p><pre><code>long key = intent.getLongExtra(""PARAM_UPLOAD"", -1);XY data = (XY)parameters.get(key);</code></pre></li></ul><p>The code is using hard references. Why should I use weak references here (as proposed by the FAQ)? And is such a use pattern for passing data ok or do you prefer something else. </p>","404200","","","","","2010-11-11 13:57:56","HashMap of WeakReferences for passing data between activities","<android><communication><hashmap><weak-references>","1","0","2","",""
"4154815","1","4164744","","2010-11-11 13:21:45","19","6372","<p>I'm trying to write an application that needs to know when there is no IP network connection available. I am using the android.net.conn.CONNECTIVITY_CHANGE broadcast event along with ConnectivityManager to react to the changes in state to achieve this, but I'm having problems testing my set up in the emulator.</p><p>I have tried both flight mode and pressing F8 to disable the ""Cellular Network"" but even with both of these engaged the application still ""sees"" the underlying network.</p><p>Has anybody managed to find a way to simulate a total lack of network access?</p>","504554","","","","","2012-11-19 13:14:37","How to simulate total network loss in Android Emulator","<android><android-emulator>","5","2","4","",""
"4154856","1","4154998","","2010-11-11 13:26:30","3","1782","<p>I am taking over a project, and am trying to launch it in the Android Emulator. I get the following error in Logcat:</p><p><code>11-11 06:21:42.215: ERROR/PackageManager(58): Package com.android.xxx requires unavailable shared library com.google.android.maps; failing</code>!</p><p>Console displays:</p><pre><code>Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY</code></pre><p>How can I make sure com.google.android.maps is included in my project?</p><p>UPDATE:I am using a min sdk level of 3 in my androidmanifest.xml:</p><pre><code>&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3""/&gt;</code></pre>","19875","","","","","2010-11-11 13:42:10","Unavailable Shared Library - INSTALL_FAILED_MISSING_SHARED_LIBRARY","<java><android><google-maps><android-emulator><packages>","1","0","0","",""
"4154970","1","4156878","","2010-11-11 13:38:43","1","980","<p>How do I move the ball on a particular angle in the Android canvas?</p>","1746300","","869912","","2012-08-15 19:20:51","2012-08-15 19:20:51","How do I move the ball on a particular angle in the Android canvas?","<android>","1","0","1","",""
"4155112","1","4155176","","2010-11-11 13:59:06","4","1543","<p>I published an application that stores data in a local database.</p><p>Now I have to publish an update to this application to fix some little bugs, but I am afraid that downloading and installing the update will delate the local database associated with the previous version.</p><p>I would like to know how the update system works. Will installing an update completely delete all the apk, files, databases associeted with the previous version?</p><p>If so, how can I avoid this in my code?</p><p>Thanks a lot for your help!!</p>","504585","","631","","2010-11-11 14:27:18","2010-11-11 14:27:18","How to publish an application update on android-market without deleting local database and local files?","<android><database><local><google-play>","2","0","","",""
"4155166","1","","","2010-11-11 14:05:52","15","6867","<p>I'm trying to stream video from the Android phone, which should be watched in an mediaplayer.I've been looking at <a href=""http://www.mattakis.com/blog/kisg/20090708/broadcasting-video-with-android-without-writing-to-the-file-system"">http://www.mattakis.com/blog/kisg/20090708/broadcasting-video-with-android-without-writing-to-the-file-system</a> which seems to be a dead end since it send the raw file data, and not a streamable format.</p><p>Then I tried using some code from SipDroid, more specific; parts of VideoCamera.java, RtpPacket.java and RtpSocket.java, which gives a stream on UDP, however these is not playable in i.e. mplayer(can't detect the codec). Wireshark tells that it is a UDP packet and not a RTP packet so something might be missing?</p><p>I'm kind'a stuck, have you any suggestions how to get past this bump?</p>","504590","","","","","2012-11-29 17:30:10","Streaming Video From Android","<android><camera><video-streaming><rtp>","2","2","9","",""
"4155211","1","","","2010-11-11 14:10:54","0","4654","<p>I'm trying to show an image scaled while preserving its aspect ratio, but at the same time align it to the bottom.</p><p>Using android:scaleType=""FitXY"" causes the image to be centered vertically and horizontally, so it doesn't get aligned to the bottom.Using ""FitEnd"" causes the image to be aligned to the bottom right corner, so it isn't centered horizontally.</p><p>Is there any way to get around this? Maybe using some matrix to scale it (scaleType=""matrix"")?</p><p>EDIT: To clarify a bit on what it is I want exactly...</p><p>I have an ImageView, whose layout (location, size, gravity, etc.) I can't change. I want to load a bitmap as its source image, but have that bitmap get scaled to the ImageView's size (preserving the aspect ratio of the bitmap) and then aligned to the ImageView's bottom.</p><p>EDIT: After trying everything I could think of (and everything that was suggested here), we ended up sub-classing ImageView and doing the scaling/translation ourselves in onDraw.</p>","74060","","74060","","2011-01-04 08:36:33","2011-01-04 08:36:33","Android image scaling and alignment","<android><android-layout>","2","0","","",""
"4155213","1","","","2010-11-11 14:10:54","0","2395","<p>I've written an APP the uses has a small SQL lite DB and using a cursor adapter I can retrieve the records and populate a list view with them. from there I can get the Id of a selected item and delete it from the DB which works great. the issue I have is that as the DB grows deleting one row at a time would be slow and frustrating so I wanted to know if there was any way to allow multiple selections possibly with check boxes or by even changing the text color of the items selected so that I can retreiving their relative ID's.</p><p>I have read some posts that talk about custom cursor adapters but I am not sure how to adapt them to my code. I have posted my code below.</p><pre><code>private void fillData() {    Cursor c = mDbHelper.fetchAllNotes();    startManagingCursor(c);    String[] from = new String[] {DBHelper.KEY_FIELD0,                             DBHelper.KEY_FIELD1,                            DBHelper.KEY_FIELD2,                            DBHelper.KEY_FIELD3,                            DBHelper.KEY_FIELD4};    int[] to = new int[] {R.id.text,R.id.text2,R.id.text3,R.id.text4,R.id.text5};    SimpleCursorAdapter dblist = new SimpleCursorAdapter(this, R.layout.row, c, from, to);                                                                                                   setListAdapter(dblist);   }</code></pre><p>Thanks.</p>","500963","","2248992","","2013-08-27 14:57:10","2013-08-27 14:57:10","Cursor Adapter with multi select","<android>","1","0","","",""
"4155247","1","","","2010-11-11 14:14:40","21","5458","<p>I am writing a procedure to sync large number of contacts with the Android Contacts database. The downloading works fine for about 700 contacts after which i am consistantly getting a memory heap error which calls infinite number of GC statement and ends up Re-booting the Phone. I am facing the problem on HTC desire.</p><p>I checked heap size of the application using the Heap alocation tool from DDMS as well as extracted the hprof file using Debug.dumpHprofData. Both the logs indicated that the Heap size is about 2.4MB.</p><p>However i get the following logs which indicates that the heap size is more that 32.MB</p><pre><code>dalvikvm-heap(92): Clamp target GC heap from 33.999MB to 32.000MBdalvikvm(92): GC_FOR_MALLOC freed 2 objects / 48 bytes in 313ms</code></pre><p>I had inserted following log statements in loop where my contatcs downloading logic was written.</p><pre><code>Log.e(""Memory"", ""free mem ="" +runtime.freeMemory());Log.e(""Memory"", ""total memory ="" +runtime.totalMemory());</code></pre><p>These are the initial and final values of the statement printed </p><pre><code>---------------------------------------------------------------11-11 12:56:04.168: ERROR/Memory(25132): free mem =87124811-11 12:56:04.168: ERROR/Memory(25132): total memory =4202464---------------------------------------------------------------11-11 13:01:55.408: ERROR/Memory(25132): free mem =89164011-11 13:01:55.408: ERROR/Memory(25132): total memory =4726752---------------------------------------------------------------</code></pre><p>This indicates that apperently there are no memory leaks present in the syncing contacts logic.</p><p>Can someone please let me know for why is the heap size increased (upto 32.00Mb) to such a extent that the device re-boots itself? I am new to Android and Java so please go easy on me :).....</p>","366053","","960524","","2011-09-27 21:24:26","2011-11-18 20:48:13","Android dalvikvm-heap: Clamp target GC heap","<java><android><memory-management><memory-leaks><garbage-collection>","3","5","10","",""
"4155630","1","4314754","","2010-11-11 14:50:11","2","1166","<p>sorry for my english ;-P!</p><p>I'm writing an app that shows in google maps pipes and valves(lines and points). For that i've two classes.</p><p>One extends from ItemizedOverlay, and i add to map overlay one for each category of valve, and each one can have more than one item.</p><p>The second extends from Overlay, and in the draw method y draw the line with the method drawline of the canvas.</p><p>The problem i've is that the lines are drawn over the ItemizedOverlay items, no matter the order i add them to the mapView.getOverlays().</p><p>I want the lines on the bottom of all overlays. is there a way to do that.</p><p>Thanks very much.</p>","504608","","","","","2011-03-04 08:35:14","Lines and drawables draw order in Android Google Maps","<android><google-maps><overlay>","2","0","","",""
"4155635","1","","","2010-11-11 14:50:51","1","1070","<p>I am new to android and was trying out stuff on my android emulator. While playing with the location manager and location listener, I could test the code of changing location using the emulator. The locationlistener catches the location change and moves to the specific location. </p><p>I now want to replicate the same test using my program, i.e. pass new coordinates every x seconds (may be through a thread ?) to the locationlistener, but through my program and not the emulator.</p><p>Can someone please suggest a way to go about implementing this functionality ?</p><p>The code for location listener that I found somewhere on the net and was trying:</p><hr><pre><code>private LocationListener locationListener;private MapView mapView;private MapController mc;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.gps);     lm = (LocationManager)         getSystemService(Context.LOCATION_SERVICE);        locationListener = new MyLocationListener();    lm.requestLocationUpdates(        LocationManager.GPS_PROVIDER,0,0,locationListener);    mapView = (MapView) findViewById(R.id.mpview);    mc = mapView.getController();}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}        private class MyLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location locn) {        if (locn != null) {                            GeoPoint point = new GeoPoint(                    (int) (locn.getLatitude() * 1E6),                     (int) (locn.getLongitude() * 1E6));            mc.animateTo(point);            mapView.invalidate();        }    }    @Override    public void onProviderDisabled(String provider) {    }    @Override    public void onProviderEnabled(String provider) {    }    @Override    public void onStatusChanged(String provider, int status,         Bundle extras) {    }}     </code></pre><hr><p>Thanks!</p>","504628","","","","","2010-11-11 14:50:51","Android: using LocationManager and provider","<android><locationmanager>","0","0","","",""
"4155684","1","","","2010-11-11 14:55:41","0","876","<p>I have a strings.xml with a string-array resource.   In another .xml I have a textview.  setText() doesnt accept an array so how do I make my string array appear in the textview?  I've done a search but can't seem to find something which addresses this issue.  It is such a simple matter that I think I must be missing the obvious.Ron</p>","479505","","","","","2010-11-11 15:47:12","android linking string_array to textview","<android>","1","0","","",""
"4155697","1","4155886","","2010-11-11 14:56:50","3","3565","<p>Currently I am careful to use different IDs for each widget, but if I used the same id for some widgets in different layout xml files, what would happen to my calls to findViewById?  Would it get confused and return a widget from the wrong layout file?</p><p>I ask because I was thinking  of including a view (with a row of buttons) in some other  views, then each of those screen classes would have to assign a slightly different behavior to each button on the included view.  But to do that they would be calling findViewById on the same id.For instance currently  I do like this in each file:</p><pre><code>final ImageButton homeButton = (ImageButton)this.findViewById(R.id.rshome_button);homeButton.setOnClickListener(new BottomButtonClickListener());final ImageButton hotButton = (ImageButton)this.findViewById(R.id.rshotlist_button);hotButton.setOnClickListener(new BottomButtonClickListener());final ImageButton locButton = (ImageButton)this.findViewById(R.id.rsbot_map);locButton.setOnClickListener(new BottomButtonClickListener());final ImageButton sendButton = (ImageButton)this.findViewById(R.id.rssend_button);sendButton.setOnClickListener(new BottomButtonClickListener());</code></pre><p>But I change the R.id in each file to point to the widget in each assiciated layout.  it would be nice if I could use the one R.id for all so I don't have to tweak every layout file and every screen class.</p><p>Thanks</p>","491739","","4737","","2010-11-11 15:32:46","2011-12-20 19:12:05","What happens if I use the same id for several widgets in different layouts?","<android><layout>","3","0","2","",""
"4155705","1","4156171","","2010-11-11 14:57:24","2","3275","<p>I'd like to add extra spacing on the sides and between tabs on the tab widget, but padding and margins dont seem to make any difference. I also played with setting the divider, tab strip left and right drawables, which didn't seem to make any difference either.</p><p>Trying to make the tabs look like this:<img src=""http://i.stack.imgur.com/7GFuk.png"" alt=""alt text""></p>","246793","","","","","2012-10-17 10:03:33","How to add spacing to tab widget in Android?","<android><coding-style><spacing><tabwidget>","3","0","1","",""
"4155830","1","","","2010-11-11 15:09:05","0","158","<p>Which files i need edit and learn to customize the android desktop, such: change main bar, turn off slider bar, turn-off desktop slide, and put a menu in desktop.</p><p>Thanks</p>","466088","","","","","2010-11-11 15:16:10","Customize Android base interface","<android>","1","0","1","",""
"4155999","1","","","2010-11-11 15:23:22","1","614","<p>I have an Tab Activity with 4 tabs.Each of tab is showing me the list view.Suppose i m on 4th tab and dragged the list view to the last position and after that i click on 3rd tab and again when i go to 4th tab it is not refreshing and showing me the last visible screen. Actually i want to show the list view again from 1st element.</p><p>is tabs refresh automatically or we need to do it programmatic??</p><p>pls help me..</p>","383597","","","","","2010-11-11 18:28:48","Android Tabs Layout","<android>","1","0","1","",""
"4156033","1","","","2010-11-11 15:26:29","0","925","<p>I want to change the size of surface view at run time when it is changed to Landscape Mode?</p><p>Thanks in advance.</p>","461972","","","","","2010-11-11 15:35:50","Surface view on Android","<android>","1","0","","",""
"4156167","1","4159767","","2010-11-11 15:40:15","1","4248","<p>I am completely new to the Eclipse world and I haven't found very many usefull resources on calling a web service written in .NET. </p><p>I'm trying to port an app over I wrote for the new Windows 7 Phone to the Android OS. I have Eclipse and the Android SDK. Can anyone point me in the right direction as to how I might call my WCF web service from my Java app?</p><p>The WCF service is very basic and uses Soap 1.1 (basic http binding)</p><p>Thanks!</p>","410061","","","","","2011-01-14 00:40:17","Eclipse Android Plugin calling a WCF Web Service in basicHttpBinding","<java><android><wcf><web-services><eclipse>","1","1","1","",""
"4156181","1","4156774","","2010-11-11 15:41:53","1","1042","<p>Is there any way of adding images to the body of the mail (i.e Compose). I have some text with images that I want to dump into the compose of the mail. I don't need to add image has an attachment. I guess the Compose is an EditText. I wonder is it possible to add images to it??</p><p>Cheers,Vinayak</p>","28557","","","","","2010-11-11 16:38:37","Android: Adding images to the compose body of the email","<android><email>","1","0","","",""
"4156217","1","4156332","","2010-11-11 15:45:06","3","4464","<p>I have a listview and I override the onScroll event for it so that I can get the first character of the text on the first visible item of the listview. My code is as follows:</p><pre><code>            @Override   public void onScrollStateChanged(AbsListView view, int scrollState) {    //   }   @Override   public void onScroll(AbsListView view, int firstVisibleItem,     int visibleItemCount, int totalItemCount) {    ListView caller = (ListView) view;    View v = caller.getChildAt(firstVisibleItem);    if(v instanceof TextView){     TextView tv = (TextView) v;     if(tv != null){      String sInitial = tv.getText().toString();       sInitial = Character.toString(sInitial.charAt(0));      TextView tvPager = (TextView) findViewById(R.id.tvPager);      tvPager.setText(sInitial);     }    }   }</code></pre><p>When the FirstVisibleItem variable is from 0 to 12(to be precise), my View v is not null and I can get the text of it. But when it goes beyond 12, my v is already null. My items are way more than 12 so it shouldn't be null.</p><p>Is there something wrong with my code? Or are there better way doing what I want? Thanks in advance!</p>","82350","","52626","","2011-03-28 20:33:12","2012-07-24 06:47:07","android ListView onScroll Question","<android><android-listview>","1","0","1","",""
"4156261","1","4156290","","2010-11-11 15:49:34","0","2587","<p>My application is basically a image viewer. It is opened from both camera and as a separate application.</p><p>I open the image viewer to view and edit the picture. Each edit operation is implemented using thread. If my application closes due to pressing the home button, the next time I open it with camera. It throws anr.</p><p>This doesn't always happen. Only when large edit operations or edit operations on large image files are done.</p><p>I get out of memory error, sometimes timeout.</p><p>I guess it s because the thread doesn't complete the edit operation when home is clicked. and it s still running on the background. so when i open it s unable to process it.</p><p>m I right?</p><p>If so what is the way to stop a thread before the completion/</p><p>Can u pls help me out? </p>","504712","","","","","2010-11-11 17:46:35","Android application crashes due to low memory","<android>","3","1","","",""
"4156375","1","4163306","","2010-11-11 16:01:17","0","1418","<p>So I was trying a hack to put a quick bandaid on an issue I'm having that's described in <a href=""http://stackoverflow.com/questions/4149764/android-finishactivity-always-causing-onactivityresult-to-get-result-canceled"">another question</a> I have posted.</p><p>I have a sub-activity that was kicked off by my main activity and it can also be stopped by the main activity calling finishActivity(requestCode) on it.  However the sub-activity is always returning 0 after the finishActivity call - even though I only set that result in the sub-activity if the user presses the back button.  I tried to cheat by calling setResult(RESULT_OK) in the sub-activity onResume method, but that seems like it makes no difference;</p><p>Also, for some reason it is taking a long time before the onActivityResults come in.  Is that normal?</p><p>Thanks for any advice!</p>","418714","","","","","2010-11-12 09:42:31","Android Activity setResult not persistant?","<android><activity>","1","0","","",""
"4156560","1","4183566","","2010-11-11 16:19:24","0","2730","<p>I'd need help with a simple implementation of a ViewFlipper. The flipper works perfect when I inflate child views ""ws.addView(childView)"" in the onCreate of the activity. </p><p>I run into a problem when I want to remove all children from the flipper and add another bunch of them via addView(child) method. I am trying to call the onFinishInflate() and invalidate() methods on the flipper which do not seem to produce the desired effect of refreshing the content of the flipper. The view of the flipper is blank. I checked if the flipper contains children after the addView loop and in my case the number is > 1. Maybe I'm missing something. Hope somebody can help me. </p><pre><code>                ws.removeAllViews();                ArrayList&lt;View&gt; childViews = getAllChildrenFromSomewhere();                for (View childView : childViews) {                    ws.addView(childView);                }                ws.onFinishTemporaryDetach();                ws.onFinishInflate();                ws.invalidate();    </code></pre><p>best regards</p>","504728","","","","","2010-11-15 10:46:30","ViewFlipper addView not working","<android><viewflipper><updating>","1","0","","",""
"4156631","1","","","2010-11-11 16:25:42","0","203","<p>When running on droid X my app does not show buttons that are written in xml. I only found this after releasing my app and users reported it. This XML code does not appear on Droid X. Any ideas?</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=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;TextView        android:id=""@+id/name""        android:text=""NAME""        android:textColor=""#FF0000""         android:textSize=""10pt""        android:maxLines=""1""        android:layout_width=""120dip""        android:layout_height=""wrap_content""/&gt;  &lt;TextView        android:text="" DAY: ""        android:textColor=""#FF0000""         android:textSize=""7pt""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;  &lt;TextView        android:id=""@+id/days""        android:text=""DAY""        android:textColor=""#FF0000""         android:textSize=""7pt""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout  android:orientation=""horizontal""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt; &lt;TextView        android:text="" ""        android:textColor=""#33CC33""         android:textSize=""7pt""        android:gravity=""right""        android:layout_width=""125dip""        android:layout_height=""wrap_content""/&gt; &lt;TextView        android:text=""CASH: $""        android:textColor=""#33CC33""         android:textSize=""7pt""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;  &lt;TextView        android:id=""@+id/cash""        android:text=""0""        android:textColor=""#33CC33""         android:textSize=""7pt""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt; &lt;/LinearLayout&gt;               &lt;View android:layout_height=""2dip""     android:layout_width=""fill_parent""    android:background=""#FF0000"" /&gt;    &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;  &lt;TextView        android:id=""@+id/note1""        android:text=""""        android:textColor=""#FF0000""         android:textSize=""15dip""        android:gravity=""right""        android:layout_width=""wrap_content""        android:maxLines=""1""        android:layout_height=""wrap_content""/&gt;        &lt;View android:layout_height=""1dip""     android:layout_width=""fill_parent""    android:background=""#FF0000"" /&gt;  &lt;TextView        android:id=""@+id/note2""        android:maxLines=""1""        android:text=""""        android:textColor=""#FF0000""         android:textSize=""15dip""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;        &lt;View android:layout_height=""3dip""     android:layout_width=""fill_parent""    android:background=""#FF0000"" /&gt;    &lt;/LinearLayout&gt;   &lt;include android:id=""@+id/bank""         layout=""@layout/bank""         android:layout_height=""330dip""         android:layout_width=""fill_parent""         /&gt;         &lt;include android:id=""@+id/buysell""         layout=""@layout/buysell""         android:layout_height=""330dip""         android:layout_width=""fill_parent""         /&gt;           &lt;include android:id=""@+id/travel""         layout=""@layout/travel""         android:layout_height=""330dip""         android:layout_width=""fill_parent""         /&gt;          &lt;include android:id=""@+id/info""         layout=""@layout/info""         android:layout_height=""330dip""         android:layout_width=""fill_parent""         /&gt;    &lt;View android:layout_height=""2dip""     android:layout_width=""fill_parent""    android:background=""#FF0000"" /&gt;           &lt;LinearLayout  android:orientation=""horizontal""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;      &lt;Button         android:id=""@+id/buy_btn""        android:text=""BUY/SELL""        android:textColor=""#FF0000""         android:textSize=""7pt""        android:gravity=""right""        android:visibility=""visible""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;Button         android:id=""@+id/bank_btn""        android:text=""BANK""        android:textColor=""#FF0000""         android:textSize=""7pt""        android:gravity=""right""        android:visibility=""visible""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;  &lt;Button         android:id=""@+id/move_btn""        android:text=""RELOCATE""        android:textColor=""#FF0000""         android:textSize=""7pt""        android:visibility=""visible""        android:gravity=""right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;  &lt;Button         android:id=""@+id/info_btn""        android:text=""INFO""        android:textColor=""#FF0000""         android:textSize=""7pt""        android:gravity=""right""        android:visibility=""visible""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>could a mod please edit this. i cant get the xml file to display correctly</strong></p>","504754","","427763","","2012-03-20 17:40:46","2012-03-20 17:40:46","Droid X issue, Buttons not appearing. (Android)","<android>","1","6","","",""
"4156715","1","4156846","","2010-11-11 16:32:21","1","176","<p>I have 10 URL's in my application, that are currently hard-coded. I want to externalize this and put it in a file so that my application can read it in.</p><p>What is the best way of doing this?</p><pre><code>private String appURL = ""http://...""private String storeURL = ""http://...""private String someURL = ""http://...""</code></pre><p>Note: I will never be writing out to this file in my app. I want the developer to be able to open up the file, and change the URL if necessary.</p>","19875","","","","","2011-11-02 18:12:38","What is the best way to externalize URL's?","<java><android><properties><fileinputstream>","3","0","","",""
"4156750","1","","","2010-11-11 16:35:54","6","4044","<p>This warning pops up when I bring up the AVD Manager in Eclipse (3.5) on a Mac with OSX 10.6.4. Any ideas of what is causing this?</p>","504769","","","","","2013-12-04 18:03:33","Warning: Ignoring platform '.DS_Store', not a folder","<android><eclipse><osx>","3","0","","",""
"4156789","1","4156886","","2010-11-11 16:40:04","0","779","<p>in my app i am having an Activity that launches another Activity ontop of it. The second Activity is meant to provide controls like next and previous for the first activity.How can i pass button events between the two activities that are visible at the same time without closing the Activity with the controls?</p>","457378","","","","","2010-11-11 16:54:32","Activity launches transparent Overlay Activity. How to pass Data without closing the Overlay?","<android><activity>","2","0","","",""
"4156869","1","4157298","","2010-11-11 16:47:39","0","9349","<p>Creating a layout in Java as the number of TableLayouts required is not known as designtime.</p><p>I get an <code>IllegalStateException</code> telling me to remove the <code>View</code> (from it's current parent) before assigning it to another parent, when I call <code>createPlayerTables()</code> </p><p>The exception is thrown at the first line in this loop, when I try to add an ImageView from the List of ImageViews to the first TableRow:</p><pre><code>for (int i = 0; i &lt; 3; i++) {    tableRowsLst.get(0).addView((ImageView) imageViewsLst.get(i));    tableRowsLst.get(1).addView((ImageView) imageViewsLst.get(i+3));}</code></pre><p>The error suggests that the ImageView has <strong>already been added to a ViewGroup</strong>, but seeing the code below, I create new ImageViews, and I only add them to an ViewGroup at the line that it errors at, so I'm not sure why it's failing.</p><pre><code>// List&lt;ImageView&gt; imageViewsLst = new ...// List&lt;TableRow&gt; tableRowsLst = new .../*** Initialises the TableLayouts, one per player*/ private TableLayout createPlayerTables(int playerNum) {    ...    for (int i = 0; i &lt; 6; i++) {        imageViewsLst.add(new ImageView(this));        ...    }    for (int i = 0; i &lt; 3; i++) {        tableRowsLst.add(new TableRow(this));        ...    }    for (int i = 0; i &lt; 3; i++) {        tableRowsLst.get(0).addView((ImageView) imageViewsLst.get(i));        tableRowsLst.get(1).addView((ImageView) imageViewsLst.get(i+3));    }    ...}</code></pre>","494879","","494879","","2013-08-22 11:15:20","2013-08-22 11:15:20","Android dynamic table layout - adding views throws exception IllegalStateException (child already has a parent)","<android><android-layout><android-view>","3","0","2","",""
"4156925","1","4157046","","2010-11-11 16:52:43","0","3483","<p>I want to set image dynamically on the ImageButton in android. However, i have more than 200 images. what would be the good solution for that?</p><p>The best idea is that i can use the name of image to call different images. i.e. imagebutton.setImage(""/res/abc.png"");   however, it seems to me that it is not trivial to do so.. please help me to solve this problems. thanks a lot!!</p><p>regardspenny</p>","502958","","","","","2012-05-05 09:46:08","Android set dynamic image on Imagebutton","<java><android><imagebutton>","3","0","","",""
"4157092","1","","","2010-11-11 17:08:45","0","1067","<p>I'm trying to turn a single page app into one with tabs. I've looked at various Googled solutions, but none work, and I can't find a 'Tabs - how they work' anywhere! One problem I have when using a 'Googled' answer is a null pointer exception on the Layout of main.xml.</p><p>Can anyone help/point me to a decent page?</p><p>My code is below.</p><p>Thanks,</p><p>Martin.</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:id=""@+id/LinearLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;EditText android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/edtICAO"" android:text=""    ""&gt;&lt;/EditText&gt;    &lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Brief!"" android:id=""@+id/btnBrief"" android:onClick=""btnBriefClick""&gt;&lt;/Button&gt;    &lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/btnHome"" android:text=""Home"" android:clickable=""true"" android:onClick=""btnHomeClick""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/btnChartList"" android:text=""Charts List"" android:onClick=""btnChartClick""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;ScrollView android:id=""@+id/ScrollView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;LinearLayout android:id=""@+id/LinearLayout02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical""&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Metar :"" android:id=""@+id/txtMetar""&gt;&lt;/TextView&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""TAF :"" android:id=""@+id/txtTAF""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;ScrollView android:id=""@+id/ScrollView01"" android:layout_width=""fill_parent"" android:fillViewport=""true"" android:isScrollContainer=""false"" android:scrollbarAlwaysDrawHorizontalTrack=""true"" android:scrollbarAlwaysDrawVerticalTrack=""true"" android:scrollbars=""horizontal|vertical"" android:visibility=""visible"" android:layout_height=""fill_parent""&gt;      &lt;TextView android:id=""@+id/txtNotam"" android:text=""NOTAM :""  android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:textColor=""@color/black"" android:background=""@color/white""&gt;&lt;/TextView&gt;    &lt;/ScrollView&gt;   &lt;/LinearLayout&gt;</code></pre>","1885069","","","","","2012-07-30 01:12:16","Getting Tabs (Tabhost) working","<android><tabs><android-tabhost>","3","1","","",""
"4157095","1","","","2010-11-11 17:09:27","0","1397","<p>I am developing an app with tabs. On one of the tabs,I have two EditText fields and a couple of buttons. I want to add an ExpandableListViewto the tab, below the rest of the elements. </p><p>My problem is that the current class extends Activity. All the example I've found extend ExpandableListActivity, but I can't extend both for the same class.</p><p>How can I add this list to the tab? I've added an ExpandableListView element in the XML file, but whenever I run it, it doesn't show up. I understand that I need to bind the view to some data, but how do I go about doing this?Thank you.</p><p>Here is my class code:</p><p>public class DirectionsTab extends Activity { private Button clear_btn; private Button go_btn; private EditText origin_txt; private EditText dest_txt;</p><p>public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.directions_tab);</p><pre><code>    // initialize views and onClick event handler    origin_txt = (EditText)findViewById(R.id.origin_txt);    dest_txt = (EditText)findViewById(R.id.dest_txt);    clear_btn = (Button)findViewById(R.id.clear_btn);    // clear all text fields and return focus to dest_txt    clear_btn.setOnClickListener(new OnClickListener()     { @Overridepublic void onClick(View v){ origin_txt.setText(""""); dest_txt.setText("""");  origin_txt.requestFocus(); }         });        } // end public void onCreate(Bundle savedInstanceState)</code></pre><p>} // end public class DirectionsTab extends Activity </p><p>and XML:</p><p>          </p><pre><code>&lt;TextView    android:id=""@+id/dest_lbl""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/origin_txt""    android:text=""Destination""/&gt;&lt;EditText    android:id=""@+id/dest_txt""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""@android:drawable/editbox_background""    android:layout_below=""@id/dest_lbl""/&gt;    &lt;ExpandableListView android:id=""@+id/listView""       android:layout_below=""@+id/dest_txt""  android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" </code></pre><p>/></p><p>        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/dest_txt""        android:layout_alignParentRight=""true""        android:layout_marginLeft=""10dip""<br>        android:layout_marginTop=""10dip""        android:text=""Clear""    />            android:layout_toLeftOf=""@id/clear_btn""        android:layout_alignTop=""@id/clear_btn""        android:text=""Go!""     /></p>","492407","","180740","","2011-09-03 21:44:39","2011-09-03 21:44:39","Add ExpandableListView to a tab with other elements","<android><tabs><expandablelistview><expandablelistadapter>","1","0","1","",""
"4157166","1","","","2010-11-11 17:17:27","1","163","<p>Can someone tell me if there is way to write an SQL query to get listof contact names from phonebook which matches its english name giventhat the phone language is set to Spanish.</p><p>E.g., If I write a query to get a contacts whose last name ends with""Dad"", but for some contacts the last name ""Dad"" will be stored as<strong>""papá""</strong> in <strong>Spanish</strong>.So the query where I write to match for lastname=""dad"" will not workas they are different characters. Is there a way in SQL which takescare of language translation as well while quering?</p><p>Appreicate your help!</p>","424296","","","","","2010-11-11 18:19:32","SQL Query support based on language settings in android","<sql><android>","2","0","","",""
"4157184","1","","","2010-11-11 17:19:05","15","6062","<p>I'm facing a huge problem developing an Android app which use a Webview to display datas. The website i'm using in the webview use localStorage API of HTML 5.</p><p>To enable this feature i've set the webview setting like this :</p><pre><code>webview.getSettings().setDomStorageEnabled(true);webview.getSettings().setJavaScriptEnabled(true);</code></pre><p>So the localStorage API works but when I close the app (and kill the process), localStorage is completly erased and when I reload it, all my datas are lost.</p><p>My question is simple : How to make DomStorage of a Webview persistant even when we close the app ?</p><p>Thank you for all you future answers.</p>","504821","","310574","","2012-04-26 04:26:33","2013-10-28 09:32:24","Android - Making Webview DomStorage persistant after app closed","<android><webview><local-storage><persistent>","5","4","5","",""
"4157228","1","4157612","","2010-11-11 17:23:34","1","1213","<p>I have the following /res/values/uris.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string name=""bladder""&gt;blahblah&lt;/string&gt;&lt;/resources&gt;</code></pre><p>I am accessing it in code:</p><pre><code>private String bladderUrl= getString(R.string.bladder);</code></pre><p>But it is returning null. I'm not sure why?</p>","19875","","19875","","2010-11-11 18:20:11","2010-11-11 18:20:11","NullPointerException trying to access a String resource","<java><android><xml><nullpointerexception><android-assets>","3","0","0","",""
"4157238","1","4157285","","2010-11-11 17:24:13","2","5410","<p>This isn't so much a programming question, but I'd like some advice.If I design an Android App that, assuming somebody uses, could provide a potenital life-saving service, should a put in a disclaimer absolving myself of any responsiblity for the users actions?</p><p>For example if my App provides a list of local hospitals, maybe with google maps too, and a pregnant woman decided to use my app, then ends up looking for a hospital to give birth, thats actually a warehouse or a bank (because my app messed up - quite badly in this case), I could imagine she might be annoyed with me.</p><p>Any advice? Thank you. (PS I'm not making an app like the example I mentioned. Or anything like that,. Just an example).</p>","485498","","","","","2013-10-29 15:21:18","Using a disclaimer on Android App","<android><legal><disclaimer>","2","1","1","",""
"4157394","1","4157495","","2010-11-11 17:36:35","2","3095","<p>I was just wondering, if I have an EditText that I'm turning the content of into a string, say</p><pre><code>String queryStr = new String(searchText.getText().toString());</code></pre><p>How would I go about escaping special characters from this string so that I could put it into an HttpGet method? Thanks!</p>","468498","","","","","2010-11-11 18:44:38","Escape string from EditText","<android><http><get><escaping><edittext>","4","0","","",""
"4157432","1","4157772","","2010-11-11 17:40:22","0","183","<p>I'm currently on my first Spinner. But I kinda got stuck during the onItemSelectedListener, since I cannot implement it. I first tried to follow the method of CommonWares book but it would work - but my method now doesn't work either.</p><p>At first I tried to let my activity implement the AdapterView directly - but the only consequence was that eclipse told me that the interface AdapterView is not available and asked me to create it ... however I got the very same error now again.</p><pre><code>public class Lunchplace extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mensa);    Context c = getApplicationContext();    Spinner dateSelection = (Spinner)findViewById(R.id.date);    //ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this, android.R.)    // get all the little tidbits of extra informations    Bundle extras = getIntent().getExtras();    String location = extras.getString(""Mensa"");    // this function will download the Lunchfile - if necessary    Data lunchData = new XMLData(c);    // set the header text    TextView mensaname = (TextView)findViewById(R.id.header);    mensaname.setText(location);    // get the spin view out of the xml    Spinner spin = (Spinner)findViewById(R.id.date);    // attach it to an adapter    ArrayAdapter adapter = ArrayAdapter.createFromResource(            this, R.array.days, android.R.layout.simple_spinner_item);    // I should be able to put a custom layout of the spinner in there.. I bet    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spin.setAdapter(adapter);    spin.setOnClickListener(             new  AdapterView.OnItemSelectedListener() {                      @Override           public void onItemSelected(AdapterView&lt;?&gt; parent,              View view, int position, long id) {           }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            // TODO Auto-generated method stub        }             }    );    // set the current day of the week as the default selection    spin.setSelection(Tools.getDayOfWeek());    // get the tablelayout    TableLayout tl = (TableLayout)findViewById(R.id.MenuTable);    lunchData.getMenuforDay(c,tl,location);    TextView counterTV = new TextView(c, null, R.style.MenuField);    }}</code></pre><p>Does anybody have any Idea on how I can solve that problem?</p>","498400","","197371","","2012-11-12 01:23:12","2012-11-12 01:23:12","AdapterView not found [Spinner]","<java><android><android-adapterview>","1","0","","",""
"4157724","1","","","2010-11-11 18:07:10","7","4390","<p>Is there a good way to add new image resources(from SD card) to a gallery widget at runtime?</p>","266578","","266578","","2010-11-11 20:07:33","2014-03-31 11:34:23","dynamically add pictures to gallery widget","<android>","1","2","3","",""
"4157880","1","","","2010-11-11 18:23:47","3","3090","<p>Is it possible to get the ip address from android app?</p>","371301","","166712","","2010-11-11 18:30:01","2011-06-27 08:58:06","Android: How can I get ip address from an android app?","<java><android>","3","0","2","",""
"4157908","1","4158042","","2010-11-11 18:26:29","2","705","<p>I've managed to get my allocations down to next to nothing using DDMS (great tool), this has drastically reduced my GCs to about 1 or 2 every 3 minutes. Still, I'm not happy because those usually cause a noticeable delay in the game (on some phones) when you interact with it.</p><p>Using DDMS, I know what the allocations are, they are Strings being converted from integers used to display game information to the HUD.</p><p>I'm basically doing this:</p><pre><code>int playerScore = 20929;String playerScoreText = Integer.toString(playerScore);canvas.drawText(playerScoreText, xPos, yPos);</code></pre><p>This happens once each frame update and the HUD system is modular so I plug things in when I need and this can cause 4 or 5 hud elements to allocate Strings and AbstractStringBuilders in DDMS.</p><p>Any way to reduce these further or eliminate all the String allocations and just reuse a String object?</p><p>Thanks,Albert Pucciani</p>","504894","","166712","","2010-11-11 18:49:20","2012-06-28 06:10:14","ANDROID How to reduce String allocations","<android>","3","3","1","",""
"4157945","1","4158257","","2010-11-11 18:29:54","0","906","<p>I can look up records by values and/or ID<br>I can add records<br>I can delete All records<br>I can delete a specific record (by either value or ID)  </p><p>But, the record ID only increments - it never adjusts to reflect the number of remaining records after deleting a record.</p><p>I haven't found anything on this subject (not even in the Doc's)</p><p>What/How do I do this?<br>Thanks<br>The declaration for this part of the db follows...  </p><pre><code>    String sql =         ""create table ""         + TABLE         + ""( "" + BaseColumns._ID        + "" integer primary key autoincrement, ""        + THE_NUMBER + "" integer, ""        + FAV_NAME + "" text not null);"";</code></pre>","382200","","135152","","2011-05-25 03:07:28","2011-05-25 03:07:28","Android SQLite - How To Update The Record ID Number After Deleting Records","<android><sqlite>","1","0","1","",""
"4157968","1","","","2010-11-11 18:33:09","8","1839","<p>I already published an <strong>android app</strong> where you can see a <strong>list of specific objects</strong> and detailed informations about them. The list changes every day but some of the objects can appear again.The application is communicating with a PHP server over HTTP and periodically pulls the list of objects.</p><p>I now plan to extend the app to make it possible to <strong>rate</strong> the objects and <strong>add a comment</strong> similar to how it is done in the android market. I'd like to avoid forcing the user to sign up for an account for being able to comment.</p><p>I see two problems:</p><ul><li>The comment-system could be abused by spammers</li><li>A comment could be added from another system</li></ul><p>So my questions are:</p><ul><li>How to protect the system from <strong>spam</strong>?</li><li>How to <strong>authenticate</strong> the application with the server?</li><li>How do I limit the <strong>number of comments</strong> to one per user and object?</li><li>What about the androids device id? Is it unique enough to use it as identifier for the user?</li><li>Which other problems do you see?</li></ul>","272802","","272802","","2010-11-11 18:59:45","2012-08-24 18:19:53","How to best add a comment/rating system to an android app","<android><comments><rating><rating-system>","4","0","3","",""
"4158068","1","4158452","","2010-11-11 18:46:59","0","3699","<p>I'm trying to create an application such that when I click on a button in the 1st layout, it will extract the text from an EditText and place that value into a TextView from the 2nd layout. However, it seems that the application will crash because of the setText for the TextView.</p><p>I didn't put the logCat as it doesn't tell much. I believe that the error comes from the setText part. But I have no idea on how to fix that part, or maybe that my way of coding is wrong. Hope that someone will help me. Thanks in advance.</p><pre><code>&lt;TextView android:id=""@+id/showtitle""    android:layout_marginTop=""1dip""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""15sp""    android:textStyle=""bold"" /&gt;&lt;TextView android:id=""@+id/showtemplate""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_below=""@+id/showtitle""    android:layout_alignLeft=""@+id/showtitle""    android:paddingBottom=""4dip""    android:includeFontPadding=""false""    android:textSize=""15sp""    android:textStyle=""normal"" /&gt;</code></pre><p>Below is my java code:</p><p>import android.os.Bundle;import android.view.View;import android.widget.TextView;import android.widget.EditText;import android.widget.Button;    import android.widget.Toast;</p><pre><code>import android.app.Activity;public class AndroidGroupSMS extends Activity{ private EditText title; private EditText template; private Button btnsave; private Button btnload; private TextView text,text2;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); title = (EditText) findViewById(R.id.title);    template = (EditText) findViewById(R.id.template);    btnsave = (Button) findViewById(R.id.save);    btnload = (Button) findViewById(R.id.load);    text = (TextView) findViewById(R.id.showtitle);    text2 = (TextView) findViewById(R.id.showtemplate);    btnsave.setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {    // TODO Auto-generated method stub       String sTitle = title.getText().toString();    String sTemplate = template.getText().toString();    if(sTitle.length() &gt; 0 &amp;&amp; sTemplate.length() &gt; 0)    {     //this is where i'm setting the text extracted from the edittext boxes     text.setText(sTitle.toString());     text2.setText(sTemplate.toString());    }    else     Toast.makeText(getBaseContext(),""Please enter the title and template"" + """", Toast.LENGTH_SHORT).show();        }  });       }</code></pre><p>I have no idea how to read this.Below is my logCat as requested:11-12 04:32:51.652: DEBUG/AndroidRuntime(283): >>>>>>>>>>>>>> AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;11-12 04:32:51.662: DEBUG/AndroidRuntime(283): CheckJNI is ON11-12 04:32:51.982: DEBUG/AndroidRuntime(283): --- registering native functions ---11-12 04:32:52.464: DEBUG/ddm-heap(283): Got feature list request11-12 04:32:53.092: DEBUG/AndroidRuntime(283): Shutting down VM11-12 04:32:53.102: DEBUG/dalvikvm(283): DestroyJavaVM waiting for non-daemon threads to exit11-12 04:32:53.102: DEBUG/dalvikvm(283): DestroyJavaVM shutting VM down11-12 04:32:53.102: DEBUG/dalvikvm(283): HeapWorker thread shutting down11-12 04:32:53.112: DEBUG/dalvikvm(283): HeapWorker thread has shut down11-12 04:32:53.112: DEBUG/jdwp(283): JDWP shutting down net...11-12 04:32:53.122: INFO/dalvikvm(283): Debugger has detached; object registry had 1 entries11-12 04:32:53.132: DEBUG/dalvikvm(283): VM cleaning up11-12 04:32:53.192: DEBUG/dalvikvm(283): LinearAlloc 0x0 used 629532 of 5242880 (12%)11-12 04:32:53.842: DEBUG/AndroidRuntime(291): >>>>>>>>>>>>>> AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;11-12 04:32:53.842: DEBUG/AndroidRuntime(291): CheckJNI is ON11-12 04:32:54.182: DEBUG/AndroidRuntime(291): --- registering native functions ---11-12 04:32:54.682: DEBUG/ddm-heap(291): Got feature list request11-12 04:32:55.302: DEBUG/dalvikvm(104): GC freed 2293 objects / 132304 bytes in 2157ms11-12 04:32:55.352: DEBUG/ActivityManager(52): Uninstalling process joel.AndroidGroupSMS11-12 04:32:55.362: DEBUG/ActivityManager(52): Force removing process ProcessRecord{43d9daf0 275:joel.AndroidGroupSMS/10024} (joel.AndroidGroupSMS/10024)11-12 04:32:55.401: INFO/Process(52): Sending signal. PID: 275 SIG: 911-12 04:32:55.492: INFO/UsageStats(52): Unexpected resume of com.android.launcher while already resumed in joel.AndroidGroupSMS11-12 04:32:55.512: INFO/WindowManager(52): WIN DEATH: Window{43cf7840 joel.AndroidGroupSMS/joel.AndroidGroupSMS.AndroidGroupSMS paused=false}11-12 04:32:55.592: INFO/ActivityManager(52): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=joel.AndroidGroupSMS/.AndroidGroupSMS }11-12 04:32:55.612: DEBUG/ActivityManager(52): Received spurious death notification for thread android.os.BinderProxy@43bc837011-12 04:32:55.652: DEBUG/AndroidRuntime(291): Shutting down VM11-12 04:32:55.652: DEBUG/dalvikvm(291): DestroyJavaVM waiting for non-daemon threads to exit11-12 04:32:55.662: DEBUG/dalvikvm(291): DestroyJavaVM shutting VM down11-12 04:32:55.662: DEBUG/dalvikvm(291): HeapWorker thread shutting down11-12 04:32:55.672: DEBUG/dalvikvm(291): HeapWorker thread has shut down11-12 04:32:55.672: DEBUG/jdwp(291): JDWP shutting down net...11-12 04:32:55.672: INFO/dalvikvm(291): Debugger has detached; object registry had 1 entries11-12 04:32:55.672: DEBUG/dalvikvm(291): VM cleaning up11-12 04:32:55.732: ERROR/AndroidRuntime(291): ERROR: thread attach failed11-12 04:32:55.832: DEBUG/dalvikvm(291): LinearAlloc 0x0 used 639500 of 5242880 (12%)11-12 04:32:55.952: INFO/ActivityManager(52): Start proc joel.AndroidGroupSMS for activity joel.AndroidGroupSMS/.AndroidGroupSMS: pid=298 uid=10024 gids={1015}11-12 04:32:56.062: WARN/InputManagerService(52): Got RemoteException sending setActive(false) notification to pid 275 uid 1002411-12 04:32:56.392: DEBUG/ddm-heap(298): Got feature list request11-12 04:32:56.592: WARN/ActivityThread(298): Application joel.AndroidGroupSMS is waiting for the debugger on port 8100...11-12 04:32:56.642: INFO/System.out(298): Sending WAIT chunk11-12 04:32:56.691: INFO/dalvikvm(298): Debugger is active11-12 04:32:56.872: INFO/System.out(298): Debugger has connected11-12 04:32:56.882: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:57.082: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:57.282: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:57.483: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:57.692: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:57.893: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:58.092: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:58.300: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:58.502: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:58.707: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:58.912: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:59.112: INFO/System.out(298): waiting for debugger to settle...11-12 04:32:59.322: INFO/System.out(298): debugger has settled (1361)11-12 04:33:00.792: INFO/ActivityManager(52): Displayed activity joel.AndroidGroupSMS/.AndroidGroupSMS: 4860 ms (total 4860 ms)11-12 04:33:02.942: WARN/KeyCharacterMap(298): No keyboard for id 011-12 04:33:02.952: WARN/KeyCharacterMap(298): Using default keymap: /system/usr/keychars/qwerty.kcm.bin11-12 04:33:04.592: DEBUG/dalvikvm(99): GC freed 481 objects / 24704 bytes in 185ms</p>","504864","","504864","","2010-11-12 04:34:30","2012-01-16 16:10:35","textview keeps crashing while trying to setText","<android>","3","6","","",""
"4158351","1","4169824","","2010-11-11 19:18:10","4","906","<p>I'm configuring emacs to debug android apps. My problem is since I'm attaching jdb to DDMS I cannot set proper classpath (jdb just won't start when I try to set -classpath and -attach  together). So jdb is practically blind - no entry point for class, no interactive debugging. How can I specify classpath when attaching debugger to ddms?</p>","480307","","480307","","2010-11-12 10:45:04","2010-11-12 23:03:25","Android app debugging with command line jdb","<android><emacs><jdb>","1","2","1","",""
"4158354","1","4159311","","2010-11-11 19:18:20","3","1207","<p>I have run my android app against the new build target provided by the add-on mentioned <a href=""http://innovator.samsungmobile.com/galaxyTab.do"" rel=""nofollow"">here</a>. This appears to be working correctly in the emulator, but now I am very unsure as to the implications of using this build target when delivering an app to the marketplace.</p><ol><li><p>It would appear that I have to use this build target to get the emulator to work. Is this true of the device in general? (i.e.) could I build against the standard android/google APIs and have it run correctly on the actual Galaxy Tab?</p></li><li><p>If I deploy an app with this build target to the Android market, will this adversely affect other (smaller screen) devices that I already run on? (I.e. is the galaxy tab ""special sauce"" a superset of Android functionality? I see grumbles about the Google APIs for maps not working in it, etc.)</p></li><li><p>Will i have to have two versions of my app in the market? One for ""standard"" devices and one for ""large"" screen devices? One for the Galaxy Tab specifically?</p></li><li><p>When Android Tablet vNext (whatever that may be) comes out and has its own custom add-on and build target, will I have to clone my repository and publish/maintain a device specific version of that (presuming that any add-on special sauce for the galaxy tab will not be in vNext's add on and will not be ""compatible"")</p></li></ol><p>What I am driving at is that I can't find reliable documentation on how an add-on like this will affect the fragmentation of my app deployment and maintenance. I want to be able to support new Android devices like the Galaxy Tab, but I don't want to be building a bunch of one-off device-specific app implementations. Isn't the point to be able to have one app work on the gamut of devices?</p><p>Thanks in advance for any insight you might have on the situation.</p>","8668","","","","","2010-11-11 21:31:45","How will using the Samsung Galaxy Tab Add-on affect/fetter my Android Market deployments?","<android><add-on><google-play><tablet>","2","1","","",""
"4158663","1","4158941","","2010-11-11 19:51:04","1","902","<p>There are list adapter:</p><pre><code>public class timetable_list_adapter extends BaseAdapter {...}</code></pre><p>and dynamic added lists:</p><pre><code>timetable_list_adapter adapter = new timetable_list_adapter(getApplicationContext(), eventList);week_day_list.setAdapter(adapter);</code></pre><p>list element is TableLayout</p><pre><code>&lt;TableLayout </code></pre><p>xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/item_root_table""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:stretchColumns=""2""></p><p>In result application height of ListViews is wrong.I try to set heigh:</p><pre><code>enter code hep = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT , ViewGroup.LayoutParams.MATCH_PARENT); TableLayout tl = (TableLayout)findViewById(R.id.item_root_table); p.height = 60 * eventList.size(); // INFO: change it after list_itemre</code></pre><p>It works, BUT! on other screen(smaller then mine) lists too big. What should I do? </p>","499393","","","","","2010-11-11 20:27:39","ListView height (actual)","<android><listview>","1","1","","",""
"4158785","1","4158902","","2010-11-11 20:07:17","2","1663","<p>sometimes I need to provide a Context object to call specific functions, such as </p><pre><code>Intent intent = new Intent(context, MyClass.class);</code></pre><p>in order to start a service</p><pre><code>context.startService(intent);</code></pre><p>Or, provide a Context object to do a query</p><pre><code>Cursor cursor = context.managedQuery(uri, projection, null, null, null);</code></pre><p>If this is done in a UI class which extends Activity, that's fine.However, If I want to create my own utility class (a singleton) that doesn't extend anything and call these functions, I don't have necessary Context object. Now my workaround is to pass an activity reference while initializing the utility class and have that reference to call those functions. I'm wondering what's the correct way to do that. It should not be reasonable to have every class to extends Context so that it can call those functions. Thanks a lot!</p>","322896","","","","","2010-11-11 21:44:27","How to provide Context to call necessary functions in my own utility class","<android><activity><android-intent><context>","2","0","1","",""
"4158828","1","4402159","","2010-11-11 20:13:44","0","2775","<p>Oi, estou criando uma aplicação que usa um android para se enviar e receber dados via bluetooth. mas estou com problemas na hora de criar o socket. Ele fica travado nessa linhammSocket = btserver.accept();E não consigo parear nenhum dispositivo.</p><p>Tenho outra duvida, eu posso fazer essa comunicação com um android e um symbian??</p><hr><p>Hi, I'm creating an application that uses an android to send and receive data via bluetooth. but I'm having problems when creating the socket. He gets caught in that line mmSocket btserver.accept = (); And I can not pair with any device.</p><p>I have another doubt, I can make that communication with an android and a symbian?</p>","476378","","1228","","2010-11-11 21:15:56","2010-12-09 19:20:13","Bluetooth socket connection","<android><bluetooth>","2","0","","",""
"4158931","1","4160285","","2010-11-11 20:26:23","0","339","<p>I am writing an Android application that uses <em>some</em> functionality that has been published under the Apache 2.0 license. The functionality is available in 2 ways:</p><ol><li>As java code</li><li>As an intent in an Android application. </li></ol><p>Being the <em>typical</em> developer that I am, I don't want to make the user install a separate application so that they can use my own application - because it would definitely put <em>me</em> off using the application if I had to.</p><p>On the other hand, doing the work to get the application up and running using the Java code will take much longer.</p><p>My questions are thus:</p><ol><li>What are most developers doing now? Are they using intents from other apps?</li><li>Does it matter to the average consumer that they need to download a separate application to make it work?</li></ol>","432041","","","","","2010-11-11 23:27:40","Use an intent from another Android application or use code?","<android><android-intent>","3","0","","",""
"4158958","1","","","2010-11-11 20:29:41","3","467","<p>Hi   Is it possible to invoke an Android App from a Web Page that i am displaying on the phone browser to the user. I know that this is possible from an another Android App using Intents. But i am not sure if this is possible from a WebPage.</p><p>Thanks in advance.</p>","505017","","","","","2010-11-11 20:37:27","Invoke an Android App from a WebPage","<android>","2","0","2","",""
"4159117","1","4708032","","2010-11-11 20:46:26","9","13493","<p>A month ago I started working with phonegap, html5, css3 and jQtouch.I am working on an application and I need to play sound in the application. I have a serious problem with this task.First I've found out that I can play .mp3 files through phonegap using the new Media(...) function. I am not sure about .wav files, can I play those?Second I've found that files must be less than 30 sec, is this so?Third I can't find the right place for my sound files. My project structure is the following: </p><pre><code>project-- src-- gen-- assets-- -- www-- -- DANCE.mp3-- -- jqtouch-- -- -- (some folders and files)-- -- phonegap.js-- libs-- res</code></pre><p>I've tried placing the file in 'www' folder and creating a new one called 'audio'. None of this gave me what I wanted.I am using this code for executing the song:</p><pre><code>function playStream() {    mp3file = new Media(""DANCE.mp3"",            function() {                alert(""playAudio():Audio Success"");            },                function(err) {                    alert(err);            }            );          mp3file.play();}</code></pre><p>I use Android 2.1 Simulator and I've tried 2.2 as well without success.I hope I was clear enough.I am looking forward to hearing from you.Yours,Mihail Velikov</p>","505010","","703019","","2012-03-04 10:13:38","2012-05-28 01:06:00","How to play song in Android - phonegap","<javascript><android><music><phonegap>","4","0","7","",""
"4159193","1","","","2010-11-11 20:55:47","0","3903","<p>i have just gone through making some basic apps on android and was wonderinghow to get graphics on the screen....and how to go about developing something like the tom cat application first and then go onto games...could you'll plz point me in the right direction as to how to approach this...and wat all it requires?</p>","502310","","","","","2010-11-11 21:20:00","how to develop graphics in android application","<android><graphics>","3","0","","",""
"4159211","1","4159260","","2010-11-11 20:59:33","29","15646","<p>My question is almost exactly this question:</p><p><a href=""http://stackoverflow.com/questions/3900044/clone-textview-to-append-it-to-a-viewgroup"">Clone textview to append it to a ViewGroup</a></p><p>However, I was inflating a view, and then attempting to clone it at the object level for performance reasons (I don't want to parse XML every single time), so that answer doesn't help me. View.clone() is protected and it apparently doesn't have a copy constructor. Is there any way to do this?</p>","210920","","","","","2013-04-02 10:32:10","How do I clone a View?","<android><view><copy><clone>","1","5","2","",""
"4159250","1","4159319","","2010-11-11 21:03:57","0","325","<p>I can not really figure how to change my home wallpaper from either resource or a URL.Whould really apprieciate if you tell me or send a link to a new developer :)</p><p>//from me to you</p>","502419","","","","","2010-11-11 21:12:04","Android Development: setWallpaper from resource and web","<android>","1","0","","",""
"4159322","1","4159355","","2010-11-11 21:12:47","1","734","<p>I have overridden the finish call in a sub-activity like so</p><pre><code>   @Override   public void finish()    {      Log.e(this.toString(), ""======== finish ========"");       if(!this.exiting)      {         Log.e(this.toString(), ""======== set RESULT_OK ========"");          // Notify the caller Activity that the user successfully         // edited or inserted the data set         setResult(RESULT_OK);      }      else      {            Log.e(this.toString(), ""======== set RESULT_CANCELED ========"");          // Notify the caller Activity that the user has canceled the         // activity without altering anything         setResult(RESULT_CANCELED);      }      super.finish();   } </code></pre><p>I am calling finishActivity on this sub-Activity from the Activity that started it for result.  But I am not seeing the finish being hit.  Instead it goes directly to onPause.</p>","418714","","","","","2010-11-11 21:20:15","Android - shouldn't calling finishActivity cause finish to be called?","<android><activity>","2","2","","",""
"4159337","1","4159512","","2010-11-11 21:14:55","1","3146","<p>I have a TableLayout with 3 TableRows, each TableRow has 3 ImageViews. Each ImageView has fitCenter for Scale type, and a weight and width per this stackoverflow <a href=""http://stackoverflow.com/questions/2865497/xml-table-layout-two-equal-width-rows-filled-with-equally-width-buttons/2865558#2865558"">answer</a>. Now all the images scale to fit into the row, but each row is way taller then it needs to be. Here's an excerpt of the xml:</p><pre><code>&lt;TableLayout android:id=""@+id/TableLayout01""android:layout_height=""wrap_content""android:padding=""10dip""android:stretchColumns=""0,1,2""android:shrinkColumns=""0,1,2""android:layout_weight=""1""android:layout_width=""wrap_content""&gt;    &lt;TableRow android:id=""@+id/TableRow01""    android:layout_width=""fill_parent""    android:layout_gravity=""center_vertical|center_horizontal""    android:baselineAligned=""false""    android:gravity=""center_vertical|center_horizontal""    android:layout_height=""wrap_content""&gt;        &lt;ImageView android:id=""@+id/image1""        android:src=""@drawable/avocado3""        android:scaleType=""fitCenter""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""wrap_content""/&gt;        &lt;ImageView android:id=""@+id/image2""        android:src=""@drawable/avocado3""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""wrap_content""        android:scaleType=""fitCenter""/&gt;        &lt;ImageView android:id=""@+id/image3""        android:src=""@drawable/avocado3""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""wrap_content""        android:scaleType=""fitCenter""/&gt;    &lt;/TableRow&gt;...&lt;/TableLayout&gt;</code></pre><p>And here's the first row:</p><p><img src=""http://i.stack.imgur.com/d4wXV.png"" alt=""first row""></p><p>And the end of the first row and start of the second:</p><p><img src=""http://i.stack.imgur.com/vX42L.png"" alt=""second row""></p><p>The ImageViews are set to a drawable that is small (@drawable/avocado3), and in the activity's onCreate() it fetches 9 images from the internet and calls setImageBitmap().</p><p>Anyone have any ideas on what I'm doing wrong?</p>","482494","","","","","2010-11-11 21:35:24","TableRow heights getting blown out","<android><imageview><tablelayout><tablerow>","1","0","","",""
"4159387","1","4159790","","2010-11-11 21:22:27","1","519","<p>I have an ActivityInstrumentationTestCase2 (which is a subclass of InstrumentationTestCase).  When running my testcases, I need to launch my activities using a custom TestApplication object, since this TestApplication objects has some configuration necessary for my tests.</p><p>However, I don't see a way to customize my ActivityInstrumentationTestCase2 testcases to use the test Application object.  Is there a way to do so?</p>","82156","","225647","","2012-01-01 23:48:37","2013-12-02 13:21:16","Using a custom Application with InstrumentationTestCase","<android><testing>","2","0","2","",""
"4159671","1","4160402","","2010-11-11 21:58:11","1","688","<p>I'm just getting started with mobile development, and after considerable searching I'm still confused about sending a message from my iPhone to another or an Android.  For instance, in building a simple Tic-Tac-Toe game, if I want to notify the other phone of a move, what is the best way to do so?  Wifi, bluetooth, 3G? And how?</p><p>Many methods seem to point to communicating through a web server, but I'd rather send them directly from phone to phone if possible.  (this is for native apps of course)</p>","451588","","","","","2010-11-12 01:58:57","How can I send simple data from an iPhone to another iPhone, or an Android?","<iphone><android><communication>","4","0","0","",""
"4159829","1","4231181","","2010-11-11 22:19:47","2","636","<p>Will you guys tell me whether or not this solution will work before I spend a lot of time learning/researching KML?  (It looks like I need to learn it at some point, but I have a deadline to meet, first.)</p><p>Background - I need to plot 1662 points on a map that fall into 7 categories.  I would like to show all, as well as filter/show only categories that the user chooses.</p><p>My first attempt at this used the Google Maps API.  I created GeoPoints, added them to an ItemizedOverlay, and then added the ItemizedOverlay to the map.  That works great for a few points.  100 points only took 3 seconds.  By the time I got up to 400 points, things really started to slow down (like 30 seconds or so).  I loaded all 1662, and it took 15 minutes!</p><p>1)  Why does this take so long?  Does the API make a call to Google Maps for each point?</p><p>2)  I found KML as a possible alternative.  How well does KML scale?  Will it be able to plot and load 1600+ points?  If not, can you recommend another solution?</p><p>3)  How do you recommend I go about filtering my categories?  Currently, I plan on loading each category to a layer.  I found references to hiding/showing layers, so I'm going to try to do that.  Is this a good approach?</p><p>4)  How can I add buttons?  Can/should I add them to an overlay?  If not, is it possible to have the map open in a MapView and then control the filter/show with Android Buttons?</p><p>I'm sorry if my questions sound basic.  I will continue researching and learning on my own.  However, I want to know whether or not my solution will work at all before I waste another week going down another dead end.</p><p>Thanks in advance!  :)</p>","359519","","","","","2010-11-20 04:16:45","KML scalability? Use KML to show and filter 1600+ points in Android?","<android><google-maps><kml>","1","0","","",""
"4159859","1","","","2010-11-11 22:22:42","1","338","<p>Is there any possibility to set the week number of the year (1-53) for a android.text.format.Time Object ?</p><p>I didn't find any, so would I have to use the java.util.Calendar class instead? Isn't it better to take Time because of performance reasons when doing complex calculations?</p>","474326","","13793","","2012-04-30 23:44:35","2012-04-30 23:44:35","Setting week number of year for Android Time Object","<android><time><calendar><week-number>","0","2","","",""
"4159916","1","","","2010-11-11 22:29:49","1","1498","<p>I am trying to parse a rather large XML file - 1MB+, but I am having some difficulties.I first tried to add the xml file to the res/xml and parse it with the XmlResourceParser, but I got an exception saying ""Data exceeds UNCOMPRESS_DATA_MAX"". After a bit of research I found out that the compressed files have to be uncompressed in memory before reading and that this restriction doesnt apply for raw files.However when trying to parse the xml file from the res/raw folder with the SAXParser, I get an IOException, without any message and stacktrace:</p><pre><code>SAXParserFactory spf = SAXParserFactory.newInstance();SAXParser sp = spf.newSAXParser();XMLReader xr = sp.getXMLReader();xr.setContentHandler(myXMLHandler);InputSource src = new InputSource(stream);xr.parse(src); // IOException</code></pre><p>From what I understand those memory restrictions do not apply to raw resources, but what is causing this exception then?</p><p>Here is the stacktrace from logcat:</p><pre><code>11-11 23:47:50.729: WARN/System.err(4886): java.io.IOException11-11 23:47:50.739: WARN/System.err(4886):     at android.content.res.AssetManager.readAsset(Native Method)11-11 23:47:50.749: WARN/System.err(4886):     at android.content.res.AssetManager.access$800(AssetManager.java:36)11-11 23:47:50.759: WARN/System.err(4886):     at android.content.res.AssetManager$AssetInputStream.read(AssetManager.java:542)11-11 23:47:50.759: WARN/System.err(4886):     at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:504)11-11 23:47:50.769: WARN/System.err(4886):     at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467)11-11 23:47:50.779: WARN/System.err(4886):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:329)11-11 23:47:50.790: WARN/System.err(4886):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:286)</code></pre>","131897","","131897","","2010-11-11 22:50:18","2012-08-07 14:25:13","Parsing large XML files in Android","<android><xml><sax>","1","4","","",""
"4159959","1","4161664","","2010-11-11 22:35:46","8","7811","<p>Is there a way to draw a circular gradient mask on a bitmap in Android?  Trying to produce something similar to a foggy window.  Click the window and a transparent circle shows up revealing whats behind the window. Prefferably using a gradient so the center of the circle is completely transparent and the further out from the center the less transparent. Is this possible?</p><p>I'm new to Android so any code samples would be appreciated.</p><p>Thanks. </p>","494249","","","","","2010-11-12 04:40:12","Android Circular Gradient Alpha Mask","<android>","1","0","10","",""
"4160037","1","4162190","","2010-11-11 22:47:01","0","884","<p>I can't get the adb to run. From the dos line when I type adb I get ""error: write failure during connection. I'm running Motodev's eclipse (probably Ganymede or Galileo) on windows XP. I've reinstalled eclipse and android three times from an administrator's account, and I've removed all virus software from the computer.</p><p>The complete error dump is:</p><p>_adb_connect: host:version   socket_loopback_client: port 5037 type tcp => fd 100   writex: 100 0022BB57 4:  30303063  000c   _socket_set_errno: unhandled value 10022   writex 100 -1 Invalid argument   adb_close: 100(lo-client:5037)   error: write failure during connection</p><p>any ideas as to what's stopping adp?</p>","493998","","","","","2013-11-27 04:14:27","android adb won't start","<android>","3","0","","",""
"4160132","1","","","2010-11-11 23:01:49","0","128","<p>I have to store informations about the user, should I user SQL lite or preferances?</p><p>If I use SQLlite, will the data dissaper when the app is shut down or telefon? Cause I need them to be saved whenever he opens the app. </p>","371301","","236247","","2011-06-27 04:11:24","2011-06-27 04:11:24","Android: Store in prefernces or SQLite","<android>","2","0","","",""
"4160149","1","","","2010-11-11 23:05:22","5","20967","<p>I'm trying to figure out how to draw on a bitmap in android, and keep a copy of these changed bitmaps for an undo function.</p><pre><code>Bitmap b = ...Paint p = new Paint();canvas.drawBitmap(b, new Matrix(), null);canvas.drawCircle(0,0,20,20);//does Bitmap b have the circle drawn on it next time?</code></pre><p>Or how do I get the bitmap after its been drawn on with the canvas(I want to preserve a stack of bitmaps with the changes applied by canvas drawing)? Maybe I'm going about this entirely wrong.</p>","266638","","","","","2012-12-14 20:43:18","How to draw on Bitmap in android?","<android><canvas><bitmap>","1","0","","",""
"4160199","1","8942004","","2010-11-11 23:13:45","3","6058","<p>xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/myWebView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;</code></pre><p>java</p><pre><code>public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.webview);  WebView webView = (WebView) findViewById(R.id.myWebView);    webView.getSettings().setJavaScriptEnabled(true);     webView.loadUrl(""http://www.google.com""); }</code></pre><p>tabview 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""        android:padding=""5dp""&gt;        &lt;TabWidget android:id=""@android:id/tabs""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Tabview java</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.tabview);        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, WebActivity.class);        spec = tabHost.newTabSpec(""webview"")                .setIndicator(""webview"", res.getDrawable(R.drawable.info))                .setContent(intent);        tabHost.addTab(spec);                // add other tabs        tabHost.setCurrentTab(0);    }</code></pre><p>This will launch a webView in full screen.<br>Is it possible to display webview inside the tabview?</p>","432056","","432056","","2010-11-12 15:37:05","2012-01-20 13:16:11","Android: How do you display Webview inside Tabview?","<android><webview>","2","0","","",""
"4160208","1","4160310","","2010-11-11 23:15:24","0","354","<p>I want to evenly space a vertical row of images in a ScrollView.</p><p>I'm telling my <code>LinearLayout</code> inside the <code>ScrollView</code> to <code>fill_parent</code>, but it's not, it's wrapping content. </p>","413414","","","","","2010-11-12 00:29:40","Android: How do I evenly space images in a ScrollView?","<android><scrollview>","1","2","","",""
"4160217","1","","","2010-11-11 23:16:44","1","653","<p>is there any simple library for managing contacts on Android platform for 1.x and 2.x?</p><p>I have found <a href=""http://code.google.com/p/contactslib/"" rel=""nofollow"">http://code.google.com/p/contactslib/</a> but it's not for 1.x.</p><p>tnx in advance.</p>","505160","","","","","2010-11-11 23:25:42","Android Contacts simple library?","<java><android><contacts>","1","0","1","",""
"4160240","1","","","2010-11-11 23:20:49","1","615","<p>Hi I am trying to connect to a MSMQ from an Android phone. The problem is that all the libraries that I seem to find have to run in Windows since they appear to just be wrappers around C libraries (""DLL""). I found J-Integra but it seems like a very messy non-open source solution. Anybody has any ideas? </p><p>And does anybody know of a server in linux to host queues that I can install for testing?</p><p>Thanks</p>","505162","","","","","2010-11-12 00:31:33","How do I connect to MSMQ (Microsoft Messaging Queue) from Android?","<android><msmq>","2","0","","",""
"4160286","1","","","2010-11-11 23:27:46","1","54","<p>I'm not quite sure where to turn for this one. I have been in touch with the developers who have no clue why this is happening.</p><p>Basically, I'm a consumer with an HTC Wildfire running Android 2.1. I connect via Orange in the UK. The app I'm after is Gizmo or Gizmote from a company called JRiver. Its an extension to their Media Centre software.</p><p>Problem is, when I search for the app on the market from the phone, any results that are returned is nothing to do with the app I'm after. I only get a few results from Gizmo and nothing for Gizmote. So far, no other users have experienced this issue from the JRiver forums. </p><p>Apparently the app should be compatible with 2.1 so I have no idea why it doesn't even show up. Can anyone throw any pointer on this?</p>","505174","","1104926","","2011-12-19 14:11:05","2011-12-19 14:11:05","Missing application (gizmo, gizmote) when searching the Android market from an HTC Wildfire","<android>","0","1","","",""
"4160504","1","","","2010-11-12 00:09:43","3","2003","<p>I need to be able to play a video received over RTSP AND save it to disc (well, the SD card) at the same time. This is a live stream, so I cannot download the entire file first and then play it. I must play and record simultaneously. I can record video from the on board camera using MediaRecorder, and I can receive an RTSP stream using MediaPlayer or VideoView, but I don't know how to combine the two.</p><p>MediaRecorder seems to be the only way to record video, but it only supports one video source: the camera. Its setVideoSource() method allows no other sources. Perhaps I need to get an OutputStream somehow, which I can then write to a file?</p><p>Thanks for any help.</p>","472737","","","","","2012-06-27 10:44:17","In android how can I save an RTSP stream to file while playing it?","<android><media-player><rtsp>","1","0","1","",""
"4160661","1","7070894","","2010-11-12 00:40:00","4","6009","<p>I've downloaded a utility called PrintShare which allows one to print things like web pages, contact lists, calendars, etc to a printer connected through wireless or a computer participating on the PrintShare network.</p><p>I would like to have my Android app create a text file, then send that text file to a printer that is shared with PrintShare. </p><p>Is there an API for printing on Android?</p><p>ThanksMike</p>","490698","","","","","2013-01-23 10:44:27","Printing API in Android","<android><printing>","3","0","","",""
"4160737","1","","","2010-11-12 00:59:23","0","259","<p>Im new to programming, so bear with me. After following a couple of tutorials i made an SMS application, i want to do an specific task when a specific text is received, i do this by comparing the text received to a value(code) that i already declared. The problem is that this condition never ocurrs.</p><hr><pre><code>public class SmsReceiver extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)     {        //---get the SMS message passed in---        Bundle bundle = intent.getExtras();                SmsMessage[] msgs = null;        String str = """";        String code = ""blue"";        String conf = ""Ok"";        String inv = ""Invalid"";    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 = msgs[i].getMessageBody().toString();            //n = Integer.parseInt(str);        }        if (str == code)          Toast.makeText(context, conf, Toast.LENGTH_SHORT).show();         else             //str = Integer.toString(n);            //Toast.makeText(context, str, Toast.LENGTH_SHORT).show();          Toast.makeText(context, inv, Toast.LENGTH_SHORT).show();    }   }</code></pre><p>}</p><p>When I send the message it always displays the inv variable (Invalid). I tried to change the ""code"" variable to an integer, and then parse the string so I could compare it; in this scenario it did work, but whenever I received a string message the application crashes. I think it should be a simple thing, but since i don't fully understand java i can't figure it out.I hope you could provide me with some guidelines or suggestions about what could i do.Thanks in advance.</p>","505228","","","","","2010-11-12 03:14:12","Can't compare received SMS text to value in Android","<java><android><sms>","2","0","0","",""
"4160748","1","","","2010-11-12 01:01:05","0","916","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1461598/what-is-the-point-of-setters-and-getters-in-java"">What is the point of setters and getters in java?</a>  </p></blockquote><p>I have a question about set method. Please provide some details if possible.I want to know why do we use set method with class name.</p><pre><code>public class Mymainclass {Private class ClassC {Private Mysecondclass sec = null;public void setMymainclass(Mysecondclass second){        Mymainclass.sec= second;     }   }}</code></pre><p>Is it just setting the sec variable value ? if yes why there is class name with set? </p>","367121","","367121","","2010-11-12 16:42:03","2010-11-12 16:42:03","why we use set method","<java><android><oop><getter-setter>","4","3","","2010-11-12 02:48:11",""
"4160755","1","","","2010-11-12 01:03:05","13","2121","<p>I'm writing tests for an activity (my test class extends ActivityInstrumentationTestCase2), I've got some basic tests written and working fine.</p><p>However my activity when it completes returns extra data to the calling activity via setResult(resultcode, Intent i) What I'd like to do using instrumentation get my activity to finish, then check what it passed in the setResult call.</p><p>Is there some framework provided way of doing this? i haven't been able to find anything yet, one approach would be to subclass the activity class and override setResult to have it remember &amp; expose what was passed to setResult (turns out setResult is final, so you can't do this either), it seems like there should be a better way.</p>","41455","","41455","","2010-11-12 03:41:20","2012-01-24 17:10:44","testing that an activity called setResult","<android><unit-testing><testing><activity>","3","0","4","",""
"4160880","1","","","2010-11-12 01:28:17","0","927","<p>I want to add some buttons on top of the soft keyboard (Enter and Cancel). Is there a nice way to do this or do I have to detect the keyboard being shown and add the buttons into my view?</p>","304795","","21234","","2010-12-11 11:19:15","2010-12-11 11:19:15","android add buttons on top of softkeyboard","<android><view><android-softkeyboard>","2","0","","",""
"4160890","1","4162173","","2010-11-12 01:30:39","0","271","<p>Iam connection to services trougth my app, I woul like to check if the connections gets broken, alert a message than. </p><p>Or is this taken carre of in android? If not, How should I take care of it? is there a timer? </p>","371301","","","","","2010-11-12 06:27:38","Android: Using service, check if connection get broken","<android><wcf>","1","0","","",""
"4161064","1","7934538","","2010-11-12 02:15:00","0","336","<p>The problem is really that specific.</p><p><strong>I need a library in java that can take HTML content and generate text in the same format that is generated by the Linux lynx program.</strong></p><hr><p>I need to expose data provided by 3rd party servers to end users on Android. Data format is ancient, in badly formatted HTML, so much that I've tried reading it using java and it fails occasionally (unacceptable). It is also growing every month (preinstall ruled out) and I can't convince them to change to ""modern"" stuff (life would be great in XML etc.).</p><p>Shortest route: I wrote a class to use the W3 html2txt service online (google search it). It worked fine on the app until I got complains and noticed that the W3 service fails occasionally. It's not that big of a deal, but the black box logic expects the output to be in this ""lynx like"" text format.</p><p>So I would like a library to do the conversion (HTML->TXT) in ""lynx style"" inside the app and avoid the outages in the W3 service. And besides, the lynx output the probably the best I've seen, the most organized and neat.</p><p><strong>Are you guys aware of any?</strong></p>","489607","","918414","","2012-06-30 02:41:30","2012-06-30 02:41:30","HTML to TXT library that mimics the output of ""lynx -dump""?","<java><html><android><html-parsing><lynx>","2","0","0","",""
"4161102","1","4161375","","2010-11-12 02:25:08","2","826","<p>I am developing my first app on the G1, with firmware 2.2, and my code crashes on the emulator and on the phone when I try to run it.</p><p>I have the following:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Prepare recorder source and type    recorder = new MediaRecorder();    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);</code></pre><p>The code will crash on the last line, when trying to execute recorder.setAudioSource(MediaRecorder.AudioSource.MIC).</p><p>After a few Google searches, it seems like a lot of people are having this problem but I cannot find any solutions for it!</p><p>Does anyone know why this is happening and how to fix it please?</p><p>I would really appreciate it,</p><p>Thank you,</p><p>Jary</p>","505281","","","","","2010-11-12 03:27:54","Android: Using MIC (via setAudioSource) crashes","<android><audio><media>","1","0","","",""
"4161256","1","4161645","","2010-11-12 03:00:11","61","62199","<p>I have been unable to find a solution for this.</p><p>What I'm trying to do: I have preferences where you can enable/disable what items will show up on the menu.  There are 17 items.  I made a string array in values/arrays.xml with titles for each of these 17 items.</p><p>I have preferences.xml which has the layout for my preferences file, and I would like to reference a single item from the string array to use as the title.</p><p>How, if it's possible, can I do this?</p><p>In the Android developer reference, I see how I can reference a single string with XML, but now how I can reference a string from an array resource in XML.</p><p>Thanks</p>","475901","","","","","2010-11-12 04:47:34","Android - reference a string in a string array resource with xml","<android><xml><reference><preferences><string-array>","3","0","17","",""
"4161285","1","4161325","","2010-11-12 03:05:22","1","1310","<p>I have a method in a client class that gathers data from a server, and returns a HashMap. I want to list the keys in an android dialog. The android API requires that the data must be in in the form of a CharSequence[]. So far as I can tell, there is no direct way to convert these data types. What would be the best way to accomplish this?</p><p>Here is the declaration and initialization of the hashmap and keyset:</p><pre><code>Map &lt;String, String&gt; players = client.listPlayers();Set&lt;String&gt; player_names = players.keySet();</code></pre><p><a href=""http://developer.android.com/guide/topics/ui/dialogs.html"" rel=""nofollow"">And here is the link to the android Dialog documentation.</a></p><p><strong>Note:</strong> CharSequence, which is able to be casted from a Set is not the same as CharSequence[]</p><p>Any help is appreciated.</p><p>-Sean W.</p>","501333","","501333","","2010-11-12 03:11:31","2010-11-12 03:25:20","Convert HashMap.keySet() to CharSequence[]?","<java><android><hashmap><charsequence>","1","0","","",""
"4161541","1","4162142","","2010-11-12 04:08:35","0","697","<p>i am trying to fetch the value in src and dest once the user clicks the navigate button but its always null. can some one plz help</p><pre><code>static String source  = ""currentLocation"";     static String destination  = null;private void getSrcDest(){        LayoutInflater factory = LayoutInflater.from(this);        final View textEntryView = factory.inflate(R.layout.srcdest, null);        final AlertDialog.Builder alert = new AlertDialog.Builder(this);        alert.setIcon(R.drawable.srcdest_icon);        alert.setTitle(""Enter Source &amp; Destination"");        alert.setView(textEntryView);        final EditText sourceText = (EditText) findViewById(R.id.sourcetext);        final EditText destinationText = (EditText) findViewById(R.id.desttext);        alert.setPositiveButton(""Navigate"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            try{                Toast.makeText(getApplicationContext(), sourceText.getText().toString()+destinationText.getText().toString(),                        Toast.LENGTH_SHORT).show();                source = sourceText.getText().toString();                destination = destinationText.getText().toString();                System.out.println(""----------------Source:""+source);                System.out.println(""-----------Destination:""+destination);            }            catch(Exception e){                System.out.println(""----------------Source:""+source);                System.out.println(""-----------Destination:""+destination);                //if(destination.equals(null)){                    final AlertDialog.Builder wrongAddressAlert = new AlertDialog.Builder(MainActivity.this);                    wrongAddressAlert.setTitle(""Destination Address Cannot be Null"");                    wrongAddressAlert.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int whichButton) {                            getSrcDest();                        }                    });                    wrongAddressAlert.show();            //}                }               }            });        alert.setNegativeButton(""Cancel"",                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        dialog.cancel();                    }                });        alert.show();    }</code></pre>","377337","","377337","","2010-11-12 04:38:35","2010-11-12 06:20:03","unable to retrieve edittext value","<android><dialog>","1","2","","",""
"4161546","1","4219987","","2010-11-12 04:10:35","1","1308","<p>I'm creating a android.text.format.Time Object from a java.util.Calendar Instance,and I read it out field by field. Isn't there a more elegant way ?</p>","474326","","","","","2010-11-18 21:56:00","Simple converting java.util.Calendar to Android Time","<android><time><calendar>","1","0","","",""
"4161603","1","4161739","","2010-11-12 04:26:39","2","1588","<p>Have any one of you checked the Android Os version Pro grammatically on the onCreate of very first screen of the App?If yes then please describe the code here . I will be grateful to you.</p><p>Thanks</p>","395661","","","","","2012-03-07 14:45:20","How can we check Pro grammatically the version of Android OS?","<android>","2","1","1","",""
"4161615","1","","","2010-11-12 04:29:17","4","1219","<p>For some reason my application crashes when I try to set the text of a textview? How can I over come this.</p><pre><code>private TextView strStatus;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);    txtUsername = (EditText) findViewById(R.id.username);    strStatus = (TextView) findViewById(R.id.status);    //strStatus.setText(""test""); // SEEMS TO BE CAUSING THE CRASH    setContentView(R.layout.main);   }</code></pre><pre><code>&lt;TextViewandroid:id=""@+id/status""android:layout_width=""fill_parent""android:layout_height=""wrap_content""/&gt;</code></pre>","505349","","19750","","2010-11-12 05:02:23","2010-11-12 05:02:23","TextView Crashes When Setting Text","<java><android><textview><settext>","1","0","","",""
"4161666","1","4162138","","2010-11-12 04:40:37","2","3113","<p>I've been having an issue with using AudioRecord for Android. I've read as much as I can find online about it, but I cannot seem to get a good initialization. I have tried the Android 2.2 emulator, 1.5 emulator and my phone, an HTC Incredible running Froyo. The emulators and my phone fail initialization.</p><p>I've tried sampling rates of 8000, 11025, and 44100, formats of CHANNEL_IN_MONO/STEREO and CHANNEL_CONFIGURATION_MONO/STEREO, 8bit and 16bit encoding (8 bit makes the getMinBufferSize fail), and AudioSource of MIC and DEFAULT. All result in the variable test becoming 0 after running a get state(failed initialization). </p><p>It seems from everything I've read that this should correctly initialize the object. I have played around with the multiplier on buflen, to have it range from 512 (the result of the function) to 102400 because I had heard that HTC devices require something above 8192.  </p><p>For testing my problem I made a new, small project that recreates my problem as simply as possible. I pull out the constants needed into local ints then run the constructor and access the getState method for checking if it worked.</p><pre><code>package com.example.audiorecordtest;import android.app.Activity;import android.os.Bundle;import android.media.AudioFormat;import android.media.AudioRecord;import android.media.MediaRecorder;public class audioRecordTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        int freq =8000;        int chan = AudioFormat.CHANNEL_IN_MONO;        int enc  = AudioFormat.ENCODING_PCM_16BIT;        int src  = MediaRecorder.AudioSource.MIC;        int buflen = AudioRecord.getMinBufferSize(freq, chan, enc);        AudioRecord ar = new AudioRecord(src,freq,chan,enc,20*buflen);        int test = ar.getState();    }}</code></pre>","505353","","1534123","","2012-10-26 15:46:50","2012-10-26 15:46:50","Android AudioRecord fails to initialize","<android><android-emulator><audiorecord><android-audiorecord>","2","0","0","",""
"4161768","1","4766326","","2010-11-12 05:04:18","1","196","<p>I developed the LWUIT based android application.But that application could not opened in emulator.I used eclipse 3.6.1 and android 2.2.Can anyone tell me the proper steps for developing the LWUIT based android application?</p>","488433","","","","","2011-01-22 05:23:22","Application not opened in android","<android><eclipse><java-me><lwuit>","2","2","1","",""
"4161807","1","4164745","","2010-11-12 05:11:48","6","370","<p>I want to develop a library for Android. In what form can I ship it?  jar, apk or something else? How should I do it so that other developers can use my library in their application?</p>","505364","","379693","","2010-11-12 05:48:40","2013-06-13 13:51:03","How to ship library for Android","<android><jar><apk><android-library>","3","0","4","",""
"4162015","1","","","2010-11-12 05:55:12","0","854","<p>I am creating a list view for message of different heights. The views are xml layout which are setup to layout the same on all resolution screens. To increase performance I am converting these view into a bitmap image by calling <strong>View.getDrawingCache()</strong>. I am getting the Bitmap image but it seems to be scaling the text, especially in the high resolution screens. This is leaving the text a little blurry and in some case it is also being cut off at the edges. If I layout the View rather than the bitmap image, everything is scaled correctly but I am not getting the performance i desire. My item xml layout looks like this:</p><p><strong>Xml Item View:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5px""    android:background=""#FFFFFF""&gt;    &lt;ImageView android:id=""@+id/contact_photo""        android:layout_width=""48dip""        android:layout_height=""48dip""/&gt;    &lt;ImageView android:id=""@+id/network_icon""        android:layout_alignParentRight=""true""        android:layout_width=""16dip""        android:layout_height=""16dip""/&gt;    &lt;TextView android:id=""@+id/created_date""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""14sp""     android:layout_toLeftOf=""@+id/network_icon""     android:textColor=""#000000""/&gt;    &lt;TextView android:id=""@+id/sender_name""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""16sp""        android:layout_toRightOf=""@+id/contact_photo""        android:ellipsize=""end""        android:singleLine=""true""        android:textColor=""#000000""/&gt;    &lt;TextView android:id=""@+id/summary""        android:layout_below=""@+id/sender_name""        android:layout_toRightOf=""@+id/contact_photo""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""14sp""        android:maxLines=""4""        android:textColor=""#000000"" /&gt;    &lt;LinearLayout         android:id=""@+id/AttachmentLayout""         android:layout_below=""@+id/summary""        android:layout_height=""wrap_content""         android:orientation=""horizontal""         android:layout_width=""wrap_content""/&gt;&lt;/RelativeLayout&gt;</code></pre><p><strong>View Measure Snippet:</strong></p><pre><code>LayoutParams params = child.getLayoutParams();if (params == null) {    params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);}final int index = layoutMode == LAYOUT_MODE_ABOVE ? 0 : -1;child.setDrawingCacheEnabled(true);addViewInLayout(child, index, params, true);final int itemWidth = (int)(getWidth() * ITEM_WIDTH);child.measure(MeasureSpec.EXACTLY | itemWidth, MeasureSpec.UNSPECIFIED);</code></pre><p>I have also added the snippet of code preforming the measurement of the view. Does anyone know how to prevent the text from scaling?</p>","505385","","","","","2010-11-17 02:49:41","Android View.getDrawingCache scale bitmap incorrect","<android><listview><bitmap><scale>","1","0","","",""
"4162039","1","","","2010-11-12 05:58:30","2","1217","<p>My android application plays a radio through MMS Stream using AudioTrack class as described <a href=""http://jongladwin.blogspot.com/2010/03/android-play-pcmwav-audio-buffer-using.html"" rel=""nofollow"">here</a></p><p>The Problem is that after playing first chunk the device doesn't get any audio output. </p><p>Here is the logcat info that may be useful</p><pre><code> DEBUG/WifiService(1904): ACTION_BATTERY_CHANGED pluggedType: 211-12 11:21:07.953: INFO/Hello(2821): There11-12 11:21:07.958: INFO/Get Current Player State(2821): 311-12 11:21:07.958: INFO/Paused(2821): 211-12 11:21:07.958: INFO/Playing(2821): 311-12 11:21:07.958: INFO/Stopped(2821): 111-12 11:21:07.963: INFO/Size(2821): 786436411-12 11:21:08.023: DEBUG/dalvikvm(2821): GC freed 103 objects / 4184 bytes in 62ms11-12 11:21:08.078: INFO/dalvikvm-heap(2821): Grow heap (frag case) to 14.770MB for 7864380-byte allocation11-12 11:21:08.153: DEBUG/dalvikvm(2821): GC freed 0 objects / 0 bytes in 74ms11-12 11:21:08.273: ERROR/AudioPolicyManager(1868): [HJ] isDuplicated = 0 11-12 11:21:08.273: ERROR/AudioPolicyManager(1868): 1.[HJ] Headset Volume = 0.354813 , device = 411-12 11:21:08.273: INFO/Offset(2821): 11837528</code></pre><p>Here is the code (It's the method itself which called periodically from C code)</p><pre><code>boolean b = false;Log.i(""Hello"", ""There"");if (at != null) {    Log.i(""Comparing"", """" + at.getPlayState());    Log.i(""Paused"", """" + AudioTrack.PLAYSTATE_PAUSED);    Log.i(""Playing"", """" + AudioTrack.PLAYSTATE_PLAYING);    Log.i(""Stopped"", """" + AudioTrack.PLAYSTATE_STOPPED);    b = at.getPlayState() != AudioTrack.PLAYSTATE_PLAYING;}try {    if (!b) {        int intSize = android.media.AudioTrack.getMinBufferSize(33075,                AudioFormat.CHANNEL_CONFIGURATION_STEREO,                AudioFormat.ENCODING_PCM_16BIT);        at = new AudioTrack(AudioManager.STREAM_MUSIC, 33075,                AudioFormat.CHANNEL_CONFIGURATION_STEREO,                AudioFormat.ENCODING_PCM_16BIT, intSize * 20,                AudioTrack.MODE_STREAM);    }    if (at == null) {        Log.d(""TCAudio"", ""audio track is not initialised "");        return;    }    // 512 kb    // Reading the file..    byte[] byteData = null;    if (file == null)        file = new File(""/sdcard/outmms.wav"");    int size = (int) file.length();    Log.i(""Size"", """" + size);    byteData = new byte[size];    FileInputStream in = null;    try {        in = new FileInputStream(file);        in.read(byteData);        // if (!b) {        at.play();        // }        at.write(byteData, offset, byteData.length);        offset += byteData.length;        Log.i(""Offset"", """" + offset);    } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (Exception e) {        e.printStackTrace();    }} catch (Exception e) {    e.printStackTrace();}</code></pre>","246942","","2961","","2011-03-24 11:33:29","2011-03-24 11:33:29","Android media player stops playing while streaming mms protocol?","<android><streaming>","0","0","","",""
"4162091","1","","","2010-11-12 06:09:50","0","334","<p>I'm new for android.I want to make an APP change my content everyday, but I don't think my user will like to update my APP everyday. </p><p>How should I do?</p>","473944","","73488","","2010-11-12 06:11:15","2010-11-12 06:14:52","How to change APP content in android but not need to update your soft version","<android>","1","0","","",""
"4162121","1","4162826","","2010-11-12 06:15:41","0","388","<p>Actually, i am fetching XML from the web, parsing it and display it on the screen. The problem which i am getting is that the activity tries to load the data from web each time the activity is called.(Actually, my mobile app requires frequent trips to the server) So i am in search of the below solution:</p><pre><code>On Re-launch of an activity, the data from web should not be loaded again. creating a class that i can use to transparently make application faster byselectively caching items in memory.  And thus, making users very happy and This class can even apply individual refresh times to each cached item.</code></pre><p>So, i think i need to store the data in Cache or something like that.</p><p>Is there any way/technique to implement such thing ? so that it need not to load every-time on Re-launch of an activity.</p>","379693","","379693","","2010-11-12 07:01:11","2010-11-12 08:42:15","Rapidly load data on Re-launch of an Activity","<android><xml><android-xml><android-internet>","3","0","1","",""
"4162156","1","4704335","","2010-11-12 06:24:23","0","256","<p>I am pretty new to using android ndk. Is it possible to use android/ standard java classes in native c code using JNI getClass method ? If it is possible, can someone point me to reference code ?</p><p>Thanks a lot!</p>","248132","","","","","2011-01-16 07:43:04","Using android sdk classes in ndk","<android><jni>","1","1","","",""
"4162157","1","4242839","","2010-11-12 06:24:41","11","7919","<p>We want to create a screen which should have different list views and the user can slide (Left or right) to view another list view (just like in TweetDeck and in home screen on some Android OS version). There is also a list of dots which identify how many list views are there.</p><p>Please refer to the screen shot.<img src=""http://i.stack.imgur.com/IHsKY.jpg"" alt=""alt text""></p><p>Thanks in advance,Afzal.</p>","231849","","","","","2012-02-21 16:40:13","How to create a slider screen (As in Tweetdeck) in Android?","<android><screen>","2","0","24","",""
"4162230","1","4162290","","2010-11-12 06:42:50","1","14860","<p>I have a small (200kb) mp3 in the res/raw folder of my android app. I am trying to run it in an emulator from Eclipse. It is recognized as a resource in the R file but when I try to prepare/start, my activity crashes! Was there something else I needed to change, perhaps in the manifest? </p><pre>MediaPlayer mPlayer = MediaPlayer.create(FakeCallScreen.this, R.raw.mysoundfile);try {mPlayer.prepare();mPlayer.start();} catch (IOException e) {// handle this later}</pre>","490703","","","","","2014-02-25 04:25:43","How do I play an mp3 in the res/raw folder of my android app?","<android><media-player>","2","1","1","",""
"4162333","1","","","2010-11-12 07:03:38","0","321","<p>I am trying to saw google map in emulator.I also have obtained googleApi key for that...but when i run my code it doesn't saw just grid insted of google map.</p><p>Any help?Thanks......</p>","505426","","","","","2010-11-12 11:31:27","Google maps in Android","<android><android-emulator>","3","0","","",""
"4162335","1","4163255","","2010-11-12 07:03:53","1","1318","<p>Suppose I have something like an alarm activity which launches the alarm through the lock screen, accomplished via</p><pre>getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);</pre><p>Now, from here I could press the back button to kill the activity, but I also want a press of the lock button to silence the alarm. How would I go about creating a handler for presses of the lock screen button?</p>","490703","","","","","2010-11-12 11:11:08","how to handle lock screen button input for android activity?","<android><lockscreen>","1","0","1","",""
"4162390","1","4163954","","2010-11-12 07:13:12","1","1342","<p>I want to parse all enclosure tag, with my SAXPArser, how i can do that?</p><pre><code>&lt;enclosure url=""http://website.com/picture.jpg"" width=""120"" height=""90"" type=""image/jpeg"" length=""10000"" /&gt;</code></pre>","472537","","19750","","2011-01-13 09:38:52","2012-06-06 16:17:35","Android SAXPArser, parsing enclosure tag, how?","<android><xml><parsing>","2","1","","",""
"4162417","1","","","2010-11-12 07:19:31","2","1000","<p>Here i created a dragable imageview .This is my sample code(not given full code)</p><pre><code>public class mainClass extends Activity {         MyView obj1,obj2;       public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        AbsoluteLayout layout = new AbsoluteLayout(LearnKid.this);        layout.setLayoutParams(new AbsoluteLayout.LayoutParams(                                   LayoutParams.WRAP_CONTENT,                       LayoutParams.WRAP_CONTENT,0,0));        obj1 = new MyView(this);        obj2 = new MyView(this);        layout.addView(obj1);        layout.addView(obj2);        setContentView(layout);    }}class MyView extends ImageView {    public MyView(Context context)     {           super(context);    }     public boolean dispatchTouchEvent(MotionEvent event)      {        center_X= (int)event.getRawX();        center_Y = (int)event.getRawY();        this.setLayoutParams(new AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT,                    AbsoluteLayout.LayoutParams.WRAP_CONTENT,center_X-10,center_Y-(70)));    }}</code></pre><p>Here i get 2 separate imageviews and also it is dragable.But how do i check whether the first image has crossed the second image.Because at that point i want to stop the dragable option.</p><p>Plz help</p><p>thanx in advance....  </p>","436663","","","","","2010-11-12 08:33:53","Android drag and drop","<android>","2","0","1","",""
"4162424","1","","","2010-11-12 07:20:13","0","2635","<p>I got a question about <code>Activity.finish()</code>.</p><p>In my Android code, there are 4 activities (<strong>A</strong>, <strong>B</strong>, <strong>C</strong>, <strong>D</strong>). The starting activity <strong>A</strong> calls <code>startActivityForResult(intent, reqCode)</code> to start activity <strong>B</strong>. <strong>B</strong> starts <strong>C</strong>, and then <code>finish()</code>, not waiting for result. <strong>C</strong> does exactly the same as <strong>B</strong>, starts <strong>D</strong> and then <code>finish()</code>. <strong>D</strong> will return some result, by <code>setResult(resultCode)</code>.</p><p>When my code runs and activity <strong>D</strong> returns some result, <strong>A</strong> will catch a <code>RESULT_CANCELED</code> on <code>onActivityResult()</code>, even if <code>RESULT_OK</code> is returned in <strong>D</strong>. I guess the <code>RESULT_CANCELED</code> is from activity <strong>B</strong>, which has been terminated before <strong>D</strong> returns a result, rather than from <strong>D</strong>. </p><p>But, my question is, why activity <strong>A</strong> catch <code>RESULT_CANCELED</code> after <strong>D</strong> returns some result, rather than immediately after <strong>B</strong> is terminated? And, what should I do to make <strong>A</strong> catch results from <strong>D</strong>? Do I have to keep <strong>B</strong> and <strong>C</strong> alive, to pass results from <strong>D</strong> to <strong>A</strong>?</p>","429224","","227536","","2013-06-28 09:27:59","2013-06-28 09:29:41","How Activity.finish() & startActivityForResult() collaborate with each other?","<android><activity>","3","2","","",""
"4162447","1","","","2010-11-12 07:24:01","42","57130","<p>I have created an application containing GWVectraNotifier activity which is called from other applications to display Notification.</p><p>In the Notification dialog, there will be 'show' button and 'close' button.</p><p>Onclick of 'show' button, the corresponding activity will be started.</p><p>To check the functionality of the above application, </p><p>I started the GWVectraNotifier activity from K9Mail application on checkmail event trigger.</p><p>I am able to start the GWVectraNotifier activity successfully, but onclick of 'show' button i will have to start 'MessageList' activity of K9mail.To do so, i wrote the below code:</p><pre><code>Intent i = new Intent();i.setComponent(new ComponentName(""com.fsck.k9"", ""com.fsck.k9.activity.MessageList""));i.putExtra(""account"", accUuid);i.putExtra(""folder"", accFolder);startActivity(i); </code></pre><p>which throws :</p><pre><code>WARN/ActivityManager(59): Permission denied: checkComponentPermission() reqUid=10050WARN/ActivityManager(59): Permission Denial: starting Intent { cmp=com.fsck.k9/.activity.MessageList (has extras) } from ProcessRecord{43f6d7c8 675:com.i10n.notifier/10052} (pid=675, uid=10052) requires nullWARN/System.err(675): java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.fsck.k9/.activity.MessageList (has extras) } from ProcessRecord{43f6d7c8 675:com.i10n.notifier/10052} (pid=675, uid=10052) requires nullWARN/System.err(675):     at android.os.Parcel.readException(Parcel.java:1247)WARN/System.err(675):     at android.os.Parcel.readException(Parcel.java:1235)WARN/System.err(675):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)WARN/System.err(675):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)WARN/System.err(675):     at android.app.Activity.startActivityForResult(Activity.java:2817)WARN/System.err(675):     at android.app.Activity.startActivity(Activity.java:2923)WARN/System.err(675):     at com.i10n.notifier.GWVectraNotifier$2$1.run(GWVectraNotifier.java:63)WARN/System.err(675):     at android.app.Activity.runOnUiThread(Activity.java:3707)WARN/System.err(675):     at com.i10n.notifier.GWVectraNotifier$2.onClick(GWVectraNotifier.java:53)WARN/System.err(675):     at android.view.View.performClick(View.java:2408)WARN/System.err(675):     at android.view.View$PerformClick.run(View.java:8816)WARN/System.err(675):     at android.os.Handler.handleCallback(Handler.java:587)WARN/System.err(675):     at android.os.Handler.dispatchMessage(Handler.java:92)WARN/System.err(675):     at android.os.Looper.loop(Looper.java:123)WARN/System.err(675):     at android.app.ActivityThread.main(ActivityThread.java:4627)WARN/System.err(675):     at java.lang.reflect.Method.invokeNative(Native Method)WARN/System.err(675):     at java.lang.reflect.Method.invoke(Method.java:521)WARN/System.err(675):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)WARN/System.err(675):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)WARN/System.err(675):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Actually i am not able to understand what permissions to include in my Notifier application's manifest file to access MessageList of k9Mail. I am pasting below the permissions included in k9mail application's manifest file:    </p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""/&gt;&lt;uses-permission android:name=""android.permission.READ_SYNC_SETTINGS""/&gt;&lt;uses-permission android:name=""android.permission.READ_OWNER_DATA""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""/&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.VIBRATE""/&gt;&lt;uses-permission android:name=""android.permission.WAKE_LOCK""/&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;&lt;uses-permission android:name=""org.thialfihar.android.apg.permission.READ_KEY_DETAILS""/&gt;&lt;permission android:name=""com.fsck.k9.permission.READ_ATTACHMENT""            android:permissionGroup=""android.permission-group.MESSAGES""            android:protectionLevel=""dangerous""            android:label=""@string/read_attachment_label""            android:description=""@string/read_attachment_desc""/&gt;&lt;uses-permission android:name=""com.fsck.k9.permission.READ_ATTACHMENT""/&gt;&lt;permission android:name=""com.fsck.k9.permission.REMOTE_CONTROL""             android:permissionGroup=""android.permission-group.MESSAGES""             android:protectionLevel=""dangerous""             android:label=""@string/remote_control_label""             android:description=""@string/remote_control_desc""/&gt;&lt;uses-permission android:name=""com.fsck.k9.permission.REMOTE_CONTROL""/&gt;&lt;permission android:name=""com.fsck.k9.permission.READ_MESSAGES""            android:permissionGroup=""android.permission-group.MESSAGES""            android:protectionLevel=""normal""            android:label=""@string/read_messages_label""            android:description=""@string/read_messages_desc""/&gt;&lt;uses-permission android:name=""com.fsck.k9.permission.READ_MESSAGES""/&gt;&lt;permission android:name=""com.fsck.k9.permission.DELETE_MESSAGES""            android:permissionGroup=""android.permission-group.MESSAGES""            android:protectionLevel=""normal""            android:label=""@string/delete_messages_label""            android:description=""@string/read_messages_desc""/&gt;&lt;uses-permission android:name=""com.fsck.k9.permission.DELETE_MESSAGES""/&gt;           </code></pre><p>Can some one tell me which permission to include in my app? In the above permissions some are only for k9mail , because those are the permission classes written for k9. So, i will only be able to include the built-in permissions of android in the above given permissions. I tried by doing so as well, but it didn't solve my issue :( </p>","466549","","180538","","2011-02-02 19:51:03","2014-03-29 03:02:44","Android: java.lang.SecurityException: Permission Denial: start Intent","<android><permissions><securityexception><denied>","5","2","6","",""
"4162544","1","4162616","","2010-11-12 07:40:47","0","102","<pre><code>try {                                                                                                                                           HttpResponse response = new DefaultHttpClient().execute(        new HttpGet(requestString));           InputStream is = response.getEntity().getContent();                                 BufferedReader br = new BufferedReader(new InputStreamReader(is));    while ((line=br.readLine()) != null){        long temp = Long.parseLong(line);                           }   } catch (ClientProtocolException e) {    e.printStackTrace();} catch (IOException e) {    e.printStackTrace();}</code></pre>","505453","","248432","","2010-11-12 07:50:59","2010-11-12 08:02:51","why doenst this code work? in order to get a response from the server in android","<android>","2","5","","",""
"4162598","1","6943536","","2010-11-12 07:51:35","2","4483","<p>Since two days I am trying to consume a WCF (.NET) Soap Service and serialize it's response without success. I am getting a correct response (I had to put it on pastebin: <a href=""http://pastebin.com/FBNTFX2K"" rel=""nofollow"">SOAP Response Example</a>), but KSOAP2 is not able to handle .NET Datasets correctly.I already consultated various articles about this specific problem, but none has a .NET Dataset to handle. The main article which gave guideance was an <a href=""http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data"" rel=""nofollow"">article by IBM ""Working with XML on Android""</a></p><p>I tried following steps to parse my data without success:</p><ol><li>Parsing with SAX (android) -> Seems not to work with this complex document because of the different namespaces.</li><li>with DOM Object(android) -> NullPointerExeption (dooh!)</li><li>with Digester (dom4j) -> NullPointerException (arggh!)</li><li>method suggested by helloandroid.com ""Using ksoap2 for android, and parsing output data""</li></ol><p>Some questions:- The returned response is a normal XML, but actually it includes a .NET Dataset. Has anyone had success to parse data out of such a response?- Is there a way to make KSOAP2 not to trying to parse the data? It returns a rubbish SoapObject, which is unreadable. I would like just the contents of the SOAP body. Is there a way to intercept that?- Do you have any other hint?</p>","408659","","","","","2011-08-18 11:46:38","How to parse a complex SOAP response in Android","<android><wcf><soap><sax>","4","1","1","",""
"4162623","1","4162637","","2010-11-12 07:54:46","2","2548","<p>How do one use assets?  I have this code:</p><pre><code>AssetManager assets = getAssets();InputStream stream = assets.open( ""test.txt"" );</code></pre><p>It seams like it can only by used in an Activity class.  If I try to use the above code in another class I get an error about getAssets() is not a type for my class.</p><p>So how do one use assets in a class that is not an Activity?</p>","324943","","","","","2010-11-12 08:04:53","How to use assets in Android","<java><android><assets>","1","0","","",""
"4162631","1","4164723","","2010-11-12 07:57:51","4","668","<p>is there an Android control for getting the user to slide something on the screen?  Here's a mockup of the kind of widget I am looking for, in two states:</p><p><img src=""http://i.stack.imgur.com/49rbO.jpg"" alt=""UI slider""></p>","15721","","","","","2011-06-27 11:14:43","control for ""slide to unlock"" -type use-cases","<android>","1","0","3","",""
"4162711","1","","","2010-11-12 08:13:14","1","676","<p>Is it possible if I want to create my application that need to zip the video and user must have password authentication to open file ?</p><p>If it poosible , could you guys provide me some of example code ?Thanks ,Regards</p>","474254","","104117","","2010-11-12 09:40:15","2011-01-17 21:36:21","Android zip file authentication","<android>","1","1","2","",""
"4162742","1","4162787","","2010-11-12 08:19:43","0","653","<p>as I know, Java always invoke a method by ""pass-by-value"".but I see the reference for Android's NotificationManager.notify(String, int, Notification):</p><blockquote>  <p>Returns</p><pre><code> the id of the notification that is associated with the string</code></pre>    <p>identifier that can be used to cancel  the notification</p></blockquote><p>please refer to the reference:<a href=""http://developer.android.com/reference/android/app/NotificationManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/NotificationManager.html</a></p><p>How could this happend?Is there something I mis-understand?</p><p>BR,Henry</p>","316435","","","","","2010-11-12 10:25:29","possible to return values from parameters in Java?","<java><android><notify><notificationmanager>","4","2","","",""
"4162756","1","4163085","","2010-11-12 08:21:41","3","5556","<p>I'm using the following code from the apidemos..</p><pre><code>        return new AlertDialog.Builder(AlertDialogSamples.this)            .setIcon(R.drawable.ic_popup_reminder)            .setTitle(R.string.alert_dialog_multi_choice)            .setMultiChoiceItems(R.array.select_dialog_items3,                    new boolean[]{false, true, false, true, false, false, false},                    new DialogInterface.OnMultiChoiceClickListener() {                        public void onClick(DialogInterface dialog, int whichButton,                                boolean isChecked) {                            /* User clicked on a check box do some stuff */                        }                    })            .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    /* User clicked Yes so do some stuff */                }            })            .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    /* User clicked No so do some stuff */                }            })           .create();</code></pre><p>Under <code>/* User clicked Yes so do some stuff */</code>, i'm not fed the isChecked variable.. however, I am given isChecked in the <code>/* User clicked on a check box do some stuff */</code> section.. Obviously i don't want to update my SharedPrefs on checkbox click, in case the user hits cancel.. </p><p>So how do I get the checkboxs and values on the <code>setPositiveButton</code> onClick ?</p><p>Thanks.</p>","502630","","","","","2010-11-12 09:16:06","How do i obtain the setMultiChoiceItems items from my AlertDialog?","<android>","2","0","","",""
"4163068","1","","","2010-11-12 09:14:30","3","4850","<p>I want to play an mp3 file using the default android player. I managed to get the file playing but it plays in the background. I want to have all the nice controls for pausing, playing, etc.</p><p>I do not know how I could do this!</p><p>My code now is something like</p><pre><code>String link = ""http://www.site.com/file.mp3"";MediaPlayer mp = new MediaPlayer();mp.setDataSource(link);mp.prepare();mp.start(); </code></pre><p>How can I do it that when this file begins to play to go to another screen with the player and all the nice controls?</p><p>Thank you</p>","306833","","79125","","2011-03-30 01:44:43","2011-03-30 01:44:43","android play audio files with default player","<android><controls><media><default><player>","1","0","","",""
"4163106","1","4843573","","2010-11-12 09:18:14","0","1308","<p>I read that the different entries in different tables are linked via the _ID column in that table. For example a contact might have an _ID = 1 I get via</p><pre><code>ContactsContract.Contacts._ID</code></pre><p>and now I want to read the phone number of that contact using </p><pre><code>Cursor phoneCursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "" = "" + contactId , null, null); //...String number = phoneCursor.getString(phoneCursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER));String id = phoneCursor.getString(phoneCursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone._ID));</code></pre><p>This works fine, but what I would expect is that if the _ID of the contact is 1 that the _ID of the phone number is as well one since they belong together, but they are not equal. So the question is how does Android match these entries?</p><p>Thanks, A.              </p>","481493","","","","","2011-01-30 15:05:51","_ID column in Contacts database","<android><contactscontract>","2","0","","",""
"4163167","1","4163264","","2010-11-12 09:27:08","3","9989","<p>How to convert class file to dex file in android?Is there any way?</p>","488650","","759866","","2014-02-04 16:05:50","2014-02-04 16:05:50","Convert class file to dex file","<android>","3","0","5","",""
"4163199","1","","","2010-11-12 09:30:50","0","539","<p>We are developing a software suite that heavily involves user interaction. We'd like to have a nice touch-based user interface, very similar to that of Android. Are there any libraries or other ways to easily build and use such user interfaces for own applications. We mainly develop in C++, but things in Python or Java or even something web-based would also help.Thanks.</p>","292209","","","","","2010-11-12 10:14:45","How to build a nice Android-like user interface for my own application","<android><user-interface><graphical-interaction>","2","0","","",""
"4163265","1","","","2010-11-12 09:38:45","1","481","<p>I want to do an Android application that use RDF store in-memory and query it. Do you know if you can use Sesame 2.3.2 onejar library in Android application without problem?</p><p>Thanks!</p>","505551","","","","","2012-05-30 09:55:40","Sesame RDF store/query on Android","<android><rdf>","1","1","","",""
"4163302","1","4163400","","2010-11-12 09:42:09","0","4304","<p>I want to rotate a button about X-axis when clicked and then display a different image so it creates an effect that after button click it's flipping and showing a different image which is at its backside. </p><p>I'm using following xml for rotation of button:</p><pre><code>  &lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:shareInterpolator=""false""&gt;  &lt;set android:interpolator=""@android:anim/decelerate_interpolator""&gt;  &lt;rotate          android:fromDegrees=""0""          android:toDegrees=""-360""         android:pivotX=""25%""         android:pivotY=""25%""         android:fromXDelta=""0""         android:toXDelta=""0""         android:fromYDelta=""0""         android:toYDelta=""0""                      android:duration=""400"" /&gt;</code></pre><p></p><p>But it's rotating the button in 2-D plane about the button's center. </p><p>Can anybody please help me?</p><p>Thanx in advance.</p>","227943","","491044","","2011-03-11 12:56:06","2013-02-21 09:15:33","Rotate button about X-axis android","<android><button><rotation>","3","0","2","",""
"4163335","1","4164696","","2010-11-12 09:46:22","2","1045","<p>I have an app which contains an activity which is a MapviewActivity and is mostly a mapview.However I have noticed that the start up time of the activity is really slow and causes a lag from the moment the button is pressed to go in to the map activity. I feel this creates a bad user experience and would like to avoid this.I have already set the background of the map activity to <code>@null</code> as suggested by one of the UI improvement articles on googles developer page, which I feel does not do the trick.</p><p>Is there a way to improve this? I would not like the main home screen to get stuck on the launch of the activity, even a transfer to the map activity and then loading the mapview would be better.</p><p>Thanks,Jason</p>","407133","","446006","","2011-03-06 12:02:39","2012-01-03 19:45:24","Speed up launch of activity containing mapview and extends MapviewActivity","<android>","2","0","3","",""
"4163337","1","4163789","","2010-11-12 09:46:31","0","342","<pre><code> &lt;enclosure length=""30367"" type=""image/jpeg"" leadimage=""true"" caption=""aaa"" url=""http://link1.jpg"" /&gt; &lt;enclosure length=""30367"" type=""image/jpeg"" leadimage=""false"" caption=""bbb"" url=""http://link2.jpg"" /&gt;</code></pre><p>how i can change in a string, all this line: </p><pre><code> &lt;enclosure length=""30367"" type=""image/jpeg"" leadimage=""true"" caption=""aaa"" url=""http://link1.jpg"" /&gt;</code></pre><p>to:</p><pre><code>&lt;enclosure&gt;image/jpeg\ntrue\naaa\nhttp://link1.jpg&lt;/enclosure&gt;</code></pre>","472537","","","","","2010-11-12 10:41:54","Android/java change RSS enclosure String maybe regex","<java><android><regex>","1","0","","",""
"4163338","1","","","2010-11-12 09:46:39","0","1161","<p>I have to create a small panel like thing with a border.This should contain a text, an image that describes the text and a button.On clicking that button I have to do some operations also.Which widget is suitable for this?Can anyone suggests any idea?</p>","504162","","","","","2010-11-12 10:02:41","Button containing images and text","<android>","3","0","","",""
"4163375","1","","","2010-11-12 09:50:20","6","13730","<p>I m running server on Linux console which written in C and creating client in android. i have not getting  any error on DDMS but following Debug message come </p><pre><code>11-12 20:38:06.787: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>but message will not go to the server. But if create client in C or java it working fine.any suggestion. </p><pre><code>public class UDPDemo extends Activity {    private EditText mEditText;    private Button sendButton;    private DatagramSocket client_socket;    private static InetAddress IPAddress;    private byte[] send_data = new byte[1024];    static{    try {     IPAddress =  InetAddress.getByName(""127.0.0.1""); } catch (UnknownHostException e1) { e1.printStackTrace(); }} /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mEditText = (EditText)findViewById(R.id.EditText01);    sendButton = (Button)findViewById(R.id.Button01);    sendButton.setOnTouchListener( send); }OnTouchListener send = new OnTouchListener() {  @Override  public boolean onTouch(View v, MotionEvent event) {  if( event.getAction() == MotionEvent.ACTION_UP)  try {        client_socket = new DatagramSocket();      String data =  mEditText.getText().toString();      send_data = data.getBytes();      DatagramPacket send_packet = new DatagramPacket(send_data,               send_data.length, IPAddress, 5000); client_socket.send(send_packet);mEditText.setText("""");  }catch (IOException e) {    System.out.println(""UDPDemo.enclosing_method() error""+e.getMessage());   e.printStackTrace();  } return true; }};}</code></pre>","484073","","484073","","2010-11-12 13:02:34","2012-01-20 06:00:04","DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol","<android>","3","2","1","",""
"4163469","1","4177726","","2010-11-12 10:00:04","6","4050","<p>I'm working on a simple game to experience the multiplayer game development on mobile plaforms especially on Android and iOS. I'm now planning network/multiplayer side of the game and need some advice.</p><p>Firstly i think about Google App Engine as the server side of the game. But i learned that app engine cannot connect directly to clients. So updates of the users cannot be send to others directly with this method. Then i started to think about serving the game on one of the gamers of the current session. But of course some of the features will be on the server. You think it is a good idea?</p><p>Second, I'm looking for a protocol to communicate iOS and Android. YAML and JSON are the ones i looked so far. </p><p>Any other suggestions about multiplayer game development would be appreciated. Thanks...</p>","29598","","","","","2013-12-03 15:48:02","Suggestions about multiplayer game development on iOS and Android?","<iphone><android><networking><ios><multiplayer>","6","0","10","",""
"4163503","1","4163574","","2010-11-12 10:04:44","1","1556","<p>I have a custom listview in which one textview and one checked box is in each row. When I click the ckeckbox, I want to add the value from TextView to database and to display a Toast message in the view. The database insertion is working fine. But the application is stopping suddently, and the Toast message is not shown in the view.</p><pre><code> public class Favourites extends Activity  {     @Override     public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main_list);        ListView listitems = (ListView) findViewById(R.id.ListView_01);        listitems.setAdapter(new EfficientAdapter(this));     }     private static class EfficientAdapter extends BaseAdapter     {        //imp        public View getView(int position,  View convertView, ViewGroup parent)         {              if (convertView == null)              {                  int itemId=SubListIdList.get(position);                  TextView text = (TextView) convertView.findViewById(R.id.TextView_02);                  CheckBox star = (CheckBox) convertView.findViewById(R.id.star);                  star.setOnCheckedChangeListener(new OnCheckedChangeListener()                   {                       @Override                       public void onCheckedChanged(CompoundButton buttonView,boolean isChecked)                       {                           Favourites f=new Favourites();                           query=""UPDATE ""+SUB_TABLE_NAME+"" SET FavoriteIndicator='Y' WHERE SubListID=""+itemId;                           db.execSQL(query);                              Toast.makeText(f, ""Insertion successfull!"", 1).show();                       }                 }           }       }    }}</code></pre><p>Please help me.... Thank you...</p>","504117","","","","","2010-11-12 11:23:07","Toast message on Custom Listview Click in Android","<android><listview><toast>","3","0","0","",""
"4163536","1","4163566","","2010-11-12 10:09:25","0","73","<p>i saw the code of starting other apps from my app.but i understood little bit ..i need some detailed ebooks on intents and start activity ON ANDROID...</p>","505580","","","","","2010-11-12 10:13:16","i saw the code of starting other apps from my app.but i came to K little bit ..i need some detailed ebooks on intents and start activity","<java><android><eclipse>","1","0","","",""
"4163572","1","","","2010-11-12 10:13:55","2","973","<p>I am developing an application in which i have to call a web service, i know the way to call the service through KSOAP2. Unfortunately I am provided with a WSDL file so i used the Sun Wireless Toolkit Stub Generator to generate the code. But the code contains the following packages which are not supported by Android.</p><pre><code>import javax.xml.rpc.JAXRPCException;import javax.xml.namespace.QName;import javax.microedition.xml.rpc.Operation;import javax.microedition.xml.rpc.Type;import javax.microedition.xml.rpc.ComplexType;import javax.microedition.xml.rpc.Element;</code></pre><p>I do not know how to generate the code from the given WSDL for Android, if any body knows the solution please help me out.</p>","131062","","114066","","2010-11-18 17:50:01","2014-01-27 10:30:35","How to generate code from a WSDL file in Android?","<android><soap>","3","0","2","",""
"4163700","1","","","2010-11-12 10:31:09","0","176","<p>Im quite new to android development and in fact also Java. I have created an activity where I have several ""rounded corner"" transparable gradient-""buttons"" that is made up of an absolutelayout, and two texfields. Now I want these ""buttons"" to be added to my screen based on some values in a database. So the UI is dynamic. It must be fetched from DB. So it can be 10 ""buttons"" and it can be 1 ""button"".How can I add these ""buttons"" dynamically Adding text from DB? and still have click-events etc. This is how the ""buttons"" are defined in XML: (I have removed some of the elements)</p><p> </p><p>   <p>Hope someone out there understands the problem, and are able to help.</p>","505608","","","","","2010-11-12 11:05:47","Custom UI object android","<android>","2","0","1","",""
"4163808","1","","","2010-11-12 10:44:29","0","1268","<p>I am working with Android + XMPP Messenger using asmack api. I am succeed with chating.</p><p>I can connect to google, can get all the online/offline friends and chat wid them. I'm not sure how to get Status Message of the Online friends, User Profile Image and How to Send/Receive file to them.</p><p>Can anybody help me with this ?</p><p>I'm currently working with<a href=""http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/"" rel=""nofollow"">http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/</a></p><p>Thanks</p>","206809","","","","","2010-11-12 10:44:29","How to Get Gtalk User Status, Profile Picture and use File Sharing?","<android><xmpp><smack>","0","2","2","",""
"4163907","1","","","2010-11-12 10:55:32","0","499","<p>any one guide me if i am uploading an image from android phone pro grammaticallymy application works fine for small images but in case of if my camera is of 3 or 5 mega pixel it takes</p><p>big size images for example 2mb which takes too much time to upload and sometimes gives me out of memory exception.</p><p>any one suggest me how can i reduce image size so that quality of image is not disturbor any other suggestion to solve this issue?</p><pre><code>public class HttpRequest {    public static HttpData post(String sUrl, Hashtable&lt;String, String&gt; params, ArrayList&lt;File&gt; files,Context mycontext,String path) {        HttpData ret = new HttpData();        try {                String boundary = ""*****************************************"";                String newLine = ""\r\n"";                int bytesAvailable;                int bufferSize;                int maxBufferSize = 4096;                int bytesRead;                URL url = new URL(sUrl);                HttpURLConnection con = (HttpURLConnection) url.openConnection();                con.setDoInput(true);                con.setDoOutput(true);                con.setUseCaches(false);                con.setRequestMethod(""POST"");                con.setRequestProperty(""Connection"", ""Keep-Alive"");                con.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+boundary);                DataOutputStream dos = new DataOutputStream(con.getOutputStream());                //dos.writeChars(params);                //upload files                for (int i=0; i&lt;files.size(); i++) {                        Log.i(""HREQ"", i+"""");                        //FileInputStream fis = new FileInputStream(files.get(i));                        InputStream fis=mycontext.getContentResolver().openInputStream(Uri.parse(path));                        dos.writeBytes(""--"" + boundary + newLine);                        dos.writeBytes(""Content-Disposition: form-data; name=myfile;filename=""                        + ""test.png""  + newLine + newLine);                        bytesAvailable = fis.available();                        bufferSize = Math.min(bytesAvailable, maxBufferSize);                        byte[] buffer = new byte[bufferSize];                        bytesRead = fis.read(buffer, 0, bufferSize);                        while (bytesRead &gt; 0) {                                dos.write(buffer, 0, bufferSize);                                bytesAvailable = fis.available();                                bufferSize = Math.min(bytesAvailable, maxBufferSize);                                bytesRead = fis.read(buffer, 0, bufferSize);                        }                        dos.writeBytes(newLine);                        dos.writeBytes(""--"" + boundary + ""--"" + newLine);                        fis.close();                }                // Now write the data                Enumeration keys = params.keys();                String key, val;                while (keys.hasMoreElements()) {                        key = keys.nextElement().toString();                        val = params.get(key);                        dos.writeBytes(""--"" + boundary + newLine);                        dos.writeBytes(""Content-Disposition: form-data;name=""                        + key + newLine + newLine + val);                        dos.writeBytes(newLine);                        dos.writeBytes(""--"" + boundary + ""--"" + newLine);                }                dos.flush();                BufferedReader rd = new BufferedReader(                new InputStreamReader(con.getInputStream()));                String line;                while ((line = rd.readLine()) != null) {                        ret.content += line + ""\r\n"";                }                /*                //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());                }                */                dos.close();                rd.close();        } catch (MalformedURLException me) {         String value = me.getMessage();         String val = value;        } catch (IOException ie) {         Log.e(""here "", ""Exception: ""+ie.toString());        } catch (Exception e) {                Log.e(""HREQ"", ""Exception: ""+e.toString());        }        return ret;}</code></pre><p>any help would be appreciated.</p>","249991","","249991","","2010-11-16 08:00:03","2010-11-16 08:00:03","big size image uploading and reading problem in android?","<android>","1","3","","",""
"4163918","1","4168394","","2010-11-12 10:57:32","0","1010","<p>I made a ""GraphBar"" custom view that is a <code>RelativeLayout</code> with a <code>TextView</code> on the bottom and an <code>ImageView</code>, varying in height, above that. Here is the code:</p><pre><code>public class GraphBar extends RelativeLayout {    private int mAvailHeight; // space for the bar (component minus label)    private float mBarHeight; // 0.0-1.0 value    public GraphBar(Context context) {        this(context, null);    }    public GraphBar(Context context, AttributeSet attrs) {        this(context, attrs, 0);    }    public GraphBar(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        LayoutInflater.from(context).inflate(R.layout.graphbar, this, true);        setId(R.id.graphBar); // defined in &lt;merge&gt; but not assigned (?)    }    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh) {        super.onSizeChanged(w, h, oldw, oldh);        mAvailHeight = getHeight()-findViewById(R.id.label).getHeight();    }    @Override    protected void onLayout(boolean changed, int l, int t, int r, int b) {        super.onLayout(changed, l, t, r, b);        View bar2 = findViewById(R.id.smallBar);        RelativeLayout.LayoutParams llp2 = (RelativeLayout.LayoutParams) bar2.getLayoutParams();        llp2.height = Math.round((float)mAvailHeight * mBarHeight);    }    public void setBarHeight(float value, float max) {        mBarHeight = value / max;        findViewById(R.id.smallBar).requestLayout();    }    public void setLabel(CharSequence c) {        ((TextView) findViewById(R.id.label)).setText(c);    }}</code></pre><p>While adding these GraphBars and setting their height in <code>onCreate()</code> works well, if I create them onClickSomething or call again <code>setBarHeight()</code> on the created bars, the only way to see changes is Load View Hierarchy. I've been told <a href=""http://stackoverflow.com/q/4150446/503900"">here</a> that it means I need to call somewhere <code>requestLayout()</code>. Where else than after modifying <code>mBarHeight</code>? Any help? I tried everywhere, and with <code>invalidate()</code> too.</p><p>Thank you,Andrea</p><p>(if you need I can post the activity with which i do my tests and the graphbar.xml)</p><hr><p>I've found it's probably <a href=""http://code.google.com/p/android/issues/detail?id=6089"" rel=""nofollow"">a bug</a>. The workaround should be, again, calling <code>requestLayout()</code>. Still i don't understand where i can put the call.</p>","503900","","503900","","2010-11-12 17:52:53","2010-11-12 19:37:37","my Custom View gets drawn only when added in onCreate","<android><android-layout><custom-component><android-custom-view>","1","0","0","",""
"4164050","1","","","2010-11-12 11:16:36","1","646","<p>I want send LinkedHashMap to another Intent. But I don't known what method for extras is allowable.</p><pre><code>Bundle extras = getIntent().getExtras();  LinkedHashMap&lt;Integer, String[]&gt; listItems = extras.get(LIST_TXT);</code></pre>","505657","","","","","2011-05-19 10:54:50","Sending LinkedHashMap to intent","<android><android-intent><linkedhashmap>","0","0","","",""
"4164051","1","","","2010-11-12 11:16:49","1","1677","<p>I have an Android app that has been already developed using SQLite.The DB is quite large (over 100 Megs) so it can be deployed only on the SD card.The data inside the DB is sensitive so for this reason we need to encrypt the DB.The default SQLite binary on the phone does not allow encryption or to add a plug in (extensions).I manage to compile the SQLite using NDK with the encryption extension (I am calling this SQLiteS - from secure) but I still need to figure out how to copy the Sqlite API and bind it to the new SQLiteS binary. The idea is to not change the already developed code using the SQLite default API excepting the package name.Any idea of how can I accomplish this ?</p>","504433","","","","","2011-01-23 02:06:28","Sqlite encryption for Android","<android><api><sqlite><encryption><android-ndk>","2","0","2","",""
"4164055","1","4165979","","2010-11-12 11:17:44","4","3237","<p>Hey guys i need a way on password protecting my app so when users click the app the password actitivty comes up first and they can only access the app if correct password.Its part of  project im doing but im stuck on this bit. PLease guys any hepl would be appreciated.</p>","505655","","328193","","2010-11-12 11:22:26","2010-11-12 15:23:43","Password protect app on start","<android><login><passwords><username>","2","1","3","",""
"4164094","1","4164232","","2010-11-12 11:23:18","3","1851","<p>I have the following very simple class which looks for the last known user coordinates and then prints one of them. But I am getting loc as null variable. The application is not reading the data into the loc variable.</p><pre><code>    import android.app.Activity;    import android.content.Context;    import android.location.Location;    import android.location.LocationListener;    import android.location.LocationManager;    import android.os.Bundle;    import android.widget.Toast;    public class Navigation extends Activity    {      /** Called when the activity is first created. */      @Override      public void onCreate(Bundle savedInstanceState)      {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        /* Use the LocationManager class to obtain GPS locations */        try        {            LocationManager mlocManager =               (LocationManager) getSystemService(Context.LOCATION_SERVICE);            Toast.makeText(getBaseContext(),                   ""Provider Enable Status : "" + mlocManager.isProviderEnabled(                                          mlocManager.getProvider(""gps"").getName()),                        Toast.LENGTH_LONG).show();            Location loc = mlocManager.getLastKnownLocation(""gps"");            Toast.makeText( getApplicationContext(), """" +                 loc.getLatitude(),  Toast.LENGTH_LONG).show();            Toast.makeText( getApplicationContext(), """" + loc,                Toast.LENGTH_LONG).show();         } catch (Exception e) {           Toast.makeText(getBaseContext(), e.getMessage() +              e.toString(), Toast.LENGTH_LONG).show();         }      }   }</code></pre><p>I have added the following listener to the code :</p><pre><code>        LocationListener mlocListener = new MyLocationListener();        mlocManager.requestLocationUpdates( mlocManager.getProvider(""gps"").getName(), 0, 0, mlocListener);</code></pre><p>in the oncreate function. And the following as a class in</p><pre><code>public class MyLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location loc) {        Toast.makeText( getApplicationContext(),            ""Hi, location changed. :)"", Toast.LENGTH_LONG).show();        try {        loc.getLatitude();        loc.getLongitude();        String Text = ""My current location is: "" +                "" Latitude = "" + loc.getLatitude() +                "" Longitude = "" + loc.getLongitude();        Toast.makeText(getApplicationContext(),                Text, Toast.LENGTH_LONG).show();        } catch (Exception e) {            Toast.makeText(getBaseContext(),                 e.getMessage(), Toast.LENGTH_LONG).show();        }    }}</code></pre><p>And after running the window, I do the following: go to DDMS in the Eclipse and set the lattitudes/longtitude and click on the send. </p><p>Still it doesn't fire any toast command in the function.</p>","269776","","628006","","2012-03-31 00:01:26","2012-03-31 00:01:26","NullPointerException in Android application working on GPS","<android><gps><nullpointerexception>","4","2","","",""
"4164116","1","","","2010-11-12 11:26:08","0","1105","<p>I want to implement <code>ksoap2</code> web service using HTTPS(HTTP over SSL). I searched a lot over net but didn't find any tutorial for this. However, I found a tutorial for HTTP which works fine.</p><p>Has anyone worked on something similar ? Any code provided will be really helpful.</p>","383597","","1122476","","2012-08-20 02:40:38","2012-08-20 02:40:38","Android ksoap2 with https","<android>","1","0","","",""
"4164143","1","4273910","","2010-11-12 11:30:26","3","1087","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1898886/removing-an-activity-from-the-history-stack"">Removing an activity from the history stack</a>  </p></blockquote><p>Suppose I have three activities on my stack, like this A ? B ? C.<br>I would like to terminate B and replace it with an activity D, so that the stack looks like this : A ? D ? C.<br>The intended effect is to have a ""screen chooser"" activity C. It opens on top of activity B, offers a number of things to choose from, and when the user clicks one, it closes, revealing the chosen screen. I can cancel the opening animation with overridePendingTransition, but that alone won't help me reveal the activity by closing the chooser interface.</p><p>Is there any way to do that in Android ?</p>","440355","","","","","2010-11-25 05:05:41","Manipulate the back of the activity stack in Android","<android>","3","0","","2011-12-09 14:12:15",""
"4164230","1","","","2010-11-12 11:44:27","1","1110","<p>I have a ListView with a lot of ""rows"". In each row, i have one TextView with a background image. When i scroll, the images of the rows mixes... they jump to another row with the scroll.In have tried android:scrollingCache=""false"" and              android:cacheColorHint=""#00000000"" but nothing.</p><p>The images are loaded dinamically.</p><p>Part of my  layout:</p><pre><code>&lt;LinearLayout   android:id=""@+id/QueryList""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:padding=""3px""                android:layout_below=""@id/NavigationTab""                android:layout_above=""@id/Query""                android:gravity=""top""&gt;        &lt;ListView               android:id=""@android:id/list""              android:layout_width=""fill_parent""              android:scrollingCache=""false""              android:cacheColorHint=""#00000000""              android:layout_height=""wrap_content""&gt;        &lt;/ListView&gt; </code></pre><p>and part of my code:</p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {        ListContent holder;        if (convertView == null) {            convertView = mInflater.inflate(R.layout.expert_inflate_list, null);            holder = new ListContent();            holder.name = (TextView) convertView.findViewById(R.id.name);            TextView iv = (TextView) convertView.findViewById(R.id.avatar);               holder.avatar = iv;            holder.onLine =(TextView) convertView.findViewById(R.id.online);            convertView.setTag(holder);        } else {            holder = (ListContent) convertView.getTag();        }        String rank = """";        for (int i = 1; i &lt;= ListviewContent.get(position).getRanking(); i++ ) { rank+=""&gt;""; };        holder.name.setText( ListviewContent.get(position).getCompleteName() + "" "" + rank );        if (  ListviewContent.get(position).getAvatar() != null &amp;&amp; !ListviewContent.get(position).getAvatar().equals(""null"") ) {            holder.avatar.setBackgroundDrawable( avatars.get( ListviewContent.get( position ).getUserId() ) );        }        if (  ListviewContent.get(position).getOnline() ) {            holder.onLine.setBackgroundDrawable( resources.getDrawable( R.drawable.arrow_on ) );        } else {            holder.onLine.setBackgroundDrawable( resources.getDrawable( R.drawable.arrow_off ) );                       }        return convertView;    }</code></pre><p>""avatars"" is a cache of Drawablesany idea?</p>","505684","","","","","2011-04-28 15:05:52","ListView with TextView with background image","<android><listview><scroll>","1","0","","",""
"4164281","1","","","2010-11-12 11:50:08","1","1243","<p>I have this code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.apod_eso2);      File f = new File(Environment.getExternalStorageDirectory() +         ""/Database.sqlite"");     CursorFactory factory = null;       db =SQLiteDatabase.openDatabase(f.toString(),        factory,SQLiteDatabase.NO_LOCALIZED_COLLATORS );    ListView list=(ListView)findViewById(R.id.restaurantsApod);      KtiriaId=getIntent().getStringExtra(PrevIntent.ID_EXTRA);    model=DbFileApodEso.getAllEntos(KtiriaId,db);    startManagingCursor(model);    //      adapter=new RestaurantAdapter(model);    list.setAdapter(adapter);    list.setOnItemClickListener(onListClick);  }</code></pre><p>and the java file i get the cursor is:</p><pre><code>public class DbFileApodEso {    private static String TABLE_NAME=""TempApodeiEn"";    private static String[] FROM = { ""_id"",""name"", ""monthPaid"",        ""fValue"",""gotPaid"", };    static Cursor getAllEntos(String id,SQLiteDatabase db) {    String[] args={id,""0""};    db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);    db.execSQL(""CREATE TABLE "" + TABLE_NAME +         ""(_id INTEGER PRIMARY KEY  NOT NULL ,old_id integer "" +        "" id1 INTEGER, id2 INTEGER, SNumber DOUBLE, name TEXT, gotPaid INTEGER,         monthPaid DATETIME, hmerej DATETIME, user TEXT,tMemo text,         GotThere INTEGER)"");    db.execSQL(""INSERT INTO TempApodeiEn (old_id,eponimo,         monthPaid,iddiamerisma,fValue,gotPaid) "" +        ""select _id,name,monthPaid,id2,fValue,        gotPaid from ApodeiEn WHERE id2=? and gotPaid=?"", args);    return(db.query(TABLE_NAME, FROM, ""id2=?  and gotPaid=?"", args, null,        null, null));   }}</code></pre><p>i noticed that it takes three seconds to execute: model=DbFileApodEso.getAllEntos(KtiriaId,db)So i'd like to show a progressbar to the user to understand that something is happening, How can i do this?Thanks for help</p><p>I followed the instructions from Shardul and the code is like this:</p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.apod_eso2);     //DEFINING A NEW THREAD WHICH WOULD DO SOME WORK AND THEN DISMISS THE DIALOG     Thread workThread=new Thread(new Runnable(){        @Override        public void run() {         //@ albertsmus :call your getAllEntos() here!         File f = new File(Environment.getExternalStorageDirectory()+""/Eisprakseis.sqlite"");       CursorFactory factory = null;       db =SQLiteDatabase.openDatabase(f.toString(), factory,SQLiteDatabase.NO_LOCALIZED_COLLATORS );      ListView list=(ListView)findViewById(R.id.restaurantsApod);      KtiriaId=getIntent().getStringExtra(DiamEso.ID_EXTRA);      EidosApod=getIntent().getStringExtra(DiamEso.ID_Eidos);      String comment;   // The generated insult.      model=DbFileApodEso.getAllEntos(KtiriaId,db);      startManagingCursor(model);      //        adapter=new RestaurantAdapter(model);      list.setAdapter(adapter);      list.setOnItemClickListener(onListClick);            someTimeConsumingWork(5000);            //ONLY ONE THREAD CAN HANDLE UI, INCLUDES DISSMISSAL OF            //PROGRESS DIALOG. runOnUiThread WILL DO ITS MAGIC HERE!            runOnUiThread(new Runnable(){                @Override                public void run() {                    mProgressDialog.dismiss();                    Toast.makeText(ApodEsoListaSec.this, ""Work done!"", Toast.LENGTH_LONG).show();                }            });        }    });    workThread.start();    mProgressDialog=ProgressDialog.show(this, ""Work Notify!"", ""Working hard, Phew!"");} private void someTimeConsumingWork(long milisToWork){     SystemClock.sleep(milisToWork); }</code></pre><p>but i eventually get the error  ERROR/AndroidRuntime(6230): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()why is that? And as i try to debug the error i realized that the error comes up when i call: adapter=new RestaurantAdapter(model);Any suggestion?</p>","505694","","418183","","2010-11-17 10:42:33","2010-11-17 12:56:46","Show Progressbar while i get records from a cursor","<android><progress-bar>","3","1","","",""
"4164373","1","4164791","","2010-11-12 12:00:16","3","8756","<p>I have an android APP. I need to connect to a remote D.B. on the internet. All i know is that i have to use a Web Service, installed on the remote DB server.</p><p>Whith my Android APP i have to connect to the web service, and the web service will do the logical operations to get the necesary data from the D.B. and will send them to me.</p><p>OK, the web service is not a problem, i have a friend that will do it (i have no idea about web services), but i dont know how i have to do the connexion with the Web Services, and also i dont know how have to be the functions of the Web Service.</p><p><strong>i need to do select's that give me multiple rows of information, and selects, then i have to send data to the Webservice (the parameters of the ""select and the insert""), i supose it's simply to call a function of the webservice with normal parameters? or it's more hard than this?. I have searched for tutorials that show me to do that on google but i can't find a good tutorial that show how to do that...</strong></p><p>can someone give me a little help? for example, a good tutorial for beginners connecting android to a remote DB with webservices?</p><p>thanks</p>","479886","","479886","","2010-11-12 12:42:03","2013-04-22 10:01:23","How to connect to a Remote Database with Webservices?","<android><database><web-services>","2","0","2","",""
"4164510","1","4164570","","2010-11-12 12:16:54","-1","1031","<p>Can any one suggest some helpful links so that I can get free online tutorial?</p>","505580","","241475","","2010-11-12 13:55:25","2013-03-27 14:16:14","I could not understand intent.setAction(); not only this there are more stuff like this related to intents and activity's","<java><android><eclipse>","1","0","","",""
"4164528","1","","","2010-11-12 12:19:27","3","3532","<p>Is it possible to get an InputStream (or file handler) to feed a SAX parser from an XML file stored at the Resources XML folder (instead raw Resources folder)?</p><p>Thanks.</p>","505646","","241475","","2010-11-12 13:54:32","2010-11-12 13:54:32","How to get an inputStream from an xml file at resources xml folder in Android","<android><xml><resources><sax>","1","0","","",""
"4164536","1","","","2010-11-12 12:20:19","2","446","<p>I need to convert from given wsdl file to class files in Android?What is the tool we can use?</p><p>Thanks in advance.</p>","461972","","","","","2011-09-12 06:48:02","Client code generation from wsdl in android","<android>","1","0","","",""
"4164557","1","4164607","","2010-11-12 12:22:29","0","998","<p>my gps location provider takes at least one minute to be available. I took best provider, and it is ""gps"". What will be the reason for that? Anybody has any idea? My code is given below..</p><pre><code>locationListener = new LocationListen();    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    String provider = locationManager.getBestProvider(criteria, true);    if(provider == null){        provider = LocationManager.GPS_PROVIDER;    }    if(!locationManager.isProviderEnabled(provider)){        locationManager.setTestProviderEnabled(provider, true);    }    boolean enabled = locationManager.isProviderEnabled(provider);    if(enabled){        System.out.println(""provider enabled"");        //          setAlert(""provider enabled"", """", false);    }else{        System.out.println(""provider disabled"");        //          setAlert(""provider disabled"", """", false);    }    locationManager.removeUpdates(locationListener);    locationManager.requestLocationUpdates(provider, (long)1000, (float)0, locationListener); </code></pre><p>onStatusChanged() method is called only after atleast a minute and changed status is the provider availability (available) after this onLoctionChanged() method is called. What will be the reason for delayed availability of gps location provider?</p>","462695","","241475","","2010-11-12 13:53:30","2010-11-12 13:53:30","GPS location provider availabilty issue","<android>","1","0","","",""
"4164592","1","4165050","","2010-11-12 12:27:52","0","921","<p>I am new in android. I need to access wsdl webservice with android. If anybody have tried it please help me.</p>","405640","","","","","2010-11-12 13:25:14","Access WSDL WebService in Android?","<android><wsdl>","1","0","0","",""
"4164618","1","4166306","","2010-11-12 12:30:26","1","1331","<p>I am new to android programming, so i have a question regarding how to open any document such as .doc, .docx, .ppt, etc. in android. I also need to implement preview functionality, wherein the file should be downloaded temporarily and user can see the file opened just by a single click.</p><p>How does dropbox does this? Is there any intents available?</p><p>Can anybody help me out of this issue by some example or code?</p><p>Thanks.</p>","396473","","","","","2011-01-30 19:50:43","How to Open Documents in Android","<android>","2","0","","",""
"4164655","1","4164903","","2010-11-12 12:35:05","0","90","<p>I have an application which downloads contacts periodically (using a service and asyn task), but at the same time I read the contacts which were already downloaded. </p><p>My problem is, when I'm downloading the contacts, I try to read the database, the application crashes. </p><p>Could someone explain to me how I can read and write to the database simultaneously.</p><p>Any help would be much appreciated.</p>","311001","","","","","2010-11-12 13:08:10","Help - android databases","<android><database><sqlite><simultaneous>","1","2","","",""
"4164686","1","","","2010-11-12 12:37:39","0","374","<p>The problem I am facing is stated below in code. I am trying to call a 'method' from another class, which is going good until it reaches a activity (like getListView() or getAssets())</p><p>Calling class:</p><pre><code>public class Main extends Activity {  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Utils ut = new Utils();    ut.initiateMainMenu();  }}</code></pre><p>Called class (method: initiateMainMenu):</p><pre><code>public class Utils extends ListActivity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);      initiateMainMenu();  }  public void initiateMainMenu() {    listView = getListView();    assetManager = getAssets();    etc...  }}</code></pre><p>In the example above a nullpointer occurs when the first class (Main) is started with an intent. </p><p>The nullpointer is given on the following lines depending on which line comes first:</p><pre><code>listView = getListView();assetManager = getAssets();</code></pre><p>The same nullpointer does not occur when class Utils is directly intended.</p><p>I hope the above description is suffient for solving my problem.</p><p>Kind regards,Conrad</p>","505711","","","","","2011-08-22 21:17:09","Nullpointer on activities for a called method (for example activity: getListView or getAssets etc.)","<android><android-emulator>","3","0","","",""
"4164740","1","","","2010-11-12 12:44:05","1","508","<p>i want to get the only one email-id from contact list on clicking the contact list NAME in android. please help  me. thank you</p>","396530","","","","","2010-11-12 14:18:37","How to get only one email id when clicked on name in contact list in android?","<android><contacts>","1","0","1","",""
"4164837","1","","","2010-11-12 12:57:58","3","476","<p>Can someone who have developed apps for iPhone and Android, tell the challenges that we would be facing when developing using Titanium?</p><p><strong>UPDATE:</strong></p><p>My question is based on the following perspective:UI Design, layout differences in iPhone and Android, supporting multiiple devices in Android.</p>","189006","","189006","","2010-11-12 14:45:34","2010-11-12 16:29:16","Challenges in developing an application for iPhone and Android using Titanium","<iphone><android><titanium>","1","2","2","",""
"4164921","1","6611761","","2010-11-12 13:09:26","2","3190","<p>I'm developping some kind of IM application for iPhone/WP7/Android.</p><p>After reading documentation I'm not sure, that understand right what credentials I must use, to authentificate my backend on ac2dm service. In <a href=""http://code.google.com/p/chrometophone/"" rel=""nofollow"">chrometophone</a> server uses user's auth token, but my client's application is not linked with google at all. Should I create Activity, that asks user to enter their google accound credentials, or I can use my own account to send notifications to c2dm?</p>","265839","","21234","","2010-11-12 13:15:21","2011-07-07 14:07:33","Who provides AUTH token to use with C2DM?","<android><google-api><android-c2dm>","2","0","1","",""
"4164986","1","4165340","","2010-11-12 13:17:01","1","294","<p>i'm trying to know the database space available.In J2ME you have getSizeAvailable(), but there is no direct replacement in Android, so i thought about doing getMaximumSize() minus database size, the thing is i just can't find a way to know the db actual size, at runtime.</p><p>Thanks!</p>","495904","","","","","2010-11-12 13:56:48","How to know db size at runtime","<java><android><sqlite>","1","1","1","",""
"4165009","1","","","2010-11-12 13:20:13","0","805","<p>So I've been searching around for a week or so, and it appears to be quite possible to start an Activity from a Service, the general order of things going like this:</p><p>Intent myIntent = new Intent();myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);myIntent.setComponent(new ComponentName(""[package]"", ""[class]""));getApplication().startActivity(myIntent);</p><p>When trying this from a WallpaperService, I'm getting what appears to be a wallpaper-specific error 'requires android.permission.BIND_WALLPAPER'. Stack trace shows the startActivity as the culprit.</p><p>I have no idea how to give it this permission; I have tried putting android:permission=""android.permission.BIND_WALLPAPER"" on every tag in the manifest that'll take it, as well as .</p><p>Notably, the debug view does have the warning:WARN/PackageManager(59): Not granting permission android.permission.BIND_WALLPAPER to package (protectionLevel=3 flags=0xbe46)</p><p>General question being asked is in the title.Thanks in advance!</p>","505781","","","","","2011-06-12 21:32:59","Android: How to start an Activity from a WallpaperService?","<android><permissions><activity>","1","0","1","",""
"4165048","1","4165173","","2010-11-12 13:24:55","0","427","<p>i recently downloaded a free app and noticed that the icons on the apps tab were colored. and had a slight 3d perspective. so i just wanted to find out if there is anything wrong doing this in a commercial related application. because from reading the icons guideline documentation for android, they kind of sound very strict on things like that. </p><p>so are we allowed to create what is pleasing in the eyes and override the guidelines?.. ;)</p>","479908","","479908","","2010-11-12 13:52:17","2012-01-19 22:57:04","Tab icon guidelines and icons in general","<android>","4","0","","",""
"4165165","1","","","2010-11-12 13:38:20","1","669","<p>I am trying to use speech recognition on a Samsung Galaxy S phone (as I know the emu doesn't have the intent). The Galaxy S has a 2.1 Android ROM. For some reason I get that the package does not exist on the device, which doesn't make sense because other apps (google maps, voice dialer, etc) are clearly using this.</p><p>Does anyone have any ideas on how I can get this to work?</p><p>The code is more or less the same as google's example (http://developer.android.com/resources/articles/speech-input.html).</p><p>As a further note, I found this thread which seems to indicate that the srec library is missing randomly on devices:<a href=""http://groups.google.com/group/android-discuss/browse_thread/thread/2a53ec01bdff8e67"" rel=""nofollow"">http://groups.google.com/group/android-discuss/browse_thread/thread/2a53ec01bdff8e67</a></p><p>Is there a way I can do this manually (i.e. contact Google's SOAP API for speech recognition)? Alternatively, can I just copy the srec source code from somewhere and put it directly into my project?</p><p>Thanks.</p>","505801","","505801","","2010-11-12 16:00:31","2010-11-12 16:25:35","RecognizerIntent.ACTION_RECOGNIZE_SPEECH on Samsung Galaxy S","<android>","1","0","","",""
"4165169","1","4165255","","2010-11-12 13:38:58","0","67","<p>How can I change text such as <code>""áéouú""</code> to <code>""aeouu""</code> in Android?</p><p><code>java.text.Normalizer</code> is not available on Android systems.</p>","472537","","119114","","2012-07-16 07:27:07","2012-07-16 07:27:07","Android/Java change áéouú to aeouu","<android><regex>","1","0","","",""
"4165175","1","4165305","","2010-11-12 13:39:39","4","660","<p>I have 3 editions of my android app. one free with ads, one paid and one branded with company CI.</p><p>so the difference betwenn them is minimal.</p><p>what is the best practice to manage multiple editions of this app.</p><ol><li>one project, in code <code>if (editionA) { ... }</code></li><li>multiple projects, reference common code in extra project</li><li>or something else ?</li></ol>","97688","","73488","","2010-11-12 13:47:01","2010-11-12 13:52:40","how to manage multiple editions of the same android app","<android><eclipse>","4","2","2","",""
"4165199","1","","","2010-11-12 13:42:48","2","635","<p>If (in Android) you wanted to write an alarm app where the user entered in the time for the alarm by swiping the hours &amp; minutes up and down, what's the easiest way of achieving this? Is it the Swipe or Fling command? </p><p>Are there any good tutorials out there for this?</p><p>Cheers</p>","497517","","","","","2010-11-12 14:23:55","Swipe gesture for number input","<android><gesture><gestures><swipe>","1","0","","",""
"4165306","1","","","2010-11-12 13:52:47","0","1866","<p>I am trying to add an open source game to my application. I mean, I developed an application. When a user installs my application, there will be button in the app and when user taps the button, internal apk (open source game) will be started. </p><p>But, I dont know where I should put the game apk file to? I dont know how I can invoke the game apk?</p><p>I found following code which starts any apk from sdcard (I guess). </p><pre><code>String fileName = Environment.getExternalStorageDirectory() + ""/myApp.apk"";Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(new File(fileName)), ""application/vnd.android.package-archive"");startActivity(intent);</code></pre><p>But, I plan to prepare one APK (and game will be put somewhere such res/raw). </p>","505806","","244296","","2010-11-12 14:00:58","2010-11-12 14:07:04","how to invoke an apk from my application","<android><android-intent><invoke><apk>","1","0","","",""
"4165414","1","11656129","","2010-11-12 14:04:10","49","59618","<p>Ok everyone knows that to hide a keyboard you need to implement:</p><pre><code>InputMethodManager imm = (InputMethodManager) getSystemService(    INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);</code></pre><p>But the big deal here is how to hide the keyboard when the user touches or selects any other place that is not an EditBox or the softKeyboard?</p><p>I tried to use the onTouchEvent on my parent Activity but that only works if user touches outside any other view and there is no scrollview.</p><p>I tried to implement a touch, click, focus listener without any success.</p><p>I even tried to implement my own scrollview to intercept touch events but I can only get the coordinates of the event and not the view clicked.</p><p>Is there a standard way to do this?? in iPhone it was really easy.</p>","505152","","505152","","2013-10-29 17:10:03","2014-04-12 07:04:46","how to hide soft keyboard on android after clicking outside EditText?","<android><touch><hide><android-softkeyboard>","16","3","36","",""
"4165438","1","4165702","","2010-11-12 14:07:15","1","1347","<p>I have written a simple app for Android and when I first created the project I selected v2.2 for the build target. I have found out that my app does not work on v1.6, it runs for a few seconds then crashes. So I guess I am using some commands that were not implemented in 1.6. So I need to find out what these commands are and find the 1.6 equivalent. Should not be too hard I guess.</p><p>My real question is; to make a 1.6v is the only way to do this to create a new project and set the build target to 1.6 then copy and paste the source code and re-compile? Or is there an easier way? ie can I take my existing 2.2 build and then tell it to compile to 1.6?</p><p>Many thanks for the help.</p>","497517","","","","","2010-11-12 14:39:20","Making an Android 2.2 app work on 1.6","<android><versioning>","2","0","2","",""
"4165493","1","4165742","","2010-11-12 14:14:13","0","129","<p>I was thinking of including functionality to allow users to click on dates in the ""important dates"" section of my app, but was wondering if it is safe to assume that most phones have Google calendar pre-installed. </p><p>I was planning on writing a custom filter to Linkify the dates and pass them to the calendar app as an event.</p><p>This project is planned for 1.6, but 2.1 is also a possibility. (Trying to reach the largest possible audience)</p>","196443","","1228","","2013-06-07 14:46:08","2013-06-07 14:46:08","Should I include Calendar functionality into my android App? (Is calendar pre-installed on most phones?)","<android><google-calendar><linkify>","1","1","","",""
"4165599","1","","","2010-11-12 14:27:16","3","1219","<p>my goal is to target with a keyevent a specific application running either in foreground or background from a background service.</p><p>I tried many solutions, but have not yet managed to do it.</p><p>The few solutions tried (all from a background running service): </p><hr><p>With a broadcast, I tried to target the first application (for example the phone app) that would manage the key event</p><pre><code>KeyEvent lKey1Up = new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_ENDCALL);KeyEvent lKey1Dwn = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_ENDCALL);Intent lKey1UpIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);Intent lKey1DwnIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);lKey1UpIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Up);lKey1DwnIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Dwn );sendOrderedBroadcast(lKey1UpIntent, null);sendOrderedBroadcast(lKey1DwnIntent, null);</code></pre><p>=> Nothing happens with my foreground phone app when the broadcast is performed while I am in a phone call state (OFFHOOK). Indeed, I was nearly sure this would not work since I have no way to specificely target the phone app.</p><hr><p>With <strong><em>Instrumentation</em></strong>, I tried to target the application that has the focus :</p><pre><code>Instrumentation lInst  = new Instrumentation();KeyEvent lKey1Up = new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_1);KeyEvent lKey1Dwn = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_1);lInst.sendKeySync(lKey1Up);lInst.sendKeySync(lKey1Dwn);</code></pre><p>also tried with a single call to :</p><pre><code>lInst.sendKeyDownUpSync(KeyEvent.KEYCODE_1)</code></pre><p>=> Application crashes (also during phone call)looks like I cannot use Instrumentation out of a testing purpose </p><hr><p>Eventually, I thought about using </p><pre><code>superDispatchKeyEvent(KeyEvent)</code></pre><p>but since I don't know how to target a specific window from the targeted running application (and I have none in my service, indeed), I don't know how to use it at all.</p><hr><p>And before anyone asks, I added the </p><blockquote>  <p>android.permission.INJECT_EVENTS<br>  android.permission.MODIY_PHONE_STATE</p></blockquote><p>in my manifest in order to be sure all I do is ""allowed"".</p><p>Then... thanks first for reading until here, and now :</p><ul><li>some of you know how I can manage todo target a specific application with akeystroke event from a service?</li><li>some of you know how to do the same with the phone application specificely?</li></ul><p>Thanks in advance for your help.</p>","498190","","","","","2011-12-19 14:13:31","How to target a running app with a KeyEvent?","<android>","1","0","1","",""
"4165699","1","4165791","","2010-11-12 14:38:44","0","3824","<p>I have following code in pre-Android2.0 API:</p><pre><code>    String[] PROJECTION = new String[] { Contacts.People._ID, Contacts.PeopleColumns.NAME, Contacts.Phones.NUMBER };    Cursor c = mActivity.managedQuery(Contacts.People.CONTENT_URI, PROJECTION, null, null, Contacts.People.DEFAULT_SORT_ORDER);</code></pre><p>What kind of selection should I do to retrieve contacts that have both name and phone number?</p>","296427","","","","","2010-11-12 14:48:57","How to query Contacts that have both a phone number and name?","<android><cursor><android-contentprovider><android-contacts>","1","0","","",""
"4165727","1","","","2010-11-12 14:41:29","4","2120","<p>I'd like to develop a live wallpaper. After some research, I concluded that there were two options to create one :</p><ul><li><p>Directly, i.e like it's said on Android-Developpers ( <a href=""http://developer.android.com/resources/articles/live-wallpapers.html"" rel=""nofollow"">http://developer.android.com/resources/articles/live-wallpapers.html</a> )</p></li><li><p>Or thanks to a game engine like AndEngine ( <a href=""http://code.google.com/p/andenginelivewallpaperextension/"" rel=""nofollow"">http://code.google.com/p/andenginelivewallpaperextension/</a> )</p></li></ul><p>I've never developed Live Wallpaper. Which solution is the easiest and fastest?</p>","400695","","242924","","2013-03-12 12:58:58","2013-03-12 12:58:58","Live Wallpaper with Game Engine or not?","<android><game-engine><live-wallpaper>","2","0","3","",""
"4165743","1","4170449","","2010-11-12 14:43:01","0","677","<p>i want to keep the public and private keys I've generated with my application in a file so I could use the exact same keys another time.. but i realize that there isn't any constructor for PublicKey and PrivateKey object in Android.. so when I could keep them and read them, I still can't reuse them in my application..</p><p>could someone tell me how the way that it could be done? </p>","500452","","115145","","2010-11-12 15:32:44","2010-11-13 01:35:15","PublicKey and PrivateKey constructor in Android (Java)","<java><android><cryptography>","1","0","","",""
"4165750","1","4169719","","2010-11-12 14:43:48","1","664","<p>I am using an Native library in android for streaming. </p><hr><p>Here is the scenario:</p><p>I am passing a url to c file and after lot of processing it writes the data in wav file.</p><p>I'm not so much familiar with C but what i could understand is there is a pointer of <code>int16_t</code> from which wav file is written.</p><hr><p>Here is the question.</p><p>Is there any way to convert <code>int16_t</code> to <code>jbytearray</code> so that i can return a byte array to my java code?</p><p>Thanks</p>","246942","","294248","","2010-11-12 22:41:15","2010-11-12 22:41:15","convert int16_t into jbytearray","<android><c><jni><android-ndk>","2","0","","",""
"4165765","1","4692133","","2010-11-12 14:46:22","8","7085","<p>I want to intercept the touch events on my parent view with onInterceptTouchEvent (MotionEvent ev). </p><p>From there I want to know which view was clicked in order to do other things, is there any way to know which view was clicked from that motion event received?</p><p>Thanks in advance</p>","505152","","","","","2012-06-23 15:19:18","how to get a view from an event coordinates in android?","<android><events><view>","2","0","7","",""
"4166162","1","","","2010-11-12 15:30:34","0","1068","<p>Im changing the background color of each row overriding onListItemClick with this piece of code</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {// First time touching the itemif(mLastPosition==-1) {    mLastPosition = position;} else {    mLocalBG.remove(String.valueOf(mLastId));    v = l.getChildAt(mLastPosition);    v.setBackgroundColor(Color.WHITE);    mLastPosition = position;}mLocalBG.add(String.valueOf(id));/* The issue: v is returning null right here, but only when touch a row that was below the first ones displayed, rows that needed to be scrolled down */v = l.getChildAt(position);v.setBackgroundColor(Color.LTGRAY);}</code></pre><p>As noted, it works perfectly till i scroll down to the next rows, after that <code> View v</code> returns null everytime. Why is that happening?</p><p>Thanks in advance</p>","2443607","","","","","2013-12-07 21:15:19","ListView backgroung color for each row android","<android><listview><android-layout><background-color>","2","1","","",""
"4166197","1","","","2010-11-12 15:33:43","1","2790","<p>Do you know how to achieve the same effect as winamp for android ? I want to do the similar thing. That is when I click on listview, sliding drawer popup. But so far I only can show the sliding drawer in new activity not in the same.</p><p>How can I achieve in overlap view. That is when I close the drawer, the layout is show at the front, and the sliding handle is on the layout, when I open the drawer, it covers the main layout.</p><p>Any ideas about that ?</p><p>Thanks !!</p>","471567","","139010","","2010-11-12 15:35:55","2013-08-15 19:08:42","Sliding drawer in the same layout","<android><slidingdrawer>","2","0","2","",""
"4166274","1","","","2010-11-12 15:40:56","0","77","<p>Recently, I program for the Android platform. I have a question about the text.<br>Is there any way to display the text <strong>without using the XML</strong>?<br>I also want the text to be able to show in each class.</p>","500067","","372239","","2014-01-04 16:07:08","2014-01-04 16:07:08","Ability to view text in each class","<java><android><text>","1","1","","",""
"4166355","1","","","2010-11-12 15:47:47","1","1769","<p>I am using Bluetooth Chat sample app from Android website. I want to pass the complete incoming message, (message format included in the code below as this website is parsing the message for me which is my job in the code as well ;-), to a function which removes the tags and extracts message name and value and uses it for further action. The <code>readMessage</code> string (in the switch case Message_Read) sends selected characters and omits few special characters. Following is the code from Bluetooth Chat app (from Android website).</p><p>I am not able to receive the complete message in the format which I have mentioned in the code. It gets displayed in multiple lines and many characters get deleted. Any suggestion why this is happening?</p><pre><code>// The Handler that gets information back from the BluetoothChatServiceprivate final Handler mHandler = new Handler() {    @Override    public void handleMessage(Message msg) {        switch (msg.what) {        case MESSAGE_STATE_CHANGE:            if(D) Log.i(TAG, ""MESSAGE_STATE_CHANGE: "" + msg.arg1);            switch (msg.arg1) {            case BluetoothChatService.STATE_CONNECTED:                mTitle.setText(R.string.title_connected_to);                mTitle.append(mConnectedDeviceName);                mConversationArrayAdapter.clear();                break;            case BluetoothChatService.STATE_CONNECTING:                mTitle.setText(R.string.title_connecting);                break;            case BluetoothChatService.STATE_LISTEN:            case BluetoothChatService.STATE_NONE:                mTitle.setText(R.string.title_not_connected);                break;            }            break;        case MESSAGE_WRITE:            byte[] writeBuf = (byte[]) msg.obj;            // construct a string from the buffer            String writeMessage = new String(writeBuf);            mConversationArrayAdapter.add(""Me:  "" + writeMessage);            break;        case MESSAGE_READ:            byte[] readBuf = (byte[]) msg.obj;            // construct a string from the valid bytes in the buffer            String readMessage = new String(readBuf, 0, msg.arg1);            mConversationArrayAdapter.add(mConnectedDeviceName+"":  "" + readMessage);                             //Make sure there is a received message. Extract it's name and value            //int msgLen = readMessage.length();            //if( msgLen!= 0)            // Message format is &lt;MSG&gt;&lt;N&gt;shiftDirection&lt;!N&gt;&lt;V&gt;1&lt;!V&gt;&lt;!MSG&gt;             if (readBuf.equals(""&lt;MSG&gt;&lt;N&gt;.*&lt;!N&gt;&lt;V&gt;.*&lt;!V&gt;&lt;!MSG&gt;""))               extractData(readMessage);             else mTitle.setText(R.string.floor_it);            break;        case MESSAGE_DEVICE_NAME:            // save the connected device's name            mConnectedDeviceName = msg.getData().getString(DEVICE_NAME);            Toast.makeText(getApplicationContext(), ""Connected to ""                           + mConnectedDeviceName, Toast.LENGTH_SHORT).show();            break;        case MESSAGE_TOAST:            Toast.makeText(getApplicationContext(), msg.getData().getString(TOAST),                           Toast.LENGTH_SHORT).show();            break;        }    }};</code></pre><hr><p>The part of the code which reads the incoming stream of bytes into a buffer and passes the buffer object for display. </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);                //String Incoming = new String(buffer);                //Pass ""Incoming"" instead of ""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>","487851","","758118","","2011-11-30 00:24:13","2012-06-29 22:00:54","Urgent help needed: Bluetooth Chat - Pass the complete incoming message as string","<android><string><buffer><parameter-passing>","3","1","","",""
"4166375","1","4166437","","2010-11-12 15:49:58","0","1021","<p>I am writing a small piece of code </p><pre><code>MediaPlayer mediaPlayer = new MediaPlayer();mediaPlayer.setDataSource(""http://..../file.mid"");mediaPlayer.prepare();mediaPlayer.start();</code></pre><p>which is not working, where as </p><pre><code>MediaPlayer mediaPlayer = new MediaPlayer();mediaPlayer.setDataSource(""http://..../file.mp3"");mediaPlayer.prepare();mediaPlayer.start();</code></pre><p>is working fine. </p>","499773","","1725096","","2014-01-28 22:14:50","2014-01-28 22:14:50","How to Play MID file in Android?","<android><midi>","1","0","","",""
"4166414","1","4166450","","2010-11-12 15:53:55","2","94","<p>Is it possible to append a string to an Android activity titlebar without needing to rebuild it entirely?</p>","501333","","139010","","2010-11-12 15:55:11","2010-11-12 15:57:28","Is it possible to append a string to an Android activity titlebar?","<java><android>","1","2","","",""
"4166425","1","","","2010-11-12 15:55:05","0","2712","<p>I have a video, and I need to get some of its frames. </p><p>I used to do the following: Create a standart bitmap with the size of the video in question, create a canvas and set it to draw on a bitmap. </p><p>I use a SurfaceView and a surfaceHolder. A mediaPlayer is drawing on the surfaceView, and I have a method that calls surfaceView.draw(canvas), which draws on the canvas, which draws to the bitmap, which I eventually take and use...</p><p>My problem is that 60% of the time I get black frames. The mediaplayer plays its content in a separete thread, and I do not know when the video has started, and when - not, so I believe this is what is getting my black screens.</p><p>I need a workaround, a fix, or another method to get the video frame.</p><p>Thanks in advance.</p>","346583","","","","","2012-10-24 17:44:51","Android::get a frame of a Video?","<android><media-player><surfaceview>","2","0","","",""
"4166452","1","","","2010-11-12 15:57:40","1","690","<p>I have to make other developers to be able to connect to my service, but my AIDL imports my classes.I don't want to give them the source code of the service, just the APK and some kind of a stub file (java, jar?).How can I give them something - ""the glue"" - which makes them to use the classes in my AIDL and using the service akp without getting the sources of the service?</p><p>Thanks for any hints!</p>","289463","","","","","2010-11-12 17:14:47","Deploying my AIDL that imports my classes","<android><service><aidl>","1","0","","",""
"4166485","1","4166557","","2010-11-12 16:00:24","3","19148","<p>Hi im new to both android and java</p><p>i have php page in my webserver, i want to get this page result in android. I have search a lot for mysql android connection someone says that it is possible through ""new URL"" in java. But i cannot catch this method. Actually i want to implement a login page for android. I have already created a login page in php. Now i want to just post username and password value to php page the php page will check the data with database and if user is a valid user i need to redirect otherwise i will show an error message. </p><p>thanks</p>","359187","","","","","2013-10-30 03:45:16","android mysql connection","<android>","4","0","4","",""
"4166793","1","4166847","","2010-11-12 16:27:53","0","968","<p>I am making an Android app, and I need to connect to a remote database with a webservice.</p><p>I will receive an XML file from the webservice with the results of my <code>SELECT</code> query (various rows in some cases).</p><p>I don't know much about XML or web services, I only know that I will receive an XML file and that I have to parse it to obtain the data.</p><p>Is there an XML parser for this purpose that is easy to add to my app and configure?</p>","479886","","496830","","2011-11-07 02:18:41","2011-11-07 02:18:41","Is there an easy to use XML parser for remote database connection?","<android><xml><database><web-services>","3","0","","",""
"4166823","1","","","2010-11-12 16:30:38","0","495","<p>I am trying, unsuccessfully, to ""shift"" a bitmap.  By ""shift"", I mean:  if I have a 500x300 and I shift it 50 pixels to the right, the result should be a 500x300 bitmap where every pixel has been shifted 50 pixels to the left, and the 50 right most pixels are blank.  So, the new image is the same as the old one except the left side is cropped, and a blank area is appended to the right side.  The below code successfully crops the left side, but it does not produce a blank area on the right side, it just produces a narrower bitmap:</p><pre><code>Bitmap newBitmap = Bitmap.createBitmap(oldBitmap.getWidth(), m_CurrentBitmap.getHeight(), Config.ARGB_8888);newBitmap = Bitmap.createBitmap(oldBitmap.getWidth(), deltaX, 0, oldBitmap.getWidth() - deltaX, oldBitmap.getHeight());</code></pre><p>So then I tried creating a new Bitmap with the desired dimensions, and manually setting the pixels (with an offset).  However, this still produces a narrower Bitmap, lacking the blank area on the right side:</p><pre><code>Bitmap newBitmap = Bitmap.createBitmap(oldBitmap.getWidth(), oldBitmap.getHeight(), Config.ARGB_8888);int[] oldPixels = new int[(int)(oldBitmap.getWidth() - deltaX) * oldBitmap.getHeight()];            m_CurrentBitmap.getPixels(oldPixels, 0, (int) (oldBitmap.getWidth() - deltaX), (int)deltaX, 0, (int) (oldBitmap.getWidth() - deltaX), oldBitmap.getHeight());newBitmap.setPixels(oldPixels, 0,  (int) (oldBitmap.getWidth() - deltaX), 0, 0, (int) (oldBitmap.getWidth() - deltaX), oldBitmap.getHeight());</code></pre>","426493","","426493","","2010-11-12 16:56:06","2010-11-12 17:06:28","In Android, how to shift a bitmap?","<android>","1","0","","",""
"4166897","1","","","2010-11-12 16:36:56","0","3785","<p>class1.java has creates a float[] array that is need to have in class2.java. How do you do this? The float[] is points. Here is an example code:</p><pre><code>class1.java    import android.app.Activity;    import android.content.Context;    import android.app.ListActivity;    import android.content.Intent;    import android.graphics.Canvas;    import android.graphics.Color;    import android.graphics.Paint;    import android.graphics.Typeface;    import android.view.Display;    import android.view.SurfaceHolder;    import android.os.Bundle;    import android.view.View;    import android.view.View.OnClickListener;    import android.widget.AdapterView;    import android.widget.ArrayAdapter;    import android.widget.Button;    import android.widget.EditText;    import android.widget.Spinner;    import android.widget.TextView;    public class class1 extends Activity  implements OnClickListener {            public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            float[] points = new float[100];            }    }class2.java import android.app.Activity;    import android.app.ListActivity;    import android.content.Context;    import android.content.Intent;    import android.graphics.Canvas;    import android.graphics.Color;    import android.graphics.DashPathEffect;    import android.graphics.Paint;    import android.graphics.Path;    import android.graphics.Rect;    import android.os.Bundle;    import android.view.View;    import android.view.View.OnClickListener;    import android.widget.AdapterView;    import android.widget.ArrayAdapter;    import android.widget.Button;    import android.widget.EditText;    import android.widget.Spinner;    import android.widget.TextView;    public class graph extends Activity{     DemoView demoview;     public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            demoview = new DemoView(this);            setContentView(demoview);     }     private class DemoView extends View{      public DemoView(Context context){       super(context);      }      @Override protected void onDraw(Canvas canvas) {       super.onDraw(canvas);       canvas.drawLines(points, paint);      }     }    }</code></pre>","487888","","375874","","2010-11-12 17:07:03","2012-06-13 09:54:45","How do you pass a float[] array between activities in android?","<android><arrays><android-intent>","5","5","","",""
"4166917","1","","","2010-11-12 16:38:32","47","62403","<p>I've been looking for over a day for a solution to this problem but nothing helps, even the answers here. Documentation doesn't explain anything too.</p><p>I am simply trying to get a rotation in the direction of another object. The problem is that the bitmap is not rotated around a fixed point, but rather around the bitmaps (0,0).</p><p>Here is the code I am having troubles with:</p><pre><code>  Matrix mtx = new Matrix();  mtx.reset();  mtx.preTranslate(-centerX, -centerY);  mtx.setRotate((float)direction, -centerX, -centerY);  mtx.postTranslate(pivotX, pivotY);  Bitmap rotatedBMP = Bitmap.createBitmap(bitmap, 0, 0, spriteWidth, spriteHeight, mtx, true);  this.bitmap = rotatedBMP;</code></pre><p>The weird part is, it doesn't matter how I change the values within <code>pre</code>/<code>postTranslate()</code> and the float arguments in <code>setRotation()</code>. Can someone please help and push me in the right direction? :)</p>","506015","","1073386","","2013-08-21 15:17:03","2014-04-10 01:02:38","Android: How to rotate a bitmap on a center point","<android><matrix><bitmap><center><image-rotation>","8","1","27","",""
"4166961","1","4169540","","2010-11-12 16:43:00","1","1266","<p>Perhaps I am attempting to do something I ought not. </p><p>I'm running a block of code in the emulator. It looks (more or less) like this: <a href=""http://pastie.org/1291380"" rel=""nofollow"">http://pastie.org/1291380</a> </p><p>This is to construct a live wallpaper background. I pass in a bitmap, color palette, and tile array.The size of my bitmap is 256 x 256. getRedPal / getGreenPal / getBluePal essentially does a call to Color.red() / Color.green() / Color.blue() in order to get the rgb color components of a palette object. </p><p>The loops chug along; I get all the way to the point where the j value of drawInC hits 32, before the emulator crashes and burns: </p><p>11-11 15:34:44.032: INFO/distort_bmp(598): DrawInC: i: 0 j: 32 </p><p>11-11 15:34:44.032: INFO/distort_bmp(598): DrawTiles: i: 0 j: 0 </p><p>11-11 15:34:44.032: INFO/distort_bmp(598): DrawTiles: i: 0 j: 1 </p><p>11-11 15:34:44.032: INFO/distort_bmp(598): DrawTiles: i: 0 j: 2 </p><p>11-11 15:34:44.032: INFO/distort_bmp(598): DrawTiles: i: 0 j: 3 </p><p>11-11 15:34:44.032: INFO/distort_bmp(598): DrawTiles: i: 0 j: 4 </p><p>After which I get a dump file sent to /data/tombstones . Here is the dump (but I sincerely don't find anything in it worth any value, just a bunch of memory addresses): <a href=""http://pastie.org/1291394"" rel=""nofollow"">http://pastie.org/1291394</a> </p><p>I added android:vmSafeMode=""true"" to my  tag after reading elsewhere that that could solve a problem. This is on 2.2, using bitmap.h. </p><p>Personally I am dubious of that </p><pre><code>jbyte* buffer = (*env)-&gt;GetByteArrayElements(env, arr, &amp;isCopy)</code></pre><p>call; I plucked that code from the net somewhere, as I was totally unable to get values from my byte array ""arr."" </p><p>Any ideas?</p><p><strong>EDIT</strong>After manipulating my loop iterators (I shortened the number of loops), I now get an informative error:</p><p>""ReferenceTable overflow (max=512)""</p><pre><code>JNI local reference table summary (512 entries):  509 of Ljava/lang/Class; 164B (3 unique)2 of Ljava/lang/String; 28B (2 unique)   1 of [Ljava/lang/String; 28BMemory held directly by tracked refs is 576 bytesFailed adding to JNI local ref table (has 512 entries)</code></pre><p>That ""509 of java.lang.class"" doesn't look too right to me...how can I optimize my code here?</p>","213345","","213345","","2010-11-12 21:59:34","2012-04-20 14:19:06","Manipulating 256x256 bitmap crashing android-ndk's JNI","<android><bitmap><jni><android-ndk>","2","1","","",""
"4167031","1","4168322","","2010-11-12 16:50:55","0","1176","<p>i am trying to display image from internet in my imageview.</p><p>which is raising following error any one guide me what mistake am i doing here    </p><p>public Bitmap DisplayLiveImage(String ImageSrc)        {            Bitmap bm;                         try {  </p><pre><code>                             URL aURL = new URL(ImageSrc);                               URLConnection conn = aURL.openConnection();                              conn.connect();                               InputStream is = null;                             try                             {                                 is= conn.getInputStream();                               }catch(IOException e)                             {                                 return null;                             }                             BufferedInputStream bis = new BufferedInputStream(is);                               bm = BitmapFactory.decodeStream(bis);                               bis.close();                               is.close();                          } catch (IOException e) {                              return null;                        }                          return  bm;    }</code></pre><p>logcat</p><pre><code>11-12 21:45:22.509: ERROR/AndroidRuntime(7118): java.lang.OutOfMemoryError: bitmap size exceeds VM budget11-12 21:45:22.509: ERROR/AndroidRuntime(7118):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)11-12 21:45:22.509: ERROR/AndroidRuntime(7118):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:476)11-12 21:45:22.509: ERROR/AndroidRuntime(7118):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:537)11-12 21:45:22.509: ERROR/AndroidRuntime(7118):     at com.Finditnear.FindItNearActivityWithoutMenu.DisplayLiveImage(FindItNearActivityWithoutMenu.java:149)11-12 21:45:22.509: ERROR/AndroidRuntime(7118):     at com.Finditnear.ViewSingleImage$1.run(ViewSingleImage.java:88)</code></pre><p>any help would be appreciated.</p>","249991","","302328","","2010-11-12 17:07:44","2011-05-31 22:16:13","bitmap size exceeds VM budget while loading image from internet?","<android><out-of-memory>","1","0","","",""
"4167063","1","","","2010-11-12 16:54:01","1","4440","<p>I've seen some references to actually using Windows 7, however I expect that a Linux partition on my Laptop would be a better choice.  Other than the Andriod SDK, what other dev tools are ""essential"" for Android?</p><p>I'd also be interested in knowing the system requirements for a reasonable IPad development system and ""essentials"" software beyond OSX and XCode.  Plus what is the difference in the learning curves for the two platforms.</p>","134597","","","","","2013-02-19 08:40:35","Is there a prefered Linux distro for Android Development?","<android><linux><ipad>","3","2","","",""
"4167146","1","","","2010-11-12 17:03:24","1","3330","<p>I am looking into developing an App that will convert a website into more readable data for an android app. I am at university and have an online notice board which can be viewed on the web but if possible I would like to transfer this into an app on android to make it more easy to read on mobile devices.</p><p>What I thinking is that the app would go to the website where the notice board is held and read in the html code to display each notice in a list adapter view. Each notice is within its own div so I assume I could use that to split each notice up into its own button on the list adapter view. Is this possible and if so how I can go about doing this. I have tried google for an answer but I have not yet found a solution to this problem. </p><p>Thanks for your help</p>","499448","","","","","2012-09-17 04:17:03","Read HTML file from Website and convert into App","<android>","1","3","","",""
"4167172","1","","","2010-11-12 17:05:24","1","1454","<p>Using <code>android.R.style.Theme_Translucent_NoTitleBar</code> makes my dialog full screen. Why?</p><p>I don't want it full screen. Using <code>android:maxWidth</code> tag does not work.</p><p>How can I fix this?</p>","506002","","1309352","","2014-03-05 18:31:14","2014-03-05 18:31:14","android.R.style.Theme_Translucent_NoTitleBar","<android><dialog><fullscreen>","0","0","","",""
"4167214","1","","","2010-11-12 17:10:26","1","616","<p>I have a simple list activity, for each list item I have onTouchEventListener class defined.</p><p>The problem is onFling event never occures, instead of it following sequence of events:onDown, onShowPress, onLongPress. When I do the same but assign onTouchEventListener to the ListView instance then onFling happens as well but not when I assign it to the list items :(</p><p>Any thoughts?</p>","390323","","","","","2011-05-12 15:13:37","Android: onFling won't to call","<android>","1","1","","",""
"4167287","1","","","2010-11-12 17:17:16","1","639","<p>I am implementing a testcase in Android Juint. I am facing problem inhandling threads. After the successful running of a test case, it willnot wait for child thread to be finished. e.g. If one testcase callsome services in server. testcase will successfully send request to aserver, but it will not wait for a response. Because testcase willstart this request in a different Thread. Currently I am usingfollowing code,</p><pre><code>   currentThread = Thread.currentThread();   synchronized (Thread.currentThread()) {           try {                              Thread.currentThread().wait();                   } catch (InterruptedException e) {                           // TODO Auto-generated catch block                           e.printStackTrace();                   }</code></pre><p>After getting response I am using the following code to start thecurrent thread again.</p><pre><code>  currentThread.interrupt();</code></pre><p>I think this is not the good way to do it. There must be a some othertechnique to handle this problem properly. Please let me know as soonas possible if any one knows solution for this.</p><p>Thanks,</p><pre><code> Vashishta</code></pre>","506052","","","","","2011-06-03 16:20:20","Thread handling problem in Android Junit Test Case","<android>","1","1","","",""
"4167335","1","4168189","","2010-11-12 17:22:37","6","8041","<p>Well, I hosed up my Android development PC, but didn't care all that much since I really needed a newer, much faster PC for this work. And here I am now with a high-end Windows 7 64-bit box.</p><p>Eclipse and all the Android components are up and running, but the one thing I'm having trouble with is how to get my previous project into the new workspace. I copied over my entire old workspace directory from the old disk and made that my Eclipse workspace, but it doesn't automatically see the projects that are there. I tried creating a new Android project ""from existing source"", but it complained about having ""overlapping projects"" or some such.</p><p>Is there a way to have it recognize the existing project files, or should I move them somewhere else, create the project from scratch, and then copy the old files back into the project tree? Or any other solutions?</p>","446874","","","","","2013-02-05 14:21:03","Moving Android/Eclipse project to new PC","<android><eclipse>","5","2","1","",""
"4167363","1","","","2010-11-12 17:25:12","0","2488","<p>I'm new to Android development. I'm trying to use the orientation change to switch between two activities. My idea is to use three Activities one TabActivity and a normal Activity. Here is some pseudo code:</p><pre><code>public class Main extends Activity{// this is the entry point into my app    @Override    public void onCreate(...){        if(this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){            // Start Activity1    } else { //Start Activity2}}</code></pre><p>The Activities Activity1 and Activity2 will have their onPause() functions overridden with an intent to start the Main Activity again.</p><pre><code>onPause(){    Intent intent = new Intent(this.ActivityX, Main.class);    startActivity(intent);}</code></pre><p>\/\/\/\/ EDIT \/\/\/\/</p><p>Ok, I'm taking a different approach. As i need a TabActivity, because i want to be able to start different activities in my tabs (I think i have to use a TabActivity in this case).</p><p>I've edited the Manifest.xml and added android.configChanges=""orientation"" for the TabActivity and the second Activity. Then I've overridden the onConfigurationChanged() functions. With this approach I'm able to switch from landscape (this is the ""normal"" activity"") to portrait (the TabActivity).The other way round does not work and i don't know why yet. I've exactly the same onConfigurationChanged functions (Copy &amp; Pasted) and only changed the essential parts.</p><p>Overriding the onConfigurationChanged of the Activities started in the tabs has no effect, too.</p>","506061","","506061","","2010-11-13 01:27:44","2011-06-07 11:12:45","Android: How to use screen orientation change to switch between activities","<android><screen-orientation>","2","8","","",""
"4167369","1","4167420","","2010-11-12 17:26:04","1","447","<p>Friend's   I'm parsing an xml file from web service,it contains html tags,when i use the particular node like description ,the parser simply escapes to parse.for example below content i use to parse it simply skipped from parsing</p><pre><code>**&lt;desc&gt;&lt;![CDATA[&lt;img src=http://www.browndailyherald.com/polopoly_fs/1.2403115!image/2344905136.jpg_gen/thumbnails/100x100/2344905136.jpg&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;    Coal to men at Brown, only 11 percent of whom told us they are gay. Our bitter heterosexual female staffers tell us that number must be higher....&lt;/p&gt;]]&gt;&lt;/desc&gt;**</code></pre><p>How can i resolve this issue.please help me.</p>","393953","","","","","2012-10-01 13:36:44","Problem while parsing node with html tags","<android>","1","0","","",""
"4167385","1","","","2010-11-12 17:29:25","0","288","<p>I've been trying to run <a href=""http://stackoverflow.com/q/3923501/176510"">this</a> compound controls' example and on the AVD pops up a window with the message - ""The application ClearableEditText (process test.todolist) has stopped unexpectedly. Please try again"", preventing the app of running. </p><p>Any idea to solve it?</p><p>Thank you.</p><p>Here's the LogCat excerpt:</p><blockquote>  <p>ERROR/AndroidRuntime(9176): FATAL  EXCEPTION: main</p>    <p>11-15 15:51:48.419:  ERROR/AndroidRuntime(9176):  java.lang.RuntimeException: Unable to  instantiate activity  ComponentInfo{test.todolist/test.todolist.ClearableEditText}:  java.lang.InstantiationException:  test.todolist.ClearableEditText</p></blockquote>","176510","","176510","","2010-11-15 16:00:06","2010-11-15 16:00:06","Compound Controls example crashing","<android><custom-controls>","0","3","","",""
"4167593","1","4169259","","2010-11-12 17:54:09","1","6475","<p>I started a test project just to get this down.  No changes to main.xml.  I want to create a widget-sized ImageView (80x100) that contains a Bitmap converted from a TextView.  Yes, that sounds very roundabout but this is just for testing; in the end I want the ImageView to have a background image and multiple TextViews.  I'm not sure exactly what I'm doing wrong, but nothing is being pushed to the screen.</p><p>Is it a problem with declaring the TextView/ImageView and passing it ""this"" in the constructor?  Is it a problem with my layoutParams?  Here is the code:</p><pre><code>package com.doaf.testproject;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Canvas;import android.os.Bundle;import android.view.View;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.TextView;public class TestProject extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView tv = new TextView(this);        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(80, 100);        tv.setLayoutParams(layoutParams);        tv.setText(""testing 1 2 3"");        tv.setTextColor(0xFFFFFF);        tv.setBackgroundColor(0x555555);        Bitmap testB;        testB = loadBitmapFromView(tv);        ImageView iv = new ImageView(this);        iv.setLayoutParams(layoutParams);        iv.setBackgroundColor(0x555555);        iv.setImageBitmap(testB);        setContentView(iv);    }    public static Bitmap loadBitmapFromView(View v) {        Bitmap b = Bitmap.createBitmap(80, 100, Bitmap.Config.ARGB_8888);        Canvas c = new Canvas(b);        v.layout(0, 0, 80, 100);        v.draw(c);        return b;    }}</code></pre><p>Thanks for any help you can provide.  I'm relatively new to Android, and pretty lost with this one.</p>","255394","","234039","","2010-11-12 19:01:07","2010-11-13 01:11:08","Converting a TextView->Bitmap->ImageView, and nothing's showing up","<android><android-widget><android-layout>","3","4","4","",""
"4167936","1","4168449","","2010-11-12 18:40:20","1","707","<p>I'm currently developing a game for Android and I want to take screenshots of it.I did so using the DDMS tool in eclipse. However, most of the screenshots are a mix of two frames:</p><pre><code>___________|new frame||         ||         ||_________||old frame||         ||_________|</code></pre><p>The separating line is in different positions.</p><p>This leads me to the conclusion that the screenshot is being made while the current frame is still being drawn.</p><p>Is there a way to get the screencap in sync with the hardware?</p><p>Are there other methods of making screenshots where this doesn't happen?</p><p>Thanks in advance for any hints!</p><p>Update: See my last comment on accepted answer for my solution.</p>","387873","","387873","","2010-11-12 22:52:43","2010-11-12 22:52:43","DDMS screenshot not in sync with vsync","<android><ddms>","2","2","0","",""
"4168065","1","","","2010-11-12 18:54:17","0","138","<p>Someone is making a simple soundboard for me but when I try it on the emulator, it loads very slow(10+ seconds), and every sound that is longer than maybe 4 seconds gets cut off. The person mentioned that he is using SoundPool. Anyone know what is wrong and what might fix it?</p>","506151","","","","","2012-08-15 22:14:14","Android Soundboard Help","<android>","1","2","","",""
"4168083","1","","","2010-11-12 18:56:24","0","814","<p>I am new to programming in Java and Android. I got admob to work at the most basic level, and whenever the device is at the landscape orientation, admob tends to popup and occupy a huge potion of the screen.</p><p>What is the best way to detect the orientation and hide the ads from displaying if it is in horizontal orientation? Is it necessary to put the admob application in a thread to check for change in orientation and hide/unhide it?</p><p>Please advice.</p><p>Thanks!</p>","506146","","","","","2010-11-12 19:49:47","Admob - How to detect horizontal orientation and hide admob?","<android><admob><screen-orientation>","1","0","","",""
"4168195","1","4168211","","2010-11-12 19:11:32","0","1592","<p>I included a WebView in my activity and load some Javascript in it which is then going to get data from an external website.This works and displays fine but the problem is that my activity doesn't scroll when the WebView is done loading so I can't see the bottom of the WebView such as all the other Views I put below this. Any idea of how I should handle this?Cheers.</p>","506168","","","","","2010-11-12 19:20:50","Android: problem scrolling my activity including a WebView","<android><webview>","2","0","","",""
"4168646","1","","","2010-11-12 20:09:47","0","99","<p>I have found wrapper class for managing contacts, but I am constantly getting that application has stopped unexpectedly. I am trying to get some good and working code to start building open source library for managing contacts that would be simple enough for general use.</p><p>Code was found on www(dot).higherpass(dot)com/Android/Tutorials/Working-With-Android-Contacts/</p><p>Idea is to make working example of using this, I just cannot succeed in this.</p><p>Here is the test project: <a href=""http://filebin.ca/uzpgaq/HelloAndroid.zip"" rel=""nofollow"">http://filebin.ca/uzpgaq/HelloAndroid.zip</a></p>","505160","","59303","","2010-12-03 22:06:23","2011-03-10 16:21:37","ContactsAPI Wrapper library","<java><android><class>","2","1","","",""
"4168687","1","","","2010-11-12 20:14:59","3","697","<p>I need the user to be able to touch and hold a button/imageview for a long time (> 30 seconds).unfortunately after ~30 seconds an ACTION_UP is fired automatically.Do you have any idea how i can prevent or bypass this event and keep tracking the users touch?</p><p>This is essential for the control of my app.</p>","373138","","1288","","2012-08-04 17:27:48","2012-08-23 18:23:50","OnTouchListener, ACTION_UP fires automatically after 30 second timeout","<android><ontouchlistener>","2","6","","",""
"4168688","1","","","2010-11-12 20:15:07","1","4904","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/214615/will-google-android-ever-support-net"">Will Google Android ever support .NET?</a>  </p></blockquote><p>Hi,  I have googled lot for getting how to create dot net application for Android mobile phones (such as LG Optimus GT540), but not found relative information. My question is, is it possible to create dot net applications for Android mobiles or not? If yes, can anybody explain me the proper way to create such application and to deploy it onto the mobile phone.</p><p>Thanks for sharing your valuable time.</p>","123514","","","","","2010-11-12 20:22:28","Dot net application for Android mobiles","<c#><asp.net><android>","2","1","1","2010-11-12 20:22:30",""
"4168843","1","","","2010-11-12 20:36:20","3","4809","<p>Trying to make the example <code>PhysicsRemoveExample.java</code> from <a href=""http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/PhysicsRemoveExample.java?r=18648ed40c65722c602591b2ae6769315fdfe134"" rel=""nofollow"">here</a>.</p><p>I get this message when the program starts:</p><pre><code>Sorry! The application PhysicsRemoveExample(process org.anddev.andengine.PhysicsRemoveExample) has stopped unexpectedly. Please try again.</code></pre><p>I have Build Path <code>andengine.jar</code> and <code>andenginephysicsbox2dextension.jar</code><code>assets/gfx -&gt; face_box_tiled.png</code> and <code>face_circle_tiled.png</code>.</p><p>This is my Java code in <code>PhysicsRemoveExample.java</code>. Same as in the example, though I have changed to <code>extends BaseGameActivity</code>.</p><pre><code>package org.anddev.andengine.PhysicsRemoveExample;import org.anddev.andengine.engine.Engine;import org.anddev.andengine.engine.camera.Camera;import org.anddev.andengine.engine.options.EngineOptions;import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;import org.anddev.andengine.entity.primitive.Rectangle;import org.anddev.andengine.entity.scene.Scene;import org.anddev.andengine.entity.scene.Scene.IOnAreaTouchListener;import org.anddev.andengine.entity.scene.Scene.IOnSceneTouchListener;import org.anddev.andengine.entity.scene.Scene.ITouchArea;import org.anddev.andengine.entity.scene.background.ColorBackground;import org.anddev.andengine.entity.shape.Shape;import org.anddev.andengine.entity.sprite.AnimatedSprite;import org.anddev.andengine.entity.util.FPSLogger;import org.anddev.andengine.extension.physics.box2d.PhysicsConnector;import org.anddev.andengine.extension.physics.box2d.PhysicsFactory;import org.anddev.andengine.extension.physics.box2d.PhysicsWorld;import org.anddev.andengine.input.touch.TouchEvent;import org.anddev.andengine.opengl.texture.Texture;import org.anddev.andengine.opengl.texture.TextureOptions;import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;import org.anddev.andengine.sensor.accelerometer.AccelerometerData;import org.anddev.andengine.sensor.accelerometer.IAccelerometerListener;import org.anddev.andengine.ui.activity.BaseGameActivity;import android.hardware.SensorManager;import android.widget.Toast;import com.badlogic.gdx.math.Vector2;import com.badlogic.gdx.physics.box2d.Body;import com.badlogic.gdx.physics.box2d.FixtureDef;import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;/** * @author Nicolas Gramlich * @since 18:47:08 - 19.03.2010 */public class PhysicsRemoveExample extends BaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener, IOnAreaTouchListener {        // ===========================================================        // Constants        // ===========================================================        private static final int CAMERA_WIDTH = 720;        private static final int CAMERA_HEIGHT = 480;        // ===========================================================        // Fields        // ===========================================================        private Texture mTexture;        private TiledTextureRegion mBoxFaceTextureRegion;        private TiledTextureRegion mCircleFaceTextureRegion;        private PhysicsWorld mPhysicsWorld;        private int mFaceCount = 0;        private final Vector2 mTempVector = new Vector2();        // ===========================================================        // Constructors        // ===========================================================        // ===========================================================        // Getter &amp; Setter        // ===========================================================        // ===========================================================        // Methods for/from SuperClass/Interfaces        // ===========================================================        @Override        public Engine onLoadEngine() {                Toast.makeText(this, ""Touch the screen to add objects. Touch an object to remove it."", Toast.LENGTH_LONG).show();                final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);                final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);                engineOptions.getTouchOptions().setRunOnUpdateThread(true);                return new Engine(engineOptions);        }        @Override        public void onLoadResources() {                this.mTexture = new Texture(64, 64, TextureOptions.BILINEAR_PREMULTIPLYALPHA);                TextureRegionFactory.setAssetBasePath(""gfx/"");                this.mBoxFaceTextureRegion = TextureRegionFactory.createTiledFromAsset(this.mTexture, this, ""face_box_tiled.png"", 0, 0, 2, 1); // 64x32                this.mCircleFaceTextureRegion = TextureRegionFactory.createTiledFromAsset(this.mTexture, this, ""face_circle_tiled.png"", 0, 32, 2, 1); // 64x32                this.mEngine.getTextureManager().loadTexture(this.mTexture);                this.enableAccelerometerSensor(this);        }        @Override        public Scene onLoadScene() {                this.mEngine.registerUpdateHandler(new FPSLogger());                final Scene scene = new Scene(2);                scene.setBackground(new ColorBackground(0, 0, 0));                scene.setOnSceneTouchListener(this);                this.mPhysicsWorld = new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH), false);                final Shape ground = new Rectangle(0, CAMERA_HEIGHT - 2, CAMERA_WIDTH, 2);                final Shape roof = new Rectangle(0, 0, CAMERA_WIDTH, 2);                final Shape left = new Rectangle(0, 0, 2, CAMERA_HEIGHT);                final Shape right = new Rectangle(CAMERA_WIDTH - 2, 0, 2, CAMERA_HEIGHT);                final FixtureDef wallFixtureDef = PhysicsFactory.createFixtureDef(0, 0.5f, 0.5f);                PhysicsFactory.createBoxBody(this.mPhysicsWorld, ground, BodyType.StaticBody, wallFixtureDef);                PhysicsFactory.createBoxBody(this.mPhysicsWorld, roof, BodyType.StaticBody, wallFixtureDef);                PhysicsFactory.createBoxBody(this.mPhysicsWorld, left, BodyType.StaticBody, wallFixtureDef);                PhysicsFactory.createBoxBody(this.mPhysicsWorld, right, BodyType.StaticBody, wallFixtureDef);                scene.getBottomLayer().addEntity(ground);                scene.getBottomLayer().addEntity(roof);                scene.getBottomLayer().addEntity(left);                scene.getBottomLayer().addEntity(right);                scene.registerUpdateHandler(this.mPhysicsWorld);                scene.setOnAreaTouchListener(this);                return scene;        }        @Override        public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final ITouchArea pTouchArea, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {                if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN) {                        PhysicsRemoveExample.this.removeFace((AnimatedSprite)pTouchArea);                        return true;                }                return false;        }        public void onLoadComplete() {        }        @Override        public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouchEvent) {                if(this.mPhysicsWorld != null) {                        if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN) {                                this.addFace(pSceneTouchEvent.getX(), pSceneTouchEvent.getY());                                return true;                        }                }                return false;        }        @Override        public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) {                this.mTempVector.set(pAccelerometerData.getY(), pAccelerometerData.getX());                this.mPhysicsWorld.setGravity(this.mTempVector);        }        // ===========================================================        // Methods        // ===========================================================        private void addFace(final float pX, final float pY) {                final Scene scene = this.mEngine.getScene();                this.mFaceCount++;                final AnimatedSprite face;                final Body body;                final FixtureDef objectFixtureDef = PhysicsFactory.createFixtureDef(1, 0.5f, 0.5f);                if(this.mFaceCount % 2 == 0) {                        face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion);                        body = PhysicsFactory.createBoxBody(this.mPhysicsWorld, face, BodyType.DynamicBody, objectFixtureDef);                } else {                        face = new AnimatedSprite(pX, pY, this.mCircleFaceTextureRegion);                        body = PhysicsFactory.createCircleBody(this.mPhysicsWorld, face, BodyType.DynamicBody, objectFixtureDef);                }                face.animate(200, true);                face.setUpdatePhysics(false);                scene.registerTouchArea(face);                scene.getTopLayer().addEntity(face);                this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(face, body, true, true, false, false));        }        private void removeFace(final AnimatedSprite face) {                final Scene scene = this.mEngine.getScene();                final PhysicsConnector facePhysicsConnector = this.mPhysicsWorld.getPhysicsConnectorManager().findPhysicsConnectorByShape(face);                this.mPhysicsWorld.unregisterPhysicsConnector(facePhysicsConnector);                this.mPhysicsWorld.destroyBody(facePhysicsConnector.getBody());                scene.unregisterTouchArea(face);                scene.getTopLayer().removeEntity(face);        }        // ===========================================================        // Inner and Anonymous Classes        // ===========================================================}</code></pre><p>And I get this error in LogCat:</p><pre><code>11-12 20:31:39.482: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test' (No such file or directory)11-12 20:31:39.482: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)11-12 20:31:39.482: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)11-12 20:31:39.482: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)11-12 20:31:55.381: ERROR/BatteryService(52): usbOnlinePath not found11-12 20:31:55.381: ERROR/BatteryService(52): batteryVoltagePath not found11-12 20:31:55.381: ERROR/BatteryService(52): batteryTemperaturePath not found11-12 20:31:55.401: ERROR/SurfaceFlinger(52): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake11-12 20:32:01.131: ERROR/EventHub(52): could not get driver version for /dev/input/mouse0, Not a typewriter11-12 20:32:01.131: ERROR/EventHub(52): could not get driver version for /dev/input/mice, Not a typewriter11-12 20:32:01.351: ERROR/System(52): Failure starting core service11-12 20:32:01.351: ERROR/System(52): java.lang.SecurityException11-12 20:32:01.351: ERROR/System(52):     at android.os.BinderProxy.transact(Native Method)11-12 20:32:01.351: ERROR/System(52):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)11-12 20:32:01.351: ERROR/System(52):     at android.os.ServiceManager.addService(ServiceManager.java:72)11-12 20:32:01.351: ERROR/System(52):     at com.android.server.ServerThread.run(SystemServer.java:176)11-12 20:32:01.361: ERROR/AndroidRuntime(52): Crash logging skipped, no checkin service11-12 20:32:12.683: ERROR/ActivityThread(103): Failed to find provider info for android.server.checkin11-12 20:32:15.853: ERROR/ActivityThread(103): Failed to find provider info for android.server.checkin11-12 20:32:16.183: ERROR/ActivityThread(103): Failed to find provider info for android.server.checkin11-12 20:32:17.303: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound11-12 20:32:17.313: ERROR/MediaPlayer(52): Unable to to create media player11-12 20:32:23.833: ERROR/AndroidRuntime(135): ERROR: thread attach failed11-12 20:32:32.292: ERROR/AndroidRuntime(178): ERROR: thread attach failed11-12 20:32:59.373: ERROR/AndroidRuntime(225): Uncaught handler: thread main exiting due to uncaught exception11-12 20:32:59.533: ERROR/AndroidRuntime(225): java.lang.ExceptionInInitializerError11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at org.anddev.andengine.PhysicsRemoveExample.PhysicsRemoveExample.onLoadScene(PhysicsRemoveExample.java:125)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(BaseGameActivity.java:159)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:1969)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at android.view.View.dispatchWindowFocusChanged(View.java:3731)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:657)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1819)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at android.os.Handler.dispatchMessage(Handler.java:99)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at android.os.Looper.loop(Looper.java:123)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at android.app.ActivityThread.main(ActivityThread.java:4363)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at java.lang.reflect.Method.invokeNative(Native Method)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at java.lang.reflect.Method.invoke(Method.java:521)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at dalvik.system.NativeStart.main(Native Method)11-12 20:32:59.533: ERROR/AndroidRuntime(225): Caused by: java.lang.UnsatisfiedLinkError: Library andenginephysicsbox2dextension not found11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at java.lang.Runtime.loadLibrary(Runtime.java:489)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at java.lang.System.loadLibrary(System.java:557)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     at org.anddev.andengine.extension.physics.box2d.PhysicsWorld.&lt;clinit&gt;(PhysicsWorld.java:30)11-12 20:32:59.533: ERROR/AndroidRuntime(225):     ... 15 more11-12 20:32:59.603: ERROR/dalvikvm(225): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre><p>What is wrong? Have tried with emulator 1.6 and 2.1 and created a whole new AVD.I could do the <a href=""http://www.andengine.org/blog/2010/06/andengine-getting-started-tutorial-video/"" rel=""nofollow"">Getting Started Tutorial (Video – 5 minutes)</a> without any problems.</p>","450019","","321731","","2013-10-05 16:12:33","2013-10-05 16:12:33","What is wrong with my code PhysicsRemoveExample.java (AndEngine)?","<java><android><andengine><physics-engine>","5","0","0","",""
"4168856","1","","","2010-11-12 20:36:59","5","191","<p>I'm having issues while coding for my Evo. While touching the screen, the Evo interprets me touching the buttons as another press on the screen instead of a onKeyDown, onBackPressed, etc. (It actually sets the MotionEvent pointer count to 2, and I can get the co-ords that I'm touching that are off the main screen, for example, 830*190 when touching the back button.)</p><p>Short of coding in the locations of the buttons (which would be different for every phone with capacitive buttons, if they all have the same issue), is there any way to get around this? Does anyone else have this issue with a different capacitive buttoned device?</p>","506237","","","","","2012-10-27 01:19:10","Cant use capacitive buttons while touching the screen","<java><android><touchscreen>","1","6","1","",""
"4168891","1","","","2010-11-12 20:43:02","0","84","<p>There is restaurant, and I have wrote app for them. Now my task is to create device communication: only single app (on a single device) should work at one time. I.e. when user starts to use application on one device, apps on other devices should show warning ""Please, wait..."". How I can do this? Any ideas? I am thinking about creating lock-file on some server (maybe on dropbox open folder???). At start app should look to this folder and if the lock file is exists - wait. If there isn't lock file - app will create it, performs all users tasks, delete lock file, and closes. Another idea - is to use bluetooth connection... Maybe at starting app should seek for bluetooth device with special name... if it isn't - open bluetooth communication with that lock-name and begin to work... But the problem is the device os 1.6.</p>","467750","","","","","2010-11-12 21:26:15","How to conncet few android devices?","<android>","1","0","","",""
"4169055","1","","","2010-11-12 21:10:13","8","9124","<p>I have an application that runs in the background, and displays an error message via the notifications system. This notification has a pendingIntent that leads back the the app's main screen. On this main screen, I have set launchmode=""singleTask"". As I understand it from the Android Dev Guide, this should mean that my main activity will only ever have one instance. </p><p>However, if the user is viewing that activity at the time (or another one within the app), and goes and touches the notification to clear it, it goes ahead and puts another copy of the activity on the stack, so if I hit the back button, it will return to the main screen again (from the main screen). </p><p>Why would it be doing this?</p>","504055","","","","","2013-10-04 00:04:48","Android launchmode=""singleTask"" does not work as expected","<android>","4","0","1","",""
"4169077","1","","","2010-11-12 21:13:10","3","1529","<p>Come on, I know this is simple, but I can't find an answer.  When I autocomplete in Android in Eclipse, the methods get param names like arg0, arg1, etc.  Presumably, this would be better if I had source or something for Android located somewhere, but there are 14,000 git repositories for it and I don't know which to grab or what to do after.</p><p>Can someone help??  I don't want ""View arg0"" I want ""View v"" or something. :-)</p>","185387","","","","","2013-10-31 14:26:06","Android in Eclipse autocompletes arg0, arg1,","<java><android>","3","3","1","",""
"4169189","1","4169676","","2010-11-12 21:29:13","1","2070","<p>I am able to successfully get lat/long and pass it to the geocoder to get an Address. However, I don't always get an address back. Seems like it takes a couple of attempts? I'm not sure why. </p><p>Is there a better way for me to obtain the address at this point?</p><pre><code>public List&lt;Address&gt; getAddresses(){          Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());          List&lt;Address&gt; addresses = new ArrayList();             try {       addresses = geocoder.getFromLocation(latitude, longitude, 1);      } catch (IOException e) {       e.printStackTrace();      }      return addresses;        }</code></pre><p>I am calling this method here:</p><pre><code>LocationListener onLocationChange=new LocationListener() {        public void onLocationChanged(Location loc) {            //sets and displays the lat/long when a location is provided            String latlong = ""Lat: "" + loc.getLatitude() + "" Long: "" + loc.getLongitude();               latitude = loc.getLatitude();            longitude = loc.getLongitude();            List&lt;Address&gt; addresses = getAddresses();            if(addresses.size() &gt; 0 &amp;&amp; addresses != null)             zipcode = addresses.get(0).getPostalCode();            Toast.makeText(getApplicationContext(), zipcode,Toast.LENGTH_SHORT).show();        }</code></pre>","19875","","19875","","2010-11-12 22:45:15","2012-09-27 18:59:16","Geocoder doesn't always return a value","<java><android><reverse-geocoding><geocode><google-geocoder>","2","3","2","",""
"4169254","1","4169403","","2010-11-12 21:36:55","1","366","<p>How could I best send a message using the Android from an external email address to the user's email address or SMS?</p><p>For example, when the phone senses acceleration, it sends a message from youdroppedme@gmail.com to the user's gmail account.</p><p>I would prefer to use the core API, if possible. I am also considering using a web server as a go between. What is the most elegant solution?</p><p>Thank you!</p>","413161","","","","","2010-11-12 21:52:35","Android Email or SMS ALerts","<android>","1","0","","",""
"4169387","1","","","2010-11-12 21:51:01","1","1996","<p>I need to use this for a Samsung Tablet.</p><p>Usually if the device is switched-off and the USB cable is being connected the display will wake up for some seconds showing an animated battery. Instead I want to let it boot.</p><p>I suspect this is close to the metal. Where do I have to make a modification?In the kernel, in the Android platform, or is this hidden in some proprietary code of the manufacturer?</p>","506290","","","","","2014-01-02 08:03:58","How to make Android device boot when power is plugged in?","<android><linux-kernel><android-ndk>","3","1","","",""
"4169420","1","4169444","","2010-11-12 21:54:41","2","1113","<p>I am a junior software developer working mostly in c#.</p><p>I am being tested at work by my boss for a new role as an android sdk developer. I passed the first interview and now he wants me to write a small application which boasts certain simple features such as communication via GPRS service and handling data (i guess he means use a sqlite table to store some input).</p><p>Anyone got any simple ideas you can throw at me to give me a good starting point.</p><p>Any ideas are welcome,thanks in advance.</p>","377613","","","","","2010-11-12 22:00:21","Need simple idea for a simple android app","<java><android><programming-languages>","3","0","","",""
"4169439","1","","","2010-11-12 21:59:13","0","346","<p>according to the android specs all the sensors must have their axes oriented the same way, as specified in:</p><p><a href=""http://developer.android.com/reference/android/hardware/SensorEvent.html"" rel=""nofollow"">http://developer.android.com/reference/android/hardware/SensorEvent.html</a></p><p>I have two Motorola phones: mb300 and motorola flipout.</p><p>In the flipout the magnetic field sensor is mounted correctly. But in the mb300 they swapped the X and Y axes.By testing I confirmed that the <em>accelerometer</em> is mounted correctly on both phones and the values agree witheach other. But regarding the magnetic field sensors the values don't agree, but they started too agree after I performed the following operation on the mb300:</p><p>(data is the array SensorEvent.values)</p><pre><code>if (type == Sensor.TYPE_MAGNETIC_FIELD) { //becauseof mb300 phone    float swap;    swap = -data[1]; //x = -y    data[1] = data[0]; //y = x    data[0] = swap;}</code></pre><p>I have tested this carefully.</p><p>Has anyone else noticed this?</p>","480894","","","","","2011-03-04 16:32:29","MB300 phone: magnetic field sensor mounted incorrectly?","<android><android-hardware>","1","0","","",""
"4169558","1","4169819","","2010-11-12 22:16:24","3","3496","<p>I have a count down timer that when it goes off (to zero) it checks to see if the app has focus. If not it launches a notification in the notification bar. When you click on the notification is re-opens the app. Now all of this works fine but if the screen happens to go off, the timer keeps going and the notification is available at the right time but never actually vibrates or rings until i turn the screen back on. Then it displays the notification like it was waiting in a queue or something.</p><p>How do I get it so that the notification manager will actually alert the user when the screen is turned off?</p><p>Update: If I set the timer for 2 minutes, it takes another 2-3 minutes for the notification to actually work. So it does work but it's on a huge delay!</p><p>Code: So I setup the notification service when the app loses focus, and when the MyCount1 is finished is checks if the app has focus and if not it shows the notification. This all works when the screen backlight is on. Once it goes off it is unreliable.</p><pre><code>@Override    public void onWindowFocusChanged(boolean hasFocus){        if(hasFocus == false){            mFocusFlag = false;            ns = Context.NOTIFICATION_SERVICE;            mNotificationManager = (NotificationManager) getSystemService(ns);            icon = R.drawable.statusbar;            tickerText = ""Check the timer!!!"";            when = System.currentTimeMillis();            notification = new Notification(icon, tickerText, when);            context = getApplicationContext();            contentTitle = ""Countdown Timer"";            contentText = ""Click to Check the Timer"";            notification.defaults |= Notification.DEFAULT_SOUND;            notification.defaults |= Notification.DEFAULT_VIBRATE;            notification.flags |= Notification.FLAG_AUTO_CANCEL;            notificationIntent = new Intent(this, StartTimer.class);            contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);            notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);        }else{            mFocusFlag = true;        }    }public class MyCount1 extends CountDownTimer {        public MyCount1(long millisInFuture, long countDownInterval) {          super(millisInFuture, countDownInterval);        }        public void onFinish() {          if(mFocusFlag == false){              mNotificationManager.notify(HELLO_ID, notification);          }else{              mVib.vibrate(1000);              }        }        public void onTick(long millisUntilFinished) {            if((millisUntilFinished/1000%60) &lt; 10){                mTime.setText(""1st Side = "" + millisUntilFinished/60000 + "":0"" + (millisUntilFinished / 1000)%60);            }else{                mTime.setText(""1st Side = "" + millisUntilFinished/60000 + "":"" + (millisUntilFinished / 1000)%60);            }        }       }</code></pre>","394093","","71059","","2012-04-13 14:21:53","2012-04-13 14:21:53","Android notification manager doesn't work with the screen is off","<android><notifications><manager><screen-off>","2","2","2","",""
"4169562","1","4548967","","2010-11-12 22:17:12","1","1896","<p>I'm trying to import a vcard into the android contacts. Within the contact manager there is an option to import a vcf file stored on the sd-card into the contacts. How can this be triggered via code?</p><p>Thanks,Prateek</p>","481314","","","","","2011-09-28 19:27:38","import vcard in android 2.1","<android><contacts><import><vcf>","1","0","2","",""
"4169630","1","","","2010-11-12 22:27:06","0","55","<p>Hi there I am looking for a utility that can monitor media streaming information while the media is being accessed via a handset device...does anyon</p>","491805","","","","","2010-11-12 22:27:06","what utilities can monitor media streaming from handset devices?","<android>","0","2","","",""
"4169699","1","4169793","","2010-11-12 22:37:21","0","2562","<p>In Android if I have an edit text and the user entered 123456789012, how could I get the program to insert a dash every 4th character. ie: 1234-5678-9012?</p><p>I guess you need to say something along the lines of:- a=Characters 1~4, b=Characters 5~8, c=Characters 9-12, Result = a + ""-"" + b + ""-"" + c. But I am unsure of how that would look in Android.</p><p>Many thanks for any help.</p>","497517","","21234","","2010-11-13 15:01:13","2013-06-20 22:31:15","String Manipulation insert a character every 4th character","<java><android><string><concatenation><edittext>","3","0","","",""
"4169714","1","4169817","","2010-11-12 22:39:39","8","15515","<p>I'm attempting to call startActivity(myIntent) from the click of a menu button but my application crashes at that point.</p><p>The same startActivity call works fine from a regular button click, so, I assume the menu button is missing information about the context? Or maybe I'm totally off the mark here.</p><p>So... what's the correct way to have a menu item take me to a specific Activity?</p><p>I've revised my code based on the initial set of advice.  Still crashing in the same place. The debugger doesn't enter the exception clause, the app just dies. </p><p>[EDITED WITH CODE SNIPPET]</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.menu, menu);  return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    // Handle item selection   try{    switch (item.getItemId()) {    case R.id.menuItemLang:                    startActivity(new Intent(""com.my.project.SETTINGS""));        return true;            default:        return super.onOptionsItemSelected(item);    }   }catch(Exception e){      log(e);   }}</code></pre>","59947","","59947","","2010-11-13 01:31:43","2010-11-14 12:50:02","How to call Activity from a menu item in Android?","<android>","2","3","3","",""
"4169771","1","","","2010-11-12 22:51:02","2","1265","<p>I write app with SL4A on Android. I want to send midi signals to Ableton Live. Tell me, HOW :> What library will be good for that ? </p>","506347","","1004889","","2012-12-22 16:40:56","2012-12-22 16:40:56","Python + MIDI + Ableton Live, How?","<android><python><midi><ableton-live>","1","1","1","",""
"4169844","1","4169985","","2010-11-12 23:08:31","2","10226","<p>I have an Android (developed on A2.2) app with following theme defined:</p><pre><code>&lt;style name=""ProgressBar""&gt; parent=""@android:style/Widget.ProgressBar""&gt;    &lt;item name=""android:indeterminateDrawable""&gt;@drawable/progress_medium&lt;/item&gt;&lt;/style&gt;&lt;style name=""AlertDialog"" parent=""@android:style/AlertDialog""&gt;    &lt;item name=""android:fullDark""&gt;@drawable/bgr_alert&lt;/item&gt;&lt;/style&gt;&lt;style name=""MyTheme"" parent=""@android:style/Theme.Light.NoTitleBar""&gt;    &lt;item name=""android:alertDialogStyle""&gt;@style/AlertDialog&lt;/item&gt;    &lt;item name=""android:progressBarStyle""&gt;@style/ProgressBar&lt;/item&gt;&lt;/style&gt;</code></pre><p>where 'progress_medium' drawable is my custom (blue) progressbar and 'bgr_alert' is custom (white) background.</p><p>When I show the dialog (application's theme is 'MyTheme')</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {  progressDialog = new ProgressDialog(this);  progressDialog.setCancelable(false);  progressDialog.setIndeterminate(true);  return progressDialog;}</code></pre><p>the dialog that shows up contains custom background (white), but the indeterministic progressBar is not visible. </p><p>On the other hand, if I set the progress drawable manually:</p><pre><code>progressDialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progress_medium));</code></pre><p>everything is perfect - custom background and custom progress drawable.</p><p>Any hint, why the progressBar drawable is not set implicitly by theme theme?</p>","97309","","683261","","2012-01-25 10:49:18","2012-01-25 10:49:18","How to set theme for indeterministic ProgressBar in ProgressDialog in Android","<android><themes><progress-bar><progressdialog><customdialog>","2","0","3","",""
"4170132","1","","","2010-11-13 00:13:15","1","239","<p>Howdy,I would like to implement a ListView in a Relative Layout - however, that ListView should not be scrollable. Meaning: It should show all of it's elements in the RelativeLayout/LinearLayout.</p><p>The elements should change the colors on touch and call an intent on click.</p><p>What would be the best approach to reach that goal? CustomListView implementation, maybe I don't even need to use a listview?</p>","498400","","","","","2010-11-13 01:06:34","ListView in a Relative Layout","<android>","1","2","","",""
"4170154","1","4198104","","2010-11-13 00:18:07","3","1676","<p>I am trying to apply the custom grammar for speech recognition. I have found a lot of documentation about android.speech.recognition package, it seams as the good place to start, but it seams that it doesn't exist in the Android SDK..</p><p>Is there a way to apply a custom grammar rules to the android speech recognition at all..?</p>","506381","","","","","2011-12-23 02:02:56","Custom grammar for speech recognition","<android><speech-recognition>","2","0","","",""
"4170338","1","4170344","","2010-11-13 01:05:15","1","296","<p>It seems like it would be very useful to make a widget that you can type directly into. </p><p>Does anyone know what the rationale was for not supporting it, and if it's slated to be supported on future versions?</p>","59947","","119280","","2010-11-13 01:08:08","2010-11-13 01:08:08","Why do RemoteViews (Widgets) not support EditText views in Android?","<android>","1","0","","",""
"4170397","1","","","2010-11-13 01:19:21","0","475","<p>Android Binder document has an simple example about how to pass an object Rect through Binder interface, I'm wondering how to do the modeling if the object itself has some methods which are also defined by AIDL interface? </p><p>For example, project A owns MusicStoreManager, project B owns MusicStore and Music, the interaction is through Binder IPC. I'm using IMusicStore.aidl defines a method ""IMusic getMusic(int musicId)"", and the IMusic.aidl defineds a method ""byte[] getMusicData(int from, int to)"", but I'm stuck here:</p><ol><li><p>How to model the Music class, the IMusic interface, and the IMusic.stub on the project B in general? </p></li><li><p>Should or CAN the getMusic() method return a IMusic.Stub instance or Music instance in the following code? </p></li><li><p>How to understand the IMusic.Stub? </p></li><li><p>Does the class Music has to implement IMusic interface as well as Parcelable?</p></li></ol><p>Many thanks - I'm really confused.</p><pre><code>public class MusicStoreService extends Service {    ...    protected static final IMusicStore.Stub store = new IMusicStore.Stub() {        ...        public IMusic getMusic(int id) throws RemoteException {            return new Music(id); // or return new IMusic.Stub() ???        }    }    ...    protected static final IMusic.Stub music = new IMusic.Stub() {        ...        public byte[] getMusicData(int from, int to) throws RemoteException {            // open the associated file, read the data within range, return it back.        }    }    ...}public class Music extends Object implements Parcelable, IMusic {    ...    public byte[] getMusicData(int from, int to) throws RemoteException {        // open the associated file, read the data within range, return it back.    }    ...}</code></pre>","506376","","506376","","2010-11-13 01:26:31","2010-11-13 01:29:10","Android Binder modeling question - MusicStore, IMusicStore.aidl, Music, IMusic.aidl","<android><api><ipc><modeling><aidl>","1","0","","",""
"4170413","1","4170686","","2010-11-13 01:25:30","2","848","<p>My company built its own project management web application.  It's like basecamp on steroids.  The core features of this application are:</p><ul><li>create task lists</li><li>assign tasks to team members</li><li>track hours against task items</li></ul><p>I am looking to build mobile application(s) as an extension to the web application.  The mobile applications(s) must:</p><ul><li>reproduce the features mentioned above</li><li>connect to the same database as the web application</li><li>retain drag drop capabilities</li><li>provide a rich user experience equivalent to or better than the web application</li><li>work on iphone, droid and blackberry</li></ul><p>Given the requirements above, how should I approach the development of this mobile application?  There's about 20 smart phone users in my company: 8 iphones, 7 droids and 5 blackberries.</p><p>I've heard of development frameworks like Phonegap that allow you to develop in HTML, Javascript and CSS.  The software then works cross platform across blackberry, iphone and droid.  If I am an average/slightly-above-average programmer, will I be able to build a high quality cross platform mobile application with PhoneGap (or another x platform development framework) that meets the above requirements?</p><p>Or should I build each iphone, droid and blackberry application independently?</p><p>What's the best approach?  What are the trade offs?</p>","27305","","27305","","2010-11-13 02:10:09","2010-12-17 19:33:55","Approach to developing mobile application that supports a web application","<iphone><android><blackberry><mobile><smartphone>","2","0","3","",""
"4170465","1","4428256","","2010-11-13 01:40:05","1","4659","<p>I have a DatePicker which I follow changes with </p><pre><code>dp.init(dp.getYear(), dp.getMonth(), dp.getDayOfMonth(), new OnDateChangedListener() {   public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {...}</code></pre><p>But I don't find any way to find the before / after values.</p><p>I would like to increment a second date (date 2) by the kind of increment done on date 1. If the user change the days, i'd like to add days to the second date, if years, I'd like to add years. Do you see a way to do this ?</p><p>After all, I would also like to forbid some values, and be able to bring back the date1 to its original value (those before the change). Any idea for this ?</p><p>I'm searching but I don't find anything that would allow me to do those two things.</p><p>Any help would be greatly appreciated.</p><p>Thank you.</p><p>Oliver</p>","499417","","499417","","2010-12-29 00:55:32","2010-12-29 00:55:32","Android - DatePicker onDateChanged before after values","<android><datepicker>","1","1","","",""
"4170559","1","4175213","","2010-11-13 02:07:48","2","458","<p>Ok so I am writing a game that has a shop. The shop is where i am having problems because each item in the shop has several stats and then 2 buttons and an edit text for buying/selling. </p><p>The layout for the shop has 3 tabs with 26 items in each tab and that totals to: 130 ImageViews, 364 TextViews, 52 Buttons, and 26 EditTexts per tab. So if you keeping count that is a total of 1,768 views in one 3 tabbed layout. (I know, ""<b>HOLY CRAP!</b>"")</p><p>I wasn't really thinking about efficiency as I was writing this section and now I find that loading this activity takes on average 3-5 seconds or more. I want it to load quicker but I like the layout and the general ""look and feel"" of the shop as it is.</p><p>I have already broke up the listeners so that it is only listening to the elements in the current tab and turns off the listeners for the inactive tabs. This helped a little but i don't think that was a major aspect of the problem.</p><p>Can anyone suggest anything else I can do to help the loading time on this activity?</p><p>EDIT: <a href=""http://i37.photobucket.com/albums/e99/Dead_Jester/Other/screen_shot.png"" rel=""nofollow"">Screenshot.</a> I have heard something about a recycler? What is that and would it apply here to help loading times?</p>","506426","","506426","","2010-11-14 20:28:53","2010-11-14 20:28:53","Android Efficiency: long loading time problem, lots of views","<android><views><performance>","1","1","1","",""
"4170676","1","4170705","","2010-11-13 02:43:05","1","850","<p>The <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#insert%28java.lang.String,%20java.lang.String,%20android.content.ContentValues%29"" rel=""nofollow"">SQLiteDataBase.insert(String, String, ContentValues)</a> convenience method takes a <code>ContentValues</code> object which contains all of the column values of a row to be inserted into the database. If I use the <code>ContentValues.put()</code> methods to build a <code>ContentValues</code> object to insert into the database, does either <code>put()</code> or <code>insert()</code> sanitize the input or do I have to do that myself?</p>","434731","","503900","","2012-08-24 01:11:48","2013-02-12 19:37:40","Does the Android SQLite implementation sanitize input via the SQLiteDatabase.insert() method?","<android><sqlite><input>","2","1","","",""
"4170701","1","","","2010-11-13 02:49:52","0","62","<p>I am trying to make an app for the Android that does RMD calculations.  The program, however, keeps giving 0.0.</p><p>I think that my problem lies in this code:</p><pre><code>package com.MinDis.android;import java.util.*;import java.text.*;public class RMD{ double balance; double rmd; long age; String bdate; SimpleDateFormat sd = new SimpleDateFormat(""MM/dd/yyyy""); Date current = new Date(); public void setBalance(double i) {  balance = i; } public double getBalance() {  return balance; } public void setBDate(String h) {  bdate = h; } public long getAge() throws Exception {  Date birthd = sd.parse(bdate);  long cur;  long birth;  long diff;  cur = current.getTime();  birth = birthd.getTime();  diff = cur - birth;  age = (diff/(24*60*60*1000))/365;  return age; } public double getRMD() {  if (age == 70)  {   rmd = balance/27.4;  }  if (age == 71)  {   rmd = balance/26.5;  }  if (age == 72)  {   rmd = balance/25.6;  }  if (age == 73)  {   rmd = balance/24.7;  }  if (age == 74)  {   rmd = balance/23.8;  }  return rmd; }}</code></pre><p>I tried using .equals(), but it complained that I was trying to dereference the long value.  Also, I am aware that java.util.Date is deprecated, but I don't want to try the other classes. From my first Android app, I figured out the ""=="" does not work, but I am not sure what to do here.</p><p>I have verified that the input for a balance and the birthdate values were accepted, so that is how I limited it to this particular class.</p>","506440","","","","","2010-11-14 00:57:29","Required Minimum Distribution Calculation not working","<android>","2","0","","",""
"4170724","1","4170952","","2010-11-13 03:00:30","0","122","<p>EDIT: I have figured out my main issue, but still have one concern. Everything below this paragraph has been solved. I am now able to populate fields on one activity after selecting from a list in the other. The only problem is that after I ""quick add"", I get stuck with the quick add screen between two versions of the other screen. In other words, say I press the quick add button and my listview activity comes up. When I select an item, it essentially goes forward and creates another instance of the original activity. So if you hit the back button, you have to go back through the listview, then back to the original instance of the original activity. Is there any way to avoid this?</p><p>I have a button in one activity that opens a list view in another that's populated with two columns from a database - name and price (this was modeled on the Notepad tutorial). The list is meant as a ""quick add"" option. What I want it to do is, when pressed, populate the ""name"" and ""price"" EditTexts in the previous activity with the corresponding database entry.</p><p>So as per the tutorial, this is what I have in my ItemPicker class:</p><pre><code> @Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Cursor c = mNotesCursor;    c.moveToPosition(position);    Intent i = new Intent(this, NewEntry.class);    i.putExtra(ItemsDbAdapter.KEY_ROWID, id);    i.putExtra(ItemsDbAdapter.KEY_NAME, c.getString(             c.getColumnIndexOrThrow(ItemsDbAdapter.KEY_NAME)));    i.putExtra(ItemsDbAdapter.KEY_PRICE, c.getString(            c.getColumnIndexOrThrow(ItemsDbAdapter.KEY_PRICE)));    startActivityForResult(i, ACTIVITY_AUTO);}</code></pre><p>I'm completely lost when it comes to retrieving that info in the NewEntry class. I figure it's a matter of getting the extras, but I don't even know how to start formatting the code. </p><p>Also, I need it to switch back to the NewEntry class activity automatically. Is that as easy as adding a startActivity() to this method? Thanks.</p><p>EDIT: Nevermind, figured this one out finally. Here's the code in my other activity:</p><pre><code>Bundle extras = getIntent().getExtras();    if (extras != null) {        editName.setText(extras.getString(ItemsDbAdapter.KEY_NAME));        editPrice.setText(extras.getString(ItemsDbAdapter.KEY_PRICE));    }</code></pre>","503185","","503185","","2010-11-13 03:38:25","2010-11-13 04:30:42","Populating EditTexts in one activity using a ListItemClick from another - how to make this work?","<java><mysql><android>","1","0","","",""
"4170784","1","4170858","","2010-11-13 03:22:56","0","3497","<p>I have some images that I want to put on top of each other on random order.</p><p>If it possible using one ImageView or do I need to create multiple image views based on number of images?</p>","33411","","","","","2010-11-13 09:14:31","Draw images on top of each other in android","<android><image>","2","0","","",""
"4170821","1","4170857","","2010-11-13 03:34:58","3","885","<p>I have my <code>android:screenOrientation=""portait""</code> on but when a physical keyboard is opened it doesn't rotate the screen as I wanted, but it restarts the app. It seems to run onCreate over again or something. Can someone point me in the right direction and/or tell me how to intercept this and handle it? Thanks.</p>","394093","","","","","2010-11-13 03:47:42","Android: How to prevent opening physical keyboard restarting app","<android><keyboard><physical>","2","0","","",""
"4171061","1","","","2010-11-13 05:03:14","1","393","<p>I'm looking to somehow enable access for my app to use up practically all  the device's RAM. This app I am creating is not designed for general release, it is just a personal project, but it requires a ton (~128mb) of RAM. My Nexus One has 512MB of RAM, but yet I cannot allocate more then ~10MB of RAM max. How can I let my app allocate as much as it wants?</p>","764272","","","","","2010-11-13 06:38:02","Android: use up tons of RAM?","<android><memory-allocation><memory-management>","1","0","1","",""
"4171141","1","","","2010-11-13 05:35:05","0","1643","<p>I am working android app, where i need  a Listview which contain different types of view sets.They have to update dynamically. i.e , initially i have some list of views, with one header.Next when i click button i have to add new view set with different header. So can any one tell me . how to achive this complex listview. </p><p>ex.My list looks like </p><p>initially looks like this </p><p><strong>Countries (Header)</strong>   (Each row contain text and image)</p><ul><li>India</li><li>Australia</li><li>America</li></ul><p>next when i click button , i have to update listView like ....<strong>Countries (Header)</strong>   (Each row contain text and image)</p><ul><li>India</li><li>Australia</li><li>America</li></ul><p><strong>Currencies(Header)</strong>(Each row contain textview button , progressBar)</p><ul><li>Rupee</li><li>Australia dollar</li><li>Dollar</li></ul><p>Can any one help me to resolve this ?With some example ?</p><p>Thanking you,Srinivas</p>","414777","","","","","2011-06-11 06:31:13","Android : How to create advance (complex) Listview and to handle?","<android><listview>","1","0","","",""
"4171173","1","4171372","","2010-11-13 05:48:17","5","554","<p>I am developing an android application where i need to determine the free space available on the sdcard. Can anyone give me some suggestion regarding this please.</p><p>thankskaisar</p>","438383","","","","","2010-12-02 18:38:33","how to obtain available free space on sdcard from android application?","<android>","2","0","2","",""
"4171234","1","4171427","","2010-11-13 06:06:54","2","14589","<p>i want to get the key value when user pressed any key and also perform action based on  the key pressed in android.</p><p>e.g. if user pressed 'A' key then i want to get that value,compare,do something.</p>","489902","","1190934","","2013-06-24 16:51:19","2013-06-24 16:51:19","Android:how to get any KeyPress event with example?","<android><event-handling>","2","0","3","",""
"4171252","1","","","2010-11-13 06:12:31","2","1523","<p>is it possible to check the status of ""Sound pool"". i want to perform some function when it will start and stop. like ;mediaplayer's function ""isplaying() "". is sound pool has this type of functionality... </p>","304961","","","","","2012-10-05 06:38:27","Android sound pool function","<android>","2","0","","",""
"4171259","1","","","2010-11-13 06:14:46","0","479","<p>My android application has both Java code and c++ code in it.</p><p>While testing on 2.1 simulator my logcat shows this error.</p><p><code>INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys'</code></p><p>I'm pretty sure this error is related to <strong>c</strong> code</p><p>Can anybody tell me what does this error means? When it occurs? </p>","246942","","","","","2010-11-13 06:14:46","Problem in my appliction, can't understand what does the error message says","<android><android-ndk>","0","5","","",""
"4171271","1","4172069","","2010-11-13 06:18:29","3","6863","<p>Ok so i have decided that I hate SQL and for that purpose I am trying to make a helper class that I can reuse over and over and never have to mess with it again but it isnt working!</p><p>Here is what i have right now:</p><p>DBAssistant.java    </p><pre><code>    public class DBAssistant {            SQLiteDatabase db = null;        public DBAssistant (){              }        /** Opens database **/        public void openDB(Context context, String name){            db = new DBOpenHelper(context, name, DB_VERSION);        }        /** Creates the table ""tableName"" with the columns contained in ""cols"" **/        public void createTable(String tableName, String[] cols){            String table = ""CREATE TABLE IF NOT EXISTS "" + tableName + "" ("";            int numOfColums = cols.length;            columnNames = cols;            for (int i = 0; i &lt; (numOfColums - 1); i++){                table += cols[i] + "" VARCHAR, "";            }            table += cols[numOfColums - 1] + "" VARCHAR);"";            try{            db.execSQL("""" + table);            System.out.println(""ExecSQL:"" + table);            } catch(Exception e){                System.out.println(e);            }            System.out.println(""Column names: "");            for (String c : getColNames(tableName)){                System.out.print(c + "" "");            }        }        /** Inserts ""data"" into new row **/        public void insertRow(String tableName, String[] data){            int cols = getCols(tableName);            System.out.println(""if ((data.length) = "" + (data.length) + "") =="" +                    "" (getCols(tableName) = "" +  getCols(tableName) + "")?"");            if (data.length == cols){                System.out.println(""Inside if loop"");                String cmd = ""INSERT INTO "" + tableName + "" ("";                for (int i = 0; i &lt; cols - 1; i++){                    cmd += getColNames(tableName)[i] + "", "";                }                cmd += getColNames(tableName)[cols - 1] + "") VALUES ('"";                for (int k = 0; k &lt; data.length - 1; k++){                    cmd += data[k] + ""', '"";                }                cmd += ""');"";                System.out.println(cmd);                db.execSQL(cmd);            }            else{                System.out.println(""Inside else loop"");                String dat = """";                String sCols = """";                for (String d : data)                    dat += ""'"" + d + ""'"";                for (String c : getColNames(tableName))                    sCols += ""'"" + c + ""'"";                System.out.println(""-------------------"");                System.out.println(""[insertRow] ERROR: Number of elements in data["" + dat + ""]"");                System.out.println(""doesnt match the number of columns ["" + cols + ""] in "" + tableName);                System.out.println(""-------------------"");            }                   }        /** Return String[] containing the column names in tableName **/        public String[] getColNames(String tableName){            Cursor c = db.rawQuery(""SELECT * FROM "" + tableName , null);            return c.getColumnNames();        }        /** Returns the number of rows in tableName **/        public int getCols(String tableName){            return getColNames(tableName).length;        }    /***  Other methods that have no relevance here .... ***/private static class DBOpenHelper extends SQLiteOpenHelper {    DBOpenHelper(Context context, String dbName, int dbVersion) {       super(context, dbName, null, dbVersion);    }    @Override    public void onCreate(SQLiteDatabase arg0) {        // Do Nothing    }    @Override    public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {        // Do Nothing    } }}</code></pre><p>I have included several System.out.println() statements to help me debug the code and find problems so please ignore them. PrintDB is another test that I wrote that I am using to make sure everything is working. Now this is what I have written to make sure everything is working....</p><pre><code>DBAssistant db = new DBAssistant();String dbName = ""testing"";String tableName = ""test"";String[] cols = {""_num"", ""num_eng"", ""num_span""};String[] row1 = {""1"", ""one"", ""uno""};String[] row2 = {""2"", ""two"", ""dos""};String[] row3 = {""3"", ""three"", ""tres""};String[] row4 = {""4"", ""four"", ""quatro""};String[] row5 = {""5"", ""five"", ""cinco""};TextView databaseView = (TextView)findViewById(R.id.databaseView);db.openDB(this, dbName);db.createTable(tableName, cols);db.insertRow(tableName, row1);db.insertRow(tableName, row2);db.insertRow(tableName, row3);db.insertRow(tableName, row4);db.insertRow(tableName, row5);databaseView.setText(db.printTable(tableName));</code></pre><p>Running this code everything goes great and all the System.out.println() statements have the right information in them until it gets to the <code>databaseView.setText(db.printTable(tableName));</code>part and it throws an exception </p><pre><code>ERROR/AndroidRuntime(3440): android.database.sqlite.SQLiteException: no such table: test: , while compiling: SELECT * FROM test</code></pre><p>pointing to the line  in the printTable() method</p><pre><code>Cursor c = dbr.rawQuery(""SELECT * FROM "" + tableName , null);</code></pre><p>This has me so confused because that same line of code is used in the getColNames() method that was called several times before this and ran with no problem. Also if the table didn't exist wouldn't it have thrown an exception when I called insertRow()? I called that method 5 times in a row with not a single exception thrown! What is happening here?<br><br><br>Edit: <br></p><blockquote>  <p>Implement onCreate() in your DBOpenHelper. Put there content of the createTable() method.</p></blockquote><p>Why would it be necessary to create the table in the onCreate() method? If I were to do this would I be able to use my existing method to do so and just call it from this method?</p><blockquote>  <p>And the second why you don't use content providers and uri >concept which is already SQLless?</p></blockquote><p>Wha...? I have no idea. Please explain what that is or leave me a link to some sort of a tutorial.</p>","506426","","506426","","2010-11-14 20:39:44","2013-01-14 20:27:44","Android: Sqlite Exception no such table?","<android><exception><sqlite><table>","3","3","1","",""
"4171352","1","4201474","","2010-11-13 06:45:18","0","1828","<p>How can we use OCR web service in android applicationI have use this webservice. How can i pass data using soap base web service and get response back.How can i pass request for nested XML tags ?</p><p><a href=""http://www.ocrwebservice.com/services/OCRWebService.asmx?op=OCRWebServiceRecognize"" rel=""nofollow"">http://www.ocrwebservice.com/services/OCRWebService.asmx?op=OCRWebServiceRecognize</a></p><p>Please help..</p>","363503","","363503","","2010-11-17 04:23:55","2012-11-20 09:08:56","How to use OCR web service in android application. How can we send request and get response?","<android><web-services><ocr>","2","1","1","",""
"4171381","1","4171469","","2010-11-13 06:54:24","0","3495","<p>HiI need to create a service that runs a piece of code in new thread after (let us say) 10 mins. How can I do that? I have service ready but I don't seem to understand how (if ) to call timer from within thread. can any one help?</p>","499773","","","","","2010-11-13 18:07:29","Android: How to run thread in Service after timely intervals?","<android>","3","0","3","",""
"4171436","1","4231239","","2010-11-13 07:21:32","1","1210","<pre><code>import java.util.List;import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import android.view.ViewGroup;import android.widget.*;import com.google.android.maps.MapView;public class MapView extends MapActivity {      LinearLayout linearLayout;      MapView mapView;      /** Called when the activity is first created. */      public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.map);          mapView = (MapView) findViewById(R.id.mapview);          mapView.setBuiltInZoomControls(true);          MapController mapController = mapView.getController();      }}</code></pre>","505453","","1128737","","2012-01-12 19:18:24","2012-01-12 19:18:24","Unable to import com.google.android.maps.MapView (Eclipse)","<java><android>","2","0","","",""
"4171479","1","","","2010-11-13 07:35:25","1","727","<p>Is there a way I can access the system preference for vibration settings?</p><p>I have an alarm-like app which I want to inherit the vibration setting from the phone's ring/sound settings. However, I do not know how to programmatically access these settings.</p>","490703","","379693","","2010-11-13 09:39:06","2012-09-11 23:09:43","is the vibration for call setting accessible in android?","<android><android-sdk-2.1><setting><vibration><android-vibration>","2","1","","",""
"4171560","1","","","2010-11-13 08:02:23","3","436","<p>BlobCity.java:  package BlobCity.xyz.com;</p><p>import java.io.BufferedReader;</p><p>import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.util.Map;</p><p>import android.app.Activity;import android.content.Intent;import android.content.pm.ActivityInfo;import android.net.Uri;import android.os.Bundle;import android.widget.*;import android.util.Log;import android.view.Gravity;import android.view.View;import android.view.View.OnClickListener;</p><p>import org.apache.http.HttpResponse;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;</p><p>public class BlobCity extends Activity{    /** Called when the activity is first created. */   Button signIn,register;   TextView Blob,City,username,password;   EditText eUsername,ePassword;    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code> signIn = (Button) findViewById(R.id.signIn);   register = (Button) findViewById(R.id.register); Blob = (TextView) findViewById(R.id.blob); City = (TextView) findViewById(R.id.city); username = (TextView) findViewById(R.id.username); password = (TextView) findViewById(R.id.password); eUsername = (EditText) findViewById(R.id.eUsername); ePassword = (EditText) findViewById(R.id.ePassword); signIn.setOnClickListener(new sendUserPass()); register.setOnClickListener(new regPage());         }class sendUserPass implements Button.OnClickListener   {    public void onClick(View v)    {            String uname = eUsername.getText().toString();     String pwd = ePassword.getText().toString();     String requestString = (""http://192.168.1.102:8080/BlobCity/RemoteLogin?email=""+ uname + ""&amp;pwd="" + pwd);     String line;      try {                                                                                                                                                 HttpResponse response = new DefaultHttpClient().execute(new HttpGet(requestString));          InputStream is = response.getEntity().getContent();          BufferedReader br = new BufferedReader(new InputStreamReader(is));          StringBuilder rb = new StringBuilder("""");          while ((line=br.readLine()) != null)               {                rb.append(line) ;                                                      }           if(rb.toString().equals(""0""))            {             Toast toast = Toast.makeText(getApplicationContext(), ""Please enter a valid Username and/or Password!"", Toast.LENGTH_LONG);             toast.show();             toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);             eUsername.setText("""");             ePassword.setText("""");            }           else            {                setContentView(R.layout.map);               eUsername.setText("""");               ePassword.setText("""");            }          }       catch (ClientProtocolException e)           {           e.printStackTrace();          }       catch (IOException e)          {           e.printStackTrace();          }    }  }class regPage implements Button.OnClickListener   {    public void onClick(View v)    {         Intent browse = new Intent( Intent.ACTION_VIEW , Uri.parse(""http://www.blobcity.com"") );         startActivity(browse);                     }  }</code></pre><p>}</p><p>============================================================================</p><p>main.xml:</p><p></p><p></p><p></p><p></p><p> </p><p></p><p> </p><p> </p><p>  </p><p></p><p>======================================================================</p><p>myMapView.java:  import java.util.List;    import android.app.Activity;    import android.os.Bundle;    import android.widget.LinearLayout;    import android.widget.Toast;    import android.view.Gravity;    import android.view.ViewGroup;    import android.widget.*;    import com.google.android.maps.MapActivity;    import com.google.android.maps.MapController;    import com.google.android.maps.MapView;</p><pre><code>public abstract class myMapView extends MapActivity{/** Called when the activity is first created. */MapView mapView;          public void onCreate(Bundle savedInstanceState) {                             super.onCreate(savedInstanceState);        setContentView(R.layout.map);        mapView = (MapView) findViewById(R.id.map);        mapView.setBuiltInZoomControls(true);        mapView.getController().setZoom(20);    }}</code></pre><p>==============================================================================</p><p>map.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;com.google.android.maps.MapView    android:id=""@+id/map""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_margin=""20dip""    android:clickable=""true""    android:apiKey=""the_key_that_i_have"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>=======================================================================</p><p>manifest.xml:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""BlobCity.xyz.com""  android:versionCode=""1""  android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;       &lt;uses-library android:name=""com.google.android.maps"" /&gt;        &lt;activity android:name="".BlobCity""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre>","505453","","505453","","2010-11-13 09:38:47","2010-11-13 09:51:07","my app gets an unexpected error an forces me to shut it down....what seems to be the problem?","<java><android><android-mapview>","2","1","","",""
"4171679","1","","","2010-11-13 08:39:15","0","1138","<p>I have an HTML form inside a WebView.  The form control looks like a regular button, but actually it is an html file with a transparent background.  When I press the HTML submit button, I want the result to open in the browser, not in the webview. Currently it is opening in the current WebView which is wrecking my layout. </p><p>How do I do this?</p><p>Here is my Form</p><pre><code>&lt;string name=""googlecheckout_html_button""&gt;&lt;![CDATA[ &lt;?xml version=\""1.0\"" encoding=\""ISO-8859-1\""?&gt;&lt;!DOCTYPE html PUBLIC \""-//W3C//DTD XHTML 1.0 Transitional//EN\"" \""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""&gt;&lt;html xmlns=\""http://www.w3.org/1999/xhtml\"" xml:lang=\""en\""&gt;    &lt;head&gt;    &lt;title&gt;Google Checkout Button&lt;/title&gt;    &lt;script type=\""text/javascript\"" language=\""javascript\""&gt;        function pass() {            return javaInterface.checkboxPass();        }    &lt;/script&gt;    &lt;/head&gt;    &lt;body&gt;        &lt;form style=\""width: 121px;margin-left: auto;margin-right: auto;\"" onsubmit=\""return pass();\"" action=\""https://%1$sapi/checkout/v2/checkoutForm/Merchant/%2$s\"" id=\""BB_BuyButtonForm\"" method=\""post\"" name=\""BB_BuyButtonForm\""&gt;            &lt;input name=\""item_name_1\"" type=\""hidden\"" value=\""%3$s\"" /&gt;            &lt;input name=\""item_description_1\"" type=\""hidden\"" value=\""%3$s\"" /&gt;            &lt;input name=\""item_quantity_1\"" type=\""hidden\"" value=\""1\"" /&gt;            &lt;input name=\""item_price_1\"" type=\""hidden\"" value=\""%4$s\"" /&gt;            &lt;input name=\""item_currency_1\"" type=\""hidden\"" value=\""%5$s\"" /&gt;            &lt;input name=\""_charset_\"" type=\""hidden\"" value=\""utf-8\"" /&gt;            &lt;input type=\""hidden\"" name=\""shopping-cart.items.item-1.merchant-private-item-data\"" value=\""%6$s\"" /&gt;            &lt;input alt=\""Pay With Google Checkout\"" src=\""https://%1$sbuttons/buy.gif?merchant_id=%2$s&amp;amp;w=121&amp;amp;h=44&amp;amp;style=trans&amp;amp;variant=text&amp;amp;loc=en_US\"" type=\""image\"" /&gt;        &lt;/form&gt;    &lt;/body&gt;&lt;/html&gt;]]&gt;&lt;/string&gt;</code></pre><p>I am then using String.format(arg...) to populate the fields with appropriate values.</p><p>Here is by WebView</p><pre><code>String form = String.format(getString(R.string.googlecheckout_html_button),                         host,                        merchantId,                        item_name_1,                        item_price_1,                        item_currency_1,                        private_item_data                        );                if(Logging.DEBUG) Log.d(TAG, form);                browser = new WebView(ActivityActivate.this);                browser.setBackgroundColor(0);                browser.getSettings().setJavaScriptEnabled(true);                browser.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);                browser.getSettings().setSupportZoom(true);                browser.setWebViewClient(new WebViewClient() {                    @Override                    public boolean shouldOverrideUrlLoading(WebView view,                            String url) {                        return false;                    }                });                //browser.getSettings().setLoadsImagesAutomatically(true);                browser.addJavascriptInterface(new JavascriptInterface(), ""javaInterface"");                //browser.loadData(header+formData+footer, ""text/html"", ""UTF-8"");                browser.loadDataWithBaseURL(""https://checkout.google.com"", form, ""text/html"", ""UTF-8"", null);                llPaymentButtons.addView(browser);</code></pre>","248521","","248521","","2010-11-13 12:27:16","2011-02-15 08:25:49","Open WebView form in the browser when pressing the submit button","<android><android-webview>","1","2","1","",""
"4171742","1","","","2010-11-13 08:55:29","5","4099","<p>i have already set the theme of my activity as android:theme = ""@android:style/Theme.Dialog""but i also want to remove the title bar of the activity. so how to use android:theme=""@android:style/Theme.Black.NoTitleBar.Fullscreen""along with the dialog theme.</p>","506591","","379693","","2010-11-13 09:19:54","2010-11-15 15:19:39","Regarding removal of Activity Title bar in Android","<android><coding-style><android-sdk-2.1><android-titlebar><android-theme>","2","1","1","",""
"4171900","1","","","2010-11-13 09:47:41","1","854","<p>I'm making an application which will utilize both touchevents and sensorevents. The problem with touchevents is that they fire off very often, and thereby consumes massive amounts of CPU time. The common solution is to do a Thread.sleep to make it cool down.</p><p>However, if one wants to use both the onTouchEvent and onSensorChanged in the same activity, applying the Thread.sleep hack will also slow down onSensorChanged. This is obviously caused by the two methods being called from the same (ui) thread. </p><p>Is there some way to call onTouchEvent from a different thread than the ui, so one could do the Thread.sleep trick without slowing down onSensorChanged as well?</p>","503074","","","","","2010-11-13 10:05:43","Sleeping in onTouchEvent blocks onSensorChanged","<android><multithreading><listener><accelerometer><sensor>","1","0","1","",""
"4171949","1","4172017","","2010-11-13 10:03:17","3","13283","<p>hi  where to use onKey and onKeyUp/Down event in android.</p><p>e.g. i have one textview . when user pressed any key i want to display that character in textview,     In this case which event(above) is used.</p><pre><code>PLEASE explain with EXAMPLE </code></pre><p>Or give some other example that get the key event and print in edittext or some other.</p><p>Thanks in advance...</p>","489902","","","","","2010-11-13 10:40:01","where & how to use onKey,onkeyDown,onKeyPressed event in android?","<android>","2","1","1","",""
"4172090","1","","","2010-11-13 10:39:44","0","273","<p>I am developing an android application and i am using fbconnect android for connect face book,It is working fine for login and post comment in facebook's wall,but i want to display successful message, when i posted commented in facebook wall.How to do for that.</p><p>Thanks in Advance</p>","500595","","","","","2010-11-13 12:45:33","How to display successfully message when i posted comment in face book's wall?","<android>","1","0","","",""
"4172098","1","","","2010-11-13 10:42:09","0","1004","<p>I am trying to call PhoneFactory.getDefaultPhone from a new application so that I can access its invokeOemRilRaw* functions. But it gives me a  ""java.lang.RuntimeException: PhoneFactory.getDefaultPhone must be called from Looper thread"" error.</p><p>Is this possible ? Or is this function dedicated for the PhoneApp only ?</p><p>Regards,</p><p>vinila</p>","470169","","","","","2010-11-13 21:50:05","PhoneFactory.getDefaultphone in android","<android>","1","0","","",""
"4172178","1","4173956","","2010-11-13 11:03:04","0","1585","<p>I am making a clock widget for the android home screen using AppWidgetProvider.</p><p>I have it calling the TImerTask class that updates all my values using this code:</p><pre><code>@Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {  Timer timer = new Timer();  timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 1000); }</code></pre><p>In the TimerTasks <code>run()</code> I am setting a bunch of text views to the relevent values.</p><p>My problem is that this seems to work fine, but it makes my home screen unresponsive, probably due to updating it every second.</p><p>How do I fix this and still have it update the display at the correct time? (I only need to see minutes not seconds, but I want the minutes to change at the correct second.)</p>","353674","","","","","2011-10-20 20:48:39","Android AppWidgetProvider and screen updating?","<android><timer><widget>","2","0","1","",""
"4172242","1","4172392","","2010-11-13 11:17:19","2","2561","<p>Is it possible to auto insert characters into an edittext box <strong>as the user inputs data</strong>?</p><p>ie if the user is entering a long number such as 123456789012, is it possible for this number to appear as he is typing it in the edit text box, but with a dash every 4th character?</p><p>So as you type the number above you would see it being entered in the edittext box but would look like this: 1234-5678-9012.</p><p>Currently I have an app that you can enter the long number in then press a button and it inserts the dashes for you, but curious if it could be done as you type?</p><p>Many thanks for any help.</p>","497517","","21234","","2010-11-13 11:29:35","2012-10-11 03:45:25","Live editing of users input","<android><string>","2","2","1","",""
"4172278","1","4172345","","2010-11-13 11:25:23","2","927","<p>i am using google transalate api in my application,i have done in text conversion is ok    but translate-text to speech is pending  </p><p><a href=""http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html</a></p><p>this code i am using how can implement translate text voice in android. </p><p><a href=""http://www.freeimagehosting.net/uploads/c382dd10f8.png"" rel=""nofollow"">http://www.freeimagehosting.net/uploads/c382dd10f8.png</a>  this above screenshot display text conversion is ok,click audiobutton image listen translate text in audioplayer how can implemented</p><p>my code     //audio button click event..........</p><pre><code>     submit = (ImageView) findViewById(R.id.ImageView01);          submit.setOnClickListener(new View.OnClickListener()            { public void onClick(View v)              {                 //speech code how can implemented                  }             });  /////////////////// translate button code//////////////////////   ((Button)findViewById(R.id.Button01)).setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                try {                    String fromLan=spineFrom.getSelectedItem().toString();                    String toLan=spineTo.getSelectedItem().toString();                Log.v(""check"",fromLan+"" :""+toLan);                    translatedText = Translate.execute(((EditText)findViewById(R.id.EditText01)).getText().toString(),converStrtoLan(fromLan),converStrtoLan(toLan));                        ((TextView)findViewById(R.id.TextView02)).setText(translatedText);                        Intent checkIntent = new Intent();                        checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);                        startActivityForResult(checkIntent,1);                  } catch (Exception e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        });    }    private TextToSpeech mTts;    protected void onActivityResult(            int requestCode, int resultCode, Intent data) {        if (requestCode == 1) {            if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {                // success, create the TTS instance                mTts = new TextToSpeech(this, null);            } else {                // missing data, install it                Intent installIntent = new Intent();                installIntent.setAction(                    TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                startActivity(installIntent);            }        }        mTts.setLanguage(Locale.US);        String myText1 = ""Did you sleep well?"";        String myText2 = ""I hope so, because it's time to wake up."";        mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);        mTts.speak(myText2, TextToSpeech.QUEUE_ADD, null);    }    private Language converStrtoLan(String lan){        if(lan.equals(""ENGLISH"") || lan==""ENGLISH""){            return Language.ENGLISH;        }else if (lan.equals(""SPANISH"") || lan==""SPANISH""){            return Language.SPANISH;        }        return null;    }}</code></pre><p>how can add this audio code in audio click event ,please forward some valuable response of this code this issue i am struggle for more number of days thanks in advance ..</p>","254790","","254790","","2010-11-13 11:50:37","2010-11-13 11:50:37","how to implement conversion text speech listen in audio file similar google translator in android","<android><google-translate>","1","2","2","",""
"4172290","1","","","2010-11-13 11:27:17","3","9434","<p>I am about finishing my first android app, and i have some questions to which i could not find an answer.</p><p>I would like to use a horizontal scroller in which to display several pictures. For that i need two things:</p><ol><li>Paging enabled, so that the user can see the pictures one by one in the scroller.</li><li>Some kind of indicator to show me the index of the picture currently displayed.</li></ol><p>If i manage to do the paging, i could probably display a text like 1/4 (2/4 and so on) if i had 4 pictures, but it is not very nice. I would like to have something more like the iPhone has with the gray/white dots. Is there anything like that, or would i have to implement it by adding content at runtime? (adding imageviews according to the number of the pictures and then changing images for them as the user scrolls to show progress)</p><p>Thank you.</p>","506656","","","","","2012-05-14 11:31:29","Android scroller paging with page indicator","<android>","3","0","","",""
"4172461","1","4172515","","2010-11-13 12:18:48","2","2261","<p>Dear Android hackers,I am trying to do the following in my Android App: When the User clicks on a list item in a ListActivity, a ProgressDialog should show up, some preloading should happen and after it's done, another Activity should be called using an intent. </p><p>I tried different approaches. What didn't work at all was using an Async Task. Apparently I cannot show, dismiss or edit my ProgressDialog out of the Async Task, if that Class is not a Member of my original Activity. </p><p>I switched to a simple Thread then, this is how I'm trying to do it:</p><pre><code>dialog = ProgressDialog.show(BookmarkActivity.this, """", ""Loading..."",true);new Thread() {    public void run() {        // do something        dialog.setMessage(""Change Message..."");        // do more        dialog.dismiss();        // ...        Intent intent = new Intent(BookmarkActivity.this, ThreadActivity.class);        BookmarkActivity.this.startActivity(intent);    }}.start();</code></pre><p>This works almost, but the changing of the dialog message does not. I'm getting errors saying something about ""leaked windows"". (I can post the complete log if it is needed).</p><p>My questions: </p><ul><li>How can I use an Async Task for this, where the Class has it's own file?</li><li>How can I <em>change</em> the ProgressDialog out of my Thread or AsyncTask without causing an error for changing the UI in another thread?</li></ul><p>Thanks in advance, Jan Oliver</p><hr><p>Ok, with the help of Jason, I put together this Async Task. <strong>That works!</strong></p><pre><code>public class ThreadPreLoader extends AsyncTask&lt;Object, String, Void&gt; {    private Activity mActivity;    private ProgressDialog mDialog;    public ThreadPreLoader(Activity activity) {        mActivity = activity;    }    protected void onPreExecute() {        mDialog = new ProgressDialog(mActivity);        mDialog.setMessage(""Loading..."");        mDialog.show();    }    protected Void doInBackground(Object... args) {        publishProgress(""Loading something else.."");        return null;    }    protected void onProgressUpdate(String... msg) {        mDialog.setMessage(msg[0]);    }    protected void onPostExecute(Void result) {        mDialog.dismiss();    }}</code></pre><p>Thanks again, Jason.</p>","169748","","169748","","2010-11-13 13:43:06","2010-11-13 13:43:06","Android: Problems with ProgressDialog ","<android><multithreading>","3","0","2","",""
"4172508","1","4173004","","2010-11-13 12:35:14","2","618","<p>I'm experiencing problem with the following code, I created two buttons with onClickListener added. </p><p>It works fine for the Button -- btnAbout, I'm trying to use another way to handle btnIntro, instead of by using findViewById(...) method, but the statement will not be executed when I click btnIntro. </p><p>Why does this happen?</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class TestActivity extends Activity {    private final String TAG = ""tag"";    private Button btnIntro;    private Button btnAbout;    private View layoutView;    private ViewWrapper wrapper;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        btnAbout = (Button) findViewById(R.id.btnAbout);        if (btnIntro == null) {            LayoutInflater inflator = getLayoutInflater();            layoutView = inflator.inflate(R.layout.main, null, false);            wrapper = new ViewWrapper(layoutView);            layoutView.setTag(wrapper);        } else {            wrapper = (ViewWrapper) layoutView.getTag();        }        btnIntro = wrapper.getButton();        Log.e(TAG, Integer.toHexString(layoutView.getId()) + """");        Log.e(TAG, btnIntro.getText().toString());        btnIntro.setOnClickListener(new OnClickListener() {            {                Log.e(TAG, ""static"");            }            @Override            public void onClick(View arg0) {                Log.e(TAG, ""btnIntro clicked"");                Toast.makeText(TestActivity.this, ""btnIntro"", Toast.LENGTH_SHORT)                    .show();            }        });        btnAbout.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View arg0) {                Log.e(TAG, ""btnAbout clicked"");                Toast.makeText(TestActivity.this, ""about"", Toast.LENGTH_SHORT).show();            }        });    }    class ViewWrapper {        View base;        Button btn1;        ViewWrapper(View base) {            this.base = base;        }        Button getButton() {            if (btn1 == null) {                btn1 = (Button) base.findViewById(R.id.btnIntro);                Log.e(TAG, btn1.getText().toString());            }            return btn1;        }    }}</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:id=""@+id/MAIN_LAYOUT_XML""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:padding=""30dip""&gt;  &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""Test"" /&gt;  &lt;Button    android:id=""@+id/btnIntro""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""btnIntro"" /&gt;  &lt;Button    android:id=""@+id/btnAbout""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""btnAbout"" /&gt;&lt;/LinearLayout&gt;</code></pre>","500840","","","","","2010-11-13 14:29:51","codes in onClickListener can't be executed","<android>","1","1","2","",""
"4172558","1","4173321","","2010-11-13 12:46:42","2","1427","<p>I am trying to find out any methods to retrieve quality parameters like BER and CIR. The only thing I was able to find in Google and in Android Developer website was getGsmBitErrorRate(), but it seems to show -1 for all the time. So is there any way to get quality parameters in other way? Or may be I am just doing something wrong?</p>","458024","","1228","","2013-11-14 21:29:42","2013-11-14 21:29:42","How to retrieve GSM signal quality parameters on Android?","<java><android><parameters><gsm>","1","1","2","",""
"4172619","1","4172625","","2010-11-13 12:59:55","0","300","<p>I'm trying to make an android app (I'm new in the Android programming world), and I'm having problems creating the GUI.</p><p>The point is that I get information of some data that is divided in days... The problem is that I don't know, until I retrieve the information, how many days the GUI should display.</p><p><a href=""http://img574.imageshack.us/img574/3787/mainscreen.jpg"" rel=""nofollow"">http://img574.imageshack.us/img574/3787/mainscreen.jpg</a></p><p>The grey part will be a TextView, and, also, the black part will be another TextView with multiple lines.</p><p>So, the point is, how can I do to have multiple TextView's without knowing before the exact number? I suppose that I can't declare them in the layout.xml</p><p>The only solution that I've been thinking about is to create in the layout 7 pairs of TextView and, when I know the exact number, just use what I have to, and don't use the others... (It's a bad solution)</p><p>What do you suggest?</p><p>Thank you for your answers!</p>","506712","","37213","","2010-11-13 13:03:18","2010-11-13 13:22:37","Question about creating GUIS ""dynamically"" on Android","<java><android><gui><mobile-phones><smartphone>","3","0","","",""
"4172793","1","","","2010-11-13 13:43:41","0","874","<p>friends,</p><p>i am using following code to display single full screen image in activity using thread problem scenario is from custom image gallery on each thumbnail clicking displays large image on this screen.</p><p>Now the problem is the user clicks on image and thread loads image and presses back button to go to previous page user keeps clicking each thumbnail one by one to display full screen image and repeats this scenario.</p><p>Finally, application crashes with out of memory error bitmap.Please guide what mistake am i doing?</p><pre><code>public void Move(final String path){    if (!isConnected()) {        Constants.DisplayMessage(getApplicationContext(),            Constants.CONNECTION_ERROR_MESSAGE);        return;    }    progressBar = (ProgressBar) findViewById(R.id.progressbar_default);    progressBar.setVisibility(View.VISIBLE);    myThread = new Thread(new Runnable() {      public void run() {        while (serviceData == null) {            serviceData = DisplayLiveImage(path);            callComplete = true;        }        mHandler.post(MoveNow());      }    });    if(myThread.getState() == Thread.State.NEW)      myThread.start();}private  Runnable MoveNow() {    return new Runnable() {        public void run() {            if (callComplete) {                try                {                    if (!serviceData.equals(""""))                    {                        bm = (Bitmap)serviceData;                        float ImageHeight = bm.getHeight();                        float ImageWidth = bm.getWidth();                        float totalHeight = (ImageHeight / ImageWidth ) * CurrentScreenWidth;                        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);                        params.width = LayoutParams.FILL_PARENT;                        params.height = (int)totalHeight;                        img.setLayoutParams(params);                        img.setImageBitmap(bm);                    }                    else                    {                      // show error                    }                }catch(Exception ex)                {                    // show error                }finally                {                    progressBar.setVisibility(View.GONE);                    serviceData = null;                    callComplete = false;                }            }        }    };}public void stopThread(){    try    {        if(myThread != null)          myThread.interrupt();    }catch(Exception ex)    { }}@Overridepublic void onDestroy(){    if(bm != null)    {        bm.recycle();        bm = null;    }    stopThread();    super.onDestroy();}</code></pre>","249991","","211292","","2011-02-09 15:49:20","2012-02-24 14:06:06","out of memory in thread repeatition?","<android><image-processing>","2","0","","",""
"4172800","1","4172875","","2010-11-13 13:44:43","2","2268","<p>I try to save and restore the state of 3 <code>WebViews</code> in my activity by using <code>onSaveInstanceState()</code> and the <code>restoreState()</code> method of my <code>WebView</code> in <code>onCreate()</code>. This works just fine when I had only one <code>WebView</code>, but with 3 <code>WebViews</code> to save, it looks like it's only the last one save which counts and overrides the other saves; and so when I use the <code>restoreState()</code> method in <code>onCreate()</code>, the first <code>WebView</code> has the content of the third <code>WebView</code> and the 2 others are empty.</p><p>Here is a sample of my activity code:</p><pre><code>@Override public void onSaveInstanceState(Bundle outState) {  ((WebView)findViewById(R.id.webview1)).saveState(outState);  ((WebView)findViewById(R.id.webview2)).saveState(outState);  ((WebView)findViewById(R.id.webview3)).saveState(outState);}@Overridepublic void onCreate(Bundle savedInstanceState) {    ((WebView)findViewById(R.id.webview1)).restoreState(savedInstanceState);    ((WebView)findViewById(R.id.webview2)).restoreState(savedInstanceState);    ((WebView)findViewById(R.id.webview3)).restoreState(savedInstanceState);}</code></pre><p>Should I use some trick to use another bundle for each view? Have I done something wrong somewhere else in my code that causes this or is it the standard behaviour?</p>","506168","","71421","","2011-07-12 23:32:43","2011-07-12 23:33:02","Android muliple WebView save instance","<android><webview>","1","0","","",""
"4172917","1","4172933","","2010-11-13 14:12:13","8","12131","<p>How do I interpret the returned array from build-in method getPixels for a Bitmap?</p><p>Here is my code:</p><pre><code>public void foo() {    int[] pixels;    Bitmap bitmapFoo = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.test2);                 int height = bitmapFoo.getHeight();    int width = bitmapFoo.getWidth();    pixels = new int[height * width];    bitmapFoo.getPixels(pixels, 0, width, 1, 1, width - 1, height - 1);     }</code></pre><p>The array ""pixels"" gets returned with values from -988,602,635 to 1,242,635,509 and that was just from a few colors on a simple PNG file I made.  How can I interpret the numbers that get returned from this method?</p><p>Edit:  I realize this single integer represents a color.  I just don't understand how to interpret this single integer into the RBG and alpha values that make up the color.</p><p>Thanks.</p><p>PS.  If your asking yourself, ""what is he trying to do?""  I am trying to figure out a way to dynamically modify the color of a bitmap.</p>","432209","","432209","","2010-11-13 14:20:48","2011-08-29 19:54:06","Explanation of the method getPixels for a Bitmap in Android","<java><android><colors><bitmap>","5","1","2","",""
"4172963","1","","","2010-11-13 14:22:50","3","2715","<p>is it possible to have low level access in Android with Java/NDK to create for example card scanner like scandisk or card defragmenter? I move a lots of stuff around my card and it gets fragmented quickly. I have experience with FAT32 defragmenting on Windows, but I'dliek to do this on Android.</p>","506760","","","","","2010-11-13 20:03:36","Low level operations with SD card on Android","<android><android-ndk>","2","1","2","",""
"4173031","1","","","2010-11-13 14:36:41","0","473","<p>My application starts with a bunch of text input fields, and I want that when starting up the the application. The virtual keyboard isn't open, but opens only when I click on one of the textinput fields.How do I do this?</p>","434885","","63550","","2011-01-20 22:04:10","2011-01-20 22:04:10","Android keyboard","<android><keyboard>","3","0","","",""
