Change two textViews inside a listview - android

Let's say, I have two textviews, TextView A and B.
when I click on A, I need to change both textviews;
When I click on B, I need it to do something else.
I used the setTag(key,A); and setTag(key,B); The textView A changed correctly but the textView B is null. And when I click on B it works.
Here is my code :
public class CustomeAdapterHowComment extends ArrayAdapter<ItemsHowComment> {
Context context;
ItemsHowComment items;
List<LikersComment> likeItems;
List<ItemsHowComment> Items1;
Bitmap bitmap;
String imageUser = "";
String filePath_Image = "/Pictures/jehad/joj/";
String user_id = "1510";
String secret_id = "789654120";
View v;
String onclick = " ";
int x;
String table = "10";
String target = "";
String type = "";
DataBaseHandler dbobj;
public static String server_List_of_Comments = "https://www.ashabe.comt";
public static String server_Comment_like = "https://www.ashabe.com/";
public static String server_Comment_like_remove = "https://www.ashabe.com/";
public static String server_Comment_Delte = "https://www.ashabe.com/";
public static String server_Comment_likers = "https://www.ashabe.com/";
String response;
public CustomeAdapterHowComment(Context context, int textViewResourceId,
List<ItemsHowComment> objects) {
super(context, textViewResourceId, objects);
// TODO Auto-generated constructor stub
this.context = context;
}
public View getView(final int position, View convertView, ViewGroup parent) {
Log.d("View ", "View>>>>>>>>");
commentholder h = null;
v = convertView;
items = getItem(position);
LayoutInflater vi = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
v = vi.inflate(R.layout.how_comment_list, null);
h = new commentholder();
h.img = (ImageView) v.findViewById(R.id.CommentImg);
h.name = (TextView) v.findViewById(R.id.CommentName);
h.commentBody = (TextView) v.findViewById(R.id.CommentBody);
h.like = (TextView) v.findViewById(R.id.CommentLike);
h.numoflike = (TextView) v.findViewById(R.id.CommentNumOfLike);
v.setTag(h);
} else {
h = (commentholder) v.getTag();
}
imageUser = items.getUserId() + items.getRand();
boolean flag_ImagePath = Methods.checkIfImage_DirExists(filePath_Image
+ imageUser);
if (flag_ImagePath == true) {
Log.v("flag_ImagePath", String.valueOf(flag_ImagePath));
bitmap = Methods.displayBitmapImage(imageUser);
h.img.setImageBitmap(bitmap);
}
h.commentBody.setText(items.getCommentBody());
h.name.setText(items.getName());
if (items.getiLike().equals("0")) {
h.like.setText("Like");
}
if (items.getiLike().equals("1")) {
h.like.setText("Unlike");
}
if (items.getNumOfLike().equals("0")) {
h.numoflike.setText("0");
} else {
h.numoflike.setText(items.getNumOfLike());
}
h.name.setOnClickListener(listener);
h.name.setTag(R.id.CommentName, h.name);
h.name.setTag(position);
h.numoflike.setOnClickListener(listener);
h.numoflike.setTag(R.id.CommentNumOfLike, h.numoflike);
h.numoflike.setTag(position);
h.like.setOnClickListener(listener);
h.like.setTag(R.id.CommentLike, h.like);
h.like.setTag(position);
h.img.setOnClickListener(listener);
h.img.setTag(R.id.CommentImg, h.img);
h.img.setTag(position);
return v;
}
private OnClickListener listener = new View.OnClickListener() {
#SuppressWarnings("deprecation")
#Override
public void onClick(View view) {
final int id = view.getId();
type = " ";
CommentEvents t = new CommentEvents();
t.execute();
switch (id) {
case R.id.CommentImg:
dbobj = new DataBaseHandler(getContext());
Items1 = dbobj.select_HowComment();
dbobj.CloseDataBase();
Collections.reverse(Items1);
x = (Integer) view.getTag();
Log.v("value", x + Items1.get(x).getName());
Toast.makeText(getContext(), Items1.get(x).getName(),
Toast.LENGTH_SHORT).show();
break;
case R.id.CommentName:
// ///profile
try {
dbobj = new DataBaseHandler(getContext());
Items1 = dbobj.select_HowComment();
dbobj.CloseDataBase();
Collections.reverse(Items1);
x = (Integer) view.getTag();
TextView tv = (TextView) view.getTag(R.id.CommentName);
Log.v("value", x + Items1.get(x).getName());
Toast.makeText(getContext(), Items1.get(x).getName(),
Toast.LENGTH_SHORT).show();
// String user = Items1.get(x).getUserId();
} catch (IndexOutOfBoundsException e) {
// TODO: handle exception
}
break;
case R.id.CommentLike:
dbobj = new DataBaseHandler(getContext());
Items1 = dbobj.select_HowComment();
dbobj.CloseDataBase();
Collections.reverse(Items1);
x = (Integer) view.getTag();
Log.v("value", x + "");
TextView like = (TextView) view.getTag(R.id.CommentLike);
target = Items1.get(x).getCommentId().toString();
type = "like";
CommentEvents s = new CommentEvents();
s.execute(user_id, secret_id, table, target);
if (Items1.get(x).getiLike().equals("0")) {
like.setText("Unlike");
onclick = "true";
} else if (Items1.get(x).getiLike().equals("1")) {
like.setText("Like");
onclick = "true";
}
case R.id.CommentNumOfLike:
// ////howlike
if (onclick.equals("true")) {
x = (Integer) view.getTag();
TextView numofLike = (TextView) view
.getTag(R.id.CommentNumOfLike);
if (numofLike != null) {
if (Items1.get(x).getiLike().equals("0")) {
Log.e("getNumOfLike____unlike", Items1.get(x)
.getNumOfLike());
int num = Integer.parseInt(Items1.get(x)
.getNumOfLike().toString());
num = num + 1;
Log.e("numberunlike", num + "");
numofLike.setText(num + "");
} else if (Items1.get(x).getiLike().equals("1")) {
Log.e("getNumOfLike_______like", Items1.get(x)
.getNumOfLike());
int num = Integer.parseInt(Items1.get(x)
.getNumOfLike().toString());
num = num - 1;
Log.e("numberlike", num + "");
numofLike.setText(num + "");
}
onclick=" "; }
} else {
try {
dbobj = new DataBaseHandler(getContext());
Items1 = dbobj.select_HowComment();
dbobj.CloseDataBase();
Collections.reverse(Items1);
x = (Integer) view.getTag();
Log.v("value", x + "");
target = Items1.get(x).getCommentId().toString();
type = "numoflike";
CommentEvents r = new CommentEvents();
r.execute(user_id, secret_id, table, target);
} catch (IndexOutOfBoundsException e) {
// TODO: handle exception
}
}
}
}
};

