|
|
@@ -5,6 +5,8 @@ import android.app.Activity;
|
|
|
import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
+import android.content.pm.PackageInfo;
|
|
|
+import android.content.pm.PackageManager;
|
|
|
import android.net.Uri;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
@@ -982,5 +984,24 @@ public class MainActivity extends AppCompatActivity {
|
|
|
mCurrentActionString = msg;
|
|
|
ContactsManager.startContactPickerActivity(self, REQUEST_SELECT_CONTACT_CODE);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void RequestAppVersion(String msg) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ PackageManager pm = mCtx.getPackageManager();
|
|
|
+ PackageInfo pi = pm.getPackageInfo(mCtx.getApplicationContext().getPackageName(), 0);
|
|
|
+ String ver_name = pi.versionName;
|
|
|
+ int ver_code = pi.versionCode;
|
|
|
+ String appVer = "Ver:" + ver_name + " build " + ver_code;
|
|
|
+
|
|
|
+ JSONObject json = new JSONObject(msg);
|
|
|
+ String js = mJSInterface.returnToWebPage(json, appVer);
|
|
|
+ evaluateJavaScript(js);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
}
|