Android :: ListView Is Not Expanding As Intended
Sep 9, 2010
My scenario is like this:
CODE:........
The problem I have is that I can't get my ListView to get the right height that I want. I'll add a couple of components with my custom BaseAdapter class and everything there works as intended. But when i then debug my application i can only see 1,5 out of 3 components in the list and the rest is hidden futher down in the ListView. But how can i make my ListView calculate how many components i have and get it to show all my components direcly without having too scroll down.
Another thought is if i could populate any other kind of View with my BaseAdapter? Because the only reason I'am using ListView is because of the setAdapter() method.
View 2 Replies
Nov 5, 2010
I'm developing a small application in with a list view filled with a compound component. This component has two text view and one button inside. One of the text view is invisible and when the button is clicked it should appear. I can show the list but i can't make the textview visible when the button is clicked. Here is the xml of the component: And this is the ArrayAdapter that fills the list:
public class AddressAdapter extends ArrayAdapter { int resource;
RelativeLayout placeView;
EditText addressText;
public AddressAdapter(Context _context, int _resource, List _items) {
super(_context, _resource, _items);
resource = _resource;
} private OnClickListener buttonClick = new OnClickListener() {
public void onClick (View v) {
int i = placeView.findViewById(R.id.stub_import).getVisibility();
visibility(i);
} };
private void visibility(int i) {
// TODO Auto-generated method stub switch(i) {
case(View.GONE): { addressText.setVisibility(View.VISIBLE);
} case(View.VISIBLE): { addressText.setVisibility(View.GONE);
} } }
@Override public View getView(int position, View convertView, ViewGroup parent) {
Item item = getItem(position);
String name = item.getName();
String address = item.getAddress();
if (convertView == null) {
placeView = new RelativeLayout(getContext());
String inflater = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater vi = (LayoutInflater)getContext().getSystemService(inflater);
vi.inflate(resource, placeView, true);
} else { placeView = (RelativeLayout) convertView;
} TextView nameText = (TextView)placeView.findViewById(R.id.placeNamwView);
Button button = (Button)placeView.findViewById(R.id.Button01);
addressText = (EditText)placeView.findViewById(R.id.placeAddressText);
button.setOnClickListener(buttonClick);
nameText.setText(name);
addressText.setText(address);
return placeView;
} }
View 2 Replies
View Related
Sep 23, 2009
The "Next" key seems to move to the next item that could interact with the keyboard.
The "Done" key is less clear to me. It sends in a KeyEvent.KEYCODE_ENTER event. Is it possible to distinguish this event from the down-and- left-arrow key that also sends in a KeyEvent.KEYCODE_ENTER? It appears that you get either but not both "Done" or down-and-left-arrow buttons on the soft keyboard.
Am I missing some documentation about this?
Is it "good UI" to have the "Done" key execute the action that would normally be done on an "OK" button? E.g. for a username and password dialog that has two text fields and an OK button the user touches the username field, gets the soft keyboard, types, presses "Next", types, presses "Done" and the dialog submits the username and password and goes away.
Or is it "good UI" to force the user to explicitly touch the OK button? Possibly having to also manually dismiss the soft keyboard if it covers up the OK button.
View 6 Replies
View Related
Oct 1, 2010
I am creating an android app, and in the app I would like to have a button that expands the status bar. When I was thinking up the design for the app it seemed like a simple task like that would be, well, simple. But I come to find out that the StatusBarManager is not part of the public API? I can now not add functionality to an app that is clearly available just not in the public api. Is there another abstract way of expanding the status bar?
View 2 Replies
View Related
Dec 17, 2009
On a relatively new emulator image (AVD) I have about 40mb of free space. How can I expand this? I tried setting the disk.cachePartition.size option, but it didn't seem to have any effect.Just to be clear.I'm talking about the "Internal phone storage" size, not the SD Card size.
View 3 Replies
View Related
Apr 8, 2010
I have a LinearLayout inside a ScrollView that has android:layout_height="fill_parent", but it doesn't expand to the full height of the ScrollView. My layout looks something like:
CODE:........
I can see that the LinearLayout doesn't expand the full height of the ScrollView because in Eclipse in Android Layout Editor, if I select the ScrollView (in the Outline panel) it is highlighted with a red border that fills the screen to the bottom but when I select the LinearLayout its highlight doesn't expand to the bottom of the screen. How can I get it to do so?
The effect I'm trying to achieve is to have some text and a button below it (inside the LinearLayout in level 4 there's just a button). The text can be big enough to need a scrollbar, in which case I want the user to have to scroll down in order to see the button. In case the text is not big enough for a scroll bar, I want the LinearLayout containing the button to stick to the bottom of the screen.
At first I thought I shouldn't post the full XML because it's usually a turn-down to see a huge chunk of code in a question. However, it seems it might be necessary, so here's the full layout.
CODE:........
At the moment I have resorted to android:layout_gravity="bottom" on the problematic LinearLayout, which makes the button stick to the bottom of the screen no matter what. But that also makes the text stick to the bottom of the screen, which is not exactly what I was after.
Update: scratch that, android:layout_gravity="bottom" makes the ScrollView unable to, well, scroll.
View 2 Replies
View Related
Feb 19, 2010
For good usability in an app that I'm developing I would like to expand the status bar to show the user the first time that there is more information to be found on the expanded status bar. (The user will run several apps at the same time, and background services will post notifications. The expanded notifications link back to several the apps/activities that the user is running. )
I've been searching for a while now, but the only thing I could find was: http://developer.android.com/reference/android/Manifest.permission.ht....
I'm looking for a code example on how to expand the status bar.
View 3 Replies
View Related
Aug 6, 2010
This should be a very simple thing, but it's driving me crazy and currently one of the older bugs of my app. Given an ExpandableListView I want to collapse all the groups but the last one and expand the last one. The code below doesn't work (basically seems to do things at random).
CODE:................
View 4 Replies
View Related
Jan 28, 2010
I want to display keyboard when my app gets started. I know we can get Virtual Keyboard when clicked on EditText field, but I want to show Virtual Keyboard without clicking on EditText.
View 3 Replies
View Related
Jul 20, 2010
I can draw overlay items onto google maps just fine, an image that looks like:
_____
| |
______
/
Where the "/" part is the "pin" that marks the lat/lon on the map and a picture in the middle of it. My question is, is there any way to expand this when the user clicks on it? I'll of course have to change this to some kind of dialog or layout and change it when it gets clicked.
I want to have it smaller like that with just an image when not clicked on, but when it is clicked on it expands over like a second to:
--------------------------------------
| <image> <buttons> |
| <buttons> |
| <some info here> |
| |
--------------------------------------
/
Is this possible?
View 2 Replies
View Related
Jun 10, 2009
I'm trying to implement an expandable list view where the group view contains a label and a checkbox, visually represented below (the v and > are the expand/collapse icons, the [x]/[ ] a checked/unchecked.
View 2 Replies
View Related
Jul 9, 2010
The side bar in eclipse shows a red cross on the title of my project folder but there are no such signs in the directories below it in hierarchy. In which particular file does error exist? How can I know that
View 3 Replies
View Related
May 1, 2010
The Hero's native weather widget contains a pretty limited number of cities. On my old WinMo phone, there was a way to expand the database of cities by modifying some Manila files. Is there a similar course of action for Android phones? I perused the files on the Hero (ROM and SD) but didn't see any obvious candidates to change.
View 10 Replies
View Related
Apr 21, 2010
Looking at greatly expanding my SD storage. It is clear that the Sprint Hero requires an SD device that meets the SD 2.0 specification. That is a given.
The question I have is about SD speed (class) and size (up to 32GB max).
I am wondering if there is noticable speed difference between Class 2 and Class 6 cards on internal or external transfers? Where do we see any difference? Internal - such as photo or file transfers between folders on the card? External - file transfers to and from the SD card set up as a USB device?
Then the possible variable (if it is) of card size? I am still running the stock 2GB card that came with my Hero. I want to go to 16GB. Does "size matter"? ---
Anybody run any experiments to measure speed and function? Photos, files, etc?
View 9 Replies
View Related
Jul 8, 2013
My parents have recently started using a Samsung Galaxy tablet. I believe it is a tab 1. They have created a gmail account for their email and are getting on fine with the gmail app except that they can't figure out how to access the earlier conversations that are grouped together in a thread. I'm an Apple MacBook user. I have googled 'expand conversations.
View 4 Replies
View Related
Jul 16, 2012
A couple of weeks ago I kept getting a low disc space error message on my Droid (the original). I have already moved everything I can to the SD card with App 2 SD Pro and I haven't loaded any new software to the internal hard drive, but I still had to delete a program to free up space.
Two days ago I started getting the message again, and I haven't installed anything. But I think several system programs have updated and gotten bigger. I've had to take off more programs to free space.
Is this normal, or is there a problem? I've cleared up any caches that I can get to without rooting the phone, but I'm starting to think I need to do that. I never use the Facebook app and it eats a lot of space, but I can't delete it without rooting.
View 3 Replies
View Related
May 8, 2013
I finally upgraded to android, i got the cheapest phone possible(kyocera milano) which seems to be a mistake. The phone has only about 300mb internal storage and can barely handle its own updates(because of the limited storage). so i would like to know if its possible to make the phone "think" that some of the sd card is part of its internal memory? I found an adb driver for it(dont ask me where or which one because i had no idea and started messing with one until it worked) i have not tried rooting but can if i need to.
View 5 Replies
View Related
Jun 26, 2010
I would like to change text and back ground color of my Listview without building custom rows. Is this possible ?
View 1 Replies
View Related
Jun 24, 2009
There must be a way to do this. How can you tell a ListView that has a header to not scroll it when the user scrolls the contents? I want it to stay in a "stuck" position so that the user can always see what column the content applies to.
View 9 Replies
View Related
Sep 9, 2010
In my project i m parsing xml and i want to put it in xml list with in list.
View 24 Replies
View Related
Apr 4, 2012
I have some class LoginActivity.java. In the onCreate method I retrieve ListView:
ListView list = (ListView)findViewById(R.id.snListView); then:
list.setAdapter(adapter);
In addition there are login.xml layout - there are:
<ListView
android:id="@+id/snListView"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
and sn_row.xml:
[Code]...
At the moment I have cell's height 100dp, I need that cell's height will depend on device, I mean I have here 5 cells showing at login screen in ListView and I need that these 5 rows will fit the ListView (cell's height = ListView's height/5).
View 1 Replies
View Related
Sep 26, 2010
I have a listview within an activity and at the bottom of the screen I have a scrollable gallery, my problem is making the listview clickable, I would normally use the listview position by doing if(position == 3) and then create the intent but postion is being used by my gallery. I listview is in the main.xml populated by an array.xml, can I add an id i.e android:id in the arrays.xml and create an intent with that, or can I create a listactivity and still use position to fire an intent if so how would I do this.
View 1 Replies
View Related
Mar 16, 2010
I am very new to Android, but I love it because it has given me back what i was longing for : Java.
but I am facing some doubts and confusions about is, since I am totally new to Mobile App Development:-
I am listing my queries here-
1.) I wish to put various items in a single element of a ListView. Like one image in the left, so many TextViews in a single element, and more things. Is it possible?
2.) I wish to give my text different colors, different sizes, and different fonts. how to do this?
3.) I wish to insert or delete elements from a List in ListView. How to do that?
4.) I wish to change the background color of my list. how to do this?
View 10 Replies
View Related
Sep 11, 2010
i can add to a db and list as a listview. When I click a list item using onListItemClick, what statement do I need to get the value? ........................
View 13 Replies
View Related
Aug 1, 2009
I am beginer to the anroid ,i am using the below code for displaying listview and i am not able to getting the onlistitemclick events for further ui's. package com.List;
import android.app.Activity; import android.app.AlertDialog; import android.app.ListActivity; import android.content.ContentUris; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.database.Cursor; import android.database.DataSetObserver; import android.os.Bundle; import android.provider.Contacts.People; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; import............................
View 4 Replies
View Related
Sep 13, 2010
i want to implement listview with uses different xml layouts for rows depending on underlying item. A non optimal solution will be int getView method just to inflate every time a new view depending on the item from the adapter. Is there a better way to do this?
View 2 Replies
View Related
Mar 24, 2010
is it possible to let my ListView show 2 different rows? On the picture you can see at the top something like a "teaser", the other rows are normal ListView. The screenshot is from the iPod. With their framework it is possible to show 2 different row styles. I badly need this on Android... Otherwise I would use a tabel design. But adding rows dynamically would be such an overhead instead of using ListView SimpleAdapter addItem...
View 2 Replies
View Related
Jun 23, 2010
Is there a way to do groups in a listview? Like I have a list of certain states, each state has its own sublist. I'd sort of like to replicate the HTML optgroup/option setup where you have a parent group then child groups. Is there a way to do this built in or would I have to do something tricky with a custom view for Parent elements then switch the view back to the child element style.
View 3 Replies
View Related
Aug 9, 2009
I have a problem, I want a appwidget with a listview, but it seems that appwidget does not support this elment.so is there any way to reslove it?
View 2 Replies
View Related
Jul 8, 2010
how to remove a row from a Listview? I have an Adapter that takes care of the List and when I try mAdapter.remove(Object) it does not remove the "Object" I passed but instead the last row on the list. I have tried different ways and it always ends up deleting the last row.
View 5 Replies
View Related