我正在尝试通过Android Annotation中的意图发送和接收ArrayList。我怎样才能做到这一点?
grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
SubcriptionAddPage_.intent(activity).startForResult(REQUEST_CODE);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
});
答案 0 :(得分:0)
在Activity
中,您可以像这样注入Intent
额外费用:
@EActivity
public class SubcriptionAddPage extends Activity {
@Extra
ArrayList<String> arrayListExtra;
@AfterInject
void afterInject() {
// you can use the injected extra here
}
}
SubcriptionAddPage_.intent(activity)
.arrayListExtra(list) // pass the extra to the generated builder
.startForResult(REQUEST_CODE)
.withAnimation(R.anim.activity_in, R.anim.activity_out); // you can use this instead of calling overridePendingTransition()