Numberpicker in listview

I have facing one problem with numberpicker in listview.
I have a custom numberpicker in my listview. I add quantity in numberpicker for first item in my list but when I scroll through the list then without adding the same quantity appears in random items numberpicker. How to solve that?
if you have any suggestion plz give me.
my email id -ashutosh3ojha2007@gmail.com
device-2013-05-10-100357 device-2013-05-10-101105 device-2013-05-10-101513
Advertisements

3 thoughts on “Numberpicker in listview

    • package com.example.listviewdemo;

      import java.text.SimpleDateFormat;
      import java.util.ArrayList;
      import java.util.Date;
      import java.util.HashMap;
      import java.util.List;
      import java.util.Locale;

      import org.apache.http.NameValuePair;
      import org.apache.http.message.BasicNameValuePair;
      import org.json.JSONException;
      import org.json.JSONObject;

      import android.app.Activity;
      import android.app.Dialog;
      import android.app.ProgressDialog;
      import android.content.Context;
      import android.content.Intent;
      import android.graphics.Color;
      import android.os.AsyncTask;
      import android.util.Log;
      import android.view.LayoutInflater;
      import android.view.View;
      import android.view.ViewGroup;
      import android.webkit.WebView.FindListener;
      import android.widget.BaseAdapter;
      import android.widget.Button;
      import android.widget.EditText;
      import android.widget.ImageView;
      import android.widget.ListView;
      import android.widget.ProgressBar;
      import android.widget.TextView;
      import android.widget.Toast;

      public class LazyAdapter_product_item extends BaseAdapter {
      static Context cn;
      private static String url_create_product = “http://web.itspl.co/mobile_file/add_item.php”;
      private static String url_delete_product = “http://web.itspl.co/mobile_file/cancel.php”;
      private static String url_update_product = “http://web.itspl.co/mobile_file/update_list.php”;

      private Activity activity;
      private ArrayList<HashMap> data;
      static final String TAG_SUCCESS1 = “success”;
      private static LayoutInflater inflater = null;
      public ImageLoader imageLoader123;
      public static TextView item;
      String pid;
      String name;
      String price;
      String notxt;
      String pname;
      int in;
      int quantity;
      int total;
      String name1;
      String email1;
      String mobile1;

      public static Dialog dialog;
      String pdctname;
      public LazyAdapter_product_item(Activity a,
      ArrayList<HashMap> d) {
      activity = a;
      data = d;
      inflater = (LayoutInflater) activity
      .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      imageLoader123 = 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(int position, View convertView, ViewGroup parent) {
      View vi = convertView;
      CommentViewHolder holder = null;
      if (convertView == null)

      vi = inflater.inflate(R.layout.list_item, null);
      final TextView title = (TextView)vi.findViewById(R.id.name);
      final TextView no=(TextView)vi.findViewById(R.id.editText1);
      final TextView textView4 = (TextView) vi.findViewById(R.id.textView4);
      HashMap song = new HashMap();
      song = data.get(position);
      // Setting all values in listview
      final ImageView add=(ImageView) vi.findViewById(R.id.imageView1);
      final ImageView update=(ImageView) vi.findViewById(R.id.update);
      final ImageView cancel=(ImageView) vi.findViewById(R.id.cancel);

      textView4.setText(song.get(Product_item.TAG_PID));

      final ImageView left = (ImageView) vi.findViewById(R.id.imageView4);
      final ImageView right = (ImageView) vi.findViewById(R.id.imageView5);

      left.setOnClickListener(new View.OnClickListener() {

      public void onClick(View arg0) {
      String st;
      if(no.getText().toString().equals(null)){
      st=”0″;
      }else{
      st=no.getText().toString();
      }
      st=no.getText().toString();
      int in=Integer.parseInt(st);
      int in1=in+1;
      no.setText(String.valueOf(in1));
      }
      });
      right.setOnClickListener(new View.OnClickListener() {

      public void onClick(View arg0) {
      String st;
      if(no.getText().toString().equals(“”)){
      st=”0″;
      }else{
      st=no.getText().toString();
      }
      if(no.getText().toString().equals(“0”)){

      }else{
      int in=Integer.parseInt(st);
      int in1=in-1;
      no.setText(String.valueOf(in1));
      }

      }
      });

      add.setOnClickListener(new View.OnClickListener() {

      public void onClick(View arg0) {

      /*
      dialog.setContentView(R.layout.list_item_p);
      dialog.show();
      */

      if(no.getText().toString().equals(“0”)){
      Toast.makeText(arg0.getContext(), “Enter a item quantity”, Toast.LENGTH_LONG).show();

      }else{
      pdctname=title.getText().toString();
      notxt=no.getText().toString();
      Log.i(“name”,”name”+title.getText().toString());
      // Toast.makeText(arg0.getContext(), “item Name”+pdctname+”item quantity-“+notxt, Toast.LENGTH_LONG).show();
      new CreateNewProduct().execute();
      Toast.makeText(arg0.getContext(), “item Name”+pdctname+”item quantity-“+notxt+”Successfully added”, Toast.LENGTH_LONG).show();
      cancel.setVisibility(View.VISIBLE);
      update.setVisibility(View.VISIBLE);
      add.setVisibility(View.INVISIBLE);

      }

      }
      });

      update.setOnClickListener(new View.OnClickListener() {

      public void onClick(View arg0) {
      if(no.getText().toString().equals(“0”)){

      Toast.makeText(arg0.getContext(), “Enter a item quantity”, Toast.LENGTH_LONG).show();

      }else{

      pdctname=title.getText().toString();
      notxt=no.getText().toString();
      Log.i(“name”,”name”+title.getText().toString());
      Toast.makeText(arg0.getContext(), “item Name”+pdctname+”item quantity-“+notxt+”Successfully Updateded”, Toast.LENGTH_LONG).show();
      new UpdateProduct().execute();

      }

      }
      });

      cancel.setOnClickListener(new View.OnClickListener() {

      public void onClick(View arg0) {

      pdctname=title.getText().toString();
      cancel.setVisibility(View.INVISIBLE);
      update.setVisibility(View.INVISIBLE);
      add.setVisibility(View.VISIBLE);

      new DeleteNewProduct().execute();
      no.setText(“0”);
      Toast.makeText(arg0.getContext(), “Successfully cancel”, Toast.LENGTH_LONG).show();
      }
      });

      /*imageLoader123.DisplayImage(song.get(Product_item.TAG_IMG_LINK),
      thumb_image);*/

      return vi;
      }

      /**
      * Background Async Task to Create new product
      * */
      class DeleteNewProduct extends AsyncTask {

      /**
      * Before starting background thread Show Progress Dialog
      * */
      /* @Override
      protected void onPreExecute() {
      super.onPreExecute();
      pDialog = new ProgressDialog(Atm_main.this);
      pDialog.setMessage(“updating details……..”);
      pDialog.setIndeterminate(false);
      pDialog.setCancelable(true);
      pDialog.show();
      }*/

      /**
      * Creating product
      * */
      protected String doInBackground(String… args) {

      SimpleDateFormat sdfDateTime = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”, Locale.US);
      String newtime = sdfDateTime.format(new Date(System.currentTimeMillis()));
      String time = newtime;

      String ad2 = “YES”;

      // Building Parameters
      List params1 = new ArrayList();

      //params1.add(new BasicNameValuePair(“enquiryid”, MyAppointment.vl1));
      // params1.add(new BasicNameValuePair(“clientid”,MyAppointment.l2));
      params1.add(new BasicNameValuePair(“productName”,pdctname));

      JSONParser jParser = new JSONParser();
      JSONObject json1 = null;

      json1 = jParser.makeHttpRequest(url_delete_product,
      “POST”, params1);
      // }

      Log.i(“params data”,””+params1.toString());
      // check log cat fro response
      Log.i(“Create Response”, json1.toString());
      // check for success tag
      try {
      Log.i(“params data”,””+params1.toString());
      int success = json1.getInt(TAG_SUCCESS1);
      Log.i(“Create Response——-“, json1.toString());
      if (success == 1) {
      Log.i(“params data”,””+params1.toString());
      // successfully created product
      /* Intent i = new Intent(getApplicationContext(), Home_page.class);
      startActivity(i);

      // closing this screen
      finish();*/
      } else {
      // failed to create product
      }
      } catch (JSONException e) {
      e.printStackTrace();
      }

      return null;
      }

      /**
      * After completing background task Dismiss the progress dialog
      * **/
      /* protected void onPostExecute(String file_url) {
      // dismiss the dialog once done
      pDialog.dismiss();
      }*/

      }

      /**
      * Background Async Task to Create new product
      * */
      class CreateNewProduct extends AsyncTask {

      /**
      * Before starting background thread Show Progress Dialog
      * */
      /* @Override
      protected void onPreExecute() {
      super.onPreExecute();
      pDialog = new ProgressDialog(Atm_main.this);
      pDialog.setMessage(“updating details……..”);
      pDialog.setIndeterminate(false);
      pDialog.setCancelable(true);
      pDialog.show();
      }*/

      /**
      * Creating product
      * */
      protected String doInBackground(String… args) {

      // Building Parameters
      List params1 = new ArrayList();

      Log.i(“ashutosh”,”ashutosh”+pdctname);
      // params1.add(new BasicNameValuePair(“enquiryid”,MyAppointment.vl1));
      // params1.add(new BasicNameValuePair(“clientid”,MyAppointment.l2));
      params1.add(new BasicNameValuePair(“productName”,pdctname));
      params1.add(new BasicNameValuePair(“no_of_product”,notxt));
      JSONParser jParser = new JSONParser();
      JSONObject json1 = null;
      /* if(in_out==1 ||in_out==2 ){
      json1 = jParser.makeHttpRequest(url_create_product1,
      “POST”, params1);
      in_out=0;
      }else {*/
      json1 = jParser.makeHttpRequest(url_create_product,
      “POST”, params1);
      // }

      Log.i(“params data”,””+params1.toString());
      // check log cat fro response
      Log.i(“Create Response”, json1.toString());
      // check for success tag
      try {
      Log.i(“params data”,””+params1.toString());
      int success = json1.getInt(TAG_SUCCESS1);
      Log.i(“Create Response——-“, json1.toString());
      if (success == 1) {
      Log.i(“params data”,””+params1.toString());
      // successfully created product
      /* Intent i = new Intent(getApplicationContext(), Home_page.class);
      startActivity(i);

      // closing this screen
      finish();*/
      } else {
      // failed to create product
      }
      } catch (JSONException e) {
      e.printStackTrace();
      }

      return null;
      }

      /**
      * After completing background task Dismiss the progress dialog
      * **/
      /* protected void onPostExecute(String file_url) {
      // dismiss the dialog once done
      pDialog.dismiss();
      }*/

      }

      /**
      * Background Async Task to Create new product
      * */
      class UpdateProduct extends AsyncTask {

      /**
      * Before starting background thread Show Progress Dialog
      * */
      /* @Override
      protected void onPreExecute() {
      super.onPreExecute();
      pDialog = new ProgressDialog(Atm_main.this);
      pDialog.setMessage(“updating details……..”);
      pDialog.setIndeterminate(false);
      pDialog.setCancelable(true);
      pDialog.show();
      }*/

      /**
      * Creating product
      * */
      protected String doInBackground(String… args) {

      SimpleDateFormat sdfDateTime = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”, Locale.US);
      String newtime = sdfDateTime.format(new Date(System.currentTimeMillis()));
      String time = newtime;

      String ad2 = “YES”;

      // Building Parameters
      List params1 = new ArrayList();

      //params1.add(new BasicNameValuePair(“enquiryid”, MyAppointment.vl1));
      // params1.add(new BasicNameValuePair(“clientid”,MyAppointment.l2));
      params1.add(new BasicNameValuePair(“productName”,pdctname));
      params1.add(new BasicNameValuePair(“no_of_product”,notxt));
      JSONParser jParser = new JSONParser();
      JSONObject json1 = null;

      json1 = jParser.makeHttpRequest(url_update_product,
      “POST”, params1);
      // }

      Log.i(“params data”,””+params1.toString());
      // check log cat fro response
      Log.i(“Create Response”, json1.toString());
      // check for success tag
      try {
      Log.i(“params data”,””+params1.toString());
      int success = json1.getInt(TAG_SUCCESS1);
      Log.i(“Create Response——-“, json1.toString());
      if (success == 1) {
      Log.i(“params data”,””+params1.toString());

      } else {
      // failed to create product
      }
      } catch (JSONException e) {
      e.printStackTrace();
      }

      return null;
      }

      /**
      * After completing background task Dismiss the progress dialog
      * **/
      /* protected void onPostExecute(String file_url) {
      // dismiss the dialog once done
      pDialog.dismiss();
      }*/

      }
      private class CommentViewHolder{
      ImageView add,update,cancel,left,right;
      TextView title,no;

      }

      }

  1. package com.example.listviewdemo;

    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Locale;

    import org.apache.http.NameValuePair;
    import org.apache.http.message.BasicNameValuePair;
    import org.json.JSONException;
    import org.json.JSONObject;

    import android.app.Activity;
    import android.app.Dialog;
    import android.app.ProgressDialog;
    import android.content.Context;
    import android.content.Intent;
    import android.graphics.Color;
    import android.os.AsyncTask;
    import android.util.Log;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.webkit.WebView.FindListener;
    import android.widget.BaseAdapter;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.ImageView;
    import android.widget.ListView;
    import android.widget.ProgressBar;
    import android.widget.TextView;
    import android.widget.Toast;

    public class LazyAdapter_product_item extends BaseAdapter {
    static Context cn;
    private static String url_create_product = “http://web.itspl.co/mobile_file/add_item.php”;
    private static String url_delete_product = “http://web.itspl.co/mobile_file/cancel.php”;
    private static String url_update_product = “http://web.itspl.co/mobile_file/update_list.php”;

    private Activity activity;
    private ArrayList<HashMap> data;
    static final String TAG_SUCCESS1 = “success”;
    private static LayoutInflater inflater = null;
    public ImageLoader imageLoader123;
    public static TextView item;
    String pid;
    String name;
    String price;
    String notxt;
    String pname;
    int in;
    int quantity;
    int total;
    String name1;
    String email1;
    String mobile1;

    public static Dialog dialog;
    String pdctname;
    public LazyAdapter_product_item(Activity a,
    ArrayList<HashMap> d) {
    activity = a;
    data = d;
    inflater = (LayoutInflater) activity
    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    imageLoader123 = 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(int position, View convertView, ViewGroup parent) {
    View vi = convertView;
    CommentViewHolder holder = null;
    if (convertView == null)

    vi = inflater.inflate(R.layout.list_item, null);
    final TextView title = (TextView)vi.findViewById(R.id.name);
    final TextView no=(TextView)vi.findViewById(R.id.editText1);
    final TextView textView4 = (TextView) vi.findViewById(R.id.textView4);
    HashMap song = new HashMap();
    song = data.get(position);
    // Setting all values in listview
    final ImageView add=(ImageView) vi.findViewById(R.id.imageView1);
    final ImageView update=(ImageView) vi.findViewById(R.id.update);
    final ImageView cancel=(ImageView) vi.findViewById(R.id.cancel);

    textView4.setText(song.get(Product_item.TAG_PID));

    final ImageView left = (ImageView) vi.findViewById(R.id.imageView4);
    final ImageView right = (ImageView) vi.findViewById(R.id.imageView5);

    left.setOnClickListener(new View.OnClickListener() {

    public void onClick(View arg0) {
    String st;
    if(no.getText().toString().equals(null)){
    st=”0″;
    }else{
    st=no.getText().toString();
    }
    st=no.getText().toString();
    int in=Integer.parseInt(st);
    int in1=in+1;
    no.setText(String.valueOf(in1));
    }
    });
    right.setOnClickListener(new View.OnClickListener() {

    public void onClick(View arg0) {
    String st;
    if(no.getText().toString().equals(“”)){
    st=”0″;
    }else{
    st=no.getText().toString();
    }
    if(no.getText().toString().equals(“0”)){

    }else{
    int in=Integer.parseInt(st);
    int in1=in-1;
    no.setText(String.valueOf(in1));
    }

    }
    });

    add.setOnClickListener(new View.OnClickListener() {

    public void onClick(View arg0) {

    /*
    dialog.setContentView(R.layout.list_item_p);
    dialog.show();
    */

    if(no.getText().toString().equals(“0”)){
    Toast.makeText(arg0.getContext(), “Enter a item quantity”, Toast.LENGTH_LONG).show();

    }else{
    pdctname=title.getText().toString();
    notxt=no.getText().toString();
    Log.i(“name”,”name”+title.getText().toString());
    // Toast.makeText(arg0.getContext(), “item Name”+pdctname+”item quantity-“+notxt, Toast.LENGTH_LONG).show();
    new CreateNewProduct().execute();
    Toast.makeText(arg0.getContext(), “item Name”+pdctname+”item quantity-“+notxt+”Successfully added”, Toast.LENGTH_LONG).show();
    cancel.setVisibility(View.VISIBLE);
    update.setVisibility(View.VISIBLE);
    add.setVisibility(View.INVISIBLE);

    }

    }
    });

    update.setOnClickListener(new View.OnClickListener() {

    public void onClick(View arg0) {
    if(no.getText().toString().equals(“0”)){

    Toast.makeText(arg0.getContext(), “Enter a item quantity”, Toast.LENGTH_LONG).show();

    }else{

    pdctname=title.getText().toString();
    notxt=no.getText().toString();
    Log.i(“name”,”name”+title.getText().toString());
    Toast.makeText(arg0.getContext(), “item Name”+pdctname+”item quantity-“+notxt+”Successfully Updateded”, Toast.LENGTH_LONG).show();
    new UpdateProduct().execute();

    }

    }
    });

    cancel.setOnClickListener(new View.OnClickListener() {

    public void onClick(View arg0) {

    pdctname=title.getText().toString();
    cancel.setVisibility(View.INVISIBLE);
    update.setVisibility(View.INVISIBLE);
    add.setVisibility(View.VISIBLE);

    new DeleteNewProduct().execute();
    no.setText(“0”);
    Toast.makeText(arg0.getContext(), “Successfully cancel”, Toast.LENGTH_LONG).show();
    }
    });

    /*imageLoader123.DisplayImage(song.get(Product_item.TAG_IMG_LINK),
    thumb_image);*/

    return vi;
    }

    /**
    * Background Async Task to Create new product
    * */
    class DeleteNewProduct extends AsyncTask {

    /**
    * Before starting background thread Show Progress Dialog
    * */
    /* @Override
    protected void onPreExecute() {
    super.onPreExecute();
    pDialog = new ProgressDialog(Atm_main.this);
    pDialog.setMessage(“updating details……..”);
    pDialog.setIndeterminate(false);
    pDialog.setCancelable(true);
    pDialog.show();
    }*/

    /**
    * Creating product
    * */
    protected String doInBackground(String… args) {

    SimpleDateFormat sdfDateTime = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”, Locale.US);
    String newtime = sdfDateTime.format(new Date(System.currentTimeMillis()));
    String time = newtime;

    String ad2 = “YES”;

    // Building Parameters
    List params1 = new ArrayList();

    //params1.add(new BasicNameValuePair(“enquiryid”, MyAppointment.vl1));
    // params1.add(new BasicNameValuePair(“clientid”,MyAppointment.l2));
    params1.add(new BasicNameValuePair(“productName”,pdctname));

    JSONParser jParser = new JSONParser();
    JSONObject json1 = null;

    json1 = jParser.makeHttpRequest(url_delete_product,
    “POST”, params1);
    // }

    Log.i(“params data”,””+params1.toString());
    // check log cat fro response
    Log.i(“Create Response”, json1.toString());
    // check for success tag
    try {
    Log.i(“params data”,””+params1.toString());
    int success = json1.getInt(TAG_SUCCESS1);
    Log.i(“Create Response——-“, json1.toString());
    if (success == 1) {
    Log.i(“params data”,””+params1.toString());
    // successfully created product
    /* Intent i = new Intent(getApplicationContext(), Home_page.class);
    startActivity(i);

    // closing this screen
    finish();*/
    } else {
    // failed to create product
    }
    } catch (JSONException e) {
    e.printStackTrace();
    }

    return null;
    }

    /**
    * After completing background task Dismiss the progress dialog
    * **/
    /* protected void onPostExecute(String file_url) {
    // dismiss the dialog once done
    pDialog.dismiss();
    }*/

    }

    /**
    * Background Async Task to Create new product
    * */
    class CreateNewProduct extends AsyncTask {

    /**
    * Before starting background thread Show Progress Dialog
    * */
    /* @Override
    protected void onPreExecute() {
    super.onPreExecute();
    pDialog = new ProgressDialog(Atm_main.this);
    pDialog.setMessage(“updating details……..”);
    pDialog.setIndeterminate(false);
    pDialog.setCancelable(true);
    pDialog.show();
    }*/

    /**
    * Creating product
    * */
    protected String doInBackground(String… args) {

    // Building Parameters
    List params1 = new ArrayList();

    Log.i(“ashutosh”,”ashutosh”+pdctname);
    // params1.add(new BasicNameValuePair(“enquiryid”,MyAppointment.vl1));
    // params1.add(new BasicNameValuePair(“clientid”,MyAppointment.l2));
    params1.add(new BasicNameValuePair(“productName”,pdctname));
    params1.add(new BasicNameValuePair(“no_of_product”,notxt));
    JSONParser jParser = new JSONParser();
    JSONObject json1 = null;
    /* if(in_out==1 ||in_out==2 ){
    json1 = jParser.makeHttpRequest(url_create_product1,
    “POST”, params1);
    in_out=0;
    }else {*/
    json1 = jParser.makeHttpRequest(url_create_product,
    “POST”, params1);
    // }

    Log.i(“params data”,””+params1.toString());
    // check log cat fro response
    Log.i(“Create Response”, json1.toString());
    // check for success tag
    try {
    Log.i(“params data”,””+params1.toString());
    int success = json1.getInt(TAG_SUCCESS1);
    Log.i(“Create Response——-“, json1.toString());
    if (success == 1) {
    Log.i(“params data”,””+params1.toString());
    // successfully created product
    /* Intent i = new Intent(getApplicationContext(), Home_page.class);
    startActivity(i);

    // closing this screen
    finish();*/
    } else {
    // failed to create product
    }
    } catch (JSONException e) {
    e.printStackTrace();
    }

    return null;
    }

    /**
    * After completing background task Dismiss the progress dialog
    * **/
    /* protected void onPostExecute(String file_url) {
    // dismiss the dialog once done
    pDialog.dismiss();
    }*/

    }

    /**
    * Background Async Task to Create new product
    * */
    class UpdateProduct extends AsyncTask {

    /**
    * Before starting background thread Show Progress Dialog
    * */
    /* @Override
    protected void onPreExecute() {
    super.onPreExecute();
    pDialog = new ProgressDialog(Atm_main.this);
    pDialog.setMessage(“updating details……..”);
    pDialog.setIndeterminate(false);
    pDialog.setCancelable(true);
    pDialog.show();
    }*/

    /**
    * Creating product
    * */
    protected String doInBackground(String… args) {

    SimpleDateFormat sdfDateTime = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”, Locale.US);
    String newtime = sdfDateTime.format(new Date(System.currentTimeMillis()));
    String time = newtime;

    String ad2 = “YES”;

    // Building Parameters
    List params1 = new ArrayList();

    //params1.add(new BasicNameValuePair(“enquiryid”, MyAppointment.vl1));
    // params1.add(new BasicNameValuePair(“clientid”,MyAppointment.l2));
    params1.add(new BasicNameValuePair(“productName”,pdctname));
    params1.add(new BasicNameValuePair(“no_of_product”,notxt));
    JSONParser jParser = new JSONParser();
    JSONObject json1 = null;

    json1 = jParser.makeHttpRequest(url_update_product,
    “POST”, params1);
    // }

    Log.i(“params data”,””+params1.toString());
    // check log cat fro response
    Log.i(“Create Response”, json1.toString());
    // check for success tag
    try {
    Log.i(“params data”,””+params1.toString());
    int success = json1.getInt(TAG_SUCCESS1);
    Log.i(“Create Response——-“, json1.toString());
    if (success == 1) {
    Log.i(“params data”,””+params1.toString());

    } else {
    // failed to create product
    }
    } catch (JSONException e) {
    e.printStackTrace();
    }

    return null;
    }

    /**
    * After completing background task Dismiss the progress dialog
    * **/
    /* protected void onPostExecute(String file_url) {
    // dismiss the dialog once done
    pDialog.dismiss();
    }*/

    }
    private class CommentViewHolder{
    ImageView add,update,cancel,left,right;
    TextView title,no;

    }

    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s