android-listview

Access to a TextView in Activity from Listview Adapter in android

☆樱花仙子☆ 提交于 2019-12-08 21:44:32
I have an Activity with a ListView and some TextViews like below, I want to call setText() method of TextViews in OnClickListener in fill() method of adapter. but I don't access to these TextViews ...! How can do this? ActivityMoshtari.class: public class ActivityMoshtari extends Activity { public ArrayList<StructMoshtariItem> moshtariItems = new ArrayList<StructMoshtariItem>(); public ArrayAdapter adaptermoshtari; ListView lstMoshtari; TextView txtInfoMoshtariName; TextView txtInfoMoshtariTel; TextView txtInfoMoshtariMob; @Override protected void onCreate(Bundle savedInstanceState) { super

How to display a ProgressBar on a View while doing some work?

谁都会走 提交于 2019-12-08 20:02:12
问题 I have a view with EditText , Button and ListView . Button's onClick() parses some site (this part works OK), but it takes some time to display the parsed info in ListView , so I want to display small ProgressBar on the place, where the ListView should take place after a while. So, I add this to my layout (I write important part here): <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

Set Round Corner image in ImageView

拈花ヽ惹草 提交于 2019-12-08 19:26:59
问题 I have searched more on websites and got many suggestions like below Changing background with custom style to set the corner radius and padding ( Getting image as rectangle and background as rounded corner) Changing Given image to Bitmap by decoding the image and cropping functionality by passing this bitmap and width ( its taking more time to load) I have checked the WhatsApp Chat history list and it has rounded corner images but its loaded with minimum time . Could you please suggest me the

Android clickable Widget with ListView not clickable on ListItems

一个人想着一个人 提交于 2019-12-08 19:21:30
问题 I am having trouble making my Widget clickable. The following code is working partially. My Widget shows a ListView with Items. When clicking into the Widget where no Item is displayed, the Intent works and the Activity starts. But when clicking on an Item of the ListView nothing happens. Here is the Code: WidgetProvicer: public void onUpdate(final Context context, final AppWidgetManager appWidgetManager, final int[] appWidgetIds) { for (final int iD : appWidgetIds) { final RemoteViews

Android widget with ListView doesn't load items correclty

可紊 提交于 2019-12-08 16:53:45
问题 I'm trying to implement a widget for my app with ListView. To do so, I've gone step-by-step in all the following links: Android app widget with list view Using App Widgets with collections - developer.android.com/guide/topics/appwidgets/index.html#collections Filling ListView in homescreen widget in Android - stackoverflow.com/questions/14121602/filling-listview-in-homescreen-widget-in-android However, when I place the widget on the homescreen, the number of list items does match the number

Android: ListView Selector set to null?

我们两清 提交于 2019-12-08 16:25:29
问题 I want to disable the Selector from my ListView . That's when I click any items there will be no indication that it has been clicked. I tried this in my ListView tag: android:listSelector="@null" and didn't work 回答1: set this android:listSelector="#00000000" Try this. 回答2: The above answer from Kalpana is correct. You can also do it in code like this:- myListView.setSelector(new ColorDrawable(0x0)); 回答3: You could create a new drawable to use as selector, that wouldn't have any state in it :

Android going back to old activity

我怕爱的太早我们不能终老 提交于 2019-12-08 14:52:09
问题 I have a Tab A, B and C. All ofthem contain a ListView called Aa, Bb and Cc. When I click on an item in one of these ListView s I want to show a new activity which will display the information of that clicked item. I have enabled the button in the ActionBar which takes me to the parent Activity . However always when I click that button it does take me to the parent activity but a whole different tab is selected and it loads everything again (data for the listviews). Basically it's the same as

Getting data from Listview with BaseAdapter

时光怂恿深爱的人放手 提交于 2019-12-08 14:12:28
I've an activity(A) that has a Button and when the user press it, it will add an Object to static List . I've another activity(B) that has a ListView to show the content of the static list. In the activity(B) I want to use the attribute of an object that is stored in that static list in the specific row. How can I do that? My code is shown below: //Activity (A): Send.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ... // Add to mycaseList All_Static.MyCaseList.add(case1); ... }}); //============================================================================== /

sorting and filtering ListView with custom array adapter with two TextView?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 14:05:08
问题 have an ArrayAdapter with two TextView . when set it to ListView it is working correctly but when I sort it, it sorts according to name but TextView which holds number doesn't change their position accordingly. and if I don't apply sort and try to filter name with number then show only initial contacts rather show the contact which I want. This is my custom adapter:- import android.app.Activity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup;

Move to the next item - Android- Horizontallistview

£可爱£侵袭症+ 提交于 2019-12-08 14:04:45
The problem is that when I call from my ListView method performItemClick() I did not turn to the method setOnItemClickListener() , and get into a method getView () . I need to call a method setOnItemClickListener() which relate to my ListView , I tried to do this with listview.performItemClick () , but nothing happened . In fact , my problem is that I just have to go to my next item in the list (listview), but there is a problem , because I have a list of looped Integer.MAX_VALUE ; . Because I just need to go to the next item on the list, I tried to do setSelection(mSelectedItem) but in my