Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Contributor
linoox
Posts: 2
Registered: ‎02-13-2012
My Device: Playbook Simulator 2.0
My Carrier: NA

Android App Activity screen keeps looping in BB Playbook tablet Simulator 2.0

Hi I need some help. I'm new to Android development and would appreciate if someone can give me some pointers. My android app (v 2.3.3) ran fine on it's AVD. However, when I ported this to BB Tablet Simulator, the activities ran in a loop? I have no idea why it is doing this.

 

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class NC extends ListActivity {
    /* set variables */

	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

		String[] values = new String[] { 	"abc", 
											"rst"	};
		// Use your own layout
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.main, R.id.label, values);
		setListAdapter(adapter);
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		switch(position){
			case 0:	Intent i1 = new Intent(this, abc.class); 
					startActivity(i1);
					break;
			case 1: Intent i2 = new Intent(this, rst.class); 
					startActivity(i2);
					break;
			default: break;
		}
	}

}

 

Please use plain text.