![我开发了一个支持阿拉伯语的应用程序,问题是当我运行我的应用程序时出现错误“阿拉伯字体意外停止工作强制关闭”请帮我检测错误.i发布了两个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;
}
}