Hi,
I want to add a menu to the Image Viewer just like the CROP menu. I
don't know what I am doing wrong. The menu doesn't show up. I know for
sure I am missing something over here.
Following is the code from my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.presci.markimage"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name"
android:name="MarkImage">
<activity android:name="org.presci.markimage.App"
android:label="@string/app_name">
<action
android:name="org.presci.markimage.action.MARKIMAGE"/>
<data android:mimeType="image/*"/>
<intent-filter label="@string/mark_image">
<category
android:name="android.intent.category.DEFAULT"/>
<category
android:name="android.intent.category.ALTERNATIVE"/>
<category
android:name="android.intent.category.SELECTED_ALTERNATIVE"/>
</intent-filter>
</activity>
<uses-permission android:name="android.permission.INTERNET" />
</application>
</manifest>
and following is the App.java file
package org.presci.markimage;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
public class App extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
System.out.println("Got Intent");
setContentView(R.layout.main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
Intent intent=new Intent(null, this.getIntent().getData());
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
menu.addIntentOptions(
Menu.CATEGORY_ALTERNATIVE,
Menu.CATEGORY_ALTERNATIVE,
Menu.CATEGORY_ALTERNATIVE,
getComponentName(),
null,
intent,
0,
null);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
System.out.println("Option selected");
return true;
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en