Create Custom BaseAdapter in Android 2.3.3 - android

I want To Create my custom baseadapter So I try the following :
MainActivity.java
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Spinner;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import java.util.ArrayList;
public class SignupActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
String [] arr = {"USA","Canda","Germany","Italy"};
Spinner S1 = (Spinner) findViewById(R.id.Spinner_Signup);
CustomCountryAdpater adapter = new CustomCountryAdpater(this, arr);
S1.setAdapter(adapter);
}
}
CustomCountryAdpater.java
import android.view.View;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.content.Context;
import java.util.ArrayList;
import android.widget.TextView;
public class CustomCountryAdpater extends BaseAdapter {
public Context con;
//public ArrayList<Country> tempList;
String [] arr;
public LayoutInflater myInflater;
public CustomCountryAdpater (Context C,String [] arr)
{
this.con = C;
this.arr = arr;
this.myInflater = (LayoutInflater) C.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return this.arr.length;
}
#Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return this.arr[arg0];
}
#Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
#Override
public View getView(int arg0, View arg1, ViewGroup arg2) {
// TODO Auto-generated method stub
if (arg1==null)
{
arg1 = myInflater.inflate(android.R.layout.simple_list_item_1, arg2, false);
TextView TT = (TextView) arg1.findViewById(android.R.id.text1);
TT.setText(this.arr[arg0]);
}
return arg1;
}
}
when I click on the spinner for first time I got the correct list :
but if I choose Germany, For example and click on the spinner again I get the following list that have no Germany !!!
can anyone told me Why ?!!!

Because you conditionally update text. arg1 you use might be an old, cached View.
Move these lines after if:
TextView TT = (TextView) arg1.findViewById(android.R.id.text1);
TT.setText(this.arr[arg0]);

Related

Accessing an element-Button in grid view

I am supposed to access a button of an element in a grid view and supposed to capture the onItemClick() activity of that button, but somehow I am not able to do it. Help me out. I am posting my code below. Please check it.
package com.nik.cardone;
import java.util.ArrayList;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.GridView;
import android.widget.TextView;
public class Fragment2 extends Fragment{
GridView fragment2Grid;
POJOMenuGrid pojo;
ArrayList<POJOMenuGrid> arr;
String[] name = {"Manchow Soup","Clear Soup","Mushroom Soup","Corn Soup","Tomato Soup"};
String[] desc = {"Soya water with capsicum , carrots , medium spicy"};
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
View v = inflater.inflate(R.layout.new_order_fragment_2, null);
initialize();
fragment2Grid = (GridView)v.findViewById(R.id.fragment2Grid);
fragment2Grid.setOnItemClickListener(new OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
View v = arg0.getChildAt(arg2);
// TODO Auto-generated method stub
System.out.println("In grid :");
}
});
for(int i=0;i<5;i++){
arr.add(new POJOMenuGrid(name[i], desc[0], R.drawable.t2));
}
System.out.println(arr.get(0).getName()+" "+arr.get(0).getDescription()+" ");
CustomGridAdapter adapter = new CustomGridAdapter(v.getContext(), arr);
fragment2Grid.setAdapter(adapter);
System.out.println("adapter set");
return v;
}
private void initialize() {
// TODO Auto-generated method stub
arr = new ArrayList<POJOMenuGrid>();
}
}
Custom Adapter
package com.nik.cardone;
import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class CustomGridAdapter extends BaseAdapter{
Context context;
ArrayList<POJOMenuGrid> arr;
LayoutInflater inflater;
TextView itemName;
TextView itemDescription;
ImageView itemImage;
Button plus;
Button minus;
TextView counter;
public CustomGridAdapter(Context context, ArrayList<POJOMenuGrid> arr) {
super();
this.context = context;
this.arr = arr;
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
System.out.println("in constructor");
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return arr.size();
}
#Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return arr.get(arg0);
}
#Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
#Override
public View getView(int arg0, View arg1, ViewGroup arg2) {
// TODO Auto-generated method stub
System.out.println("in adapter 1");
arg1 = inflater.inflate(R.layout.grid_single_item, null);
System.out.println("in adapter 2");
itemName = (TextView)arg1.findViewById(R.id.itemName);
itemDescription = (TextView)arg1.findViewById(R.id.itemDescription);
//counter = (TextView)arg1.findViewById(R.id.counter);
itemImage = (ImageView)arg1.findViewById(R.id.itemImage);
plus = (Button)arg1.findViewById(R.id.plus);
minus = (Button)arg1.findViewById(R.id.minus);
plus.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
System.out.println("In plus :");
// TODO Auto-generated method stub
TextView counter = (TextView)arg0.findViewById(R.id.counter);
int counter1 = Integer.parseInt(counter.getText().toString());
counter1++;
counter.setText(""+counter1);
}
});
minus.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
TextView counter = (TextView)arg0.findViewById(R.id.counter);
int counter1 = Integer.parseInt(counter.getText().toString());
counter1--;
counter.setText(""+counter1);
}
});
System.out.println("in adapter 3");
itemName.setText(arr.get(arg0).getName());
itemDescription.setText(arr.get(arg0).getDescription());
itemImage.setImageResource(arr.get(arg0).getImage());
System.out.println("in adapter 4");
return arg1;
}
}

Android onClick event on RadioButton not working

I want to make a list of restaurants and have radiobutton besides each name. so i have made two xml files. In the first one there is a listview and another there is a single radioButton.
Now i want to set the onClick listener on each radioButton.Please suggest me about how to do it. I am posting my code below.
MainActivity.java
package com.example.radiogroup;
import java.util.ArrayList;
import java.util.HashMap;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.app.Activity;
import android.content.Context;
import android.database.DataSetObserver;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import android.os.Build;
public class MainActivity extends Activity {
private ArrayList<HashMap<String,Object>> data;
private ListAdapter adapter;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ListView lv=(ListView)findViewById(R.id.listView1);
data=new ArrayList<HashMap<String, Object>>();
prepareListData();
adapter = new ListAdapter(this,data);
lv.setAdapter(adapter);
lv.setOnItemClickListener(new OnItemClickListener()
{
#Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id)
{
RadioButton rb=(RadioButton)findViewById(R.id.radioButton1);
{
if(position==0)
{
Toast.makeText(getApplicationContext(), "Move forward",
Toast.LENGTH_SHORT).show();
}
}
}
});
}
private void prepareListData()
{
HashMap<String,Object> row1=new HashMap<String,Object>();
row1.put("ID",1 );
row1.put("NAME","Taj Mahal");
data.add(row1);
HashMap<String,Object> row2=new HashMap<String,Object>();
row2.put("ID",2 );
row2.put("NAME","Agra Fort");
data.add(row2);
HashMap<String,Object> row3=new HashMap<String,Object>();
row3.put("ID",3 );
row3.put("NAME","Ram Baugh");
data.add(row3);
HashMap<String,Object> row4=new HashMap<String,Object>();
row4.put("ID",4 );
row4.put("NAME","Panch Mahal");
data.add(row4);
HashMap<String,Object> row5=new HashMap<String,Object>();
row5.put("ID",5 );
row5.put("NAME","Musamman Burj");
data.add(row5);
}
class ListAdapter extends BaseAdapter
{
private Context context;
private ArrayList<HashMap<String,Object>> list;
public ListAdapter(Context context,ArrayList<HashMap<String,Object>> list){
this.context = context;
this.list = list;
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return list.get(position);
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
#Override
public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder holder;
if(convertView == null){
holder = new ViewHolder();
convertView = LayoutInflater.from(context).inflate(R.layout.row,null,false);
holder.rb = (RadioButton) convertView.findViewById(R.id.radioButton1);
convertView.setTag(holder);
}else{
holder = (ViewHolder) convertView.getTag();
}
holder.rb.setText(list.get(position).get("NAME").toString());
return convertView;
}
class ViewHolder
{
RadioButton rb;
}
}
}
Use it in ListAdapter-
holder.rb.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), "" + position,
Toast.LENGTH_LONG).show();
}
});

trying to add a Custom ListView With an Adapter to a Fragment?

