Re: [android-beginners] TextView @id/android:empty - What am i doing wrong?
Try taking out the android:layout_below attribute from the TextView... I'm not sure if that is the problem, but I have a feeling it is. -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Fri, Jul 23, 2010 at 11:50 PM, Nick Richardson richardson.n...@gmail.com wrote: Thanks for the reply Tre. I made the changes to the id's like you suggested - the TextView is still displayed even when the ListView has data in it. This is very frustrating :S Updated layout snippet: ListView android:id=@id/android:list android:layout_width=fill_parent android:layout_height=fill_parent android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical android:layout_weight=1 android:paddingLeft=6dip android:paddingRight=6dip android:layout_below=@id/text_main_instructions android:drawSelectorOnTop=false/ TextView android:id=@+id/android:empty android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical|center_horizontal android:paddingLeft=6dip android:paddingRight=6dip android:text=@string/main_schedule_empty android:layout_below=@id/text_main_instructions/ .. Just in case i'm doing something complete stupid, here's the code i'm using to populate the ListView. Note that i'm manually adding strings to be displayed for testing right now. ListView scheduleList = (ListView)parent.findViewById(android.R.id.list); scheduleList_ar.add(asdf); scheduleList_ar.add(WTF huh??); scheduleList.setTextFilterEnabled(true); scheduleList.setAdapter(new ArrayAdapterString(parent, android.R.layout.simple_list_item_1, scheduleList_ar)); scheduleList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView? a, View v, int position, long id) Intent scheduleOptionsActivity = new Intent(parent.getBaseContext(), ScheduleOptions.class); scheduleOptionsActivity.putExtra(scheduleId, scheduleList_ar.get(position)); parent.startActivity(scheduleOptionsActivity); } }); Thanks again for any help! //Nick On Fri, Jul 23, 2010 at 9:20 PM, TreKing treking...@gmail.com wrote: On Fri, Jul 23, 2010 at 5:59 PM, Nick Richardson richardson.n...@gmail.com wrote: Is there something i have to call in code to make this work? What am i doing wrong? I have @id/android:list (no '+') and @+id/android:empty (yes '+') and it works for me. Maybe that's it? Also, does my ListView have to have the id @id/android:list in order for this to work, or can i give it a different id? It does if you're using it in a ListActivity. Otherwise, no. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 -- //Nick Richardson //richardson.n...@gmail.com -- 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
Re: [android-beginners] TextView @id/android:empty - What am i doing wrong?
Maybe it's stupid to askbut just to make sure, does your activity extend ListActivity? (maybe it has nothing to do with your problemdunno hehe) On Sat, Jul 24, 2010 at 7:50 AM, Nick Richardson richardson.n...@gmail.comwrote: Thanks for the reply Tre. I made the changes to the id's like you suggested - the TextView is still displayed even when the ListView has data in it. This is very frustrating :S Updated layout snippet: ListView android:id=@id/android:list android:layout_width=fill_parent android:layout_height=fill_parent android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical android:layout_weight=1 android:paddingLeft=6dip android:paddingRight=6dip android:layout_below=@id/text_main_instructions android:drawSelectorOnTop=false/ TextView android:id=@+id/android:empty android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical|center_horizontal android:paddingLeft=6dip android:paddingRight=6dip android:text=@string/main_schedule_empty android:layout_below=@id/text_main_instructions/ .. Just in case i'm doing something complete stupid, here's the code i'm using to populate the ListView. Note that i'm manually adding strings to be displayed for testing right now. ListView scheduleList = (ListView)parent.findViewById(android.R.id.list); scheduleList_ar.add(asdf); scheduleList_ar.add(WTF huh??); scheduleList.setTextFilterEnabled(true); scheduleList.setAdapter(new ArrayAdapterString(parent, android.R.layout.simple_list_item_1, scheduleList_ar)); scheduleList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView? a, View v, int position, long id) Intent scheduleOptionsActivity = new Intent(parent.getBaseContext(), ScheduleOptions.class); scheduleOptionsActivity.putExtra(scheduleId, scheduleList_ar.get(position)); parent.startActivity(scheduleOptionsActivity); } }); Thanks again for any help! //Nick On Fri, Jul 23, 2010 at 9:20 PM, TreKing treking...@gmail.com wrote: On Fri, Jul 23, 2010 at 5:59 PM, Nick Richardson richardson.n...@gmail.com wrote: Is there something i have to call in code to make this work? What am i doing wrong? I have @id/android:list (no '+') and @+id/android:empty (yes '+') and it works for me. Maybe that's it? Also, does my ListView have to have the id @id/android:list in order for this to work, or can i give it a different id? It does if you're using it in a ListActivity. Otherwise, no. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 -- //Nick Richardson //richardson.n...@gmail.com -- 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 -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!) http://android.yuvalsharon.net -- 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] TextView @id/android:empty - What am i doing wrong?
Otherwise you can also add this: scheduleList.setEmptyView(findViewById(android.R.id.empty)); On Sat, Jul 24, 2010 at 11:06 AM, YuviDroid yuvidr...@gmail.com wrote: Maybe it's stupid to askbut just to make sure, does your activity extend ListActivity? (maybe it has nothing to do with your problemdunno hehe) On Sat, Jul 24, 2010 at 7:50 AM, Nick Richardson richardson.n...@gmail.com wrote: Thanks for the reply Tre. I made the changes to the id's like you suggested - the TextView is still displayed even when the ListView has data in it. This is very frustrating :S Updated layout snippet: ListView android:id=@id/android:list android:layout_width=fill_parent android:layout_height=fill_parent android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical android:layout_weight=1 android:paddingLeft=6dip android:paddingRight=6dip android:layout_below=@id/text_main_instructions android:drawSelectorOnTop=false/ TextView android:id=@+id/android:empty android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical|center_horizontal android:paddingLeft=6dip android:paddingRight=6dip android:text=@string/main_schedule_empty android:layout_below=@id/text_main_instructions/ .. Just in case i'm doing something complete stupid, here's the code i'm using to populate the ListView. Note that i'm manually adding strings to be displayed for testing right now. ListView scheduleList = (ListView)parent.findViewById(android.R.id.list); scheduleList_ar.add(asdf); scheduleList_ar.add(WTF huh??); scheduleList.setTextFilterEnabled(true); scheduleList.setAdapter(new ArrayAdapterString(parent, android.R.layout.simple_list_item_1, scheduleList_ar)); scheduleList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView? a, View v, int position, long id) Intent scheduleOptionsActivity = new Intent(parent.getBaseContext(), ScheduleOptions.class); scheduleOptionsActivity.putExtra(scheduleId, scheduleList_ar.get(position)); parent.startActivity(scheduleOptionsActivity); } }); Thanks again for any help! //Nick On Fri, Jul 23, 2010 at 9:20 PM, TreKing treking...@gmail.com wrote: On Fri, Jul 23, 2010 at 5:59 PM, Nick Richardson richardson.n...@gmail.com wrote: Is there something i have to call in code to make this work? What am i doing wrong? I have @id/android:list (no '+') and @+id/android:empty (yes '+') and it works for me. Maybe that's it? Also, does my ListView have to have the id @id/android:list in order for this to work, or can i give it a different id? It does if you're using it in a ListActivity. Otherwise, no. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 -- //Nick Richardson //richardson.n...@gmail.com -- 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 -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!) http://android.yuvalsharon.net -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!) http://android.yuvalsharon.net -- 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] TextView @id/android:empty - What am i doing wrong?
On Sat, Jul 24, 2010 at 4:05 AM, Justin Anderson janderson@gmail.comwrote: Try taking out the android:layout_below attribute from the TextView... I'm not sure if that is the problem, but I have a feeling it is. I agree with this. I set my TextView height to fill_parent as well, though I doubt that makes a different. The layout_weight attribute also seems suspect ... If you're still not getting anywhere, get rid of everything but the main layout, the listview, and the textview. Remove all the properties from them, set their widths and heights to fill_parent, then add the other properties back one at a time to see which is causing the issue. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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] TextView @id/android:empty - What am i doing wrong?
That did the trick! Thanks everyone for all your help!! On Sat, Jul 24, 2010 at 2:08 AM, YuviDroid yuvidr...@gmail.com wrote: Otherwise you can also add this: scheduleList.setEmptyView(findViewById(android.R.id.empty)); On Sat, Jul 24, 2010 at 11:06 AM, YuviDroid yuvidr...@gmail.com wrote: Maybe it's stupid to askbut just to make sure, does your activity extend ListActivity? (maybe it has nothing to do with your problemdunno hehe) On Sat, Jul 24, 2010 at 7:50 AM, Nick Richardson richardson.n...@gmail.com wrote: Thanks for the reply Tre. I made the changes to the id's like you suggested - the TextView is still displayed even when the ListView has data in it. This is very frustrating :S Updated layout snippet: ListView android:id=@id/android:list android:layout_width=fill_parent android:layout_height=fill_parent android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical android:layout_weight=1 android:paddingLeft=6dip android:paddingRight=6dip android:layout_below=@id/text_main_instructions android:drawSelectorOnTop=false/ TextView android:id=@+id/android:empty android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical|center_horizontal android:paddingLeft=6dip android:paddingRight=6dip android:text=@string/main_schedule_empty android:layout_below=@id/text_main_instructions/ .. Just in case i'm doing something complete stupid, here's the code i'm using to populate the ListView. Note that i'm manually adding strings to be displayed for testing right now. ListView scheduleList = (ListView)parent.findViewById(android.R.id.list); scheduleList_ar.add(asdf); scheduleList_ar.add(WTF huh??); scheduleList.setTextFilterEnabled(true); scheduleList.setAdapter(new ArrayAdapterString(parent, android.R.layout.simple_list_item_1, scheduleList_ar)); scheduleList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView? a, View v, int position, long id) Intent scheduleOptionsActivity = new Intent(parent.getBaseContext(), ScheduleOptions.class); scheduleOptionsActivity.putExtra(scheduleId, scheduleList_ar.get(position)); parent.startActivity(scheduleOptionsActivity); } }); Thanks again for any help! //Nick On Fri, Jul 23, 2010 at 9:20 PM, TreKing treking...@gmail.com wrote: On Fri, Jul 23, 2010 at 5:59 PM, Nick Richardson richardson.n...@gmail.com wrote: Is there something i have to call in code to make this work? What am i doing wrong? I have @id/android:list (no '+') and @+id/android:empty (yes '+') and it works for me. Maybe that's it? Also, does my ListView have to have the id @id/android:list in order for this to work, or can i give it a different id? It does if you're using it in a ListActivity. Otherwise, no. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 -- //Nick Richardson //richardson.n...@gmail.com -- 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 -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!) http://android.yuvalsharon.net -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!) http://android.yuvalsharon.net -- 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
Re: [android-beginners] TextView @id/android:empty - What am i doing wrong?
On Fri, Jul 23, 2010 at 5:59 PM, Nick Richardson richardson.n...@gmail.comwrote: Is there something i have to call in code to make this work? What am i doing wrong? I have @id/android:list (no '+') and @+id/android:empty (yes '+') and it works for me. Maybe that's it? Also, does my ListView have to have the id @id/android:list in order for this to work, or can i give it a different id? It does if you're using it in a ListActivity. Otherwise, no. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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] TextView @id/android:empty - What am i doing wrong?
Thanks for the reply Tre. I made the changes to the id's like you suggested - the TextView is still displayed even when the ListView has data in it. This is very frustrating :S Updated layout snippet: ListView android:id=@id/android:list android:layout_width=fill_parent android:layout_height=fill_parent android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical android:layout_weight=1 android:paddingLeft=6dip android:paddingRight=6dip android:layout_below=@id/text_main_instructions android:drawSelectorOnTop=false/ TextView android:id=@+id/android:empty android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=?android:attr/textAppearanceMedium android:gravity=center_vertical|center_horizontal android:paddingLeft=6dip android:paddingRight=6dip android:text=@string/main_schedule_empty android:layout_below=@id/text_main_instructions/ .. Just in case i'm doing something complete stupid, here's the code i'm using to populate the ListView. Note that i'm manually adding strings to be displayed for testing right now. ListView scheduleList = (ListView)parent.findViewById(android.R.id.list); scheduleList_ar.add(asdf); scheduleList_ar.add(WTF huh??); scheduleList.setTextFilterEnabled(true); scheduleList.setAdapter(new ArrayAdapterString(parent, android.R.layout.simple_list_item_1, scheduleList_ar)); scheduleList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView? a, View v, int position, long id) Intent scheduleOptionsActivity = new Intent(parent.getBaseContext(), ScheduleOptions.class); scheduleOptionsActivity.putExtra(scheduleId, scheduleList_ar.get(position)); parent.startActivity(scheduleOptionsActivity); } }); Thanks again for any help! //Nick On Fri, Jul 23, 2010 at 9:20 PM, TreKing treking...@gmail.com wrote: On Fri, Jul 23, 2010 at 5:59 PM, Nick Richardson richardson.n...@gmail.com wrote: Is there something i have to call in code to make this work? What am i doing wrong? I have @id/android:list (no '+') and @+id/android:empty (yes '+') and it works for me. Maybe that's it? Also, does my ListView have to have the id @id/android:list in order for this to work, or can i give it a different id? It does if you're using it in a ListActivity. Otherwise, no. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 -- //Nick Richardson //richardson.n...@gmail.com -- 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