external activity launch - Confused!

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

external activity launch - Confused!

Postby xray » Mon Oct 26, 2009 7:27 am

Here are some snippets from my code and the manifest file.
I am trying to launch an external activity from my own activity. I see so far only examples for maps and urls. I am assuming because these are not private interfaces.
Anyway, the way this is written implies that I can launch any app from my own, just by filling out the manifest file with the package info of the other activity.

I am using the notepad as the activity to be launched.

Can someone point out where I went wrong?

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. code:
  3.  
  4. String pkgName  = "com.android.demo.notepad3";
  5.  
  6.                         String nameClass = "NoteEdit";
  7.  
  8.                         Intent intent = new Intent("com.android.demo.notepad3");
  9.  
  10.                         intent.setClassName(pkgName,nameClass);
  11.  
  12.                         startActivity(intent); 
  13.  
  14.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Manifest:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.      package="org.openintents.samples.SensorDemo"
  7.  
  8.      android:versionCode="1"
  9.  
  10.      android:versionName="1.0">
  11.  
  12.    
  13.  
  14.     <!-- The INTERNET permission is required to connect to the SensorSimulator: -->
  15.  
  16.     <uses-permission android:name="android.permission.INTERNET"/>
  17.  
  18.    
  19.  
  20.     <application android:icon="@drawable/icon" android:label="@string/app_name">
  21.  
  22.  
  23.  
  24.         <activity android:name=".SensorDemoActivity"
  25.  
  26.                  android:label="@string/app_name">
  27.  
  28.             <intent-filter>
  29.  
  30.                 <action android:name="android.intent.action.MAIN" />
  31.  
  32.                 <category android:name="android.intent.category.LAUNCHER" />
  33.  
  34.             </intent-filter>
  35.  
  36.         </activity>
  37.  
  38.         <activity android:name="com.android.demo.notepad3.NotePad">
  39.  
  40. </activity>
  41.  
  42.         <intent-filter>
  43.  
  44.         <action android:name="com.android.demo.notepad3" />
  45.  
  46.         <category android:name="android.intent.category.MAIN" />
  47.  
  48.         </intent-filter>
  49.  
  50.     </application>
  51.  
  52.     <uses-sdk android:minSdkVersion="2" />
  53.  
  54. </manifest>
  55.  
  56.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4
xray
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Oct 26, 2009 7:18 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests