Groups
Groups
Sign in
Groups
Groups
日本Androidの会
Conversations
About
Send feedback
Help
BroadcastReceiverでApplicationクラスのデータを読み出す
556 views
Skip to first unread message
karamu
unread,
Jun 11, 2014, 11:44:15 PM
6/11/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
BroadcastReceiverクラスで
Applicationクラスのデータを読み出すことはできないでしょうか?
ActivityクラスやServiceでは
getApplication()を使用することで参照ができたのですが…
Yoshiaki Ito
unread,
Jun 12, 2014, 12:26:11 AM
6/12/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
伊藤です。
onReceiveメソッドの第一引数のContextから
Application app = (Application)context.getApplicationContext();
で取得出来るものでどうでしょうか?
On 2014/06/12, at 12:44, karamu <
karamuk...@gmail.com
> wrote:
> BroadcastReceiverクラスで
> Applicationクラスのデータを読み出すことはできないでしょうか?
>
> ActivityクラスやServiceでは
> getApplication()を使用することで参照ができたのですが…
>
>
> --
> このメールは Google グループのグループ「日本Androidの会」に登録しているユーザーに送られています。
> このグループから退会し、グループからのメールの配信を停止するには
android-group-j...@googlegroups.com
にメールを送信してください。
> このグループに投稿するには
android-g...@googlegroups.com
にメールを送信してください。
>
http://groups.google.com/group/android-group-japan
からこのグループにアクセスしてください。
> その他のオプションについては
https://groups.google.com/d/optout
にアクセスしてください。
Reply all
Reply to author
Forward
0 new messages