package com.mmad.sales;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
public class CopyOfDailyReport extends Activity {
ListView lv;
LocationAdapter locationAdapter;
List<String> day;
List<BeanOutlet> outletList;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.daily_report);
lv=(ListView)findViewById(R.id.listView1);
dailyReport();
}
private void dailyReport() {
day=new ArrayList<String>();
day.add("Sunday");
day.add("Monday");
day.add("TusDay");
day.add("Wednesday");
day.add("Thourday");
day.add("Friday");
day.add("Saturday");
locationAdapter = new LocationAdapter(this);
lv.setAdapter(locationAdapter);
locationAdapter.setNotifyOnChange(true);
locationAdapter.notifyDataSetChanged();
}
public class ViewHolder
{
TextView textiew;
}
public class LocationAdapter extends ArrayAdapter {
Context context;
public LocationAdapter(Context context) {
super(context, R.layout.daily_report_details,day);
this.context = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if(convertView == null) {
convertView = (LinearLayout)LayoutInflater.from(context).inflate(R.layout.daily_report_details, null);
holder = new ViewHolder();
holder.textiew=(TextView)convertView.findViewById(R.id.textView1);
convertView.setTag(holder);
}
else{
holder = (ViewHolder) convertView.getTag();
}
holder.textiew.setText(day.get(position));
return convertView;
}
}
}
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
public class CopyOfDailyReport extends Activity {
ListView lv;
LocationAdapter locationAdapter;
List<String> day;
List<BeanOutlet> outletList;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.daily_report);
lv=(ListView)findViewById(R.id.listView1);
dailyReport();
}
private void dailyReport() {
day=new ArrayList<String>();
day.add("Sunday");
day.add("Monday");
day.add("TusDay");
day.add("Wednesday");
day.add("Thourday");
day.add("Friday");
day.add("Saturday");
locationAdapter = new LocationAdapter(this);
lv.setAdapter(locationAdapter);
locationAdapter.setNotifyOnChange(true);
locationAdapter.notifyDataSetChanged();
}
public class ViewHolder
{
TextView textiew;
}
public class LocationAdapter extends ArrayAdapter {
Context context;
public LocationAdapter(Context context) {
super(context, R.layout.daily_report_details,day);
this.context = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if(convertView == null) {
convertView = (LinearLayout)LayoutInflater.from(context).inflate(R.layout.daily_report_details, null);
holder = new ViewHolder();
holder.textiew=(TextView)convertView.findViewById(R.id.textView1);
convertView.setTag(holder);
}
else{
holder = (ViewHolder) convertView.getTag();
}
holder.textiew.setText(day.get(position));
return convertView;
}
}
}
No comments:
Post a Comment