2

![我开发了一个支持阿拉伯语的应用程序,问题是当我运行我的应用程序时出现错误“阿拉伯字体意外停止工作强制关闭”请帮助我检测错误。我发布了两个 log n 源代码文件][1 ]

package com.android.arabicfont;

import android.app.Activity;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity {
    AssetManager arabi_font;
    TextView tx;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Typeface face = Typeface.createFromAsset(getAssets(),"dejavusans.ttf");
        tx.setText(ArabicUtilities.reshape("\u0641\u0641\u0633"));
        TextView tx = (TextView) findViewById(R.id.textView1);
        tx.setTypeface(face);

    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    }
4

0 回答 0