Use
View view = v.getParent();
and then try to initialize views with view in onClick
You can set Tag
h.name.setOnClickListener(listener);
h.name.setTag(h.numoflike); // use setTag only once
h.numoflike.setOnClickListener(listener);
h.numoflike.setTag(h.name); // use setTag only once
Then in on click
public void onClick(View v) {
switch(v.getId())
{
case R.id.CommentName :
TextView tv1 = (Button) v.getTag();
TextView tv2 = (TextView) v;
tv1.setText("clicked");
tv2.setText("clicked");
break;
case R.id.CommentNumOfLike :
//do something
break;
}
}
Or in onClick Initialize yours views
View view = v.getParent();
TextView tv = view.findVIewById(R.id.CommentName);
TextView tv1 = view.findVIewById(R.id.CommentNumOfLike);
tv.setText("clicked");
tv1.setText("clicked");

Related

Cannot Cast Holder - ListView

I have a problem in Android, and Ive tried a couple of solutions, but nothing work.
When I scroll the list I get the exception:
java.lang.ClassCastException: com.example.restaurante.SmartMercadoriasAdapter$FirstViewHolder cannot be cast to com.example.restaurante.SmartMercadoriasAdapter$SecondViewHolder
This my code:
#Override
public int getViewTypeCount() {
return 2;
}
#Override
public int getItemViewType(int position) {
if (tipo.equals("1"))
return 0;
else
return 1;
}
#Override
public View getView(int position, View view, ViewGroup parent) {
MyListSmartMercadoria mercadoria = null;
if(mercadorias.size() > 1){
mercadoria = mercadorias.get(position);
}else{
mercadoria = mercadorias.get(0);
}
tipo = "";
tipo = mercadoria.getTipo();
int viewType = getItemViewType(position);
switch (viewType) {
case 0: {
FirstViewHolder firstViewHolder = null;
if(view == null){
view = LayoutInflater.from(getContext()).inflate(R.layout.merc_lista_smart_adp, parent, false);
firstViewHolder = new FirstViewHolder(view);
view.setTag(firstViewHolder);
}
else {
firstViewHolder = (FirstViewHolder)view.getTag();
}
firstViewHolder.mTipo.setText(tipo);
String codigo = mercadoria.getCod();
if(codigo.matches("[0-9]+")){
int codI = Integer.parseInt(mercadoria.getCod());
codigo = "[";
codigo += String.format("%06d", codI);
codigo += "]";
}else{
codigo = "[";
codigo += codigo;
int cont = 6 - codigo.length();
for(int i = 0; i < cont; i++){
codigo = codigo + " ";
}
codigo += "]";
}
firstViewHolder.mCodigo.setText(codigo);
firstViewHolder.mDescricao.setText(mercadoria.getNome());
firstViewHolder.mPreco.setText(mercadoria.getPreco());
break;
}
case 1: {
SecondViewHolder holder = null;
if(view == null){
view = LayoutInflater.from(getContext()).inflate(R.layout.merc_sub_lista_smart_adp, parent, false);
holder = new SecondViewHolder(view);
view.setTag(holder);
}
else holder = (SecondViewHolder)view.getTag();
holder.mTipo.setText(tipo);
String codigo = mercadoria.getCod();
if(codigo.matches("[0-9]+")){
int codI = Integer.parseInt(mercadoria.getCod());
codigo = "[";
codigo += String.format("%06d", codI);
codigo += "]";
}else{
codigo = "[";
codigo += codigo;
int cont = 6 - codigo.length();
for(int i = 0; i < cont; i++){
codigo = codigo + " ";
}
codigo += "]";
}
holder.mCodigo.setText(codigo);
holder.mDescricao.setText(mercadoria.getNome());
holder.mQuant.setText(mercadoria.getPreco());
break;
}
}
return view;
}
protected class SecondViewHolder {
TextView mTipo;
TextView mCodigo;
TextView mDescricao;
EditText mQuant;
public SecondViewHolder(View view) {
mCodigo = (TextView) view.findViewById(R.id.text_view_cod_merc);
mTipo = (TextView) view.findViewById(R.id.text_view_tipo_merc);
mDescricao = (TextView) view.findViewById(R.id.text_view_nome_merc);
mQuant = (EditText) view.findViewById(R.id.text_view_preco_merc);
}
}
protected class FirstViewHolder {
TextView mTipo;
TextView mCodigo;
TextView mDescricao;
TextView mPreco;
public FirstViewHolder(View view) {
mCodigo = (TextView) view.findViewById(R.id.text_view_cod_merc);
mTipo = (TextView) view.findViewById(R.id.text_view_tipo_merc);
mDescricao = (TextView) view.findViewById(R.id.text_view_nome_merc);
mPreco = (TextView) view.findViewById(R.id.text_view_preco_merc);
}
}
EDIT1: The exception occurs in this stretch:
if(view == null){
view = LayoutInflater.from(getContext()).inflate(R.layout.merc_sub_lista_smart_adp, parent, false);
holder = new SecondViewHolder(view);
view.setTag(holder);
}
else holder = (SecondViewHolder)view.getTag();
Specifically in view.getTag()
Don't store fields while views are recycled
Try this
#Override
public int getItemViewType(int position) {
String tipo = mercadorias.get(position).getTipo();
if (tipo.equals("1"))
return 0;
else
return 1;
}
Also, this doesn't make sense
if(mercadorias.size() > 1){
mercadoria = mercadorias.get(position);
}else{
mercadoria = mercadorias.get(0);
}
If the Arraylist is empty, this will throw an exception, but if the size is equal to one, then the position should already be the first element

How to get Id of ChildView Items of ExpandableListView in Android

