android-context
When is casting Context to Activity allowed?
In a showAlret(String message, Context ctx) method of an alert Dialog class, I am trying to get a reference to TextView in the dialog\'s layout XML:[详细]
2023-03-06 23:42 分类:问答Refer to non static method from static method
I am trying to call the following function from a s开发者_开发百科tatic method. File directory = getDir(folderName, Context.MODE_PRIVATE);[详细]
2023-03-06 15:43 分类:问答Is passing context through a static class efficient way or not?
In android, I need reference \"context\" or to say pass \"context\" to several classes. For this purpose I have implemented a static class which holds the \"context\" and all other class access contex[详细]
2023-03-05 05:25 分类:问答Need to shut off a service when a call is coming in and when user dials a number
So, I have a service that runs in the background (it\'s super secret so I cant tell you what it is:) ) but I need to be able to shut it off when the user initiates a call or a call is coming in. So fa[详细]
2023-03-03 11:09 分类:问答SQLite Database "context" passed to adapter
I have followed this tutorial to use SQLite db in my android app. Since I am a beginner I\'m having problems understanding "context" parameter used in the example.[详细]
2023-03-02 12:22 分类:问答Which Context to use?
I\'m writing an android app, and I have a little p开发者_C百科roblem regarding Context. I\'ve read the Avoiding Memory Leaks article on Android developers. They suggest using application context inst[详细]
2023-03-01 16:18 分类:问答Android - Calling a system service in fixed intervals from another service
As the question implies, I am wondering how I could write a thread that would call a system service and then wait a certain amount of time before calling said system service\'s function that calls bac[详细]
2023-02-26 04:03 分类:问答Access Activity in a static way
I have an activity which has a static method for updating a textfield. This way I can update this view from another activity.[详细]
2023-02-24 22:04 分类:问答Android unit test/test.runner - access to Application object
I\'m using the android.test.runner library and the AndroidTestCase etc. to create some unit tests. I\'m finding it useful, but one test requires access to the application object. Usually I just get th[详细]
2023-02-20 15:55 分类:问答Passing context to Handler
Is it possible to pass arguments to an Android Handler?? I have two pieces of code. new Thread(){ public void run(){[详细]
2023-02-20 13:21 分类:问答