listactivity

Why do i get “source not found” when I change extends Activity to extends ListActivity?

☆樱花仙子☆ 提交于 2019-12-25 15:52:23
问题 I've got a problem with this class. This Activity will be called when I press a button. When I extend Activity to this class the programm gets into the class, but when I extend ListActiviy and I click the button the debugger tells me in red words "source not found" and nothing else, not even something in the logcat. Please tell me if there is something missing in the xml-file of this activity or the manifest. This is the class activity: public class SeeAllEntriesActivity extends ListActivity

json android: parsing json

一笑奈何 提交于 2019-12-25 09:45:14
问题 I have a json : [ {user:"John",s:"Ldh",e:"usa"},{user:"Paul",s:"bukit panjang ",e:"FedExForum - Memphis"},{user:"ross",s:"bukit panjang ",e:"FedExForum - Memphis "}] I am parsing this with the following code to retrieve all the values of "user" .. public class ListViewAndroidActivity extends ListActivity { private String newString, user; ArrayList<String> results = new ArrayList<String>(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

onItemClick not being invoked on ListActivity

自作多情 提交于 2019-12-25 05:24:27
问题 I have a class that extends from ListActivity and implements OnItemClickListener It's a very simple test class, the idea is that I select an item on the list, and it shows the selected item on a Toast . I can see the list normally on the emulator, and I can also see the effects of clicking in the item, but then nothing happens. I don't think the event is being fired, because I see nothing on LogCat, here's the code: public class CarsListActivity extends ListActivity implements

android combination of fragmentactivity and listactivity

空扰寡人 提交于 2019-12-25 05:21:56
问题 sorry for may be stupid question, I am a beginner. what can I do if I needed to extend both ListActivity and FragmentActivity in one activity? I know that I can extend only 1 class, but is there any trick which resolves this? Thank in advance. 回答1: you don't have to extended list activity in order to use list , you can include list View inside your layout file 回答2: No, you cannot extend 2 classes in Java. Could you specify why you need to extend both? My guess is FragmentActivity should

Failed to Print position of ClickedItem of ListView in Android using JAVA

∥☆過路亽.° 提交于 2019-12-25 04:29:07
问题 Below class extends from public class LocationListFragment extends ListFragment implements LoaderManager.LoaderCallbacks<List<Location>>{ private final static String TAG = LocationListFragment.class.getName(); private LocationListLoader locationListLoader; private LocationListAdapter locationListAdapter; private int userId; Context context; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ListView lv = getListView(); lv

ListActivity inside TabActivity

怎甘沉沦 提交于 2019-12-25 02:22:46
问题 Please help to solve this problem. I use implementation of OnGestureListener in TabActivity with overriding of method onFling for switching between tabs. But that doesn't work when one of my tabs is ListActivity. Thanks 回答1: Try adding the listener to ListView or yours ListActivity too. 来源: https://stackoverflow.com/questions/5116837/listactivity-inside-tabactivity

How to use R to select a ListView when using it with ListActivity

a 夏天 提交于 2019-12-24 20:26:47
问题 I have this code: public class MyActivity extends ListActivity implements OnClickListener { private ArrayList<String> listItems = new ArrayList<String>(); ArrayAdapter<String> adapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setAdapter(); this.bindButtons(); } private void setAdapter() { setContentView(R.layout.siteactivity); adapter=new ArrayAdapter<String>(this, R.layout.siteitem, listItems); setListAdapter(adapter); } private

When does android's ListActivity class call setContentView()?

本小妞迷上赌 提交于 2019-12-24 07:26:26
问题 I'm trying to use the requestWindowFeature() function to set a custom title view on a list activity. The method works fine with a view that only subclasses Activity , but whenever I try the same method with a ListActivity subclass, it errors, giving me a NullPointerException when I try to programmatically modify the title view. I believe the problem pertains to the fact that requestWindowFeature() needs to be called before setContentView() . Because ListActivity takes care of setting the

What is the better way, keeping adapter as an inner class of activity or outside?

ぃ、小莉子 提交于 2019-12-23 10:09:42
问题 I want to check the better and faster way for program of using adapter for a ListView. Is it out or in activity class? 回答1: This is more of a Java question than Android. Inner classes are more for making your code readable and do not affect performance as long as you use static inner classes . Static inner classes are pulled out by the compiler and compiled as separate classes (Class$InnerClass). So if using inner classes are helpful to you in terms of code organization, you can safely go

Add items to ListView on Android in Xamarin application

こ雲淡風輕ζ 提交于 2019-12-23 09:19:28
问题 I'm trying to remix the base Android advice for adding items to a ListView in a Xamarin application, but so far I'm failing. In Xamarin Studio, I've created an Android App targeting Latest and Greatest , and all default settings. I then added a ListView to my activity and gave it an id of @android:id/list . I've changed the activity's code to this: [Activity (Label = "MyApp", MainLauncher = true, Icon = "@drawable/icon")] public class MainActivity : ListActivity { List<string> items;