android-listview

ListView images changing During Scroll

杀马特。学长 韩版系。学妹 提交于 2019-12-10 20:54:56
问题 im try to make listview with dynamic images, using asyntask its download image and set into listview. my problem is while scroll down images get randomly changed.. class ps1 extends ArrayAdapter<String> { Context context; String[] images1; List mList; String[] namearray; String[] rating; static class ViewHolder { ImageView localImageView1; ImageView localImageView2; ImageView localImageView3; } ps1(Context paramContext, String[] paramArrayOfString1, String[] paramArrayOfString2, String[]

SwipeRefreshLayout with EmptyView nullPointerException

孤者浪人 提交于 2019-12-10 20:26:45
问题 Whenever I swipe down to refresh, I get a NullPointerException but it's not in my code , rather in the startRefresh() method from SwipeRefreshLayout. 07-14 11:55:06.714: E/AndroidRuntime(20484): java.lang.NullPointerException 07-14 11:55:06.714: E/AndroidRuntime(20484): at android.support.v4.widget.SwipeRefreshLayout.startRefresh(SwipeRefreshLayout.java:441) 07-14 11:55:06.714: E/AndroidRuntime(20484): at android.support.v4.widget.SwipeRefreshLayout.onTouchEvent(SwipeRefreshLayout.java:399)

Drag and Drop for listview of views

◇◆丶佛笑我妖孽 提交于 2019-12-10 20:04:57
问题 Hi i am having Listview where each item is having different layout.and i want to perform drag and drop on this listview.i have searched many examples and tried but all works for listview of strings or something like that,none is working on listview of views.finally i decided to go with DevBytes: ListView Cell Dragging and Rearranging this one.i implemented dynaliclistview but it is crashing as this also using strings in listview.Following is my listview adapter public class

ViewPager with a ListView fragment - The specified child already has a parent

Deadly 提交于 2019-12-10 19:36:09
问题 So I will start off by saying that I have seen several other people post with the exact same error. However, I am at the stage where I have tried all ten different solutions and am still getting the exact same stack trace and ANR. I am using the standard Tabs + Swipe template and have not changed a single thing on it with the exception of setting the first page to return the ListView fragment I will show below. Below is the code for my fragment. CacheFrament is simply a super class that

Testing a click on an Android ListView with ActivityUnitTestCase

不打扰是莪最后的温柔 提交于 2019-12-10 19:00:52
问题 I have implemented a ListView that starts a new Activity when a list item is clicked. When I test it manually, it works perfectly. But when I try to do an automated test with ActivityUnitTestCase , I get a NullPointerException as though the ListView was empty. MainActivity (partial): public class MainActivity extends ListActivity { @Override protected void onResume() { super.onResume(); String[] items = new String[] {"item 1", "item 2"}; ArrayAdapter<String> adapter = new ArrayAdapter<String>

Android ListView onTouchEvent doesn't give ACTION_DOWN

柔情痞子 提交于 2019-12-10 18:22:24
问题 In order to have list reordering functionality I turned to this implementation. My problem is that when I try to drag an item in my ListView, I don't get the ACTION_DOWN event. Instead, for a single smear down motion I get 2 ACTION_MOVE events (action=0x00000002) and a single ACTION_UP event (action=0x00000001) in this order. I've looked at similar questions but it seems like everyone has the opposite problem, getting only ACTION_DOWN events. Can anyone think of why this is happening? Thanks,

Android Listview inside Viewpager Fragement- No scroll

青春壹個敷衍的年華 提交于 2019-12-10 18:17:37
问题 I am trying to create a ListView inside a Viewpager. ViewPager is using Fragements. So ListView is inside the Fragement. My Listview is not scrolling, although in Listview onitmclicked and ontouch gets called. My Code <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app1="http://schemas.android.com/apk/res/com.bookthefield.user" android:layout_width="match_parent"

Flipping CardView in RecyclerView

筅森魡賤 提交于 2019-12-10 18:16:06
问题 I am trying to implement a CardView flip in a RecyclerView. I just cannot figure out a simple solution. I have a working CardView where i can display a list of card using the recycler view. The problem is, how to show the back of the card if user click the card. I want to use animation and change the front of the card to the back of the card. Can someone give a simple animation and example of the card layout. My current example is pretty much copy of this example where a new activity is being

Can a ListView have two or more different types of row layouts in Android?

◇◆丶佛笑我妖孽 提交于 2019-12-10 18:13:07
问题 I have a very simple ListView right now in a ListActivity that displays just a list of text values. Here's my current code: public class InfoActivity extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); List<String> values = new ArrayList<String>(); // loads up the values array here // ... ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values); setListAdapter(adapter); } My

ViewPager inside ViewPager.How to scroll parent pager horizontally instead of scrolling child, but keep child pager vertical scroll?

允我心安 提交于 2019-12-10 18:03:26
问题 I have a parent ViewPager , each page of which contains a child ViewPager . Child ViewPager may contain a ListView or a vertical ScrollView . I want to pass horizontal scroll from child ViewPager to parent ViewPager , but want to keep child ViewPager scrollable vertical. Overriding dispatchTouchEvent(MotionEvent event) in child ViewPager and returning false helps to pass motion events to parent ViewPager, but how to keep ListView and ScrollView in child ViewPager scrollable? 回答1: The solution