[android-developers] Re: Tabhost Disappearing List view

2009-05-02 Thread cre

Mark,

Thanks.

Will do both.

On May 1, 9:05 pm, Mark Murphy mmur...@commonsware.com wrote:
 cre wrote:
  I didn't answer your previous question.  No, there are not problems
  with other Adapters only the ones in TabHost.
  I went back and looked at the Hierarchyviewer property values and it
  shows an item count of 3, which is the number of items in this
  ListView that should be visible but are not.  I am sure I will see the
  same thing with getCount() next time it fails. So I would say that the-
  adapter-thinks-its-empty theory is negative.  It thinks it has 3 items
  but has lost the pointer to them somehow.

  I also didn't make it clear that this problem only occurs after
  leaving the activity and returning. As long as I remain in the
  activity there is no problem with the ListViews.  That is why I
  suggested putting the code in onResume().

  At this point I firmly believe that this is a bug.

 That is quite likely. The question is, a bug in what?

 I recommend you try replacing ArrayAdapter.createFromResource() with
 some other constructed Adapter (e.g., new ArrayAdapter()) and see if the
 problem persists. If the problem goes away, then the problem is fairly
 well narrowed down, and you have a workaround. I suspect that
 createFromResource() is not the most popular way of creating adapters,
 so it is possible the difficulty lies there.

 Also, is this on 1.5 final, or some other edition? If you are not on 1.5
 final, you probably should try it there, since the issue might have been
 resolved.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 2.0 Available!- Hide 
 quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tabhost Disappearing List view

2009-05-01 Thread cre

Mark,

I never call setAdapter() anywhere but in onCreate.
There is only a single definition in array.xml.
I do not manually manipulate the content of list3's adapter.

What happened to List3 happens to List1 and List2 at random and
on occasion more than one list will disappear.

Is there a way to test for this condition and manually update the list
adapters?

On May 1, 6:45 am, Mark Murphy mmur...@commonsware.com wrote:
 cre wrote:
  I got to see the error condition with hierarchyviewer. The ListView is
  visible but the TextViews that contain the lines of text are missing
  from the diagram.  That is why the list of items does not appear.

 That suggests that the adapter for that list thinks it has no contents
 at that point.

 In your code from a previous post, you have:

 ListView list3 = (ListView) findViewById(R.id.tab3);
 list3.setAdapter(ArrayAdapter.createFromResource(
         this, R.array.letters, R.layout.tab_row));

 Do you ever:

 -- Call setAdapter() on list3 again, perhaps with an empty ArrayAdapter?

 -- Have multiple definitions of R.array.letters (e.g., landscape versus
 portrait), with one being empty?

 -- Manually manipulate the contents of list3's adapter?

 --
 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 Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tabhost Disappearing List view

2009-05-01 Thread cre

Mark,

I have inserted the getCount() Now I am trying to make it fail to see
if I get a zero returned.
Would it be wise for me to move the calls to the listadapters from
onCreate to onResume so that they would be refreshed each time this
activity get control because onCreate is only executed once?

On May 1, 11:24 am, Mark Murphy mmur...@commonsware.com wrote:
 cre wrote:
  Is there a way to test for this condition and manually update the list
  adapters?

 If I am correct, and the adapters think they have no contents, they will
 return 0 to a call to getCount(). You may want to check this, in part to
 confirm my adapter-thinks-it-is-empty theory.

 Do adapters other than ArrayAdapter.createFromResource() exhibit the
 same behavior? For example, does an ArrayAdapter created via the
 constructor have its contents vanish?

 --
 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 Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tabhost Disappearing List view

2009-05-01 Thread cre

Mark,

I didn't answer your previous question.  No, there are not problems
with other Adapters only the ones in TabHost.
I went back and looked at the Hierarchyviewer property values and it
shows an item count of 3, which is the number of items in this
ListView that should be visible but are not.  I am sure I will see the
same thing with getCount() next time it fails. So I would say that the-
adapter-thinks-its-empty theory is negative.  It thinks it has 3 items
but has lost the pointer to them somehow.

I also didn't make it clear that this problem only occurs after
leaving the activity and returning. As long as I remain in the
activity there is no problem with the ListViews.  That is why I
suggested putting the code in onResume().

