0

I'm writing android app and currently debugging some functionality which runs on Activity X. Activity X depends on some value from Activity Y, which depends on Activity B, which runs when I click button on Main Activity.

It's really painful to:

  1. change code
  2. re-run app
  3. click on button on Main Act, enter some text on Act B, chose value from spinner on Act. Y
  4. debug function
  5. --> 1. change code

Is there some faster way to run Activity X with parameters I get from getExtras()? IDE I using is Eclipse, actually it's Android Developer Tools.

fenix
  • 1,716
  • 2
  • 20
  • 26
  • Could just put some temporary dummy variables at the top of Activity X set to what you want them to be and comment out the part where you are actually pulling those variables from a bundle from Activity Y. – zgc7009 Aug 02 '14 at 14:16
  • I have this situation often. Is this 'trick' really a solution? – fenix Aug 02 '14 at 14:21
  • 1
    Ideal and best, probably not, but a solution yes :) That's why I left it as a comment. – zgc7009 Aug 02 '14 at 14:28
  • So, each time you need to debug some Activity, you hardcode parameters and change in manifest to start first? – fenix Aug 02 '14 at 14:35

2 Answers2

0

use the class like this and run the class from activity A like this :

class B :

public class UpdateUtils { 


}
    public void update {
  // your sample code

} and call it from activity A :

private final UpdateUtils updateUtils = UpdateUtils.getInstance();
 updateUtils.update();
Meysam
  • 694
  • 6
  • 20
0

put startActivity() in on resume method with pre filled data in intent OR change intent filter in android manifest of that activity to launcher activity

Ashish Singh
  • 371
  • 3
  • 16