I have an Android Project and an Android Library. If i import the library into the project with a reference there is no problem on runtime. If i add the resulted jar from the Android Library and trying to run again the app, i get this error:
07-15 17:56:35.415: W/System.err(3457): java.lang.NoClassDefFoundError: packagename.here.R$layout
I don't understand why in the second situation this error is thrown. I should be able to import a jar of an Android Library, right? In the jar there is a method that shows a webview on the main ui thread. Confused. In this method the code breaks when trying to create the webView:
public static Dialog showWebView(final Activity context) {
Dialog callAlert = new Dialog(context,
android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
WebView webView = (WebView) context.findViewById(R.id.wb_webview);
System.out.println("webview: " + webView);
callAlert.requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = callAlert.getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
callAlert.setCanceledOnTouchOutside(true);
callAlert.setContentView(webView);
return callAlert;
}