android-context
creating a file on android
I am trying to create a file with my android application. I need to write to the file in a specific class. The code I currently have for it is list开发者_如何转开发ed below. I keep getting a nullpoint[详细]
2023-02-20 02:04 分类:问答Why does AlertDialog.Builder(Context context) only accepts Activity as a parameter?
In my ongoing learning process (dialog boxes this time), I discovered that th开发者_JS百科is works:[详细]
2023-02-19 15:27 分类:问答What exactly does using the Application Context mean?
I\'m new to this and I\'m sorry if this is a really dumb question. I\'m just trying to clarify things. My book says I can retrieve application context for process by using the getApplicationContext()[详细]
2023-02-15 16:04 分类:问答What is the best practice to localize status message in an objects for Android apps?
I am trying to localize my Android apps,开发者_如何学C however I found out the I would need a Context() where ever I have a string. This including some exception and status message in my other objects[详细]
2023-02-14 11:34 分类:问答How would I set up this enum to return the image I want?
I\'m trying to set up this enum so that it has the ability to return the correct image, though I\'m struggling with a way to incorporate the context since it is in a separate class.[详细]
2023-02-13 18:09 分类:问答How to start an activity from a dialog in Android
I created a custom dialog and I\'d like to start a new activity when OK is clicked. How can I get the context to set it as first argument of my Intent constructor?[详细]
2023-02-13 00:55 分类:问答In an android app, can I just use the application context instead of a service service?
I made an app that uses the application context to share data and run functions between activities (or when the activity is closed). I also have a BroadcastReceiver that processes intents, plus it spa[详细]
2023-02-11 20:58 分类:问答getApplication() vs. getApplicationContext()
I couldn\'t find a satisfying answer to this, so here we go: what\'s the deal with Activity/Service.getApplication() and Context.getApplicationContext()?[详细]
2023-02-11 01:44 分类:问答ClassCastException when casting an ImageView context to an Activity
I don\'t understand why I\'m receiving a ClassCastException when I use this line: Activity a=(Activity)photoToLoad.imageView.getConte开发者_如何学Goxt();[详细]
2023-02-09 05:59 分类:问答getApplicationContext() throws an exception when used
I\'ve specified a class, based on another one in an existing Android project. The addRow() method is supposed to dynamically add rows to a table.[详细]
2023-02-08 04:18 分类:问答