を介してaHashMap
を別のユーザーに渡そうとしています。しかし、私は戻ってきています。fragment
bundle
bundle
null
これで を作成bundle
します
protected void onPostExecute(String string) {
// dismiss the dialog
pDialog.dismiss();
int a = 0;
Bundle bundle = new Bundle();
Fragment fragment = new Assessment_Fragment();
for (int i = 0; i < infoList.size(); i++) {
// get HashMap
HashMap<String, String> map = infoList.get(i);
// autoincremented key for retreiving as many HashMaps as needed
bundle.putSerializable("" + a, map);
// so i will know how many hashmaps exist
bundle.putInt("key", a);
// increment key
a++;
}
fragment.setArguments(bundle);
};
これが私が受け取る方法ですbundle
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_assessment, container, false);
// check for values
if (getArguments() != null) {
// application never gets here !
int a = getArguments().getInt("key");
for (int i = 0; i < a; i++) {
@SuppressWarnings("unchecked")
HashMap<String, String> map = (HashMap<String, String>) getArguments()
.getSerializable("" + i);
if (map.get(TAG_FIELD).equals(r)) {...
アプリケーションはクラッシュせず、エラーもありません。が never であるため、これfragment
は決して膨張しbundle
ません!= null
。私は何を間違っていますか?