This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void storeProcessID(Context context, int processid) { | |
final SharedPreferences prefs = getPushPreferences(context); | |
SharedPreferences.Editor editor = prefs.edit(); | |
editor.putInt(PROCESS_ID, processid); | |
editor.apply(); | |
} | |
public int getStoredProcessID(Context context){ | |
final SharedPreferences prefs = getPushPreferences(context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.JsonParser; | |
/** | |
* Created by mustafaferhan on 22/05/15. | |
* | |
* When the working on webview.evaluateJavascript() method, it return as String on onReceiveValue() method. | |
* The problem is this String not convertable for JSON Object. | |
* Error Log: | |
* org.json.JSONException: Expected literal value at character 1 of or | |
* JSONException: Value of type java.lang.String cannot be converted to JSONObject |