アプリで Setter getter メソッドを使用しています。セッターとゲッターを含む私のクラスは次のとおりです。
public class Product {
private ArrayList<Integer> id=new ArrayList<Integer>();
public ArrayList<Integer> getId() {
return id;
}
public void setId(ArrayList<Integer> id) {
this.id = id;
}
}
public class Check extends Activity {
ArrayList<Integer> passedid=new ArrayList<Integer>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_checkout_page);
Intent checkoutintent=getIntent();
Intent shopcart=getIntent();
Product prodobj=new Product();
passedid=prodobj.getId();
new LongRunningGetIO().execute();
}
}
商品クラスのオブジェクトでgetId()メソッドを使用したいのですが、毎回null値を返しています。setId() メソッドに格納された id 値を返す方法はありますか。事前に感謝します。