access parent's protected variable when extend a android class!

by Romain Guy » Thu, 12 Mar 2009 09:44:22 GMT


Sponsored Links
 Because as you said, this field has the default access modifier, which
restricts its use to the android.widget package.






-- 
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

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. startActivityForResult problem...

I have an activity that needs to start another activity in the
onCreate method.  The second activity doesn't have a UI, it just
processes some data (very quickly) and returns it via setResult.

The problem I am having is that it looks like the onActivityResult
method from my first activity is called before the second activity has
finished!

I put in some Toast notifications to be sure, but the order that the
notifications appear is as follows:
- onCreate for Activity1 (just before calling startActivityForResult
to launch Activity2)
- onActivityResult for Activity1
- onCreate for Activity2

Has anyone else run into this problem?  I have not been able to find
anything about this issue on these forums or on google.

Thanks in advance,
Justin
--~--~---------~--~----~------------~-------~--~----~

2. wrap around with textview in a tablelayout broken

Hi Fabian,
Actually, your TextView is just fine; all the text "exists" and is wrapping
properly, it has just been rendered off the edge of the screen. It is the
TableLayout that is doing something odd.

(In fact, I found that if I put items following the TableLayout, but still
within the vertical LinearLayout, they don't show, presumably pushed
offscreen right....)

If you leave out the TableLayout, you will find that the TextView is
functioning properly. Perhaps you can use something other than TableLayout
for your app. Here is a working example:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="horizontal"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   >
   <TextView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
       android:text="Title:"
   />
   <TextView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Ein ganz langer Text der umgebrochen werden muss, der
so lange ist, dass er auf mindestens 3 zeilen verteilt werden muss"
  />
</LinearLayout>



And here is a puzzling non-working example where the textViews were
duplicated just after the TableLayout....

<?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"
   >
   <TableLayout
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
   >
       <TableRow>
           <TextView
               android:text="Title:"
           />
           <TextView
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:text="Ein ganz langer Text der umgebrochen werden
muss, der so lange ist, dass er auf mindestens 3 zeilen verteilt werden
muss"
          />
       </TableRow>
   </TableLayout>

   <TextView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
       android:text="Title:"
   />
   <TextView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Ein ganz langer Text der umgebrochen werden muss, der
so lange ist, dass er auf mindestens 3 zeilen verteilt werden muss"
  />

</LinearLayout>









--~--~---------~--~----~------------~-------~--~----~

3. Can we take pictures without setting a camera preview?

4. Can i fetch the latest image from gallery taken from camera ?

5. Convince Dalvik to add a class with the same canonical path as another

6. connect to wifi from Program

7. Can i install 'barcode scanning app' on emulator ???