Now, I want to make the device vibrate when device show result on screen
some parts of MainActivity.java
public void onResult(String result) { String tres = "\n"; try { JSONObject j = new JSONObject(result); JSONObject j1 = j.getJSONObject("status"); int j2 = j1.getInt("code"); if(j2 == 0){ JSONObject metadata = j.getJSONObject("metadata"); if (metadata.has("custom_files")) { JSONArray musics = metadata.getJSONArray("custom_files"); for(int i=0; i<musics.length(); i++) { JSONObject tt = (JSONObject) musics.get(i); String title = tt.getString("title"); tres = tres + (i+1) + ". Title: " + title + "\n"; } } }else{ tres = result; } } catch (JSONException e) { tres = result; e.printStackTrace(); } mResult.setText(tres); } How can I do this?
Thanks!