Android :: ListView Items Not Clickable With HorizontalScrollView Inside / Make It?
Jun 6, 2010
I have quite a complicated ListView. Each item looks something like this...
In my activity, when an item is created (getView() is called) I add dynamic TextViews to the LinearLayout inside the HorizontalScrollView (besides filling the other, simpler stuff out). Amazingly, performance is pretty good.
My problem is that when I added the HorizontalScrollView, my list items became unclickable. They don't get the orange background when clicked and they don't fire the OnItemClickedListener I have set up (to do a simple Log.d call).
How can I make my list items clickable again?
Edit: setting android:descendantFocusability="blocksDescendants" on the topmost LinearLayout seems to work. I'd like to know if there are other ways, though: what if I want focusable items in my list items?
View 1 Replies
Sep 5, 2013
I have 20 items in an grid view.
If I click any item in an grid view,how should I make that item non clickable?
View 1 Replies
View Related
Nov 19, 2010
I've been trawling the internet looking for an answer for several hours, but I can't seem to find anyone who has been able to solve this. I've got a listview which uses enter code herea custom adapter. A row looks like this. The list is filled by an array. Everything works great. Now, I want the ImageView and the ToggleButton to react to clicks, so I implement the OnClickListener in my adapter, put the items position in each view's tag, and then I set their onclicklistener to this. Works great, except now I can't use the onListItemClick for starting an activity for the item! OK, I say, I just make the relativelayout holding the text in the middle there use the same onclicklistener. Works great. Everything is clickable, and life is good.
EXCEPT! Now, when I scroll the list, I cannot "continue" the scroll by just flinging again. This causes the scrolling to stop, and I have to fling once more to get it going again. It seems the onclick-thingy causes the fling-motion to be interpreted as a tap or something (it does not trigger the logic within onClick).
I know that this is possible by just going to the phone list on my HTC Hero, which has exactly the kind of layout and behaviour I want from my app. This app even seems to have the onItemClickListener working. So how can I make sure the list keeps scrolling, and still be able to click the togglebutton, listitem and the imageview? I've been stuck on this all day, and it's giving me a headache
View 1 Replies
View Related
Jul 7, 2010
I have a HorizontalScrollView that has lots of views and images inside it.
The issue is that if I have lots of stuff inside it I will get a 'java.lang.OutOfMemoryError: bitmap size exceeds VM budget'
is there any way to use some kind of cache, or add/remove stuff as I move left/right so its not on memory all the time?
View 2 Replies
View Related
Aug 11, 2010
I have a horizontal scroll view containing multiple Bitmaps of variable length. My question is how can i make a particular bitmap selected which in not visible on the current screen and let the horizontal scroll to scroll such that the earlier invisible Bitmap is now visible.
View 3 Replies
View Related
Jul 7, 2009
So I've been extremely frustrated by this for a long time now.I've posted before, but can't seem to find a good solution. My goal is to have something pretty much exactly like the installed application details page in the Android Market.I need a list of items displayed along with other content above the list, and would like the content above to scroll up along with the list (exactly like the application details does for the "My Review" and other descriptive info).Due to responses to my previous posts, I came to believe that it really wasn't possible to do this with a ListView.So rather than using a ListView, I refactored my code to use a simple LinearLayout and add individual View items to the list, thinking I could just set each View as clickable and add an OnClickListener to each View in the LinearLayout.That's not working at all though, and now I'm getting even more frustrated.If someone can help me get the OnClickListener working, then I think it'll work, but I do need a separator for the LinearLayout.How do I add a separator like the one used for ListView to my LinearLayout?
View 12 Replies
View Related
Jan 20, 2010
Is it possible to use a OnItemClickListener on a ListView when the Items layout has a clickable/editable widget (RadioButton,EditText, or CheckBox)?
View 1 Replies
View Related
Mar 16, 2010
I really appreciate if anyone can help. i want to make textview clickable just like in Market application. I have set all focusable, clickable in XML but still not working.
View 8 Replies
View Related
Sep 19, 2010
I am using drawable and translateobject to create animation on camera overlay. how do i get clickable drawable object?
View 2 Replies
View Related
Aug 7, 2010
I am trying to make the images I have clickable so that when they are pressed it will send the user to another page or link. How do I go about this? Currently each row in the gridview has 2 buttons. How will it know which item in the gridview is clicked so that it performs a certain action, specific to the item that was clicked.
View 1 Replies
View Related
Oct 18, 2010
I need to display a pretty image of a map of Europe, and I want my app to, e.g. bring up a different activity, when the user clicks each country - each country on the map needs to have a different onClickListener (or equivalent). Essentially, I need to be able to call a different function when the user taps on France rather than Spain in an image such as this:http://commons.wikimedia.org/wiki/File:Blank_map_of_Europe_cropped.svg How would I best go about this on Android?
View 1 Replies
View Related
Sep 13, 2012
I have a Listview or Gridview (tried both) that will display search results from a database query. This works great. Now I want to make each result a hyperlink, for example each row is in this format: <a href='http://mylink.com'>Result1</a>
I used Html.fromHtml() to change each row string into a Spanned type, and now each row (TextView) appears hyperlinked, but they won't click. I keep reading over and over that I need to simply add textView.setMovementMethod(LinkMovementMethod.getI nstance());, HOWEVER, it crashes the program. I think this is because I'm not manually adding each TextView to the ListView, because I am using the ArrayAdapter to dynamically fill the ListView.
View 2 Replies
View Related
Apr 29, 2010
Android is highlighting the links in the TextView, but they do not respond to clicks. Can someone tell me what I'm doing wrong? Do I have to set an onClickListener for the TextView in my activity for something as simple as this?
View 4 Replies
View Related
Nov 19, 2010
I am building a twitter-like client. Assume I have a string: "$AAPL rocks!" I want to be able to click on "$AAPL" and do something. How can I go about making $ clickable in a TextView?
View 1 Replies
View Related
Jul 14, 2010
I have a ViewGroup (LinearLayout) which contains a couple of TextViews and one ImageView. I want to make this entire group clickable. However, clicks on the TextViews or ImageViews or on the area enclosed by the ViewGroup above doesn't result in the handler being called. Any suggestions on how I can make a whole ViewGroup clickable?
View 2 Replies
View Related
Apr 20, 2010
I've got some Buttons that I want to make un-clickable (but still appear on the screen) until another process (thread) has finished its work ? How would you do this ?
View 1 Replies
View Related
Nov 22, 2010
The twitter and facebook apps allow you to click on a username which in turn takes you to a new activity. How can this be achieved? I know there is Linkify, but it seems like it can only send you to a browser/phonecall/ etc. How can I make text that are like "@mynamehere" clickable so that it starts a new activity?
View 2 Replies
View Related
May 23, 2010
I have developed a very simple widget that was meant to interact with the user via an ImageButton. What I am trying to do now is as follows. When a user taps the button (after adding the widget to their home screen), I want the phone to dial a certain telephone number.
View 2 Replies
View Related
Feb 23, 2010
I have a listView, where each row has a button in the row layout. However, this seems to make the row itself unclickable. How can I make both the button and row clickable?
View 2 Replies
View Related
Sep 25, 2009
Is there a way to make URLs in a EditText clickable when the MovementMethod is set to ArrowKeyMovementMethod?
View 3 Replies
View Related
Jul 6, 2010
I need simple multitouch example . I have two button controls. How to make the both to be clickable(pressed) at the same time ?
View 1 Replies
View Related
Oct 12, 2010
I have Acvtivity that creates view and mediaplayer. I want to use OnCompletion event to make that view clickable. But it throws exception, I don't know why. Probably, mediaplayer runs in another thread and cannot access elements from main ui thread?
View 1 Replies
View Related
Aug 21, 2009
I wanna put a "List" inside a TabActivity. by google and coder's guide, my work out "direction" is to create a "TabActivity" as MAIN and "ListActivity" then add it in the "TabHost" and turn out code something like (below) and fail:
CODE:.........
I know i may need to spend more time on the BOOK and google for android development, but i also feel that the resource for android is quit scattered and not detail. (i'm a developer of C# for a few years, and it's more easilier to search for information)
View 2 Replies
View Related
May 28, 2010
I'm just getting my feet wet with Android and have built a UI that contains a TabHost with three tabs. Each tab is powered by its own Activity. The first Tab contains a listview with a prepopulated set of rows and is built from a custom ArrayAdapter.
The problem I'm running into is that none of the ListView rows are tappable. In other words, when I tap on them there is no orange selection. If I use the scroll ball on my Nexus One it will select, but any touch gestures don't seem to be responding. All the UI is being handled using XML files with a main.xml housing the TabHost -> LinearLayout -> TabWidget/FrameLayout and a nearby_activity.xml file containing my ListView UI
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"............
View 1 Replies
View Related
Aug 27, 2009
I cannot get the data from SqLite using order by because the data is encrypted, so the sort wouldn't work there. Is it possible to sort the items in the ListView?
View 5 Replies
View Related
May 15, 2009
I've noticed after I've switched to 1.5 that if ListView item is not enabled the divider(s) for this item are not rendering. Is this intentional?
View 7 Replies
View Related
Jun 19, 2010
I want to achieve this kinda of row look in my app. I already have a ImageView/TextView layout, but I want that 'positive' little image in the right always being displayed at the exact same place!
View 1 Replies
View Related
Aug 16, 2010
When this displays the first two rows of the listview appear under the tabs, the Mercury, and Venus planets. How do I get the tabs to occupy the top and the listview rows to start after the tabs?
tablistmenu.xml:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@+id/lstMain"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ListView>
</LinearLayout>
</TabHost>
tablistmenu.java: public class tablistmenu extends TabActivity {
private ListView mainListView ;
private ArrayAdapter<String> listAdapter ;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.tablistmenu);
TabHost mTabHost = getTabHost();
mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("Contacts", getResources().getDrawable(R.drawable.contact_32)).setContent(R.id.textview1));
mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("Credit Cards", getResources().getDrawable(R.drawable.credit_card_32)).setContent(R.id.textview2));
mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("Notes/Misc", getResources().getDrawable(R.drawable.notes_32)).setContent(R.id.textview3));
mTabHost.addTab(mTabHost.newTabSpec("tab_test4").setIndicator("Websites", getResources().getDrawable(R.drawable.globe_32)).setContent(R.id.textview4));
mTabHost.setCurrentTab(0);
// Find the ListView resource.
mainListView = (ListView) findViewById( R.id.lstMain);
// Create and populate a List of planet names.
String[] planets = new String[] { "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"};
ArrayList<String> planetList = new ArrayList<String>();
planetList.addAll( Arrays.asList(planets) );
// Create ArrayAdapter using the planet list. listAdapter = new ArrayAdapter<String>(this, R.layout.simplerow, planetList);
// Set the ArrayAdapter as the ListView's adapter. mainListView.setAdapter( listAdapter );
// End
} } }
View 3 Replies
View Related
Aug 30, 2010
How to add items to a ListView in Android during runtime?
View 1 Replies
View Related
Jul 20, 2010
I have a listview that's using a custom adapter. I want to dynamically show/remove items from the listview. I've tried everything inside the getView() method in my view adapter. I've tried doing setVisiblity(View.GONE) on the view I'm returning. And it infact doesn't draw the view, but it allocates space for the view and it's just a blank black space.
Is this even possible to set items in listview invisible?
View 2 Replies
View Related