• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Search results

  1. A

    Apps Encoding in uri.buider

    Hello, i have a question about encoding of uri.builder. I created an uri with uri.builder. the problem that one of my parameters values includes comma. .appendQueryParameter("locatiion",-25.654, 45.98) so builder replace comma with hex value(%2C). To repair this link, i wrote replace function...
  2. A

    Apps delete all records in sql table

    Hello, i have two tables : table1 and table2, they have the same fields. i want to use one method for two tables to delete all rows. proc void deleteAll(String table) { sqlLiteDB=this.getWritableDattabase(); sqlLiteDB.delete(dbHelper.table, null, null); sqlLiteDB.close(); } the problem...
  3. A

    Apps Shared Preference

    Hello, i have a question about shared preferences. In my app, user can choose language in settings. How can i retrieve the language? i write the next code in onCreate: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); String myPref = prefs.getString("language"...
  4. A

    Apps if/else inside doInBackground in AsyncTask

    Hello, i get an error when i use if/else inside doInBackground. String Town="NewYork"; if (Town.equals("NewYork")) { Toast..... } When i close if/else the program is running. What i should do? Thank you
  5. A

    Apps retrieve values from Json

    Hello. I retrieve float variable from Json Object and it's works wonderful. float grade = Float.parseFloat(root.getString("grade_json)); The problem is that sometimes, there are no grade, and the value inside grade_json is "N/A" and i get an error. How can i solve this problem? I want to put...
  6. A

    Apps throw exception

    Hello, i have a question about exceptions. This is my code. If(var="test") { ok:) } else { throw exception , stop the program. How can i throw exception here, when var not equal to "test"? }; Thank you very much
  7. A

    Apps Exit from app

    I want to exit from app, i created a menu with option exit, when the user choose exit menu, app shutdown. But unfortunately this not work always. What's wrong? Thank you i wrote this code on my button EXIT click. Intent intent = new Intent(getApplicationContext(), MainActivity.class)...
  8. A

    Apps Method falls due to other method

    I have two different methods that do different things. When the is open and second close, All work wonderful, when the second method open and first close, all work wonderful. the problem happened when they both open.In this case the first method falls(i click on item and for a second see alert...
  9. A

    Apps using onResume() : when?

    Hello. I want to understand when i should use and what i should write in onResume() method in my app. My app read data from internet, save it in the database and then user can see the list of songs. thank you
  10. A

    Apps Creation SQLite Database and Insert Data

    Hello. I have problem with SQLite connection. I get next error: E/AmanattoDataUpdaterHelper: Failed to get contextual suggestions. E/AmanattoDataUpdaterHelper: package name: com.example.name_app I put some Logs, and found that SQLiteDatabase database = this.getWritableDatabase(); statement...
  11. A

    Apps Changing the Text color depending on the progress of a SeekBar

    Hello, i wold like to know how to change the text color of the text depending on the Seekbar. the color should change automatically from the red(when the seekbar 0) to green(when the seekbar is 100). I know how create the Seekbar but i don't know how create color automatically between two...
  12. A

    Hold Notifications (display notifications at intervals)

    First Step : import Json file, with two fields : name and id and present only name. AssyncTask: .... protected ArrayList<String> doInBackground(String... params) { for (int i = 0; i < rootArray.length(); i++) { JSONObject...
  13. A

    Apps JSON and Arraylist

    Hello, my app get json file, read two field(name and id) , and add them to the list view(in doinBackground). In onPostExecute i add the listview to arrayadapter. I present only one of the variables(name). When user click on the name(setOnItemClickListener), i need to get id of the name. My...
  14. A

    Apps AlertDialog with Intents

    Hello. I created AlertDialog and have a problem with Negative Button Click. When i clicked it, i get an Fatal Error, i mean i have a problem with intent1. Thank you public void onClick(DialogInterface dialog, int which) { switch(which) { case DialogInterface.BUTTON_POSITIVE...