I'm trying to add a Custom ListView With an Adapter to a Fragment.
I don't Know where is the problem exactly, I think I got everything in place yet I cant get rid of the Unfortunately Stopped message.
I Used the debug and knew where it all collapses ;
in the Fragment class at the
for (int i = 0;i<4;i++){
.
.
.
questions.add(question);
when the debug reaches this statement it ends.
Fragment
import java.util.List;
import code.me.R.id;
import android.R.layout;
import android.app.Application.ActivityLifecycleCallbacks;
import android.app.Fragment;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
#SuppressLint("NewApi")
public class Fragment1 extends Fragment
{
ListView lv;
List<Question> questions;
Integer[] Q_Id ;
String[] AskerUserName = {"Jack" ,"John" ,"Lio" ,"Sam" ,"Mike" };
String[] AnswererUserName ={"Jacob" ,"Mario" ,"Tom" ,"Shon" ,"Jasmine" };
String[] Qusetion = {"What?" ,"Where?" ,"When" ,"How?" ,"Who?" };
String[] Answer = {"jjjjjjjjjj","llllllll","fffffffff","eeeeeeeeeeee","oooooooooooo"};
#Override
public View onCreateView( LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState )
{
for (int i = 0;i<4;i++){
int qid = i;
String AUName = AskerUserName[i].toString();
String AnUName = AnswererUserName[i].toString();
String Ans = Answer[i].toString();
String Ques = Qusetion[i].toString();
Question question = new Question(qid, AUName, AnUName, Ans, Ques);
questions.add(question);
}
View view = inflater.inflate(R.layout.frag1, container, false);
QuestionsAdapter questad = new QuestionsAdapter(getActivity(),questions);
lv = (ListView) view.findViewById(id.listView1);
lv.setAdapter(questad);
return inflater.inflate( R.layout.frag1,
container, false );
}
}
Adapter
import java.util.List;
import code.me.R.id;
import android.R.layout;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class QuestionsAdapter extends BaseAdapter {
private final Activity context;
public List<Question> questions;
LayoutInflater inflater;
public QuestionsAdapter(Activity context,List<Question> qu) {
this.context = context;
this.questions = qu;
// TODO Auto-generated constructor stub
}
#Override
public View getView(int position, View view , ViewGroup parent){
View rowView = view;
if(view == null)
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rowView = inflater.inflate(R.layout.question_answer_item, null,false);
TextView askerUserName = (TextView) view.findViewById(id.askerUsername);
askerUserName.setText(questions.get(position).getAskerUserName().toString());
TextView question = (TextView) view.findViewById(id.Question);
question.setText(questions.get(position).getQuestion().toString());
TextView ratingView = (TextView) view.findViewById(id.RatingAsker);
//ratingView.setText(questions.get(position)._RatingU);
TextView ratingAnswerer = (TextView) view.findViewById(id.RatingAnswerer);
//ratingAnswerer.setText(questions.get(position).getRatingView());
return rowView;
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return 0;
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return questions.get(position);
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return questions.get(position)._QId;
}
}
Class_Question
public class Question {
private
String _Answer ;
String _AnswererUserName;
String _AskerUserName ;
String _Question ;
Integer _QId;
Integer _RatingU;
Integer _RatingQ;
public Question (int Q_Id,String AUName,String AnUName,String Ans,String Ques){
_QId = Q_Id;
_AnswererUserName = AnUName;
_AskerUserName = AUName;
_Answer = Ans;
_Question = Ques;
}
public String getAnswer() {
// TODO Auto-generated method stub
return _Answer;
}
public String getAnswererUserName() {
// TODO Auto-generated method stub
return _AnswererUserName;
}
public String getAskerUserName() {
// TODO Auto-generated method stub
return _AskerUserName;
}
public String getQuestion() {
// TODO Auto-generated method stub
return _Question;
}
public int getRatingView() {
// TODO Auto-generated method stub
return _RatingU;
}
public void setRatingQ() {
// TODO Auto-generated method stub
}
public int getRatingQ() {
// TODO Auto-generated method stub
return _RatingQ;
}
}
You never initialize the List<Question> questions in your fragment.
You never initialize your question collection. That's why it stops when you try to add questions in onCreateView. Either initialize List questions initially or some time before you try to add things to it.

Android Fragment List and GridView

i try to make two fragments in honeycomb, list and gridview.When i clicked the list-item, the GridView successfully displayed.but,the list was disappear.GridView should be displayed beside the list.here's my code:
FragmentTestActivity.java
package com.android.tabgrid;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class FragmentTestActivity extends FragmentActivity implements
OnItemClickListener {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ListView lv = (ListView)findViewById(R.id.list_icon);
ArrayAdapter<String> yoyo = new ArrayAdapter<String>(getApplicationContext(),
android.R.layout.simple_list_item_1,new String[] {
"Traffic",
"Forum",
"Promo",
"Others"
});
lv.setAdapter(yoyo);
lv.setOnItemClickListener(this);
}
#Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
// TODO Auto-generated method stub
Fragment f = new TestFragment(position+1);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.the_frag,f);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.addToBackStack(null);
ft.commit();
}
}
TestFragment.java
package com.android.tabgrid;
import com.android.content.GridView1;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
public class TestFragment extends Fragment {
private int magznumber;
public TestFragment() {
}
public TestFragment(int position) {
this.magznumber = position;
}
#Override
public void onCreate(Bundle saved) {
super.onCreate(saved);
if (null != saved) {
magznumber = saved.getInt("magznumber");
}
}
#Override
public void onSaveInstanceState(Bundle toSave) {
toSave.putInt("magznumber", magznumber);
}
/**
* Make a grid to view the magazines
*/
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saved) {
Context c = getActivity().getApplicationContext();
LinearLayout l = new LinearLayout(c);
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.FILL_PARENT, 0);
l.setLayoutParams(params);
ImageView i = new ImageView(c);
switch(magznumber){
case 1:
Intent i1 = new Intent(getActivity(), GridView1.class);
startActivity(i1);
break;
case 2:
i.setImageResource(R.drawable.lfymag);
break;
case 3:
i.setImageResource(R.drawable.ffymag);
break;
}
l.addView(i);
return l;
}
}
GridView1.java
package com.android.content;
import com.android.tabgrid.FragmentTestActivity;
import com.android.tabgrid.R;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import com.android.tabgrid.TestFragment;
public class GridView1 extends FragmentActivity{
Integer[] img = {
R.drawable.btn_spot_u,
R.drawable.btn_traffic_u,
R.drawable.btn_forum_u,
R.drawable.btn_promo_u
};
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_1);
GridView gV = (GridView)findViewById(R.id.grid1);
gV.setAdapter(new ImageAdapter(this));
}
public class ImageAdapter extends BaseAdapter {
private Context ctx;
public ImageAdapter(Context c) {
ctx = c;
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return img.length;
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
#Override
public View getView(int position, View v, ViewGroup parent) {
// TODO Auto-generated method stub
ImageView imgView;
if(v == null) {
imgView = new ImageView(ctx);
imgView.setLayoutParams(new GridView.LayoutParams(85,85));
imgView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imgView.setPadding(5, 5, 5, 5);
} else {
imgView = (ImageView) v;
}
imgView.setImageResource(img[position]);
return imgView;
}
}
}
please help me and repair mycode.big thanks

