Created
July 10, 2012 14:15
-
-
Save sakurabird/3083547 to your computer and use it in GitHub Desktop.
マッシュルームアプリアプリを起動する/される
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.sakurafish.example.myexamplemashreceive" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk android:minSdkVersion="7" /> | |
<application | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/app_name" > | |
<activity | |
android:name=".MashReceiveActivity" | |
android:label="@string/app_name" > | |
<intent-filter> | |
<action android:name="com.adamrocker.android.simeji.ACTION_INTERCEPT" /> | |
<category android:name="com.adamrocker.android.simeji.REPLACE" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
</intent-filter> | |
</activity> | |
</application> | |
</manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sakurafish.example.myexamplemashreceive2; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class MashReceiveActivity extends Activity { | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Intent intent = getIntent(); | |
Toast.makeText(getApplicationContext(), intent.getAction(), Toast.LENGTH_SHORT).show(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sakurafish.example.mashcall; | |
import android.app.Activity; | |
import android.content.ActivityNotFoundException; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class MyExampleMashCallActivity extends Activity { | |
public static final String ACTION_INTERCEPT = "com.adamrocker.android.simeji.ACTION_INTERCEPT"; | |
public static final String REPLACE_KEY = "replace_key"; | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Intent i = new Intent(ACTION_INTERCEPT); | |
String p = "param"; | |
// Intent intent = new Intent(); | |
// intent.setAction(ACTION_INTERCEPT); | |
// intent.setAction(Intent.ACTION_CHOOSER); | |
// intent.putExtra(p, "parameter"); | |
// try { | |
startActivity(Intent.createChooser(i, null));// 常に連携先を選択させる | |
// startActivity(Intent.createChooser(i, "test"));// 常に連携先を選択させる | |
// startActivityForResult(Intent.createChooser(i, "test"),1);// 常に連携先を選択させる | |
// startActivity(i); | |
// startActivityForResult(intent, 1); | |
// startActivityForResult(i, 1); | |
// } catch (ActivityNotFoundException e) { | |
// handle error | |
// Toast.makeText(this, "呼び出すアプリがありません", Toast.LENGTH_SHORT).show(); | |
// e.printStackTrace(); | |
// } | |
} | |
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
Toast.makeText(getApplicationContext(), "requestCode=" + requestCode + " resultCode=" | |
+ resultCode, Toast.LENGTH_SHORT); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment