Click here to Skip to main content
15,890,438 members

Comments by Sandip Paul 491984 (Top 49 by date)

Sandip Paul 491984 28-Feb-17 6:56am View    
as i mentioned i want to show list where all items need to show that are passed from previous activity
Sandip Paul 491984 27-Feb-17 8:35am View    
this is my adapter
Sandip Paul 491984 27-Feb-17 8:35am View    
public class ItemLazyAdapter extends BaseAdapter {

private Activity activity;
private ArrayList<HashMap<String, String>> data;
private static LayoutInflater inflater = null;
private int count = 0;
private HashMap<String, String> itemlist = new HashMap<String, String>();

// public ImageLoader imageLoader;

public ItemLazyAdapter(Activity a, ArrayList<HashMap<String, String>> d) {
activity = a;
data = d;
inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
notifyDataSetChanged();
// imageLoader = new ImageLoader(activity.getApplicationContext());
}

public int getCount() {
return data.size();
}

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

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

public View getView(final int position, View convertView,
final ViewGroup parent) {
final ViewHolder holder;
View vi = convertView;
if (convertView == null) {

holder = new ViewHolder();
vi = inflater.inflate(R.layout.productlist_row, null, false);

holder.titem = (TextView) vi.findViewById(R.id.item);
holder.tdet = (TextView) vi.findViewById(R.id.det);
holder.tprice = (TextView) vi.findViewById(R.id.price);
holder.tpid = (TextView) vi.findViewById(R.id.pid);

holder.ithumb_image = (ImageView) vi.findViewById(R.id.list_image);
holder.tCount = (TextView) vi.findViewById(R.id.txtcount);

holder.ibuttonInc = (ImageView) vi.findViewById(R.id.btplus);
holder.ibuttonDec = (ImageView) vi.findViewById(R.id.btminus);
vi.setTag(holder);
} else {
holder = (ViewHolder) vi.getTag();
}
// image

itemlist = data.get(position);

// Setting all values in listview
holder.titem.setText(itemlist.get(ViewItem.KEY_PNAME));
holder.tdet.setText(itemlist.get(ViewItem.KEY_DET));
holder.tprice.setText(itemlist.get(ViewItem.KEY_PRICE));

holder.tpid.setText(itemlist.get(ViewItem.KEY_PCODE));

// String url = song.get(ViewStores.KEY_THUMB_URL);

holder.ibuttonInc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

count = Integer.parseInt(holder.tCount.getText().toString());
count++;
holder.tCount.setText(String.valueOf(count));

}
});

holder.ibuttonDec.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
count = Integer.parseInt(holder.tCount.getText().toString());
if (count > 0) {
count--;
}
holder.tCount.setText(String.valueOf(count));

}
});

return vi;
}

private class ViewHolder {
public TextView titem, tdet, tprice, tpid, tCount;
public ImageView ithumb_image, ibuttonInc, ibuttonDec;

}
}
Sandip Paul 491984 18-Mar-15 4:08am View    
The user may not open any browser.When admin send any message from a website then client must be notified.
For that a small window application will be installed in client machine which can revive message and show alert on the screen.
Can you tell which mechanism is best to use in this scenario.
I have seen SignalR is used for both way communication but here in case server uses web application and client uses desktop or winform application.
Sandip Paul 491984 18-Mar-15 3:39am View    
There will a small application will running in background which can communicate with server and when server send any message then that exe file show a popup on the desktop.