getting problem to add items in listview from spinner item selection on button click

Hello friends i m getting problem to add items in listview from spinner item selection on button. Here i m providing code please help me to get rid of the problem.
import java.util.ArrayList;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Adapter;
public class DefectlistviewActivity extends ListActivity {
ArrayList<String> listItems=new ArrayList<String>();
ArrayAdapter<String> adapter;
/** Called when the activity is first created. */
ListView defectDisplay;
Spinner spinner;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
spinner = (Spinner)this.findViewById(R.id.Defect);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.defects_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
// defectDisplay = (ListView) findViewById(R.id.list);
Button add = (Button) findViewById(R.id.Add_new_Defect_Button);
add.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
startActivity(new Intent("com.android.HCS.AddDialog"));
}
});
spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
}
private class EfficientAdapter extends BaseAdapter {
TextView tv;
// private LayoutInflater mInflater;
Context context;
#Override
public int getCount() {
// TODO Auto-generated method stub
return 0;
}
#Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return null;
}
#Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return 0;
}
#Override
public View getView(int position, View row, ViewGroup convertView) {
// TODO Auto-generated method stub
LayoutInflater mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// mInflater = LayoutInflater.from(context);
if (null == convertView) {
row = mInflater.inflate(R.layout.listview, null);
} else {
row = convertView;
}
tv = (TextView) row.findViewById(R.id.Defect1);
//tv.setText(getItem(position));
String itemVal = (String)getItem(position);
tv.setText(itemVal);
return row;
}
}
public class MyOnItemSelectedListener implements OnItemSelectedListener {
public void onItemSelected(final AdapterView<?> parent,
final View view, final int pos, long id) {
Button add_defect = (Button) findViewById(R.id.Add_Defect_Button);
add_defect.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Toast.makeText(parent.getContext(),
parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();
setListAdapter(new EfficientAdapter());
}
});
}
public void onNothingSelected(AdapterView parent) {
// Do nothing.
}
}
}
Your getCount() function in EfficientAdapter is returning 0. So you wont get any callback to getView(). Also getItem(position) is returning null which you trying to set to textview in getView funcion of EfficientAdapter .
I guess you should have a list set to EfficientAdapter who's size should be returned in getCount() and on spinner operation you add your addtional data to the list and notify your list adaptor ie..,EfficientAdapter

Categories

Resources