neelima kant

Greenhorn
+ Follow
since Sep 17, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by neelima kant

how i made the association among two lists if i considered that first list containing the selected components of second list....
13 years ago
instead of using table layout i use framelayout in my application but it works not properly......we cant use framlelayout for this why???
13 years ago
yes it works properly now thanks. can you tell me what is the significance of using tablelayout in xml file.
13 years ago
yes thanks it work but i want that the items which i checked in second list it will not be there in the second list once i checked...... it will visible in first list only.
13 years ago
thanks ....it work properly now.

if i want that the checked item of the second list move to the first list??? then how should i proceed??? i m taking my first list as empty list.
13 years ago
i want to made the second list with multiple choices...using choice_mode_multiple.....
13 years ago
yes with checkboxes....my code is not working properly.
13 years ago
if i want to make the second list checkable then i modify my code as

ArrayAdapter list2 = new ArrayAdapter<String>(
this, android.R.layout.simple_list_item_multiple_choice,mStrings2);
final ListView listView = getListView();

listView.setItemsCanFocus(false);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

lv1.setAdapter(list1);
lv2.setAdapter(list2);


but its not working???
13 years ago
thanks swastik

again a query ....if i want to add separator between these two lists den how can i acheive this???.
13 years ago
package com.example.hellotwolistviews;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class HelloTwoListViews extends ListActivity {

private String[] mStrings = {
"Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam",
"Abondance", "Ackawi",
"Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l",
"Pitu", "Airag", "Airedale",
"Aisy Cendre"};
private String[] mStrings2 = {"dsds", "qwqwqq", " dsdsdsd sdsdsds",
"dsdsds sdsds"};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

//setListAdapter for ListView 1
setListAdapter(new ArrayAdapter<String>(this, .layout.main,
.id.ScrollView01, mStrings));
//Code to display ListView 2
ListView cities = (ListView) findViewById(R.id.ListView02);
ArrayAdapter<String> aa = new ArrayAdapter<String>(this, .layout.main,
.id.ListView02, mStrings2);
cities.setAdapter(aa);


}

}

thats my sample code,please check it out.
13 years ago

setListAdapter(new ArrayAdapter<String>(this,layout.main,
id.ScrollView01, mStrings));

ListView cities = (ListView) findViewById(R.id.ListView02);

ArrayAdapter<String> aa = new ArrayAdapter<String>(this, layout.main,
id.ListView02, mStrings2);

cities.setAdapter(aa);



its not working properly, i add the sample code of my problem please check it out.
13 years ago
xml code


<?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"
android:layout_height="fill_parent"
>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="198px">
</ListView>
<ListView
android:id="@+id/ListView01"
android:layout_width="192px"
android:layout_height="215px">
</ListView>
<ListView
android:id="@+id/ListView02"
android:layout_width="192px"
android:layout_height="215px">
</ListView>

</LinearLayout>
13 years ago
private class MyListAdapter extends BaseAdapter {
public MyListAdapter(Context context) {
mContext = context;
}

public int getCount() {
return mStrings.length;
}

@Override
public boolean areAllItemsEnabled() {
return false;
}

@Override
public boolean isEnabled(int position) {
return !mStrings[position].startsWith("-");
}

public Object getItem(int position) {
return position;
}

public long getItemId(int position) {
return position;
}

public View getView(int position, View convertView, ViewGroup parent) {
TextView tv;
if (convertView == null) {
tv = (TextView) LayoutInflater.from(mContext).inflate(
android.R.layout.simple_expandable_list_item_1, parent, false);
} else {
tv = (TextView) convertView;
}
tv.setText(mStrings[position]);
return tv;
}

private Context mContext;
}
13 years ago
how i can change my above code to acheive the goal of adding separator between the two lists???
13 years ago
how we can add two different lists with separator between the two???
13 years ago