Click here to Skip to main content
15,846,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a wordpress website by using Raavi font. That i have upload the font by using Wordpress Font Uploader. same website I am running in WebView. When I run my android project in emulator it shows me the font.. but when I run my phone.. My phone had 4.2.2 android version. it do not show punjabi font... only english is displaying. but when I run it on 4.0.2. it works...
please guide how can i make eligile to run on higher version...
Java
package com.aarcreationz.bhajanmala;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity 
{
    WebView mWeb;
    ProgressDialog mProgress;


    @SuppressLint("SetJavaScriptEnabled") 
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        mWeb = new WebView(this);
        mWeb.setClickable(true);
        mWeb.setFocusableInTouchMode(true);
        setContentView(mWeb);
        WebSettings settings = mWeb.getSettings();
        settings.setJavaScriptEnabled(true);


        mWeb.setWebViewClient(new WebViewClient() {

            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }


            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                super.onPageStarted(view, url, favicon);
                mProgress = new ProgressDialog(MainActivity.this);
                mProgress.setTitle("Please Wait!");
                mProgress.setMessage("Loading...");
                mProgress.show();

            }

            public void onPageFinished(WebView view, String url) {
                if(mProgress.isShowing()) {
                    mProgress.hide();
                    mProgress.dismiss();
                }
            }
        });

        mWeb.loadUrl("http://www.aarcreationz.com/mala");
    }
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if ((keyCode == KeyEvent.KEYCODE_BACK) && mWeb.canGoBack())
        {
            mWeb.goBack();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
Posted

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900