Hasan
Hasan

Reputation: 36

keyboard not coming up

I am using google form inside a webview in my application, it worked perfectly until i saw it this morning the keyboard is not coming up for the user input.

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class AndroidMobileAppSampleActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    final WebView mainWebView = (WebView) findViewById(R.id.mainWebView);

    WebSettings webSettings = mainWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);

    mainWebView.setWebViewClient(new WebViewClient());
    mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);

    mainWebView.loadUrl("https://docs.google.com/forms/d/1Q3Ld-JwtrxSAlw-7mcVcEYH4kohCSqhzRZ9SHsRyu_U/viewform?usp=send_form");
    {

mainWebView.setWebViewClient(new WebViewClient() {
    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
        mainWebView.loadUrl("file:///android_asset/b.txt");

    }
});

class MyCustomWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
    }
}
}}} 

this is the logcat

11-28 11:55:43.249: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:44.300: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:45.352: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:46.416: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:47.468: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:48.521: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:49.571: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:50.623: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:51.675: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:52.726: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:53.777: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:54.829: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:55.806: E/WifiStateMachine(591): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=0.00 rxSuccessRate=7.86 targetRoamBSSID=any RSSI=-44

11-28 11:55:55.808: I/wpa_supplicant(5496): wlan0: CTRL-EVENT-SCAN-STARTED

11-28 11:55:55.880: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

11-28 11:55:56.924: W/ActivityManager(591): getTasks: caller 10108 does not hold GET_TASKS; limiting output

Upvotes: 1

Views: 2231

Answers (2)

Cabezas
Cabezas

Reputation: 10717

You must only add this line in AndroidManifest.xml

<uses-permission android:name="android.permission.GET_TASKS" />

I hope you can fix the bug.

Upvotes: 0

Grandpa
Grandpa

Reputation: 63

What level of api you are using to test?

The android api 21 has a bug unsolved. That presents in logcat output:

W/ActivityManager﹕ getTasks: caller 10077 does not hold GET_TASKS; limiting output

Far as I know the problem occurs when it is called the code below:

ActivityManager am = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfo = am.getRunningTasks(5);

Solved when I added the version check:

if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)

Upvotes: 1

Related Questions