custom action

Put your problem here if it does not fit any of the other categories.

custom action

Postby tp.hrbeu » Sun Dec 30, 2007 12:57 am

how to add a custom action in the program?
i added this into my manifest
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <activity class=".ui1">
  3.  
  4.  <intent-filter>
  5.  
  6.   <action android:value="hrbeu.android.app1.action.myaction" />"
  7.  
  8.  </intent-filter>
  9.  
  10. </activity>
  11.  
  12.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

i added this into ui1.java
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.    
  2.  
  3. public static final String MYACTION ="hrbeu.android.app1.action.myaction";
  4.  
  5.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

i added this into main.class
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.         @Override
  3.  
  4.         public boolean onOptionsItemSelected(Menu.Item item) {
  5.  
  6.                 // TODO Auto-generated method stub
  7.  
  8.                 switch(item.getId()){
  9.  
  10.                 case UI1:
  11.  
  12.                         startActivity(new Intent(ui1.MYACTION,null));
  13.  
  14.                         break;
  15.  
  16.                 }
  17.  
  18.                 return super.onOptionsItemSelected(item);
  19.  
  20.         }
  21.  
  22.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4

when i click the menu item UI1, I got this runtime error "No activity found to handle intend={action=hrbeu.android.app1.action.myaction}"
what's wrong with my program, pls help me!
tp.hrbeu
Freshman
Freshman
 
Posts: 3
Joined: Sat Dec 29, 2007 11:59 pm

Top

Postby plusminus » Thu Jan 03, 2008 12:14 pm

Hello tp.hrbeu,

perhaps add:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <category android:value="android.intent.category.LAUNCHER" />
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

Tell us if worked.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby tp.hrbeu » Mon Jan 07, 2008 5:59 am

thanks plusminus ,i already have a activity set as LAUNCHER, so i set this activity as DEFAULT, it works!
tp.hrbeu
Freshman
Freshman
 
Posts: 3
Joined: Sat Dec 29, 2007 11:59 pm

Postby Katharnavas » Tue Jan 08, 2008 7:04 am

Is this type of Intents can be used to show menu from a different project in some other projects show that we can make use of it..

http://code.google.com/android/kb/commo ... dmenuitems

under the category..
Adding yourself to menus on other applications

What it actually means can u explain it?
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Postby plusminus » Tue Jan 08, 2008 3:42 pm

Hello Katharnavas,

if your application has a cool feature that might be useful for another Activity you can offer it to be displayed in the other Activity's "MENU".
The other Activity (if it wants to) sends out a request for other Activities offering such "MENU"-Features.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Katharnavas » Wed Jan 09, 2008 5:14 am

plusminus wrote:Hello Katharnavas,

if your application has a cool feature that might be useful for another Activity you can offer it to be displayed in the other Activity's "MENU".
The other Activity (if it wants to) sends out a request for other Activities offering such "MENU"-Features.

Regards,
plusminus


Thats how im quite confused i tried with two sort of applications and i could not get success .. can you please do a tutorial for me.. which will be really useful to all the members.
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Top

Postby plusminus » Wed Jan 09, 2008 5:36 pm

Hello Katharnavas,

I'd love to, but I have to learn for exams... :( Easter-break in a bit more than one month, there will be a flush of tuts :)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests