title: Start Android activity from command line with extra
body: <p>I created a simple activity that I want to start from command line and pass in some value from command line.</p>
  
  <p>However, if I try to do </p>
  
  <pre><code>adb shell am start com.example.mike.app/.SimpleActivity --es "Message" "hello!"
  </code></pre>
  
  <p>and then receive the message in activity, <code>intent.getExtras()</code> returns null.</p>
  
  <p>Activity:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.simple_activity);
  
      Intent intent = getIntent();
      Bundle bundle = intent.getExtras();
      Log.d(LOGTAG, intent == null ? "Intent is null" : "Intent is not null");
      Log.d(LOGTAG, bundle == null ? "Bundle is null" : "Bundle is not null");
  }
  </code></pre>
  
  <p>Result: </p>
  
  <pre><code>SimpleActivity(12345): Intent is not null
  SimpleActivity(12345): Bundle is null
  </code></pre>