At this point I firmly believe that this is a bug.

Thank you for your time.



On May 1, 6:16 pm, Mark Murphy mmur...@commonsware.com wrote:
  I have inserted the getCount() Now I am trying to make it fail to see
  if I get a zero returned.
  Would it be wise for me to move the calls to the listadapters from
  onCreate to onResume so that they would be refreshed each time this
  activity get control because onCreate is only executed once?

 If your problem is that as you click around tabs, lists decide to
 spontaneously empty out, onResume() will only get called once, shortly
 after the onCreate() call.

 If, on the other hand, your problem is tied to something else taking the
 foreground (dialog or other activity), or if your problem is tied to
 resource changes (e.g., screen rotation), then onResume() might be part of
 the mix.

 --
 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 Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tabhost Disappearing List view

2009-04-30 Thread cre

Mark,
Gone means that only the selected tab's ListView's visiblility is set
to visible.  The other 2 are set to gone.  When you select a different
tab the states change. Since a cannot replicate the error at will I
cannot see if visibility is not set properly when the ListView should
be visible and is not.  I suspect it is a bug since I have no control
over the code that changes the visibility state.  How are bugs
reported to Google?
Thanks,

On Apr 30, 9:03 am, Mark Murphy mmur...@commonsware.com wrote:
 cre wrote:
  Ran hierarchyviewer and all is as expected.  The Listview is (visible)
  when its supposed to be and (gone) when it supposed to be.

 I thought you said you didn't want it to be gone. What does when it
 supposed to be mean?

  The Listviews are setup once in OnCreate and never modified, that is
  why I cannot understand what could cause it or them  to disappear.

 Outside of a possible bug in Android tab support, I have no idea.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tabhost Disappearing List view

2009-04-30 Thread cre

Mark,
I got to see the error condition with hierarchyviewer. The ListView is
visible but the TextViews that contain the lines of text are missing
from the diagram.  That is why the list of items does not appear.  I
did a print screen to capture the diagrams of the error condition and
the normal condition.



Here are the properties and values of the ListView.  Does this provide
any clues?

absolute_x  0
absolute_y  91
getBaseline()   -1
getDescendantFocusability() FOCUS_BEFORE_DESCENDANTS
getHeight() 0
getPersistentDrawingCache() SCROLLING
getSelectedView()   null
getTag()null
getVisibility() VISIBLE
getWidth()  0
hasFocus()  true
isAlwaysDrawnWithCacheEnabled() false
isAnimationCacheEnabled()   true
isChildrenDrawnWithCacheEnabled()   false
isClickable()   false
isDrawingCacheEnabled() false
isEnabled() true
isFocusable()   true
isFocusableInTouchMode()true
isFocused() true
isInTouchMode() true
isSelected()false
isSoundEffectsEnabled() true
layout_bottomMargin 0
layout_height   FILL_PARENT
layout_leftMargin   0
layout_rightMargin  0
layout_topMargin0
layout_widthFILL_PARENT
mBottom 0
mFirstPosition  0
mID id/tab2
mItemCount  3
mLeft   0
mMeasuredHeight 0
mMeasuredWidth  0
mNextSelectedPosition   -1
mPaddingBottom  0
mPaddingLeft0
mPaddingRight   0
mPaddingTop 0
mRight  0
mScrollX0
mScrollY0
mSelectedPosition   -1
mTop0
mUserPaddingBottom  0

On Apr 30, 12:26 pm, Mark Murphy mmur...@commonsware.com wrote:
  How are bugs reported to Google?

 http://b.android.com.

 --
 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 Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Tabhost Disappearing List view

2009-04-29 Thread cre

I have a Linearlayout with a tabhost. Intermittently the listview
under tab3 will disappear when navigating to it.
It is difficult to replicate the problem with any consistency.  It
seems to just happen randomly but I certain there is a specific
trigger.  I just can't find it nor understand what is causing the
listview not to appear when the tab is selected.  The only way to fix
it is to restart the app.

Anyone have any ideas?

?xml version=1.0 encoding=utf-8?
LinearLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:orientation=vertical
android:background=#336633
android:layout_width=fill_parent
android:layout_height=fill_parent

