I am working on an application in which I have to create a Lunar Calendar I am creating a custom Lunar calendar. The lunar calendar has a very limited code. But somehow I manage to create it. This is my code.
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webView = (WebView)this.findViewById(R.id.wv); webView.loadUrl(contentUri); // webView.loadUrl("file://D:/Andro_WS_2/LunarCalendar/assets/calendar.html"); mGestureDetector = new GestureDetector(this); webView.setOnTouchListener(this); try { Thread.sleep(1500); } catch (InterruptedException e) { e.printStackTrace(); } webView.loadUrl("javascript:pushBtm('MU')"); webView.loadUrl("javascript:pushBtm('MD')"); if(!ConfigCenter.getValue(this, Constant.KEY_WIDGET_ADDED, false)){ Toast.makeText(MainActivity.this, "Please Wait", Toast.LENGTH_LONG).show(); } }
and when I run this code, it will work. My logcat error shows:
03-20 04:51:41.197: E/AndroidRuntime(967): FATAL EXCEPTION: main 03-20 04:51:41.197: E/AndroidRuntime(967): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lunarcalendar/com.example.lunarcalendar.MainActivity}: android.view.InflateException: Binary XML file line
and my xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:umadsdk="http://schemas.android.com/apk/res/com.china.calendar" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/white" android:orientation="vertical" > <WebView android:id="@+id/wv" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <net.youmi.android.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" /> </RelativeLayout>
Prinkal
source share