I have some problems with my application. I explain : in fact, i have some activities, linked with intents like that :
Using java Syntax Highlighting
- private void lancerCreerMulti() {
- Intent i = new Intent(Accueil.this, Creer_multi.class);
- startSubActivity(i, 0);
- }
Parsed in 0.011 seconds, using GeSHi 1.0.8.4
The problem is that in the parent activity, there an ArrayList, I would to be accessible by the subActivity. I tried to do something like :
// In the parent activity Accueil.java
Using java Syntax Highlighting
- public ArrayList<String> getListeParties(){
- ArrayList<String> res = this.listeParties;
- if (this.listeParties.isEmpty()){
- res=null;
- }
- return res;
- }
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
// In the subActivity
Using java Syntax Highlighting
- Accueil ac = (Accueil)this.getParent();
- liste = ac.getListeParties();
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
but i get a null pointer exception.
So can I send my list in parameter with the Intent and get it back in the subActivity ?
Why my two classes cant communicate like that ?
How may I do it ?
Thank for your answers.......
Cop3rfi3ld