on android app: send intent for PosLink (fixes #437)
This commit is contained in:
25
mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java
Normal file
25
mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.cradle.iitc_mobile;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.webkit.JavascriptInterface;
|
||||
|
||||
// provide communication between IITC script and android app
|
||||
public class IITC_JSInterface {
|
||||
|
||||
// context of main activity
|
||||
Context context;
|
||||
|
||||
IITC_JSInterface(Context c) {
|
||||
context = c;
|
||||
}
|
||||
|
||||
// send intent for gmaps link
|
||||
@JavascriptInterface
|
||||
public void intentPosLink(String s) {
|
||||
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
|
||||
Uri.parse(s));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user