android-listview

StaggeredGridView null pointer

情到浓时终转凉″ 提交于 2019-12-12 04:06:49
问题 I've just imported StaggeredView demo to my workspace, I get no errors in eclipse, but when I'm trying to start the demo, I'm getting this errors in logCat: 09-17 14:01:06.111: E/AndroidRuntime(11611): FATAL EXCEPTION: main 09-17 14:01:06.111: E/AndroidRuntime(11611): java.lang.NullPointerException 09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup$LayoutParams.<init>(ViewGroup.java:5299) 09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget

Android - Get values of Radio Buttons in a ListView

白昼怎懂夜的黑 提交于 2019-12-12 03:38:46
问题 I designed a scenario which, according to my understanding of Java, should have worked out fine but unfortunately didn't. The scenario is explained in code: ListViewAdapter public final class ListViewAdapter extends BaseAdapter { private Context context; private RadioGroup[] radioGroups; private List<String> listOfData; public OneForAllListViewAdapter(Context context, List<String> listOfData) { super(); this.context = context; this.radioGroups = new RadioGroup[listOfData.size()]; this

transfer checked items in list-view to another list-view on button click in android

末鹿安然 提交于 2019-12-12 03:23:23
问题 I have a listview with data using customAdapter.class now what i want is that to transfer checked items in listview to secondActivity on button click... btest.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SparseBooleanArray checked = listView.getCheckedItemPositions(); ArrayList<Model> mylist = new ArrayList<Model>(); for (int i = 0; i < checked.size(); i++) { int position = checked.keyAt(i); if (checked.valueAt(i)) // listView = new ArrayList<Model>(

How to access items inside ExpandableListView?

戏子无情 提交于 2019-12-12 03:18:34
问题 I have an ExpandableListView. When I click on one of these lists, I have several items. http://img15.hostingpics.net/pics/311437expandablelistview.png Is there a way or not to access to the first item in the first group ? I have private ExpandableListView mGattServicesList; SimpleExpandableListAdapter gattServiceAdapter = new SimpleExpandableListAdapter(...); mGattServicesList.setAdapter(gattServiceAdapter); I can access to the first group with : mGattServicesList.getChildAt(0); I want to go

listview not refreshing how to clear the listview items?

我的梦境 提交于 2019-12-12 03:17:50
问题 I am using a custom Adapter class. And retrieving data from database using cursor. When user click a button it will open a custom dialog with single selection list and when user will choose a item from it a list will pop up. every time user will select a item the list must be refreshed. My problem is that list items are appending to the previous list instead of refreshing. Code--> public class ChannelListActivity extends Activity { private Cursor countryCursor; private Cursor channelCursor;

How to get position in Baseadapter

心不动则不痛 提交于 2019-12-12 03:17:25
问题 I am getting response from server and display it in listview,but how to get position in baseadapter,,i have one imageview in listitem and i want to get userid as per selection,right now i am getting 6 last id in everylistitem when i click on imageview this is my response { "searchresult": [ { "user_id": "5", }, { "user_id": "6", } ] } MY adapter public class CustomAdapterAccept extends BaseAdapter{ private Context context; private ArrayList<HashMap<String,String>> listData; private AQuery

Custom ListView selector not showing color as expected

三世轮回 提交于 2019-12-12 03:16:58
问题 I have a ListView , showing the default color of the selector as shown in the picture below. I would like to change color of this selector to, lets say the color teal. ListView.xml: <ListView android:drawSelectorOnTop="true" android:listSelector="@drawable/listitem_selector" android:choiceMode="singleChoice" android:id="@+id/lw" android:layout_width="fill_parent" android:layout_height="fill_parent"/> listitem_selector.xml: <selector xmlns:android="http://schemas.android.com/apk/res/android">

Copying “.apk” file to specified folder

为君一笑 提交于 2019-12-12 03:16:19
问题 I am trying to copy apk of installed app from listview to some specified folder.Copying of apk is working fine...But each time i click on app to copy its apk ..."phone.apk" gets copied to destination folder with diff package name. Here is code of file copying. public class MainActivity extends ListActivity { PackageManager packageManager; List<ApplicationInfo> applist; Listadapter listadapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Getting Null pointer Exception when trying to populate listview from fragment C to fragment B

家住魔仙堡 提交于 2019-12-12 03:14:18
问题 I am newbie to android development. I need to populate ListView in fragment B from the value selected by user in the spinner from fragment C. So far what I tried is bundle method but its throwing null pointer exception. Really I am confused why this happen. This is my code : How to pass spinner value from one fragment to another?. I would be very glad if someone helps me what is the procedure to communicate between fragments of same activity . This is my from_fragment(fragment c) package com

How to hide and show the Android ActionBar like in Google Inbox app?

一曲冷凌霜 提交于 2019-12-12 03:13:44
问题 I wnat to show and hide the Android ActionBar when the user scrolls the screen. I found some examples, like this question in SO. But the code showed in this question and its answer makes the action hides after the list have scrolled some pixels, and I want to make this scroll like the Inbox App by Google, that is the action bar is pulled by the Layout according to the user scroll the screen up or down, in other words, I want to show/hide the action bar at the same time the user scroll down/up