Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • I failed to customize array adapter

    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 332
    Answer it

    Problem facing in customization of array adapter

    I am want to

    1) fetch data from a SQL server 2008

    2) display fetched data into a list view.


    After successfully I tried to display data with a listview, I fetched two column data that's why I tryed to customize my array adapter where is the code 

    public class testlistviewAdapter  extends ArrayAdapter<String> {
     public testlistviewAdapter(Context context, String[] foods) {
     super(context, R.layout.testlistview,foods);
        }
    
    @Override
        public View getView(int position,View convertView,ViewGroup parent ){
        LayoutInflater joyinflater=LayoutInflater.from(getContext());
        View customView=joyinflater.inflate(R.layout.listview_adapter_file,parent,false);
        String singleFoodItem=getItem(position);
        TextView firstrow=(TextView)customView.findViewById(R.id.tx);
        TextView secondrow=(TextView)customView.findViewById(R.id.datetime);
        firstrow.setText(singleFoodItem);
        secondrow.setText(singleFoodItem);
        return customView;
    
    }
    }


    and here is the code from activity part 

 1 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: