[android-beginners] Re: ListView refresh in ListActivity
Thank you Mark! In my deleteBeeyard() method, the finally {dbCon.close();} was the problem. I thought the SQLiteDatabase I get from getWritableDatabase() is unrelated to the previously created Cursor (with getReadableDatabase().rawQuery(...) ) for the CursorAdapter. Obviously I didn't (and still don't) understand some basics. :-( -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: ListView Selection Help
Can you give a little more detail about how the workflow of your application is supposed to work? We might be able to give some better suggestions on how best implement it. Seems to me like you have two different options, but they are drastically different and the one you would want to choose would depend on how your app works: 1. Switch to a new Activity. You do this by creating a new intent and passing in the class of the new Activity in the constructor. You then call startActivity from the current context (most likely an Activity) and that will launch the new Activity. However, you have to set up your activities with the correct behavior when you do this... e.g. when you go to the new activity should it replace the current one on the Activity stack or should the user go back to it if they hit the back button? See http://developer.android.com/guide/topics/intents/intents-filters.htmlfor more info on Intents... 2. Use some mechanism to store a setting (most likely using SharedPreferences but there are other methods available as well) and read that setting in the onCreate method of your activity to determine which layout to load. This would require the user to exit out of the application and restart it to see the new layout though... (but I have seen this mechanism used in quite a few apps, just put a note or something saying that changing the setting requires a restart). See http://developer.android.com/guide/topics/data/data-storage.html for more info on storing data... I'm sure there are many other ways to go about this but these seem like the most intuitive to me off the top of my head. Again, if you were to walk us through the entire user experience we might be able to give some more precise advice/feedback... Hope that helps somewhat, Justin -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Mon, May 24, 2010 at 5:48 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: How would you do it via Switching the Activity On May 24, 7:34 pm, Justin Anderson janderson@gmail.com wrote: Hmmm... that may be possible but I'm not sure exactly how to do it. I know there have been lots of people who have tried but I'm not sure if they have come up with a solution... If you can't figure it out you can always set it up so that the layout changes requires a restart of your app... You can then save a setting and use that at startup to determine which layout to load. On May 24, 2010 5:18 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 7:02 pm, Justin Anderson janderson@gmail.com wrote: Typically you would want to... On Mon, May 24, 2010 at 4:16 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 5:15 pm, TreKing treking...@gmail.co... android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=... android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en ... -- You received this message because you are subscribed to the Google Groups Android Beginner... Im trying to click an item on the list that will load a new layout, but when I use setContentView it errors out -- You received this message because you are subscribed to the Google Groups Android Beginners group -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp:// stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are
[android-beginners] Re: ListView Selection Help
On May 24, 5:15 pm, TreKing treking...@gmail.com wrote: On Mon, May 24, 2010 at 4:06 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: Anyone know how to fix this? Since you are using setListAdapter, I assume you're using a ListActivity, which has onListItemClick(). --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-beginners?hl=en Ahh yes ofcourse! Thanks, now my only problem now is when I have an item selected, I have setContentView(R.layout.name of item) it compiles right and the xml file exist, it just errors out once I click an item on a list. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: ListView Selection Help
Typically you would want to start another activity rather than just changing the layout... What exactly are you trying to accomplish? -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Mon, May 24, 2010 at 4:16 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 5:15 pm, TreKing treking...@gmail.com wrote: On Mon, May 24, 2010 at 4:06 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: Anyone know how to fix this? Since you are using setListAdapter, I assume you're using a ListActivity, which has onListItemClick(). --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp:// sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp:// stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=en Ahh yes ofcourse! Thanks, now my only problem now is when I have an item selected, I have setContentView(R.layout.name of item) it compiles right and the xml file exist, it just errors out once I click an item on a list. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: ListView Selection Help
On May 24, 7:02 pm, Justin Anderson janderson@gmail.com wrote: Typically you would want to start another activity rather than just changing the layout... What exactly are you trying to accomplish? -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Mon, May 24, 2010 at 4:16 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 5:15 pm, TreKing treking...@gmail.com wrote: On Mon, May 24, 2010 at 4:06 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: Anyone know how to fix this? Since you are using setListAdapter, I assume you're using a ListActivity, which has onListItemClick(). --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp:// sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp:// stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=en Ahh yes ofcourse! Thanks, now my only problem now is when I have an item selected, I have setContentView(R.layout.name of item) it compiles right and the xml file exist, it just errors out once I click an item on a list. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-beginners?hl=en Im trying to click an item on the list that will load a new layout, but when I use setContentView it errors out -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: ListView Selection Help
Hmmm... that may be possible but I'm not sure exactly how to do it. I know there have been lots of people who have tried but I'm not sure if they have come up with a solution... If you can't figure it out you can always set it up so that the layout changes requires a restart of your app... You can then save a setting and use that at startup to determine which layout to load. On May 24, 2010 5:18 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 7:02 pm, Justin Anderson janderson@gmail.com wrote: Typically you would want to... On Mon, May 24, 2010 at 4:16 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 5:15 pm, TreKing treking...@gmail.co... android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=... android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en ... -- You received this message because you are subscribed to the Google Groups Android Beginner... Im trying to click an item on the list that will load a new layout, but when I use setContentView it errors out -- You received this message because you are subscribed to the Google Groups Android Beginners group -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: ListView Selection Help
How would you do it via Switching the Activity On May 24, 7:34 pm, Justin Anderson janderson@gmail.com wrote: Hmmm... that may be possible but I'm not sure exactly how to do it. I know there have been lots of people who have tried but I'm not sure if they have come up with a solution... If you can't figure it out you can always set it up so that the layout changes requires a restart of your app... You can then save a setting and use that at startup to determine which layout to load. On May 24, 2010 5:18 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 7:02 pm, Justin Anderson janderson@gmail.com wrote: Typically you would want to... On Mon, May 24, 2010 at 4:16 PM, chris_green1...@yahoo.com chris_green1...@yahoo.com wrote: On May 24, 5:15 pm, TreKing treking...@gmail.co... android-beginners+unsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=... android-beginners+unsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en ... -- You received this message because you are subscribed to the Google Groups Android Beginner... Im trying to click an item on the list that will load a new layout, but when I use setContentView it errors out -- You received this message because you are subscribed to the Google Groups Android Beginners group -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview selector problem with g1
Sorry for the question i found the solution must se cache color hint attribute On Mon, Mar 22, 2010 at 12:56 PM, manigault manig...@gmail.com wrote: Hi all, I have listview with custom selector for it. On nexus 1 is working fine but on g1 when i am scrolling it set the default background for all items during scroll. The strange thing is that on nexus is working but this is happening only on g1. Here is the code of the selector - ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_focused=true android:state_pressed=true android:drawable=@drawable/custom_background / item android:state_focused=false android:state_pressed=true android:drawable=@drawable/custom_background / item android:state_focused=true android:drawable=@drawable/custom_background / /selector Any ideas ? -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe from this group, send email to android-beginners+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: [android-beginners] Re: listview fill parent
Hey thanks for the reply but it's still not working. Here is some code - main.xml - xml containing the listview ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent ListView android:layout_height=fill_parent android:layout_width=fill_parent android:id=@+id/listview/ListView /LinearLayout item.xml - xml used for inflating listview items ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textview android:layout_height=fill_parent android:layout_width=fill_parent/TextView /LinearLayout and i am using ArrayAdapter for populating items in listview super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView listView = (ListView)findViewById(R.id.listview); listView.setAdapter(new ArrayAdapterString(this,R.layout.item,R.id.textview,new String[]{line 1, line 2, line 3})); but still the items don't fill the whole height -- Forwarded message -- From: Javadid its.va...@gmail.com Date: Sat, Mar 6, 2010 at 7:04 AM Subject: [android-beginners] Re: listview fill parent To: Android Beginners android-beginners@googlegroups.com Well first of all there are 2 possible ways by which u might be getting each row item... 1 is by defining them in an xml and inflating them at runtime and the other is by directly initiating it through code... supposing that u have used the xml inflation method all u have to do is define the list's width = fill_parent... and similarly in the properties of the xml u have created for items u must have used Linear/ Relative layout in which all items reside... just change its width parameter from wrap_content to fill_parent... this will do the trick... if it doesnt then we'll have to look at the xml of your row which u inflate or incase of making it dynamically through code, we'll have to have a look at the code... On Mar 5, 3:08 pm, Martin Obreshkov manig...@gmail.com wrote: I am sorry for the misleading question - i want the listview items to be stretched to the whole listview On Fri, Mar 5, 2010 at 12:00 PM, manigault manig...@gmail.com wrote: Hi all i have a listview with small number of items but they are still fetched dynamically. How can i make my list view to fill to whole screen no not depending on number of items -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview fill parent
I am sorry for the misleading question - i want the listview items to be stretched to the whole listview On Fri, Mar 5, 2010 at 12:00 PM, manigault manig...@gmail.com wrote: Hi all i have a listview with small number of items but they are still fetched dynamically. How can i make my list view to fill to whole screen no not depending on number of items -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview fill parent
Well first of all there are 2 possible ways by which u might be getting each row item... 1 is by defining them in an xml and inflating them at runtime and the other is by directly initiating it through code... supposing that u have used the xml inflation method all u have to do is define the list's width = fill_parent... and similarly in the properties of the xml u have created for items u must have used Linear/ Relative layout in which all items reside... just change its width parameter from wrap_content to fill_parent... this will do the trick... if it doesnt then we'll have to look at the xml of your row which u inflate or incase of making it dynamically through code, we'll have to have a look at the code... On Mar 5, 3:08 pm, Martin Obreshkov manig...@gmail.com wrote: I am sorry for the misleading question - i want the listview items to be stretched to the whole listview On Fri, Mar 5, 2010 at 12:00 PM, manigault manig...@gmail.com wrote: Hi all i have a listview with small number of items but they are still fetched dynamically. How can i make my list view to fill to whole screen no not depending on number of items -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview is getting me mad plase help
i didnt do it yet. but you can get a sample from here, i am folowing this book http://apress.com/book/downloadfile/4433 there is a zip file, extract it and navigate to FancyLists\RateList\. there you have a full and working example. please send the question to the list wo everyone can get the answer 2010/2/3 Abhi abhinay.pothuga...@gmail.com Hi David, Are you able to capture the checkbox click in the list view ?if so can you pls send me the code I am also facing the same problem as you are facing, I am having a list view with Checkbox,If user clicks on the listrow then the checkbox needs to get selected and on further click it needs to unselect Can you pls help me in solving this On Jan 31, 9:32 pm, David Fire ddf...@gmail.com wrote: SOLVED all the items in the row must be facusable=false i just put it David 2010/1/31 free1000 prwfree...@googlemail.com Just out of curiosity why do you have this in the ListView definition android:isScrollContainer=true Not saying it has anything to do with your problem,just wondering. The list knows how to scroll without this attribute being set. P On Jan 30, 5:08 pm, David Fire ddf...@gmail.com wrote: hi i cant press any item on my listview nor in the emulator nor in a real phone. item layout ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android= http://schemas.android.com/apk/res/android; android:id=@+id/LinearLayout01 android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal CheckBox android:id=@+id/RuleEnable android:text= android:layout_width=wrap_content android:layout_height=wrap_content/CheckBox TextView android:id=@+id/RuleName android:layout_width=wrap_content android:layout_height=wrap_content android:text= android:focusable=true /TextView /LinearLayout listview layout ListView android:id=@+id/Listado android:layout_width=fill_parent android:layout_height=250px android:isScrollContainer=true android:drawSelectorOnTop=false android:choiceMode=singleChoice/ListView some code public class GuiActivity extends Activity implements View.OnClickListener, OnItemClickListener{ //lista means list in spanish lista = (ListView)findViewById(R.id.Listado); RuleList = new ArrayListSMSRule(); loadRuleList(); adapter=new SMSRuleAdaptor(this,RuleList); lista.setAdapter(adapter); lista.setOnItemClickListener(this); this method is never called public void onItemClick(AdapterView? arg0, View arg1, int arg2, long id) { enable.setText(id: +id); } -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your ()_()signature to help him gain world domination. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-develop...@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your ()_()signature to help him gain world domination. -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your ()_()signature to help him gain world domination. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: ListView
Check listview's properties. There are some of them inherited that will allow you to disable the scrollbar. On Dec 24, 4:01 pm, sabs bsabare...@gmail.com wrote: Hi all I have a list view with scroll bar, now i would like to remove the scroll bar in that list view. I am not sure whether it is possible to disable the scroll bar or not. If it is possible please guide me how to disable the scroll bar in the list view.. Happy X-mas Thanks in adavance sabs -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: ListView Header
so here's my latest layout, following some examples I've seen on the interwebsIts not working. The header shows. The list does not. If I remove the header, the list shows... LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=wrap_content TextView android:id=@+id/playerHeaderTextId android:layout_width=wrap_content android:layout_height=wrap_content android:text=You got stuff. Your stuff aint worth anything / LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=0px android:layout_weight=1 ListView android:id=@+id/android:list android:layout_width=fill_parent android:layout_height=wrap_content / TextView android:id=@+id/android:empty android:layout_width=fill_parent android:layout_height=wrap_content android:text=No investments held at this time. Purchase investments to increase your earnings. / /LinearLayout /LinearLayout -- You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: ListView with multiple TextView
Thanks Jbrohan for the reply. I saw this Notepad example. In my case, I'm parsing an XML (RSS) and needs to show this in ListView. My actual requirement is to show the title in bold. So, I was planning to insert two TextView, 1st for Title and 2nd for Description, and set the property of the first one to bold. In the Notepad example, I saw that it uses DB to get the values (cursor) and to bind it in each row. So, do I need to insert the values to DB before accessing and displaying the values? thanks ash. On Oct 28, 12:13 pm, jbrohan jbro...@gmail.com wrote: The Notepad example does this. On Oct 27, 6:37 pm, Ash ashly@gmail.com wrote: Hi, I need to create a ListView with two TextView items. Please help with some example code for implementing this. Thanks, ash. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView with multiple TextView
The Notepad example does this. On Oct 27, 6:37 pm, Ash ashly@gmail.com wrote: Hi, I need to create a ListView with two TextView items. Please help with some example code for implementing this. Thanks, ash. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: listview height
Try giving the view a higher layout weight in the xml... android:layout_weight= Thanks, Justin -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Thu, Oct 22, 2009 at 5:58 PM, Jeffrey Blattman jeffrey.blatt...@gmail.com wrote: i have a listview that is enclosed in a few other views. the view height of the listview is only about the size of one entry. i can't seem to figure how to make the listview expand to show more entries at a time. i'd like to be able to set the max height of the listview, or something like that. any ideas? -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~--- inline: qr-gmail.png
[android-beginners] Re: listview height
Yes I tried that thanks. I ended up just setting a static height. Everything I read says not to embed a listview in a scrollview (from the experts). Seems kind of short sighted to me. A listview offers a lot more than just the fact that it can scroll. On Oct 24, 2009 9:00 PM, Justin Anderson janderson@gmail.com wrote: Try giving the view a higher layout weight in the xml... android:layout_weight= Thanks, Justin -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Thu, Oct 22, 2009 at 5:58 PM, Jeffrey Blattman jeffrey.blatt...@gmail.com wrote: i have ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: listview
Hi, You can try getIdentifier: http://developer.android.com/reference/android/content/res/Resources.html#getIdentifier(java.lang.String, java.lang.String, java.lang.String) However, note this note: Note: use of this function is discouraged. It is much more efficient to retrieve resources by identifier than by name. If you still think this will be the best way to go about it, you should probably cache the resources ints after they've been determined Cheers, James On Wed, Oct 14, 2009 at 9:11 AM, frederic glouzon frederic.glou...@gmail.com wrote: hello, I am looking for a way to display the 200+ images of the countries of my listview. The problem is that my listview datas come from a sqlite database with the name of the countries and the name of the images files of the countries flags. I have an issue to get the ressources for the images files as the names i get from the database are strings and the setImageResource require an int. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Urgent Help Req :)
Typically you won't get much of a response when the word urgent is in your tittle... -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Sun, Sep 27, 2009 at 11:00 PM, Alok Kulkarni kulsu...@gmail.com wrote: Any takers ? On Mon, Sep 28, 2009 at 12:44 AM, Alok Kulkarni kulsu...@gmail.comwrote: By the text should be scrollable i mean It should be like Marquee of HTML .. thanks :) On Mon, Sep 28, 2009 at 12:40 AM, Alok kulsu...@gmail.com wrote: Hi guys, I am developing a music application where there will be almost 30 to 35 lists . Example .. A list on page one say albums , artists etc etc Then if you select one list item say Albums , you go on a new page with Album list, when u click on one album listitem , u enter song list.. that way . each list item has an image associated with it . And the text for the listitem may be 2 lines per item. And the text should be scrollable. Now my idea is to create a generic list which is common to all the listview screens. At runtime i should be able to pass the contents of each list to this generic class. What approach should i take? Can a XML layout solve this purpose.. Please give me some guidelines. Reuse is my main aim.. And for each listitem i should be able to handle click listeners.. Please give me some guidelines. Thanks in advance, Alok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Urgent Help Req :)
You will need to make a custom adapter for the listview and populate your list using that , but yes, it is possible. - Moazzam http://moazzam-khan.com/ On Sep 28, 9:15 am, Justin Anderson janderson@gmail.com wrote: Typically you won't get much of a response when the word urgent is in your tittle... -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Sun, Sep 27, 2009 at 11:00 PM, Alok Kulkarni kulsu...@gmail.com wrote: Any takers ? On Mon, Sep 28, 2009 at 12:44 AM, Alok Kulkarni kulsu...@gmail.comwrote: By the text should be scrollable i mean It should be like Marquee of HTML .. thanks :) On Mon, Sep 28, 2009 at 12:40 AM, Alok kulsu...@gmail.com wrote: Hi guys, I am developing a music application where there will be almost 30 to 35 lists . Example .. A list on page one say albums , artists etc etc Then if you select one list item say Albums , you go on a new page with Album list, when u click on one album listitem , u enter song list.. that way . each list item has an image associated with it . And the text for the listitem may be 2 lines per item. And the text should be scrollable. Now my idea is to create a generic list which is common to all the listview screens. At runtime i should be able to pass the contents of each list to this generic class. What approach should i take? Can a XML layout solve this purpose.. Please give me some guidelines. Reuse is my main aim.. And for each listitem i should be able to handle click listeners.. Please give me some guidelines. Thanks in advance, Alok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Urgent Help Req :)
Ok.. So XML layout file will do the job ?I will work on it ! THANKS anyways... Any other detailed explaination or snippet will do hell good :)] Thanks.. On Mon, Sep 28, 2009 at 7:38 PM, moazzamk moazz...@gmail.com wrote: You will need to make a custom adapter for the listview and populate your list using that , but yes, it is possible. - Moazzam http://moazzam-khan.com/ On Sep 28, 9:15 am, Justin Anderson janderson@gmail.com wrote: Typically you won't get much of a response when the word urgent is in your tittle... -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Sun, Sep 27, 2009 at 11:00 PM, Alok Kulkarni kulsu...@gmail.com wrote: Any takers ? On Mon, Sep 28, 2009 at 12:44 AM, Alok Kulkarni kulsu...@gmail.com wrote: By the text should be scrollable i mean It should be like Marquee of HTML .. thanks :) On Mon, Sep 28, 2009 at 12:40 AM, Alok kulsu...@gmail.com wrote: Hi guys, I am developing a music application where there will be almost 30 to 35 lists . Example .. A list on page one say albums , artists etc etc Then if you select one list item say Albums , you go on a new page with Album list, when u click on one album listitem , u enter song list.. that way . each list item has an image associated with it . And the text for the listitem may be 2 lines per item. And the text should be scrollable. Now my idea is to create a generic list which is common to all the listview screens. At runtime i should be able to pass the contents of each list to this generic class. What approach should i take? Can a XML layout solve this purpose.. Please give me some guidelines. Reuse is my main aim.. And for each listitem i should be able to handle click listeners.. Please give me some guidelines. Thanks in advance, Alok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Listview help
Thanks Yusuf :) On Tue, Sep 29, 2009 at 12:36 AM, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: You can do this with an XML layout. If the three lists look different (for example, album has a picture and three rows of text, song has no picture and two rows of text, etc.), then make three xml files that describe the layouts. Setting the click listener is straightforward and is covered in various ListView tutorials. When the user clicks on an item, then get the appropriate ListView, load it with data (ArrayAdapter works well) and display it (setContentView is one way). Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 28, 7:09 am, Alok kulsu...@gmail.com wrote: Hi guys, I am developing a music application where there will be almost 30 to 35 lists . Example .. A list on page one say albums , artists etc etc Then if you select one list item say Albums , you go on a new page with Album list, when u click on one album listitem , u enter song list.. that way . each list item has an image associated with it . And the text for the listitem may be 2 lines per item. And the text should be scrollable. (Like Marquee) Now my idea is to create a generic list which is common to all the listview screens. At runtime i should be able to pass the contents of each list to this generic class. What approach should i take? Can a XML layout solve this purpose.. Please give me some guidelines. Reuse is my main aim.. And for each listitem i should be able to handle click listeners.. Please give me some guidelines. Thanks in advance, Alok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Urgent Help Req :)
By the text should be scrollable i mean It should be like Marquee of HTML .. thanks :) On Mon, Sep 28, 2009 at 12:40 AM, Alok kulsu...@gmail.com wrote: Hi guys, I am developing a music application where there will be almost 30 to 35 lists . Example .. A list on page one say albums , artists etc etc Then if you select one list item say Albums , you go on a new page with Album list, when u click on one album listitem , u enter song list.. that way . each list item has an image associated with it . And the text for the listitem may be 2 lines per item. And the text should be scrollable. Now my idea is to create a generic list which is common to all the listview screens. At runtime i should be able to pass the contents of each list to this generic class. What approach should i take? Can a XML layout solve this purpose.. Please give me some guidelines. Reuse is my main aim.. And for each listitem i should be able to handle click listeners.. Please give me some guidelines. Thanks in advance, Alok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Urgent Help Req :)
Any takers ? On Mon, Sep 28, 2009 at 12:44 AM, Alok Kulkarni kulsu...@gmail.com wrote: By the text should be scrollable i mean It should be like Marquee of HTML .. thanks :) On Mon, Sep 28, 2009 at 12:40 AM, Alok kulsu...@gmail.com wrote: Hi guys, I am developing a music application where there will be almost 30 to 35 lists . Example .. A list on page one say albums , artists etc etc Then if you select one list item say Albums , you go on a new page with Album list, when u click on one album listitem , u enter song list.. that way . each list item has an image associated with it . And the text for the listitem may be 2 lines per item. And the text should be scrollable. Now my idea is to create a generic list which is common to all the listview screens. At runtime i should be able to pass the contents of each list to this generic class. What approach should i take? Can a XML layout solve this purpose.. Please give me some guidelines. Reuse is my main aim.. And for each listitem i should be able to handle click listeners.. Please give me some guidelines. Thanks in advance, Alok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: listview scroll position
Sorry for the post my mistake i just reload every time the view in onResume :) On Fri, Sep 11, 2009 at 2:45 PM, manigault manig...@gmail.com wrote: I have a listview and when i select an item a new activity is started, but when i go back the listview's scroll is positioned at the beginning the list. How can i save the scroll position and when i go back to the listview the scroll to be positioned in the same place. -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: listview orientation
How to orient listview items horizontal. ListView does not work horizontally. You may be able to use HorizontalScrollView with something else (e.g., a horizontal LinearLayout) and some extra code to achieve a similar look. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Add an image as well as 2 line text to a single list item
Alok wrote: Hi guys, I want to have a listview of songs where on the left of each list item i can have a musical image or image of album and then the actual song name on the right. The song name , with some other details fits in two lines on the right side. I hv gone through the Android sdk example where i can have a Contact name and number ,on two lines of single list item. I want to add image as well.. Please help me out! You can find instructions here: http://commonsware.com/Android/excerpt.pdf -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Add an image as well as 2 line text to a single list item
Thanks Mark, the PDF seems great, One question more .I donno if the pdf answers this but how can i reduce the height of an item in a listview. I googled for it , some answers came up but not much convincing. Thanks and Regards, Alok. On 9/1/09, Mark Murphy mmur...@commonsware.com wrote: Alok wrote: Hi guys, I want to have a listview of songs where on the left of each list item i can have a musical image or image of album and then the actual song name on the right. The song name , with some other details fits in two lines on the right side. I hv gone through the Android sdk example where i can have a Contact name and number ,on two lines of single list item. I want to add image as well.. Please help me out! You can find instructions here: http://commonsware.com/Android/excerpt.pdf -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Add an image as well as 2 line text to a single list item
Alok Kulkarni wrote: Thanks Mark, the PDF seems great, One question more .I donno if the pdf answers this but how can i reduce the height of an item in a listview. I googled for it , some answers came up but not much convincing. The height of an item in a ListView is controlled by the item. If you have a 200px high image, the row will be 200px high at minimum. If you want shorter rows, design shorter row layouts, and use them per the PDF I linked to. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Training: http://commonsware.com/training.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Add an image as well as 2 line text to a single list item
Thats my way to go then !! Thanks again Mark :) On 9/1/09, Mark Murphy mmur...@commonsware.com wrote: Alok Kulkarni wrote: Thanks Mark, the PDF seems great, One question more .I donno if the pdf answers this but how can i reduce the height of an item in a listview. I googled for it , some answers came up but not much convincing. The height of an item in a ListView is controlled by the item. If you have a 200px high image, the row will be 200px high at minimum. If you want shorter rows, design shorter row layouts, and use them per the PDF I linked to. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Training: http://commonsware.com/training.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView item stay selected
Thanks a lot it's really very simple and clear using ContextMenu On Fri, Aug 28, 2009 at 1:14 AM, Justin Andersonjanderson@gmail.com wrote: The preferred way is to use a long-press to bring up a context menu. The menu populated by pressing the menu button should be used for things that do not require a selection. -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Tue, Aug 25, 2009 at 9:30 AM, Martin Obreshkov manig...@gmail.com wrote: Thanks for the reply but if this is not the recommended way what is the solution for it. For example i have a list with mails and when i select given mail there are actions i can perform(delete, reply). What is the best way to implement this, should i use listview at all. Thanks in advance. On Tue, Aug 25, 2009 at 5:39 PM, Mark Murphymmur...@commonsware.com wrote: I have a listview and i want when i select a row to stay selected The core Android team does not recommend this. The problem is that if i change some attribute ( for example v.setBackgroundColor(Color.BLACK) ) the selected view no longer stays selected. That is because selected is one of the background colors. A widget background is usually some form of ColorStateList. You can supply a simple color to setBackgroundColor(), but that only works if you do not intend to allow the item to be selected, for example. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView item stay selected
The preferred way is to use a long-press to bring up a context menu. The menu populated by pressing the menu button should be used for things that do not require a selection. -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Tue, Aug 25, 2009 at 9:30 AM, Martin Obreshkov manig...@gmail.comwrote: Thanks for the reply but if this is not the recommended way what is the solution for it. For example i have a list with mails and when i select given mail there are actions i can perform(delete, reply). What is the best way to implement this, should i use listview at all. Thanks in advance. On Tue, Aug 25, 2009 at 5:39 PM, Mark Murphymmur...@commonsware.com wrote: I have a listview and i want when i select a row to stay selected The core Android team does not recommend this. The problem is that if i change some attribute ( for example v.setBackgroundColor(Color.BLACK) ) the selected view no longer stays selected. That is because selected is one of the background colors. A widget background is usually some form of ColorStateList. You can supply a simple color to setBackgroundColor(), but that only works if you do not intend to allow the item to be selected, for example. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView item stay selected
I have a listview and i want when i select a row to stay selected The core Android team does not recommend this. The problem is that if i change some attribute ( for example v.setBackgroundColor(Color.BLACK) ) the selected view no longer stays selected. That is because selected is one of the background colors. A widget background is usually some form of ColorStateList. You can supply a simple color to setBackgroundColor(), but that only works if you do not intend to allow the item to be selected, for example. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView item stay selected
Thanks for the reply but if this is not the recommended way what is the solution for it. For example i have a list with mails and when i select given mail there are actions i can perform(delete, reply). What is the best way to implement this, should i use listview at all. Thanks in advance. On Tue, Aug 25, 2009 at 5:39 PM, Mark Murphymmur...@commonsware.com wrote: I have a listview and i want when i select a row to stay selected The core Android team does not recommend this. The problem is that if i change some attribute ( for example v.setBackgroundColor(Color.BLACK) ) the selected view no longer stays selected. That is because selected is one of the background colors. A widget background is usually some form of ColorStateList. You can supply a simple color to setBackgroundColor(), but that only works if you do not intend to allow the item to be selected, for example. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView with addHeaderView Example?
Thanks, It Helps me a lotI tried to populate a listView by extending Activity, not ListActivity..The list also contains two icon,one Text,and one checkBox in each row...It was quite tough to implement this application, but finally I overcome it, and then the task was to detect which item or row is selected or clicked in the list view with a proper message..it works ok now..The sample is given below: import java.util.ArrayList; import android.app.Activity; import android.app.ListActivity; import android.content.Context; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.os.Bundle; import android.util.Log; import android.util.SparseBooleanArray; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemSelectedListener; public class IconListText extends Activity { /** Called when the activity is first created. */ ListView messageList; EfficientAdapter mAdapter; private TextView mPhone; private static class EfficientAdapter extends BaseAdapter { private LayoutInflater mInflater; private Bitmap mIcon1; private Bitmap mIcon2; private Bitmap mIcon3; private Bitmap mIcon4; private Integer[] mPhotoPool = { R.drawable.stat_sys_wifi_signal_4, R.drawable.stat_sys_data_out_g, R.drawable.stat_sys_wifi_signal_4, R.drawable.stat_sys_data_out_g }; private String[] GENRES = { Item1 , Item2 , Item3 , Item4 }; private ArrayListInteger mPhotos = new ArrayListInteger (); private ArrayListString mText = new ArrayListString(); public EfficientAdapter(Context context) { // Cache the LayoutInflate to avoid asking for a new one each time. mInflater = LayoutInflater.from(context); // Icons bound to the rows. mIcon1=BitmapFactory.decodeResource(context.getResources (), R.drawable.stat_sys_data_out_g); mIcon2=BitmapFactory.decodeResource(context.getResources (), R.drawable.stat_sys_wifi_signal_4); mIcon3=BitmapFactory.decodeResource(context.getResources (), R.drawable.ic_network_signal_4); mIcon4=BitmapFactory.decodeResource(context.getResources (), R.drawable.stat_signal_4); } public int getCount() { return DATA.length; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } 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.main,null); // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.icon = (ImageView) convertView.findViewById (R.id.icon); holder.icon2 = (ImageView) convertView.findViewById (R.id.icon2); holder.text = (TextView) convertView.findViewById (R.id.text); holder.cb=(CheckBox)convertView.findViewById (R.id.cb); convertView.setTag(holder); } else { // Get the ViewHolder back to get fast access to the TextView // and the ImageView. holder =
[android-beginners] Re: ListView with addHeaderView Example?
Finally figured it all out. Here is the final code extended from ListActivity. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/tvHeader android:layout_width=fill_parent android:layout_height=wrap_content android:text=Hello List Activity/ ListView android:id=@android:id/list android:layout_width=fill_parent android:layout_height=fill_parent/ /LinearLayout public class HelloListActivity extends ListActivity { private TextView tv; private TextView tp; private ListView lv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView) findViewById(R.id.tvHeader); tp = new TextView(this); tp.setText(Top of the list); getListView().addHeaderView(tp); setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, COUNTRIES)); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub super.onListItemClick(l, v, position, id); String temp = l.getItemAtPosition(position).toString(); Toast.makeText(HelloListActivity.this, temp, Toast.LENGTH_SHORT).show (); } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina }; } On Aug 17, 12:55 am, chinchin nchinn...@googlemail.com wrote: Hello, I'm trying to modify the HelloListView example to useaddHeaderViewor addFooterView. Unfortunately I am unable to get this working. Is anyone able to provide any help? Here is my code, thanks in advance. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textDisplay android:layout_width=fill_parent android:layout_height=wrap_content android:text=Hello! / /LinearLayout public class HelloListView extends ListActivity { private TextView test; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); test = (TextView) findViewById(R.id.textDisplay); getListView().addHeaderView(test); setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, COUNTRIES)); getListView().setTextFilterEnabled(true); } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina }; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView with addHeaderView Example?
Just in case anyone wants this in future, here is the solution to having a ListView with an addHeaderView enabled with a permanent TextView item at the top of list that doesn't move, even after you scroll through the list. If anyone has a better implementation please let me know as this doesn't extend ListActivity but just Activity. Cheers! ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textHeader android:layout_width=fill_parent android:layout_height=wrap_content android:text=Text Header, Always on Top/ ListView android:id=@+id/listEntries android:layout_width=fill_parent android:layout_height=wrap_content/ /LinearLayout public class HelloListView extends Activity { private TextView th; private TextView tv; private ListView lv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); th = (TextView) findViewById(R.id.textHeader); lv = (ListView) findViewById(R.id.listEntries); tv = new TextView(this); tv.setText(Hello There! Stays at top of list); lv.addHeaderView(tv); lv.setAdapter(new ArrayAdapterString (this, android.R.layout.simple_list_item_1, COUNTRIES)); lv.setOnItemClickListener(new ItemClickedListener()); } private class ItemClickedListener implements OnItemClickListener { @Override public void onItemClick(AdapterView? arg0, View arg1, int position, long id) { String temp = arg0.getItemAtPosition(position).toString(); Toast.makeText(HelloListView.this, temp, Toast.LENGTH_SHORT).show (); } } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina }; } On 17 Aug, 16:33, Neil Chinniah nchinn...@googlemail.com wrote: Just in case anyone is interested I found a thread in one of the other groups that makes a reference to HeaderViewListAdapter:http://groups.google.com/group/android-developers/browse_thread/threa... With this I created the following, its far from perfect but at least it loads ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent ListView android:id=@+id/lvEntries android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout public class HelloAddHeaderview extends Activity { private ListView lv; private TextView tv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); lv = (ListView) findViewById(R.id.lvEntries); tv = new TextView(this); tv.setText(Hello There!); lv.addHeaderView(tv); lv.setAdapter(new ArrayAdapterString (this, android.R.layout.simple_list_item_1, COUNTRIES)); } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan }; } 2009/8/17 chinchin nchinn...@googlemail.com Hello, I'm trying to modify the HelloListView example to use addHeaderView or addFooterView. Unfortunately I am unable to get this working. Is anyone able to provide any help? Here is my code, thanks in advance. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textDisplay android:layout_width=fill_parent android:layout_height=wrap_content android:text=Hello! / /LinearLayout public class HelloListView extends ListActivity { private TextView test; /** Called when the activity is first created. */ �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); test = (TextView) findViewById(R.id.textDisplay); getListView().addHeaderView(test);
[android-beginners] Re: ListView with addHeaderView Example?
Just in case anyone is interested I found a thread in one of the other groups that makes a reference to HeaderViewListAdapter: http://groups.google.com/group/android-developers/browse_thread/thread/14617420938f6d70?pli=1 With this I created the following, its far from perfect but at least it loads ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent ListView android:id=@+id/lvEntries android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout public class HelloAddHeaderview extends Activity { private ListView lv; private TextView tv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); lv = (ListView) findViewById(R.id.lvEntries); tv = new TextView(this); tv.setText(Hello There!); lv.addHeaderView(tv); lv.setAdapter(new ArrayAdapterString (this, android.R.layout.simple_list_item_1, COUNTRIES)); } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan }; } 2009/8/17 chinchin nchinn...@googlemail.com Hello, I'm trying to modify the HelloListView example to use addHeaderView or addFooterView. Unfortunately I am unable to get this working. Is anyone able to provide any help? Here is my code, thanks in advance. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textDisplay android:layout_width=fill_parent android:layout_height=wrap_content android:text=Hello! / /LinearLayout public class HelloListView extends ListActivity { private TextView test; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); test = (TextView) findViewById(R.id.textDisplay); getListView().addHeaderView(test); setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, COUNTRIES)); getListView().setTextFilterEnabled(true); } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina }; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView with addHeaderView Example?
chinchin wrote: Hello, I'm trying to modify the HelloListView example to use addHeaderView or addFooterView. Unfortunately I am unable to get this working. Is anyone able to provide any help? Here is my code, thanks in advance. snip @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); test = (TextView) findViewById(R.id.textDisplay); getListView().addHeaderView(test); Dynamically create your TextView in Java, or inflate it from a separate layout XML file via getLayoutInflater().inflate(). You cannot move a widget that is outside the list into the list in the fashion you are trying to. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Item lost focus event
ListView subclasses AdapterView, which has setOnItemSelectedListenter: http://developer.android.com/reference/android/widget/AdapterView.html#setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 6, 5:03 am, Martin Obreshkov manig...@gmail.com wrote: Hi when i select item in listview and then scroll it the selected item in no more highlighted. Can e register listener for this event ( when the item come unselected ). -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: listview activity not stopping
From the log, you appear to have a null pointer exception, although that could be a red herring. What happens when you step through it? Do you get the same problem for all list items? Looking at your code, you might want to consider simplifying it with a switch statement, like: switch (position) { case SHOULDER: startActivityForClass (GymExercise.this,ShoulderViewController.class); break; case BICEPS: startActivityForClass (GymExercise.this,BicepsViewController.class); etc. Why do you call lv.bringToFront() for position 0? Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 27, 3:16 am, ranjit ranjit.pate...@gmail.com wrote: i have face this error,i cant found the solution please help.Application is based on listview Activity.when u click on one listview item then it ll go to another listview.second activity start but ther is some error please help yr...this error .. --- --- -- 07-27 15:38:48.117: WARN/dalvikvm(741): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) 07-27 15:38:48.127: ERROR/AndroidRuntime(741): Uncaught handler: thread main exiting due to uncaught exception 07-27 15:38:48.147: ERROR/AndroidRuntime(741): java.lang.RuntimeException: Unable to stop activity {com.vigyaapan.Exercise/com.vigyaapan.Exercise.GymExercise}: java.lang.NullPointerException 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.ActivityThread.performStopActivityInner (ActivityThread.java:2905) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.ActivityThread.handleStopActivity(ActivityThread.java: 2948) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.ActivityThread.access$2100(ActivityThread.java:112) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1708) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.os.Handler.dispatchMessage(Handler.java:99) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.os.Looper.loop(Looper.java:123) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.ActivityThread.main(ActivityThread.java:3948) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at java.lang.reflect.Method.invokeNative(Native Method) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at java.lang.reflect.Method.invoke(Method.java:521) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:782) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at dalvik.system.NativeStart.main(Native Method) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): Caused by: java.lang.NullPointerException 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.Activity.performStop(Activity.java:3575) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): at android.app.ActivityThread.performStopActivityInner (ActivityThread.java:2902) 07-27 15:38:48.147: ERROR/AndroidRuntime(741): ... 11 more --- - here is my program --- package com.vigyaapan.Exercise; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.util.AndroidRuntimeException; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; public class GymExercise extends ListActivity { DBExercise dbExercise = new DBExercise(this); Cursor cursor; String aryListMainMenu[]; int intGetSelectedItem = 0; protected ListView lv; public void onCreate(Bundle savedInstanceState) { try { super.onCreate(savedInstanceState); dbExercise.openDataBase(); dbExercise.getTricepDipImage(); aryListMainMenu = dbExercise.displayMainMenu(); startManagingCursor(cursor); if(dbExercise != null) dbExercise.close(); setContentView(R.layout.main); lv = (ListView)this.findViewById(android.R.id.list); setupListView(); } catch(NullPointerException e) { e.printStackTrace(); } } private void setupListView() { try
[android-beginners] Re: ListView: Default highlight the item
Launch the application using the trackball :) On Mon, Jul 6, 2009 at 10:38 AM, pdesaipink...@gmail.com wrote: Hello I am using ListView in my application. When My application gets launched, it displays Listview with some items in the list. I want the first item to be highlighted by default without any user action. How can i do that ? I tried listview.setSelection(0) method but it is not actually highlighting that first item. Can someone help me on this ? -PD -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView vs ScrollView
frodo wrote: Now I have read all of the Dev Guide, and have started working on my program, I just cant figure out why I would Use the ScrollView. Not everything is a list. Take the screen for adding or editing a contact in the built-in Contacts app. It is a long form, and has a scrollbar. That might be a ListView. It might also be some other type of layout (e.g., TableLayout), wrapped in a ScrollView. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Looking for Android opportunties? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView
Liviu Ungureanu wrote: Is posible to remove/hide the ListView separator? From http://wiki.andmob.org/faq-listsep - You can use the android:dividerHeight XML layout attribute to make the divider be 0px high. Or, you can use the android:divider XML layout attribute to make the divider be transparent (#). Either of those should have the effect of hiding the separator. The difference is that in the latter, the space taken up by the separator will still be there. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView
Thank you! 2009/5/24, Mark Murphy mmur...@commonsware.com: Liviu Ungureanu wrote: Is posible to remove/hide the ListView separator? From http://wiki.andmob.org/faq-listsep - You can use the android:dividerHeight XML layout attribute to make the divider be 0px high. Or, you can use the android:divider XML layout attribute to make the divider be transparent (#). Either of those should have the effect of hiding the separator. The difference is that in the latter, the space taken up by the separator will still be there. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado -- Trimis de pe dispozitivul meu mobil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Entries
Kevin J. Brooks wrote: Is there a way to set the Entries of a ListView through the program code? Something like ListView.setEntries(R.layout.stringarray); If by entries you mean the rows that appear in the list, you use setAdapter(). http://wiki.andmob.org/samplecode Scroll down on that page and you will find the links to the six posts I made last summer in the Fancy ListViews series, which demonstrate the use of adapters and creating custom adapters. Or, check out the samples with the SDK: http://developer.android.com/guide/tutorials/views/hello-listview.html http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/index.html (for the latter, scroll down to the eight samples under the Lists heading) If I have completely misunderstood your question, write back! -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Listview again
I am at a loss. I have tried multiple ways to get this done. I have tried setListAdapter also with the same results. The ListView is always blank. What am I doing wrong? When you are stuck, grab the code from an example bit of code (e.g., the SDK samples), get it working, then slowly manipulate it to get it to look like you want. ListView lvDrinks = (ListView)this.findViewById(android.R.id.list); //View lvDrinks = this.findViewById(android.R.id.list); String sType = extras.getString(drinktype); // lvDrinks.setAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, R.array.beers)); beerscreen XML ?xml version=1.0 encoding=utf-8? 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=#ff android:textColor=#00 TextView android:id=@+id/beerselect android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/selecttxt android:layout_centerHorizontal=true android:textStyle=bold android:textColor=#00 / ListView android:id=@android:id/list android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/beerselect android:background=#aa android.textColor=ff android:choiceMode=singleChoice/ I'm skeptical about the android:layout_height=wrap_content. I would have your Buttons appear in the layout second and third, anchored to the bottom, then have the ListView appear below the TextView and above the upper Button. If you use hierarchyviewer (in your SDK tools/ directory), I suspect you will find that your ListView has zero height. Fixing it to take up the space between the TextView at the top and a Button at the bottom should help. If you are not comfortable with RelativeLayout, switch to LinearLayout for now and follow this layout example: http://developer.android.com/guide/samples/ApiDemos/res/layout/list_12.html Also, dump the background and textColor for now -- you don't need them right away, and all that will do is make it more difficult to diagnose your problem. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Listview again
Thanks Mark, I finally figured it out. On Sat, 2009-05-09 at 19:55 -0400, Mark Murphy wrote: I am at a loss. I have tried multiple ways to get this done. I have tried setListAdapter also with the same results. The ListView is always blank. What am I doing wrong? When you are stuck, grab the code from an example bit of code (e.g., the SDK samples), get it working, then slowly manipulate it to get it to look like you want. ListView lvDrinks = (ListView)this.findViewById(android.R.id.list); //View lvDrinks = this.findViewById(android.R.id.list); String sType = extras.getString(drinktype); // lvDrinks.setAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, R.array.beers)); beerscreen XML ?xml version=1.0 encoding=utf-8? 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=#ff android:textColor=#00 TextView android:id=@+id/beerselect android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/selecttxt android:layout_centerHorizontal=true android:textStyle=bold android:textColor=#00 / ListView android:id=@android:id/list android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@id/beerselect android:background=#aa android.textColor=ff android:choiceMode=singleChoice/ I'm skeptical about the android:layout_height=wrap_content. I would have your Buttons appear in the layout second and third, anchored to the bottom, then have the ListView appear below the TextView and above the upper Button. If you use hierarchyviewer (in your SDK tools/ directory), I suspect you will find that your ListView has zero height. Fixing it to take up the space between the TextView at the top and a Button at the bottom should help. If you are not comfortable with RelativeLayout, switch to LinearLayout for now and follow this layout example: http://developer.android.com/guide/samples/ApiDemos/res/layout/list_12.html Also, dump the background and textColor for now -- you don't need them right away, and all that will do is make it more difficult to diagnose your problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView and Buttons on Screen
Junior Einsfeld wrote: Hello people, I have a problem and need your help. I have a class that extends the class ListActivity and in this class I have a ListView. I must add two buttons after the ListView, but I am not getting. The layout I don’t have defined into XML file. How can I do to display the two buttons on a line below my ListView? Create a layout in an XML file, put your buttons below the ListView, and use that XML file in your setContentView() call in your ListActivity onCreate(). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView and Buttons on Screen
Junior Einsfeld wrote: I tried to do this, but I getting an error from Android. And the error is...what? You can get the error message and Java stack trace from adb logcat or DDMS. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Training: http://commonsware.com/training.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView and Buttons on Screen
Junior Einsfeld wrote: I have find this error, but now a I have a new problem: This code is my XML layout file: ?xml version=/1.0/ encoding=/utf-8/? LinearLayout xmlns:android=/http://schemas.android.com/apk/res/android/ //android:orientation=/vertical/ //android:layout_width=/fill_parent/ //android:layout_height=/fill_parent/ ListView android:id=/@android:id/android:list/ //android:layout_width=/wrap_content/ //android:layout_height=/wrap_content// Button android:id=/@+botao/btSSBack/ //android:layout_width=/wrap_content/ //android:layout_height=/wrap_content/ //android:text=/Voltar// /LinearLayout In java, how I get a reference of the ListView from XML file using findViewById()? Don't bother. Just call getListView() from your ListActivity to get the ListView. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView and Buttons on Screen
Thank you very much, man! =] On Mon, May 4, 2009 at 10:04 PM, Mark Murphy mmur...@commonsware.comwrote: Junior Einsfeld wrote: I have find this error, but now a I have a new problem: This code is my XML layout file: ?xml version=/1.0/ encoding=/utf-8/? LinearLayout xmlns:android=/http://schemas.android.com/apk/res/android/ //android:orientation=/vertical/ //android:layout_width=/fill_parent/ //android:layout_height=/fill_parent/ ListView android:id=/@android:id/android:list/ //android:layout_width=/wrap_content/ //android:layout_height=/wrap_content// Button android:id=/@+botao/btSSBack/ //android:layout_width=/wrap_content/ //android:layout_height=/wrap_content/ //android:text=/Voltar// /LinearLayout In java, how I get a reference of the ListView from XML file using findViewById()? Don't bother. Just call getListView() from your ListActivity to get the ListView. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView Activity, fill space
Hi, Get rid of the LienarLayout around ListView, it's useless. Then simply add android:weight=1.0 to ListView and change its height to 0dip. On Tue, Apr 28, 2009 at 8:09 AM, Ventrix Kostis P. vent...@gmail.com wrote: I have this xml layout for a ListActivity. ?xml version=1.0 encoding=utf-8? LinearLayout android:id=@+id/VoicemailLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=List: android:textSize=20sp android:textStyle=bold android:layout_gravity=top /TextView LinearLayout android:id=@+id/linearMain android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical ListView android:id=@android:id/list android:layout_width=wrap_content android:layout_height=wrap_content /ListView /LinearLayout Button android:id=@+id/onlinerButton1 android:layout_width=fill_parent android:layout_height=wrap_content android:layout_gravity=bottom /Button /LinearLayout The problem is that the ListView does not fill the free space between the TextView and the Button. I would like it to be like this: Code: |-| | ListName | |-| | ListItem | | ListItem | | ListItem | | [free space] | | [free space] | | [free space] | |-| | Button | |-| Any suggestions please? -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView focus problem
Try setting the width on the li_cht_text TextView to fill_parent. On Feb 3, 4:53 pm, Selmi se...@centrum.sk wrote: thanks a lot, i knew i had to do something stupid. this helped partially, now text turns to black and is readable when focused but it didn't solved 2nd problem - when i make my own adapter and then click on item then there is not orange flash on it. instead text temporarily changes color to black (becomes unreadable because of black background). i guess i must set something special for its TextView to make it work? just for curiosity i went through listview apidemos, especially List4, but didn't found anything special to enable/disable my listview definition now looks like this: ListView android:id=@android:id/list android:layout_width=fill_parent android:layout_height=0px android:layout_weight=1 android:drawSelectorOnTop=false / and its items: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal CheckBox android:id=@+id/li_cht_checkbox android:layout_width=wrap_content android:layout_height=wrap_content android:layout_weight=0 / TextView android:id=@+id/li_cht_text android:layout_width=0px android:layout_height=wrap_content android:layout_weight=1 android:singleLine=true android:textAppearance=?android:attr/textAppearanceLarge / /LinearLayout /RelativeLayout On 4. Feb, 00:34 h., Romain Guy romain...@google.com wrote: Make sure you haven't set the selector to be drawn on top of the list items. On Tue, Feb 3, 2009 at 3:31 PM, Selmi se...@centrum.sk wrote: hi its probably extremely stupid question, but i can't move with it and when i searched i didn't found anything relevant... problem: if you look to any listview api demos from samples you will see that 1) when orange focus is over any item in list then its text changes to black automatically 2) when you click on any item it flashes with orange if you look to these listview api demos you will see there is no additional code, just setting of adapter and some data. but when i use SimpleCursorAdapter with android.R.layout.simple_list_item_1 in my application then if i scroll list then this orange overlay hides text under it...all i see is orange rectangle. why text under it doesn't change to black and if i use my own ListAdapter based on SimpleCursorAdapter then i will not get this orange flash when item is clicked on. why i have no idea what is wrong, how come that code copied from api demo to my code starts to behave differently? in xml file i don't have anything special set for listview, just its dimensions are not fill_parent but based on weight=1. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView and TextView in a LinearLayout - issue
Just replace android:orientation=horizontal by android:orientation=vertical On Mon, Mar 30, 2009 at 6:24 PM, rch ravichitt...@gmail.com wrote: I am trying to render a ListView and a TextView within a LinearLayout. That activity is inherited from ListActivity. The problem I am running into is Listview and TextView are not getting arranged properly one below the other in the layout. basically they getting rendered side by side. Need help.. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal TextView android:id=@+android:id/test android:layout_width=fill_parent android:layout_height=wrap_content android:text=test test / ListView android:id=@android:id/list android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView focus problem
Make sure you haven't set the selector to be drawn on top of the list items. On Tue, Feb 3, 2009 at 3:31 PM, Selmi se...@centrum.sk wrote: hi its probably extremely stupid question, but i can't move with it and when i searched i didn't found anything relevant... problem: if you look to any listview api demos from samples you will see that 1) when orange focus is over any item in list then its text changes to black automatically 2) when you click on any item it flashes with orange if you look to these listview api demos you will see there is no additional code, just setting of adapter and some data. but when i use SimpleCursorAdapter with android.R.layout.simple_list_item_1 in my application then if i scroll list then this orange overlay hides text under it...all i see is orange rectangle. why text under it doesn't change to black and if i use my own ListAdapter based on SimpleCursorAdapter then i will not get this orange flash when item is clicked on. why i have no idea what is wrong, how come that code copied from api demo to my code starts to behave differently? in xml file i don't have anything special set for listview, just its dimensions are not fill_parent but based on weight=1. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView focus problem
thanks a lot, i knew i had to do something stupid. this helped partially, now text turns to black and is readable when focused but it didn't solved 2nd problem - when i make my own adapter and then click on item then there is not orange flash on it. instead text temporarily changes color to black (becomes unreadable because of black background). i guess i must set something special for its TextView to make it work? just for curiosity i went through listview apidemos, especially List4, but didn't found anything special to enable/disable my listview definition now looks like this: ListView android:id=@android:id/list android:layout_width=fill_parent android:layout_height=0px android:layout_weight=1 android:drawSelectorOnTop=false / and its items: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=wrap_content LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal CheckBox android:id=@+id/li_cht_checkbox android:layout_width=wrap_content android:layout_height=wrap_content android:layout_weight=0 / TextView android:id=@+id/li_cht_text android:layout_width=0px android:layout_height=wrap_content android:layout_weight=1 android:singleLine=true android:textAppearance=?android:attr/textAppearanceLarge / /LinearLayout /RelativeLayout On 4. Feb, 00:34 h., Romain Guy romain...@google.com wrote: Make sure you haven't set the selector to be drawn on top of the list items. On Tue, Feb 3, 2009 at 3:31 PM, Selmi se...@centrum.sk wrote: hi its probably extremely stupid question, but i can't move with it and when i searched i didn't found anything relevant... problem: if you look to any listview api demos from samples you will see that 1) when orange focus is over any item in list then its text changes to black automatically 2) when you click on any item it flashes with orange if you look to these listview api demos you will see there is no additional code, just setting of adapter and some data. but when i use SimpleCursorAdapter with android.R.layout.simple_list_item_1 in my application then if i scroll list then this orange overlay hides text under it...all i see is orange rectangle. why text under it doesn't change to black and if i use my own ListAdapter based on SimpleCursorAdapter then i will not get this orange flash when item is clicked on. why i have no idea what is wrong, how come that code copied from api demo to my code starts to behave differently? in xml file i don't have anything special set for listview, just its dimensions are not fill_parent but based on weight=1. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView id R.java application crash
Mark, Two additional points: 1) My activity does have a main.xml file (see below) 2) Does the lack of explicit reference to a layout file in the code explain why the application crashes (at setContentView(main)? Thanks. Alex Donnini ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:textSize=15sp ListView android:id=@android:id/list android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:textAppearance=?android:attr/textAppearanceMedium android:textSize=15sp / /LinearLayout On Nov 3, 8:31 am, Mark Murphy [EMAIL PROTECTED] wrote: alexdonnini wrote: Could someone explain to me why the entry of a ListView id (list) defined in the layout files used by my application is not among the entries in the id class in R.java? In the source code you included in your email, you don't have any layout files. Layout files are in XML, not Java: http://code.google.com/android/devel/ui/xml.html -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView id R.java application crash
alexdonnini wrote: 1) My activity does have a main.xml file (see below) If you don't call setContentView(R.layout.main) someplace, or use LayoutInflater on main.xml, it won't get used. 2) Does the lack of explicit reference to a layout file in the code explain why the application crashes (at setContentView(main)? Possibly -- it is difficult to tell from the code snippets. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---