Hi 
I think It will give compile time error, how you are calling like this?
"1. Intent dosth = new Intent(ThisActivity.this, *
NextActivity(integervalue).class*); "

if you want  similar you can try like this
1. Intent dosth = new Intent(ThisActivity.this,*(new 
NextActivity(integervalue)).getclass()*); 

Hope it will satisfy your desire, but better way is Raghav advice.
 To pass String/integer/boolean from one Activity to another activity , 
pass via Intent.

Regards
Imran Ali

On Wednesday, 16 May 2012 13:23:58 UTC+5:30, superpsycho wrote:
>
> Hi, 
> i´ll want to call the NextActivity, give an integer to its creation 
> and identify whats to create by the given int. 
> My existing code is like: 
>
> 1. Intent dosth = new Intent(ThisActivity.this, NextActivity.class); 
> 2. startActivity(dosth); 
>
> what i simply want to have is: 
>
> 1. Intent dosth = new Intent(ThisActivity.this, 
> NextActivity(integervalue).class); 
> 2. startActivity(dosth); 
>
> The called activity looks like this at the moment: 
>
> 1.public class NextActivity extends ListActivity{ 
> 2.        private final int idoflist; 
> 3. 
> 4.        public NextActivity(Integer idoflist) { 
> 5.                this.idoflist = idoflist; 
> 6.        } 
> 7.      @Override 
> 8.            public void onCreate(Bundle savedInstanceState) { 
> 9.                    super.onCreate(savedInstanceState); 
> 10.                    final String[] text = 
> getResources().getStringArray(R.array.text_array); 
> 11.                    setListAdapter(new ImagedArrayAdapter(this, 
> beverages, 
> idoflist)); 
> 12. 
> 13.                    ListView listView = getListView(); 
> 14.                    listView.setTextFilterEnabled(true); 
> 15. 
> 16.                    listView.setOnItemClickListener(new 
> OnItemClickListener() { 
> 17.                            public void onItemClick(AdapterView<?> 
> parent, View view, 
> int position, long id) { 
> 18.                                    System.out.println(id); 
> 19.                            } 
> 20.                    }); 
> 21. 
> 22.            } 
> 23.} 
>
> the actual problem is that the 
> 1. Intent dosth = new Intent(ThisActivity.this, 
> NextActivity(integervalue).class); 
> doesn´t work like expectet cause i don´t know what i have to do :D

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to