[Q] standout library quetions

guys please help i have stucked in this problem for a long time.

Code:

public class Activity_Calculator extends StandOutWindow {

@Override public String getAppName() { return "test"; }

@Override public int getAppIcon() { return android.R.drawable.ic_menu_close_clear_cancel; }

@Override public void createAndAttachView(int id, FrameLayout frame) { // create a new layout from body.xml LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); View child= inflater.inflate(R.layout.activity_activity__calculator, frame, true); WebView myWebView = (WebView)child.findViewById(R.id.webView1); EditText field = (EditText)child.findViewById(R.id.urlField); //myWebView.getSettings().setJavaScriptEnabled(true); myWebView.setWebViewClient(new MyBrowser()); //myWebView.getSettings().setJavaScriptEnabled(true); //myWebView.getSettings().setPluginsEnabled(true); //myWebView.getSettings().setDomStorageEnabled(true); } private class MyBrowser extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }

// the window will be centered @Override public StandOutLayoutParams getParams(int id, Window window) { return new StandOutLayoutParams(id, 500, 600, StandOutLayoutParams.CENTER, StandOutLayoutParams.CENTER); }

// move the window by dragging the view @Override public int getFlags(int id) { return StandOutFlags.FLAG_DECORATION_SYSTEM | StandOutFlags.FLAG_BODY_MOVE_ENABLE | StandOutFlags.FLAG_WINDOW_HIDE_ENABLE | StandOutFlags.FLAG_WINDOW_BRING_TO_FRONT_ON_TAP | StandOutFlags.FLAG_WINDOW_EDGE_LIMITS_ENABLE | StandOutFlags.FLAG_WINDOW_PINCH_RESIZE_ENABLE; } @Override public String getPersistentNotificationMessage(int id) { return "Click to close the SimpleWindow"; }

@Override public Intent getPersistentNotificationIntent(int id) { return StandOutWindow.getCloseIntent(this, Activity_Calculator.class, id); }

}

xml

Code:

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android= xmlns:tools= android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".Activity_Calculator" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" />

<EditText android:id="@+id/urlField" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/textView1" android:layout_centerHorizontal="true" android:ems="10" />

<Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/urlField" android:layout_centerHorizontal="true" android:onClick="open" />

<WebView android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView1" android:layout_alignParentBottom="true" android:layout_below="@+id/button1" /> </RelativeLayout>

the webview does not respond and the apps force closed, the attachment below is the logcat,guys please help

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by stoltenberg.dimitri
2 hours ago
Last post by shemar47
1 hour ago
Last post by abigale.tremblay
1 hour ago
Last post by kuhic.bernita
33 minutes ago
Last post by schiller.zora
4 hours ago
Last post by paxton34
2 hours ago
Last post by lizzie.orn
2 hours ago
Last post by ari29
3 hours ago
Last post by danika65
2 hours ago