問題タブ [android-bundle]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
17080 参照

android - BroadcastReceiver クラスから現在実行中のアクティビティにインテントを送信する

を拡張するクラスがありますBroadcastReceiver。SMS を受信したら、情報をメイン アクティビティ クラスに渡して、テキストをボックスに表示したいと思います (既にテキストが存在する場合は追加)。

MainActivity.java

活動クラスは 1 つしかありません ( MainActivity.java)。ただし、これを行うと、アクティビティを一時停止できませんという例外が発生します。

0 投票する
1 に答える
85 参照

android - Android でバンドル/エクストラ経由で PIN を渡すのは安全ですか?

ユーザーにアプリのピンを入力してもらい、そのピンをもう一度入力して確認する必要があります。そのピンをデバイスに保存するつもりはなく、取得したらすぐにサーバーに送信します。

確認画面を実装しているときに、この質問が頭に浮かびました。

ルート化された Android デバイスで、バンドルを使用してアクティビティ間でデータを渡す場合、他のアプリはバンドルを使用して渡されている値を見つけることができますか?

PS: 入力 (ピン) を取得するためにカスタム キーボードを使用しています。

0 投票する
0 に答える
194 参照

android - バンドルからのデータを使用してグリッドビューにアイテムを追加する方法

このチュートリアルを使用してグリッドビューを作成しています: https ://developer.android.com/guide/topics/ui/layout/gridview.html

arraymThumbIds を からに変更し、List<Integer>Bundle を介して MainActivity から dataGridFragment に渡されたデータで初期化しようとしていますが、機能しません。要素を手動で追加すると機能します。バンドルが来るのが遅すぎると思いますが、同期する方法がわかりません。

0 投票する
1 に答える
909 参照

android-fragments - Androidフラグメントインスタンス変数とバンドル引数?

Android Fragment インスタンス変数とバンドル引数の違いは何ですか? いつ何を使う?

0 投票する
2 に答える
254 参照

android - インテント データから SMS アドレスを取得する

さまざまなタイプのインテントから電話番号を取得する必要があります。ケースは次のようなインテントです。

また:

新しいアクティビティを開始すると、バンドル エクストラを次のように取得します。

具体的には、インテントがエクストラをキーで明示的にバインドする最初のケースでは、次のよう"address"にします。

smsto:しかし、2 番目のインテント ケースの後に値を取得しようとすると、問題が発生します。

私はすでにバンドルエクストラを反復しようとしました:

}

しかし、エクストラが空の場合、これは私に NPE を与えます。

Google 自体のドキュメントが不足しているため、何も見つかりませんでした。前もって感謝します。

0 投票する
1 に答える
599 参照

java - ArrayList の格納 in an Bundle for use by a Fragment

My application has a view pager including three fragments. These are managed by a FragmentPagerAdapter.

protected void onCreate(Bundle savedInstanceSt

My application has a view pager including three fragments. These are managed by a FragmentPagerAdapter.

Things start to get complicated when all of these Fragments contain a RecyclerView that can be updated.

To correctly pass data to the Fragments, I'm using the newInstance method shown below:

I then have another method inside InformationFragment to update the arguments when required:

Data that can be used to populate the RecyclerView needs to be of multiple types (some android, some custom). Therefore, I have ArrayList<Object> items; containing all my objects.

My question is, what is the best way to store this ArrayList in a bundle so it can be used by a fragment?

I am able to do the following, but it feels dirty:

and then retrieve by:

Or is there a better approach?


SimpleMembership - object 'Users' already exists

I'm developing SPA with Asp.net MVC. Project works on localhost fine, but i've a problem on hosting.

There is controller to work with MembershipProvider containg few methods.

The key moment - is the attribute InitializeSimpleMembership. It's declaration:

When i'm calling any method in controller i'm getting an error:

There is already an object named 'Users' in the database.

If i'm deleting table Users then first request running fine and creating the table. In the next call i'm getting an error again. Why it's trying to create table and not using existing?