![外部アプリの起動にgetLaunchIntentForPackageを使ってはいけない - 組み込みエンジニアのアプリ日誌](https://cdn-ak-scissors.b.st-hatena.com/image/square/1a0a851fbb8c3b09fee18e7ddc30a5789cae9372/height=288;version=1;width=512/http%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fs%2Fshekeenlab%2F20150919%2F20150919100755.png)
Before API 11, we used activities show every new page on the screen. Now with Fragments and the navigation tools in API 28, it’s totally possible to make a very complex app with only one activity. However, activities are still great for sectioning your app out into stages and processes. Maybe you want to divide up all the marketing into one activity, and have the actual app in its own activity. Ma
他のActivityを起動する場合、「新しいタスクで起動」や「スタックをクリアしてから起動」などのオプションを指定することができます。ここではこれらのオプションについて説明します。 他のActivity(例えばToActivity)を呼び出して実行するには通常下記のように定義します。 MyActivity.javaIntent intent = new Intent(this, ToActivity.class); startActivity(intent); 上記のようにIntentのオプションを指定せずにActivityを起動した場合は、起動されたActivityは既にスタックに存在したとしても新たにインスタンスが生成され実行されます。IntentのsetFlags()メソッドを利用することで起動するActivityの動きを指定することができます。具体的な指定の仕方は下記のようになりま
Fragment から Activity にコールバックしたいときに、例えばこんな感じで実装することができます。 public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MainFragment fragment = new MainFragment(); fragment.setOnOkBtnClickListener(new MainFragment.OnOkBtnClickListener() { @Override public void onOkClicked() { // TODO Auto-generated method stub } }); getF
I've been working on the Android SDK platform, and it is a little unclear how to save an application's state. So given this minor re-tooling of the 'Hello, Android' example: package com.android.hello; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { private TextView mTextView = null; /** Called when the activity is
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く