2016-10-01 3 views
0

Я пытаюсь отправить и получить ArrayList через намерение в аннотации Android. Как я могу это достичь?Как отправить и получить ArrayList в намерении в Android Аннотации

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

В вашем 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()