title: opening another app from my app in android
body: <p>I have a method to open a twitter posting page, but once a click the button to do this, nothing happens. No response no anything. I have even tried a simple method just to open any other installed app from my app but it does't work.</p>
  
  <p>The app doesn't crash, it's just like a dummy. It won't do anything.</p>
  
  <p>Any idea what the problem could be?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public void openTwitter(View v) {
  
  
          Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
      shareIntent.setType("text/plain");
      shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
              (String) v.getTag(R.string.app_name));
      shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,
              (String) v.getTag(R.drawable.ic_launcher));
      PackageManager pm = v.getContext().getPackageManager();
      List&lt;ResolveInfo&gt; activityList = pm.queryIntentActivities(shareIntent,
              0);
      for (final ResolveInfo app : activityList) {
          if ("com.twitter.android.PostActivity"
                  .equals(app.activityInfo.name)) {
              final ActivityInfo activity = app.activityInfo;
              final ComponentName name = new ComponentName(
                      activity.applicationInfo.packageName, activity.name);
              shareIntent.addCategory(Intent.CATEGORY_LAUNCHER);
              shareIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
                      | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
              shareIntent.setComponent(name);
              v.getContext().startActivity(shareIntent);
              break;
          }
      }
  </code></pre>
  
  <p>Error log:</p>
  
  <pre><code>12-04 20:36:57.229: ERROR/DataRouter(1689): DSR is ON. Don't send DTR ON.
  12-04 20:36:57.414: ERROR/lights(1849): write_int: path  /sys/devices/virtual/sec/sec_touchkey/brightness, value 1
  12-04 20:36:58.914: ERROR/lights(1849): write_int: path /sys/devices/virtual/sec/sec_touchkey/brightness, value 2
  12-04 20:36:59.229: ERROR/DataRouter(1689): usb connection is true 
  12-04 20:36:59.229: ERROR/DataRouter(1689): DSR is ON. Don't send DTR ON.
  12-04 20:36:59.999: ERROR/AlarmManagerService(1849): android_server_AlarmManagerService_set to type=3, 8893.012000000
  12-04 20:37:01.229: ERROR/DataRouter(1689): usb connection is true 
  12-04 20:37:01.229: ERROR/DataRouter(1689): DSR is ON. Don't send DTR ON.
  12-04 20:37:01.739: ERROR/AlarmManagerService(1849): android_server_AlarmManagerService_set to type=3, 8951.273000000
  12-04 20:37:03.234: ERROR/DataRouter(1689): usb connection is true 
  12-04 20:37:03.234: ERROR/DataRouter(1689): DSR is ON. Don't send DTR ON.
  12-04 20:37:05.234: ERROR/DataRouter(1689): usb connection is true 
  12-04 20:37:05.234: ERROR/DataRouter(1689): DSR is ON. Don't send DTR ON.
  12-04 20:37:06.919: ERROR/Watchdog(1849): !@Sync 296
  12-04 20:37:07.234: ERROR/DataRouter(1689): usb connection is true 
  12-04 20:37:07.234: ERROR/DataRouter(1689): DSR is ON. Don't send DTR ON.
  </code></pre>