TextView
android:id=@+id/widget173
android:text=Shop 'n Stock

android:layout_width=fill_parent
android:layout_height=26px
android:textSize=16px
android:drawableLeft=@drawable/hgsmgrey
android:drawablePadding=10px
android:textStyle=italic

/TextView

TextView
android:id=@+id/widget93
android:text=Main Menu

android:textColor=#ff
android:paddingTop=4px
android:layout_width=fill_parent
android:layout_height=30px
android:textStyle=bold
android:paddingLeft=116px
android:background=@drawable/grad
android:layout_marginBottom=10px

/TextView

TabHost
android:id=@+id/tabhost
android:layout_width=fill_parent
android:layout_height=270px

TabWidget
android:id=@android:id/tabs
android:layout_width=fill_parent
android:layout_height=wrap_content
/

FrameLayout
android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=fill_parent
android:paddingTop=72px

ListView
android:id=@+id/tab1
android:layout_width=fill_parent
android:layout_height=fill_parent
/

ListView
android:id=@+id/tab2
android:layout_width=fill_parent
android:layout_height=fill_parent
/
ListView
android:id=@+id/tab3
android:layout_width=fill_parent
android:layout_height=fill_parent
/
/FrameLayout
/TabHost

TextView
android:id=@+id/widget83
android:text=Message!

android:layout_marginTop=20px
android:layout_width=fill_parent
android:layout_height=30px
android:textStyle=italic
android:paddingLeft=50px
android:background=#336633
android:textSize=20px

/TextView

TextView
android:id=@+id/widget82
android:paddingTop=30px
android:layout_width=fill_parent
android:layout_height=60px
android:background=#336633
android:drawableBottom=@drawable/hgmedgrey

/TextView
/LinearLayout

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tabhost Disappearing List view

2009-04-29 Thread cre



Mark,

Ran hierarchyviewer and all is as expected.  The Listview is (visible)
when its supposed to be and (gone) when it supposed to be.

The Listviews are setup once in OnCreate and never modified, that is
why I cannot understand what could cause it or them  to disappear.
Here is the code:

ListView list1 = (ListView) findViewById(R.id.tab1);
list1.setAdapter(ArrayAdapter.createFromResource(
this, R.array.books, R.layout.tab_row));

ListView list2 = (ListView) findViewById(R.id.tab2);
list2.setAdapter(ArrayAdapter.createFromResource(
this, R.array.cards, R.layout.tab_row));

ListView list3 = (ListView) findViewById(R.id.tab3);
list3.setAdapter(ArrayAdapter.createFromResource(
this, R.array.letters, R.layout.tab_row));

TabHost tabs = (TabHost) findViewById(R.id.tabhost);

tabs.setup();

TabHost.TabSpec spec = tabs.newTabSpec(tag1);
spec.setContent(R.id.tab1);
spec.setIndicator(Books, getResources().getDrawable(
R.drawable.bookt_tab));
tabs.addTab(spec);

spec = tabs.newTabSpec(tag2);
spec.setContent(R.id.tab2);
spec.setIndicator(Cards, getResources().getDrawable(
R.drawable.cardt_tab));
tabs.addTab(spec);

spec = tabs.newTabSpec(tag3);
spec.setContent(R.id.tab3);
spec.setIndicator(Letters, getResources().getDrawable(
R.drawable.lettert_tab));
tabs.addTab(spec);

tabs.setCurrentTab(0);

Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: USB signal control class?

2008-12-15 Thread cre

Jusin,
I am trying to use the USB port to input data from a keyboard.  How
can I do this?

On Oct 24, 11:35 am, Justin (Google Employee) j...@google.com
wrote:
 In 1.0 you don't have access to the USB port via the Java API layer.
 What is the goal of your project?

 Regards,
 Justin
 Android Team @ Google

 On Oct 18, 11:18 am, chamika sbmcdes...@gmail.com wrote:



  Hi I'm very new to android. This question regard to my future project.
  For instance what I want to know is;
  Is there any class to control the USB signal output using android.
  Up to now I have found that there were class called android.os.IUsb
  but no longer exist.
  Is this class suit to my requirement?

  Please help me!.
  I'm under a situation of selecting a technology- Hide quoted text -

 - Show quoted text -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---