Hi Sascha,
I'm not an expert yet at this, but I did look into your problem. Perhaps you
are forgetting to use the ListActivity's own ListView? Code below should
work.


package com.android.hello;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class HelloAndroid extends ListActivity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);

       String[] someStringArrayThatShouldWork = {"Test1", "Test2", "Test3"};

       ArrayAdapter<String> aAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, someStringArrayThatShouldWork);
       getListView().setAdapter(aAdapter);
   }
}



Hope this helps,
David






On Mon, Sep 29, 2008 at 11:09 AM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

>
> Hi fellows,
>
> first of all, please don't hit me for asking stupid question. :) I'm
> quite a novice when it comes to Java (J2EE, J2ME, J2SE), but I'm a
> totally n00b when it comes to android. The tutorials are very helpful
> although I needed several tries to get a ListActivity working (using a
> ListAdapter)... my approach to just display an array of Strings didn't
> work... That should have been the easiest solution, since I have a
> fixed number of items to display in the list...
>
> This is what I did:
>
> private String[] someStringArrayThatShouldWork = {"Test1", "Test2"};
>
> in the onCreate method:
>
> setListAdapter(new ArrayAdapter<String>(this,
>                android.R.layout.simple_list_item_1,
> someStringArrayThatShouldWork));
> getListView().setTextFilterEnabled(true);
>
> I received an exception whenever I wanted to start the app. Is there
> anything else I need? That exception was something like "need ID for
> TextView" or something...
>
> But basically I'd like to have something like that:
>
> A list, which is semi-transparent printed on a background image! That
> background image should change when ever the device is rotated to it's
> widescreen "outfit". You should see the background image and also the
> list entrie about it. (65% opacity)
>
> Can someone give me some hints where to start... I've already checked
> the API demos... But I didn't even get the simple List (String Array
> example) to work... :)
>
> Regards and thank you very much in advance,
>
> Sascha
>
> >
>

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

Reply via email to