I'm using ExpandapbeListView its work perfect all expand and collapse but I just want to update only particular child item here when I click on plus value should be update in EditText and I don't want to use notifyDatasetChanged() Just want to update only particular field and also i should able to update EditText directly. It can have multiple child item.
Ex: Colgate may have multiple child Item like 100gm,200gm,300gm
So when I click on Plus It should able to get Id of EditText and Update Quantity
#Override
public View getChildView(int productPos, int weightPos, boolean b, View plusMinusView, ViewGroup viewGroup) {
if (plusMinusView == null) {
csHolder = new ChildHolder();
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
plusMinusView = inflater.inflate(R.layout.orders_products_plus_minus_design, null);
}
csHolder.minQty = (TextView) plusMinusView.findViewById(R.id.orderProducts_submitMinQtyTxt);
csHolder.totalPriceTxt = (TextView) plusMinusView.findViewById(R.id.orderProducts_submitTotalPriceTxt);
csHolder.weightTxt = (TextView) plusMinusView.findViewById(R.id.orderProducts_submitWeightTxt);
csHolder.unitPrice = (TextView) plusMinusView.findViewById(R.id.orderProducts_submitUnitPriceTxt);
csHolder.totalTaxTxt = (TextView) plusMinusView.findViewById(R.id.orderProducts_submitTotalTaxTxt);
csHolder.netPriceTxt = (TextView) plusMinusView.findViewById(R.id.orderProducts_submitNetPriceTxt);
csHolder.orderQtyEdit = (CustomEditText) plusMinusView.findViewById(R.id.orderProducts_orderQtyTxt);
csHolder.plusTxt = (RelativeLayout) plusMinusView.findViewById(R.id.orderProducts_plusTxtLay);
csHolder.minusTxt = (RelativeLayout) plusMinusView.findViewById(R.id.orderProducts_minusTxtLay);
plusMinusView.setTag(productPos + "_" + weightPos);
String tag = "weight_" + productPos + "_" + weightPos;
csHolder.orderQtyEdit.setTag(tag);
csHolder.plusTxt.setTag(tag);
csHolder.minusTxt.setTag(tag);
//csHolder.plusTxt.setOnClickListener(weightClick);
//csHolder.minusTxt.setOnClickListener(weightClick);
final View finalPlusMinusView = plusMinusView;
csHolder.plusTxt.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
csHolder.orderQtyEdit.setText("5");
}
});
if(!csStatus.equalsIgnoreCase("DRAFT")) {
csHolder.plusTxt.setVisibility(View.GONE);
csHolder.minusTxt.setVisibility(View.GONE);
csHolder.orderQtyEdit.setEnabled(false);
}
else
{
csHolder.plusTxt.setVisibility(View.VISIBLE);
csHolder.minusTxt.setVisibility(View.VISIBLE);
csHolder.orderQtyEdit.setEnabled(true);
}
try
{
csHolder.orderQtyEdit.addTextChangedListener(new MyTextWatcher(csHolder.orderQtyEdit));
JSONObject weighObj = csMainArr.getJSONObject(productPos).getJSONArray("weights").getJSONObject(weightPos);
if(weighObj.has("unit"))
{
csHolder.weightTxt.setText(weighObj.getString("unit"));
}
if (weighObj.has("order_qty") == false)
weighObj.put("order_qty", "0");
if (weighObj.has("sell_price") == false)
weighObj.put("sell_price", "0");
if (weighObj.has("order_qty") == false)
{
csHolder.totalPriceTxt.setText("0.00");
csHolder.totalTaxTxt.setText("0.00");
csHolder.netPriceTxt.setText("0.00");
}
else {
int qty = 0;
double sellPrice = 0.00;
float tax = 0f;
double totalPrice = 0.00;
double totalTax = 0.00;
double netPrice = 0.00;
if(csStatus.equals("DRAFT")) {
qty = Integer.parseInt(weighObj.getString("order_qty"));
sellPrice = weighObj.getDouble("sell_price");
}
else
{
qty = Integer.parseInt(weighObj.has("qty") ? weighObj.getString("qty"):"0");
sellPrice = weighObj.getDouble("unit_price");
}
tax = Float.parseFloat(csMainArr.getJSONObject(productPos).has("tax") ? csMainArr.getJSONObject(productPos).getString("tax") : "0");
totalPrice = qty*sellPrice;
totalTax = (totalPrice*tax)/100;
netPrice = totalPrice + totalTax;
csHolder.totalPriceTxt.setText(getResources().getString(R.string.Rs)+" "+String.format("%.2f",totalPrice));
csHolder.totalTaxTxt.setText(getResources().getString(R.string.Rs)+" "+String.format("%.2f",totalTax));
csHolder.netPriceTxt.setText(getResources().getString(R.string.Rs)+" "+String.format("%.2f",netPrice));
}
csHolder.orderQtyEdit.isValueChangeMySelf = true;
if(csStatus.equals("DRAFT"))
csHolder.orderQtyEdit.setText(weighObj.getString("order_qty"));
else
csHolder.orderQtyEdit.setText(weighObj.has("qty")?weighObj.getString("qty"):"0");
/*if(weightPos == iClickedItem) {
csHolder.orderQtyEdit.requestFocus();
}
else {
csHolder.orderQtyEdit.clearFocus();
}*/
if(csStatus.equals("DRAFT"))
csHolder.unitPrice.setText(getResources().getString(R.string.Rs)+" "+String.format("%.2f",weighObj.has("sell_price")?weighObj.getDouble("sell_price") : 0.00));
else
csHolder.unitPrice.setText(getResources().getString(R.string.Rs)+" "+String.format("%.2f",weighObj.has("unit_price")?weighObj.getDouble("unit_price") : 0.00));
csHolder.minQty.setText(weighObj.has("min_order_qty")?weighObj.getString("min_order_qty"):"0");
//View line = (View) plusMinusView.findViewById(R.id.orderProducts_submitDividerLine);
//if(isLast)
// line.setVisibility(View.GONE);
}
catch(Exception e)
{
}
return plusMinusView;
}

Fully displayed listview image is not displaying properly

