13 |
import android.os.Message; |
import android.os.Message; |
14 |
import android.provider.Settings; |
import android.provider.Settings; |
15 |
import android.telephony.TelephonyManager; |
import android.telephony.TelephonyManager; |
16 |
|
import android.text.InputType; |
17 |
import android.util.Log; |
import android.util.Log; |
18 |
import android.view.Menu; |
import android.view.Menu; |
19 |
import android.view.MenuItem; |
import android.view.MenuItem; |
26 |
import android.webkit.WebStorage.QuotaUpdater; |
import android.webkit.WebStorage.QuotaUpdater; |
27 |
import android.webkit.WebView; |
import android.webkit.WebView; |
28 |
import android.webkit.WebViewClient; |
import android.webkit.WebViewClient; |
29 |
import android.widget.Toast; |
import android.widget.EditText; |
30 |
|
|
31 |
public class EKLLauncherActivity extends Activity { |
public class EKLLauncherActivity extends Activity { |
32 |
|
|
70 |
}*/ |
}*/ |
71 |
|
|
72 |
@Override |
@Override |
73 |
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) { |
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, final JsPromptResult result) { |
74 |
if (message.trim().toLowerCase().equals("pda identifikation mangler")) { |
String msg = message.trim().toLowerCase(); |
75 |
|
|
76 |
|
if (msg.equals("pda identifikation mangler")) { |
77 |
result.confirm(device); |
result.confirm(device); |
78 |
|
|
79 |
timeoutHandler.sendEmptyMessageDelayed(1, 500); //efter pdaID er sendt til app'en skal vi genindlæse siden for at tvinge den til at hente data |
timeoutHandler.sendEmptyMessageDelayed(1, 500); //efter pdaID er sendt til app'en skal vi genindlæse siden for at tvinge den til at hente data |
80 |
return true; |
return true; |
81 |
|
} else if (msg.startsWith("indtast retur antal")) { |
82 |
|
|
83 |
|
AlertDialog.Builder alert = new AlertDialog.Builder(EKLLauncherActivity.this); |
84 |
|
|
85 |
|
//alert.setTitle("Title"); |
86 |
|
alert.setMessage(message); |
87 |
|
|
88 |
|
// Set an EditText view to get user input |
89 |
|
final EditText input = new EditText(EKLLauncherActivity.this); |
90 |
|
input.setInputType(InputType.TYPE_CLASS_NUMBER); |
91 |
|
alert.setView(input); |
92 |
|
|
93 |
|
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { |
94 |
|
public void onClick(DialogInterface dialog, int whichButton) { |
95 |
|
result.confirm(input.getText().toString()); |
96 |
|
} |
97 |
|
}); |
98 |
|
alert.show(); |
99 |
|
|
100 |
|
return true; |
101 |
} else { |
} else { |
102 |
return super.onJsPrompt(view, url, message, defaultValue, result); |
return super.onJsPrompt(view, url, message, defaultValue, result); |
103 |
} |
} |
104 |
} |
} |
105 |
|
|
106 |
} |
} |
107 |
|
|
108 |
class DummyWebViewClient extends WebViewClient { |
class DummyWebViewClient extends WebViewClient { |