Click here to Skip to main content
14,271,874 members
Rate this:
Please Sign up or sign in to vote.
See more:
This is my Child activity file java code.Please suggest me what to do.

package com.example.javabook; import android.content.Context; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.webkit.WebSettings; import android.webkit.WebView; public class DescriptionActiviity extends AppCompatActivity { private static final String TAG ="DescriptionActivity"; private Context mContext; private Bundle extras; private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_description_activiity); mContext = DescriptionActiviity.this; webView = (WebView) findViewById(R.id.simpleWebView); extras =getIntent().getExtras(); if (extras.equals(null)) { String data = extras.getString( "titles"); Log.d(TAG, "onCreate: the coming is" +data); String url = "file:///android_assest/"+data+".html"; webView.loadUrl(url); WebSettings webSettings =webView.getSettings(); webSettings.setBuiltInZoomControls(true); webSettings.setDisplayZoomControls(false); webSettings.setJavaScriptEnabled(true); } } }

What I have tried:

Everything is looking fine to me,but file is not loading.
Posted
Comments
OriginalGriff 11-Aug-19 9:01am
   
Do us all a favour, and format that chunk of code so it's actually readable before you post it here.
And then explain what "not loading" means for those of us who can't see your screen or run your code because we don't have your HTML file...
Tell us what happened when you tried, tell us any error messages, when they happened, what you did to make them happen.
Tell us what you tried to find out why it failed.

Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
And the better your question, the better our response.

Use the "Improve question" widget to edit your question and provide better information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100