its my following code.
public class Wishlist extends Activity {
Button checkout;
ListView ListCart;
String name, cusid, ffname, llname, phone, fax, password, email;
String[] qu, s;
int[] g;
int k = 0;
String cost;
ProgressDialog pDialog = null;
List<CartProducts> product_list;
Context ctx;
Integer pos = 0, total = 0, q = 0, gtot = 0, total1 = 0, sum = 0;
SQLiteDatabase FavData;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_modifywishlist);
Intent page1 = getIntent();
cusid = page1.getStringExtra("cus_id");
ffname = page1.getStringExtra("fname");
llname = page1.getStringExtra("lname");
phone = page1.getStringExtra("ph");
fax = page1.getStringExtra("fax");
password = page1.getStringExtra("password");
email = page1.getStringExtra("email");
ListCart = (ListView) findViewById(R.id.list_item);
pDialog = new ProgressDialog(this);
ctx = this;
FavData = Wishlist.this.openOrCreateDatabase("SHOPPING_CARTFAV", MODE_PRIVATE, null);
FavData.execSQL("CREATE TABLE IF NOT EXISTS fav_items(product_id varchar, name varchar, price varchar, quantity integer, model varchar, image varchar, manufacturer varchar )");
ArrayList<CartProducts> myList = new ArrayList<CartProducts>();
Cursor crsr = FavData.rawQuery("SELECT * FROM fav_items", null);
final String[] productID = new String[crsr.getCount()];
final String[] ProductName = new String[crsr.getCount()];
final String[] ProductPrice = new String[crsr.getCount()];
final String[] ProductQuantity = new String[crsr.getCount()];
final String[] ProductModel = new String[crsr.getCount()];
final String[] ProductImage = new String[crsr.getCount()];
final String[] ProductManufacturer = new String[crsr.getCount()];
int j = 0;
while (crsr.moveToNext()) {
String id = crsr.getString(crsr.getColumnIndex("product_id"));
productID[j] = id;//product_id,name,price,quantity,model,image,manufacturer
name = crsr.getString(crsr.getColumnIndex("name"));
ProductName[j] = name;
String price = crsr.getString(crsr.getColumnIndex("price"));
ProductPrice[j] = price;
String s = ProductPrice[j].toString();
s = s.replace(",", "");
String[] parts = s.split("\\."); // escape .
String part1 = parts[0];
String part2 = parts[1];
part1 = part1.replace("₹", "");
total = Integer.parseInt(part1); // Toast.makeText(Table.this, part1, Toast.LENGTH_SHORT).show();
String qnty = crsr.getString(crsr.getColumnIndex("quantity"));
ProductQuantity[j] = qnty;
String s2 = ProductQuantity[j].toString();
total1 = Integer.parseInt(s2);
sum = total * total1;
String model = crsr.getString(crsr.getColumnIndex("model"));
ProductModel[j] = model;
String image = crsr.getString(crsr.getColumnIndex("image"));
ProductImage[j] = image;
String manufacturer = crsr.getString(crsr.getColumnIndex("manufacturer"));
ProductManufacturer[j] = manufacturer;
//Toast.makeText(getApplicationContext(), productID[j] + "" + ProductName[j] + "" + ProductPrice[j] + "" + ProductQuantity[j] + "" + ProductModel[j] + "" + ProductImage[j] + "" + ProductManufacturer[j], Toast.LENGTH_SHORT).show();
myList.add(new CartProducts(productID[j], ProductName[j], ProductPrice[j], ProductQuantity[j], ProductModel[j], ProductImage[j], ProductManufacturer[j]));
gtot = gtot + sum;
j++;
}
ListCart.setAdapter(new Wishlist_Listadapter(ctx, R.layout.activity_wishlist_cartrow, myList));
getListViewSize(ListCart);
String s1 = ProductPrice.toString();
}
public static void getListViewSize(ListView myListView) {
ListAdapter myListAdapter = myListView.getAdapter();
if (myListAdapter == null) {
//do nothing return null
return;
}
//set listAdapter in loop for getting final size
int totalHeight = 0;
for (int size = 0; size < myListAdapter.getCount(); size++) {
View listItem = myListAdapter.getView(size, null, myListView);
if (listItem != null) {
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}
}
//setting listview item in adapter
ViewGroup.LayoutParams params = myListView.getLayoutParams();
if (params != null) {
params.height = totalHeight
+ (myListView.getDividerHeight() * (myListAdapter
.getCount() - 1));
myListView.setLayoutParams(params);
// print height of adapter on log
}
myListView.requestLayout();
// print height of adapter on log
Log.i("height of listItem:", String.valueOf(totalHeight));
}
}
Adapter class
Public class Wishlist_Listadapter extends ArrayAdapter<CartProducts> {
Bitmap bitmap;
ImageView img;
String urll, name,totalps;
SQLiteDatabase FavData;
Integer total = 0, quanty = 1, grandtot = 0, i = 0;
String it;
Button addbtn, minbtn;
EditText editqu;
int total1 = 0, quantity=0, fulltotal = 0, sum;
SQLiteOpenHelper dbhelper;
Wishlist_Listadapter cart = Wishlist_Listadapter.this;
private int resource;
private LayoutInflater inflater;
private Context context;
int count=1 ;
public Wishlist_Listadapter(Context ctx, int resourceId, List<CartProducts> objects) {
super(ctx, resourceId, objects);
resource = resourceId;
inflater = LayoutInflater.from(ctx);
context = ctx;
}
public View getView(int position, View convertView, ViewGroup parent) {
/* create a new view of my layout and inflate it in the row */
convertView = (RelativeLayout) inflater.inflate(resource, null);
final ViewHolder viewholder;
viewholder = new ViewHolder();
final CartProducts banqt = getItem(position);
totalps=(banqt.getPrice());
String s = totalps.toString();
s = s.replace(",", "");
String[] parts = s.split("\\."); // escape .
String part1 = parts[0];
String part2 = parts[1];
part1 = part1.replace("₹", "");// Toast.makeText(getContext(), part1, Toast.LENGTH_LONG).show();
total = Integer.parseInt(part1);
quanty = Integer.parseInt(banqt.getQuantity());
grandtot = total *quanty;
viewholder.total = (TextView) convertView.findViewById(R.id.txt_total);
viewholder.total.setText(String.valueOf(grandtot));
Button delet = (Button) convertView.findViewById(R.id.btn_remove);
delet.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
/*delete function*/
it = banqt.getProduct_id();
FavData = context.openOrCreateDatabase("SHOPPING_CARTFAV", context.MODE_PRIVATE, null);
FavData.execSQL("DELETE FROM fav_items WHERE product_id=" + it + ";");
Intent intent = ((Wishlist) context).getIntent();
((Wishlist) context).finish();
context.startActivity(intent);
}
});
viewholder.txtName = (TextView) convertView.findViewById(R.id.product_name);
viewholder.txtName.setText(banqt.getName());
img = (ImageView) convertView.findViewById(R.id.img_product);
urll = banqt.getImage().toString();
urll = urll.replaceAll(" ", "%20");// Toast.makeText(getContext(),urll,Toast.LENGTH_LONG).show();
new LoadImage().execute(urll);
return convertView;
}
static class ViewHolder {
TextView txtName;
TextView total;
EditText editqu;
TextView txtprice;
}
private class LoadImage extends AsyncTask<String, String, Bitmap> {
#Override
protected void onPreExecute() {
super.onPreExecute();
}
protected Bitmap doInBackground(String... args) {
try {
bitmap = BitmapFactory.decodeStream((InputStream) new URL(args[0]).getContent());
} catch (Exception e) {
e.printStackTrace();
}
return bitmap;
}
protected void onPostExecute(Bitmap image) {
if (image != null) {
img.setImageBitmap(image);
// pDialog.dismiss();
} else {
// pDialog.dismiss();
Toast.makeText(getContext(), "Image Does Not exist or Network Error", Toast.LENGTH_SHORT).show();
}
}
}
}
listview is working properly
i just inflate cardview in listview.
when using this code image cannot displaying. only dispaly last image in list view
params.height = totalHeight
+ (myListView.getDividerHeight() * (myListAdapter
.getCount() - 1));
my problem is: In listview only displaying last image
check this image:
Try adding your ImageView to Holder class and use like viewholder.img.setImageBitmap(new LoadImage().execute(urll)) and change the return type to Bitmap
Use BaseAdapter instead of ArrayAdapter. Load and show image with UIL, Picasso or other image loader library.
public class ImageAdapter extends BaseAdapter {
private List<ImageBean> list;
private ArrayList<ImageBean> arraylist;
private LayoutInflater inflater;
public ImageAdapter(Context context, List<ImageBean> list) {
this.list = list;
inflater = LayoutInflater.from(context);
this.arraylist = new ArrayList<>();
}
#Override
public int getCount() {
return list.size();
}
#Override
public ImageBean getItem(int position) {
return list.get(position);
}
#Override
public long getItemId(int position) {
return position;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.recycler_view_item, parent, false);
holder.ivImage = (ImageView) convertView.findViewById(R.id.ivImage);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
// Loading image with UIL example
ImageLoader.getInstance().displayImage(getItem(position).getUrl(), holder.ivImage, ImageUtils.UIL_USER_AVATAR_DISPLAY_OPTIONS);
return convertView;
}
private class ViewHolder {
public ImageView ivImage;
}
}

