¿Cómo iniciar la actividad cuando el usuario hace clic en una notificación?

Estoy intentando convertir un código que encontré en un tutorial para mi propio uso. Originalmente, el código lanzó la lista de contactos del sistema cuando el usuario hacía clic en una notificación generada por mi aplicación. Estoy tratando de comenzar unActivity de mi propia en lugar de lanzar la lista de contactos, pero no está funcionando. Más específicamente, no pasa nada. No hay error, y miActivity no carga tampoco La ventana de notificación desaparece después de hacer clic, y el originalActivity sigue siendo visible.

Aquí está mi código:

<code>public class MyBroadcastReceiver extends BroadcastReceiver {
    private NotificationManager mNotificationManager;
    private int SIMPLE_NOTFICATION_ID;

    public void onReceive(Context context, Intent intent){
        Bundle extras = intent.getExtras();

        String deal = (String) extras.get("Deal");
        String title = "Deal found at " + (String) extras.get("LocationName");

        mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notifyDetails = new Notification(R.drawable.icon, title,System.currentTimeMillis());

        Class ourClass;
        try {
            ourClass = Class.forName("com.kjdv.gpsVegas.ViewTarget");
            Intent startMyActivity = new Intent(context, ourClass);

            PendingIntent myIntent = PendingIntent.getActivity(context, 0,startMyActivity, 0);
            notifyDetails.setLatestEventInfo(context, title, deal, myIntent);
            notifyDetails.flags |= Notification.FLAG_AUTO_CANCEL;
            notifyDetails.flags |= Notification.DEFAULT_SOUND;
            mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
        }
        catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
</code>

Esta es mi entrada en elAndroidManifext.xml expediente...

<code>  <activity android:name=".ViewTarget" android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.kjdv.gpsVegas.ViewTarget" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
   </activity>
</code>

Y esta es miActivity que quiero lanzar ...

<code>public class ViewTarget extends ListActivity {
    public ListAdapter getListAdapter() {
        return super.getListAdapter();
    }

    public ListView getListView() {
        return super.getListView();
    }

    public void setListAdapter(ListAdapter adapter) {
        super.setListAdapter(adapter);
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.locations);
        Log.v("db", "Inside ViewTarget");
    }
}
</code>

Respuestas a la pregunta(6)

Su respuesta a la pregunta