setting max height of listview with initial height is wrap content(it may be empty)

by jalandar » Tue, 13 Jan 2009 20:50:32 GMT


Sponsored Links
 Hello everybody I want set initial height of list view with wrap
content, and later it will be expanded as per data added to specific
limit of height. I used wrap_content for height and android:maxHeight
="100px", but it is not working properly the list grows in height
beyond the maxHeight as the list item added.
Is there any other solution.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. I want to know to get browse history on android ?

Thank
Sorry,
 I mean, I want to pull out web histroy from content provider  for my
application.



I have some coding. But I got exception .

So, how can I do ?please help me.
Here are my coding
package com.app.browser;


import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.SimpleCursorAdapter;



public class BrowserApp extends ListActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_activity_view);
        //Cursor
browserinfo=android.provider.Browser.getAllVisitedUrls(getContentResolver());

        String []proj= new String
[]{android.provider.Browser.SearchColumns._ID,
                android.provider.Browser.SearchColumns.DATE,
                android.provider.Browser.SearchColumns.SEARCH};
        Cursor results=

managedQuery(android.provider.Browser.SEARCHES_URI,proj,null,null,
android.provider.Browser.SearchColumns.URL+" ASC");
       /* if (results.moveToFirst())
        {
            do {
                DisplayTitle(results);
            } while (results.moveToNext());
        }


    }
    public void DisplayTitle(Cursor c)
    {

Toast.makeText(this,"url:"+c.getString(0)+"\t"+"search:"+c.getString(1)+"\t"+c.getString(2),Toast.LENGTH_LONG).show();

    }*/

        ListAdapter adapter = new SimpleCursorAdapter(
                this, // Context.
                android.R.layout.two_line_list_item,  // Specify the row
template to use (here, two columns bound to the two retrieved cursor rows).
                results,                                    // Pass in the
cursor to bind to.
                proj, // Array of cursor columns to bind to.
                new int[0]);                                 // Parallel
array of which template objects to bind to those columns.

        // Bind to our new adapter.
        setListAdapter(adapter);

        }
    }

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

2. Audio input- capturing external audio

Has anyone experimented with an external audio connector, so the Dream/
G1 could be connected to a high quality, external microphone through
the USB connector?
--~--~---------~--~----~------------~-------~--~----~

3. multiple selection in drop down list -spinner like widget

4. Efficiency of requestLocationUpdates() and how to save these gps data

5. Default keyboard pop up

6. onKeyDown event unavailable for space key in ListView

7. Build time optimization while copying workspace