Sectioning date header in a ListView that has adapter extended by CursorAdapter

I am trying to build a demo chatting App.I want to show the messages with section headers as Dates like "Today","Yesterday","May 21 2015" etc.I have managed to achieve this but since the new View method gets called whenever I scroll the list.The headers and messages get mixed up.
For simplicity, I have kept the header in the layouts itself and changing its visibility(gone and visible) if the date changes.
Can you help me out with this? Let me know if anyone needs any more info to be posted in the question.
public class ChatssAdapter extends CursorAdapter {
private Context mContext;
private LayoutInflater mInflater;
private Cursor mCursor;
private String mMyName, mMyColor, mMyImage, mMyPhone;
// private List<Contact> mContactsList;
private FragmentActivity mActivity;
private boolean mIsGroupChat;
public ChatssAdapter(Context context, Cursor c, boolean groupChat) {
super(context, c, false);
mContext = context;
mMyColor = Constants.getMyColor(context);
mMyName = Constants.getMyName(context);
mMyImage = Constants.getMyImageUrl(context);
mMyPhone = Constants.getMyPhone(context);
mIsGroupChat = groupChat;
mCursor = c;
// mActivity = fragmentActivity;
/*try {
mContactsList = PinchDb.getHelper(mContext).getContactDao().queryForAll();
} catch (SQLException e) {
e.printStackTrace();
}*/
}
#Override
public int getItemViewType(int position) {
Cursor cursor = (Cursor) getItem(position);
return getItemViewType(cursor);
}
private int getItemViewType(Cursor cursor) {
boolean type;
if (mIsGroupChat)
type = cursor.getString(cursor.getColumnIndex(Chat.COLMN_CHAT_USER)).compareTo(mMyPhone) == 0;
else type = cursor.getInt(cursor.getColumnIndex(Chat.COLMN_FROM_ME)) > 0;
if (type) {
return 0;
} else {
return 1;
}
}
#Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = null;
int itemViewType = getItemViewType(cursor);
if (v == null) {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (itemViewType == 0) {
v = mInflater.inflate(R.layout.row_chat_outgoing, parent, false);
} else {
v = mInflater.inflate(R.layout.row_chat_incoming, parent, false);
}
}
return v;
}
#Override
public void bindView(View view, Context context, Cursor cursor) {
ViewHolder holder = new ViewHolder();
View v = view;
final Chat chat = new Chat(cursor);
boolean fromMe = mIsGroupChat ? chat.getUser().compareTo(mMyPhone) == 0 : chat.isFrom_me();
if (fromMe) {
// LOGGED IN USER'S DATA SETTING....
holder.chat_name = (StyleableTextView) v
.findViewById(R.id.chat_user_name);
holder.chat_time = (StyleableTextView) v
.findViewById(R.id.chat_time);
holder.chat_tag = (StyleableTextView) v
.findViewById(R.id.chat_tag);
int color = Color.parseColor("#FFFFFF");
v.setBackgroundColor(color);
holder.chat_name.setText("#You");
holder.chat_time.setText(AppUtil.getEventTime(chat.getTimestampLong()));
// header text setting and process..
holder.chat_header_text = (TextView) v.findViewById(R.id.header_text);
String str_date = AppUtil.covertToDate(chat.getTimestampLong());
String pref_date = SharePreferencesUtil.getSharedPreferencesString(mContext, Constants.CHAT_TIMESTAMP, "");
if (!str_date.equalsIgnoreCase(pref_date)) {
holder.chat_header_text.setVisibility(View.VISIBLE);
SharePreferencesUtil.putSharedPreferencesString(mContext, Constants.CHAT_TIMESTAMP, str_date);
holder.chat_header_text.setText(str_date);
} else {
holder.chat_header_text.setVisibility(View.GONE);
}
String firstWord, theRest;
String mystring = chat.getText();
String arr[] = mystring.split(" ", 2);
if (arr.length > 1) {
firstWord = arr[0]; // the word with hash..
theRest = arr[1]; // rest of the body..
holder.chat_tag.setText(Html.fromHtml("<font color=\"#999999\"><b>" + firstWord + "</b></font>" + " " + "<font color=\"#000000\">" + theRest + "</font>"));
// holder.chat_text.setText(theRest);
// holder.chat_text.setClickable(false);
} else {
String msg = arr[0]; // the word with hash..
holder.chat_tag.setText(Html.fromHtml("<font color=\"#999999\"><b>" + msg + "</b></font>"));
//holder.chat_text.setText("");
}
updateTimeTextColorAsPerStatus(holder.chat_time, chat.getStatus());
v.setTag(holder);
} else {
// OTHER USER'S DATA SETTING....
holder.chat_name = (StyleableTextView) v
.findViewById(R.id.chat_user_name);
holder.chat_time = (StyleableTextView) v
.findViewById(R.id.chat_time);
holder.chat_tag = (StyleableTextView) v
.findViewById(R.id.chat_tag);
holder.chat_image = (ImageView) v
.findViewById(R.id.chat_profile_image);
String image = cursor.getString(cursor.getColumnIndex("image"));
String name = cursor.getString(cursor.getColumnIndex("name"));
String color = cursor.getString(cursor.getColumnIndex("color"));
// set the values...
if (holder.chat_image != null) {
MImageLoader.displayImage(context, image, holder.chat_image, R.drawable.round_user_place_holder);
}
int back_color = Color.parseColor("#FFFFFF");
v.setBackgroundColor(back_color);
holder.chat_name.setText(name);
holder.chat_time.setText(AppUtil.getEventTime(chat.getTimestampLong()));
// header text setting and process..
holder.chat_header_text = (TextView) v.findViewById(R.id.header_text);
String str_date = AppUtil.covertToDate(chat.getTimestampLong());
String pref_date = SharePreferencesUtil.getSharedPreferencesString(mContext, Constants.CHAT_TIMESTAMP, "");
Log.d("eywa", "str date is ::::: " + str_date + " pref date is :::::: " + pref_date);
/*if (!TextUtils.isEmpty(pref_date)) {
if (!pref_date.contains(str_date)) {
holder.chat_header_text.setVisibility(View.VISIBLE);
SharePreferencesUtil.putSharedPreferencesString(mContext, Constants.CHAT_TIMESTAMP, pref_date + str_date);
holder.chat_header_text.setText(str_date);
} else {
holder.chat_header_text.setVisibility(View.GONE);
}
} else {
holder.chat_header_text.setVisibility(View.VISIBLE);
SharePreferencesUtil.putSharedPreferencesString(mContext, Constants.CHAT_TIMESTAMP, pref_date + str_date);
holder.chat_header_text.setText(str_date);
}*/
if (!str_date.equalsIgnoreCase(pref_date)) {
holder.chat_header_text.setVisibility(View.VISIBLE);
SharePreferencesUtil.putSharedPreferencesString(mContext, Constants.CHAT_TIMESTAMP, str_date);
holder.chat_header_text.setText(str_date);
} else {
holder.chat_header_text.setVisibility(View.GONE);
}
String firstWord, theRest;
String mystring = chat.getText();
String arr[] = mystring.split(" ", 2);
if (arr.length > 1) {
firstWord = arr[0]; // the word with hash..
theRest = arr[1]; // rest of the body..
holder.chat_tag.setText(Html.fromHtml("<font color=\"#999999\"><b>" + firstWord + "</b></font>" + " " + "<font color=\"#000000\">" + theRest + "</font>"));
// holder.chat_text.setClickable(false);
} else {
String msg = arr[0]; // the word with hash..
holder.chat_tag.setText(Html.fromHtml("<font color=\"#999999\"><b>" + msg + "</b></font>"));
// holder.chat_text.setText("");
}
String phone = cursor.getString(cursor.getColumnIndex("user"));
final Contact contact = new Contact(name, phone, "", color, image);
if (holder.chat_image != null) {
holder.chat_image.setTag(contact);
// holder.chat_name.setTag(contact);
holder.chat_image.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Contact con = (Contact) v.getTag();
Intent intent = new Intent(mContext, OtherProfileActivity.class);
intent.putExtra(Constants.EXTRA_CONTACT, con);
mContext.startActivity(intent);
}
});
}
v.setTag(holder);
}
/*else
{
view=
}*/
}
private void updateTimeTextColorAsPerStatus(TextView chat_time, int status) {
if (status == 0) chat_time.setVisibility(View.INVISIBLE);
else {
chat_time.setVisibility(View.VISIBLE);
/* if (status == 1)
chat_time.setTextColor(mContext.getResources().getColor(android.R.color.white));*/
if (status == 2)
chat_time.setTextColor(mContext.getResources().getColor(android.R.color.darker_gray));
else if (status == 3)
chat_time.setTextColor(mContext.getResources().getColor(android.R.color.black));
}
}
#Override
public int getViewTypeCount() {
return 2;
}
public class ViewHolder {
public StyleableTextView chat_name;
public StyleableTextView chat_time;
public StyleableTextView chat_tag;
public ImageView chat_image;
public TextView chat_header_text;
}
#Override
public int getCount() {
if (getCursor() == null) {
return 0;
} else {
return getCursor().getCount();
}
}
}

