TableLayout layout params

by kingkung » Wed, 07 May 2008 17:51:42 GMT


Sponsored Links
 I understand the inherited structure of the LayoutParams (parent--
what I do:

XML:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/view_contact"
        xmlns:android=" http://schemas.android.com/apk/res/android" ;
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >
</TableLayout>

JAVA:

        private void populateData(AndroidContact ac)
        {
                TableLayout tl = (TableLayout)findViewById(R.id.view_contact);

                TableRow tr = null;
                TextView tv=null;
                if (ac.name!=null)
                {
                        (tr = new 
TableRow(this)).setLayoutParams(tl.getLayoutParams());
                        (tv = new 
TextView(this)).setLayoutParams(tr.getLayoutParams());
                        tv.setText("Name: "+ac.name);
                        tr.addView(tv);
                        tl.addView(tv);
                }
      }

I've also tried:

        private void populateData(AndroidContact ac)
        {
                TableLayout tl = (TableLayout)findViewById(R.id.view_contact);

                TableRow tr = null;
                TextView tv=null;
                if (ac.name!=null)
                {
                        (tr = new TableRow(this)).setLayoutParams(new
TableLayout.LayoutParams());
                        (tv = new TextView(this)).setLayoutParams(new
TableLayout.LayoutParams());
                        tv.setText("Name: "+ac.name);
                        tr.addView(tv);
                        tl.addView(tv);
                }
      }


I don't understand anymore... *sigh*.


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



TableLayout layout params

by kingkung » Wed, 07 May 2008 18:40:41 GMT


 Never mind, I just used a vertical LinearLayout... much less prone to
restrictions IMHO.



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


Sponsored Links


Other Threads

1. Problem with AudioRecord on Samsung Moment

We have been getting reports of audio recording not working on Samsung
Moment phones on 2.1-update1.

 int bufferSize = AudioRecord.getMinBufferSize(sampleRate,
AudioFormat.CHANNEL_IN_MONO,
                                AudioFormat.ENCODING_PCM_16BIT);
 this.audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
sampleRate,
                                AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT, bufferSize);

generates these logs:

I/AudioPolicyManager( 1889): getInput() inputSource 1, samplingRate
16000, format 1, channels 10, acoustics 0
W/AudioHardwareALSA( 1889): openInputStream : mInput already exists!!
E/AudioRecord( 2618): Could not get audio input for record source 1
E/AudioRecord-JNI( 2618): Error creating AudioRecord instance:
initialization check failed.
E/AudioRecord-Java( 2618): [ android.media.AudioRecord ] Error code
-20 when initializing native AudioRecord object.

I can't find the "mInput already exists" anywhere in the source base,
could this perhaps be an error message included by the OEM?

Thanks!

-- 

2. PreferenceActivity - set text color of preference category?

Hi,

I have a PreferenceActivity. Is there a way to change the color of
each section title?:

    <PreferenceScreen
      xmlns:android="http://schemas.android.com/apk/res/android">

      <PreferenceCategory
        android:title="some title"
        android:textColor="#FF0000"> // <--
        <CheckBoxPreference
          android:key="..."

         ....

textColor won't work here, just an example. Is there some way to set
this?

Thanks

-- 

3. UMTS Signal strength : RSCP or RSSI ?

4. Adding ASFParser(for wma for which libraries are available i need to call API's)

5. How to get access for surfaceflinger

6. http post and get request for updating map

7. IOException with openRawResource(int id)