Kumar
Kumar

Reputation: 169

Generating activities Dynamically

I have an application in which according to the user input , i have to display activities.. Plz specify how can i display activities dynamically . Already keeping the maximum no of activities and displaying it them using intent is definitely not a viable option..

How can i achieve this?z

public class Progress extends Activity implements OnClickListener{
Button b;

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.progress);
    b = (Button) findViewById(R.id.b);
    b.setOnClickListener(this);
}

@Override
public void onClick(View view) {
// TODO Auto-generated method stub

switch(view.getId()){

 case R.id.b:

 String numberPos = et.getText.toString();
 int n = Integer.parseInt(numberPos);


  break;

}

}

Upvotes: 1

Views: 85

Answers (1)

Stephan Celis
Stephan Celis

Reputation: 2612

Try to be a bit less vague. For what problem you want to use dynamic activities? Why can't you use intents.

You should make your activity as you make every other activity but you should pass through parameters with your intent and let your activity show the information it needs based on the parameters.

Upvotes: 1

Related Questions