ListView with ImageView and TextView, after Scrolling down an Up a random item is set

I have a list with ImageView and TextView. I read a scann time and for the specified position of textview has to be set. This is done i a right way, but after srolling down and then up another textview in Listview is set. I am seeing that this is not new, but I could not solve this problem.Any idea?? BaseAdapter is in the following. I tried for more then a week but no solution
#Override
public View getView( final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
Log.d("convertView", "NULLL");
convertView = LayoutInflater.from(mContenxt).inflate(
R.layout.list_items, null);
holder = new ViewHolder();
holder.textView = (TextView) convertView
.findViewById(R.id.placeName);
holder.imageView = (ImageView) convertView
.findViewById(R.id.itemSymbole);
holder.textDate = (TextView) convertView
.findViewById(R.id.txtViewTimeAndDate);
holder.imageMap = (ImageView)convertView.findViewById(R.id.imageViewMap);
holder.linearLayoutText = ( LinearLayout)convertView.findViewById(R.id.txtViewList);
holder.linearLayoutImage = ( LinearLayout)convertView.findViewById(R.id.thumbnail);
convertView.setTag(holder);
}
Log.d("convertView", "Not NULLLL");
holder = (ViewHolder) convertView.getTag();
holder.id = position;
holder.textView.setText(items.get(position).get("ProductName"));
holder.imageView.setId(position);
holder.linearLayoutText.setBackgroundColor(position);
if (items.get(position).get("Identifier")
.equals(com.metasec.wachmann.ItemActivity.uID)) {
holder.linearLayoutText.setBackgroundColor(Color.CYAN);
holder.imageView.setImageResource(R.drawable.ok);
Log.d("TIMEEEE", ItemActivity.scannDateAndTime);
holder.textDate.setText(ItemActivity.scannDateAndTime);
notifyDataSetChanged();
}else {
holder.imageView.setImageResource(R.drawable.not_ok);
holder.textDate.setText("");
notifyDataSetChanged();
}
holder.linearLayoutText.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
holder.linearLayoutText.setBackgroundColor(position);
holder.linearLayoutText.setBackgroundColor(Color.RED);
notifyDataSetChanged();
String placeName = items.get(position).get("ProductName");
String identifier = items.get(position).get("Identifier");
String itemId = items.get(position).get("ItemId");
String propertyBaseId = null;
String gpsCoordinates = null;
GPSTracker gpsTracker = new GPSTracker(mContenxt);
gpsTracker.stopUsingGPS();
double latitude = 0;
double longitude = 0;
if (gpsTracker.canGetLocation()) {
latitude = gpsTracker.getLatitude();
longitude = gpsTracker.getLongitude();
gpsCoordinates = latitude + ", " + longitude;
}
for (int k = 0; k < LoggedActivity.propertyBaseList.size(); k++) {
if (LoggedActivity.propertyBaseList.get(k).getName()
.equals("xxxxxxx")) {
propertyBaseId = LoggedActivity.propertyBaseList.get(k)
.getPropertyBaseId();
Intent intentSenderDataToServer = new Intent(mContenxt,
SenderReportDemageToServerActivity.class);
// give ItemId
intentSenderDataToServer.putExtra(ITEM_ID, itemId);
// give GroupId
intentSenderDataToServer.putExtra(PRODUCT_NAME,
placeName);
// give GroupName
intentSenderDataToServer.putExtra(IDENTIFIER,
identifier);
// give PropertyBaseID
intentSenderDataToServer.putExtra(PROPERTY_BASE_ID,
propertyBaseId);
// give GPS Coordinates
intentSenderDataToServer.putExtra(GPS_COORDINATES,
gpsCoordinates);
Log.d("items.get(position).get(ProductNNNNName)", items
.get(position).get("ProductName"));
intentSenderDataToServer.putExtra("ProductName",
placeName);
intentSenderDataToServer.putExtra("Identifier",
identifier);
mContenxt.startActivity(intentSenderDataToServer);
} // END IF Loop
} // END FOR Loop
}
});
holder.imageMap.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
String placeName = items.get(position).get("ProductName");
String identifier = items.get(position).get("Identifier");
String itemId = items.get(position).get("ItemId");
Log.d("placeName11",placeName);
Log.d("identifier111",identifier);
Log.d("itemId111",itemId);
Intent intentWachmanMapActivitiy = new Intent(mContenxt,
WachmanOpenStreetMapViewActivity.class);
intentWachmanMapActivitiy.putExtra(ITEM_ID, itemId);
// give GroupId
intentWachmanMapActivitiy.putExtra(PRODUCT_NAME,
placeName);
// give GroupName
intentWachmanMapActivitiy.putExtra(IDENTIFIER,
identifier);
Log.d("items.get(position).get(ProductNNNNName)", items
.get(position).get("ProductName"));
intentWachmanMapActivitiy.putExtra("ProductName",
placeName);
intentWachmanMapActivitiy.putExtra("Identifier",
identifier);
mContenxt.startActivity(intentWachmanMapActivitiy);
}
});
return convertView;
}
static class ViewHolder {
TextView textView = null;
TextView textDate = null;
CheckBox checkbox = null;
ImageView imageView = null;
ImageView imageMap = null;
ImageButton imageButtonMap = null;
LinearLayout linearLayoutText = null;
LinearLayout linearLayoutImage = null;
int id;
}
And the following class shows where my own adapter would be called. I backgroudn I have to call my adapter ofter and the previous time and figure has to be remained.
private class SendBackground extends AsyncTask<Void, Void, Boolean>
{
#Override
protected void onPreExecute() {
mProgDialog = new ProgressDialog(getBaseContext());
mProgDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
mProgDialog = ProgressDialog.show(ItemActivity.this, "Sending", " Please Wait" );
}
#Override
protected Boolean doInBackground(Void... params) {
// TODO Auto-generated method stub
return httpRequest.postData(itemIdTmp, propertyBaseIdtmp, uID, coordinatesTmp);
}
#Override
protected void onPostExecute(Boolean result) {
Log.d("SendBackground", "onPostExecute");
if (result == true) {
Log.d("onPostExecute", "TRUE");
//mProgressBar.setVisibility(View.GONE);
mProgDialog.dismiss();
Toast.makeText(getApplicationContext(), "Data sent..",
Toast.LENGTH_LONG).show();
/*----------------------------->>>> Whenever from Server True is return then my oown adapter hast to be adapted, as mentioned the state and time of previous items have to be remained */
//setListAdapter(myBaseAdapterItemActivity);
listView.setAdapter(myBaseAdapterItemActivity);
myBaseAdapterItemActivity.notifyDataSetChanged();
} else {
mProgDialog.dismiss();
Toast.makeText(getApplicationContext(),
"Sending Data to Server failed", Toast.LENGTH_LONG)
.show();
}
}
}
// read all comments i write where need modifiaction
// Do not call notifiy dataset change inside adapter.
// if it will not work then i will write a sample code
#Override
public View getView( final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null; // use it
if (convertView == null) {
Log.d("convertView", "NULLL");
convertView = LayoutInflater.from(mContenxt).inflate(
R.layout.list_items, null);
holder = new ViewHolder();
holder.textView = (TextView) convertView
.findViewById(R.id.placeName);
holder.imageView = (ImageView) convertView
.findViewById(R.id.itemSymbole);
holder.textDate = (TextView) convertView
.findViewById(R.id.txtViewTimeAndDate);
holder.imageMap = (ImageView)convertView.findViewById(R.id.imageViewMap);
holder.linearLayoutText = ( LinearLayout)convertView.findViewById(R.id.txtViewList);
holder.linearLayoutImage = ( LinearLayout)convertView.findViewById(R.id.thumbnail);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag(); // new changes
Log.d("convertView", "Not NULLLL");
}
holder.id = position;
holder.textView.setText(items.get(position).get("ProductName"));
holder.imageView.setId(position); // why you set position it will cause error
//holder.linearLayoutText.setBackgroundColor(position);
if (items.get(position).get("Identifier")
.equals(com.metasec.wachmann.ItemActivity.uID)) {
holder.linearLayoutText.setBackgroundColor(Color.CYAN);
holder.imageView.setImageResource(R.drawable.ok);
Log.d("TIMEEEE", ItemActivity.scannDateAndTime);
holder.textDate.setText(ItemActivity.scannDateAndTime);
// notifyDataSetChanged(); no need to call it.
}else {
holder.imageView.setImageResource(R.drawable.not_ok);
holder.linearLayoutText.setBackgroundColor(Color.GREEN);
holder.textDate.setText("");
//notifyDataSetChanged(); no need to call it.
}
holder.linearLayoutText.setTag(position);
holder.linearLayoutText.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// holder.linearLayoutText.setBackgroundColor(position);
holder.linearLayoutText.setBackgroundColor(Color.RED);
// notifyDataSetChanged();
int selectedPosition = (Integer)v.getTag();
String placeName = items.get(selectedPosition).get("ProductName");
String identifier = items.get(selectedPosition).get("Identifier");
String itemId = items.get(selectedPosition).get("ItemId");
String propertyBaseId = null;
String gpsCoordinates = null;
GPSTracker gpsTracker = new GPSTracker(mContenxt);
gpsTracker.stopUsingGPS();
double latitude = 0;
double longitude = 0;
if (gpsTracker.canGetLocation()) {
latitude = gpsTracker.getLatitude();
longitude = gpsTracker.getLongitude();
gpsCoordinates = latitude + ", " + longitude;
}
// you are starting activity in lop it is dangerous because
// you are launching many activity.
// you should pass array
// i do not know are requirement.
for (int k = 0; k < LoggedActivity.propertyBaseList.size(); k++) {
if (LoggedActivity.propertyBaseList.get(k).getName()
.equals("xxxxxxx")) {
propertyBaseId = LoggedActivity.propertyBaseList.get(k)
.getPropertyBaseId();
Intent intentSenderDataToServer = new Intent(mContenxt,
SenderReportDemageToServerActivity.class);
// give ItemId
intentSenderDataToServer.putExtra(ITEM_ID, itemId);
// give GroupId
intentSenderDataToServer.putExtra(PRODUCT_NAME,
placeName);
// give GroupName
intentSenderDataToServer.putExtra(IDENTIFIER,
identifier);
// give PropertyBaseID
intentSenderDataToServer.putExtra(PROPERTY_BASE_ID,
propertyBaseId);
// give GPS Coordinates
intentSenderDataToServer.putExtra(GPS_COORDINATES,
gpsCoordinates);
Log.d("items.get(position).get(ProductNNNNName)", items
.get(position).get("ProductName"));
intentSenderDataToServer.putExtra("ProductName",
placeName);
intentSenderDataToServer.putExtra("Identifier",
identifier);
mContenxt.startActivity(intentSenderDataToServer);
} // END IF Loop
} // END FOR Loop
}
});
holder.imageMap.setTag(postion);
holder.imageMap.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
int selectedPosition = (Integer)v.getTag();
String placeName = items.get(selectedPosition).get("ProductName");
String identifier = items.get(selectedPosition).get("Identifier");
String itemId = items.get(selectedPosition).get("ItemId");
Log.d("placeName11",placeName);
Log.d("identifier111",identifier);
Log.d("itemId111",itemId);
Intent intentWachmanMapActivitiy = new Intent(mContenxt,
WachmanOpenStreetMapViewActivity.class);
intentWachmanMapActivitiy.putExtra(ITEM_ID, itemId);
// give GroupId
intentWachmanMapActivitiy.putExtra(PRODUCT_NAME,
placeName);
// give GroupName
intentWachmanMapActivitiy.putExtra(IDENTIFIER,
identifier);
Log.d("items.get(position).get(ProductNNNNName)", items
.get(position).get("ProductName"));
intentWachmanMapActivitiy.putExtra("ProductName",
placeName);
intentWachmanMapActivitiy.putExtra("Identifier",
identifier);
mContenxt.startActivity(intentWachmanMapActivitiy);
}
});
return convertView;
}
static class ViewHolder {
TextView textView = null;
TextView textDate = null;
CheckBox checkbox = null;
ImageView imageView = null;
ImageView imageMap = null;
ImageButton imageButtonMap = null;
LinearLayout linearLayoutText = null;
LinearLayout linearLayoutImage = null;
int id;
}

Categories

Resources