Hi i am creating an external jar file and that is a library for reshaping a text view and here is the reshape class :
public class Reshaper extends Activity{
public static Context co;
public static void ReshapeTextview(TextView Textview, String fontpath) {
Typeface tf = Typeface.createFromAsset(co.getAssets(), fontpath);
Textview.setTypeface(tf);
PersianReshape.reshape(Textview.getText().toString());
}
and here is how i use it in other project that i have imported that jar there.
public class Main extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView) findViewById(R.id.textView1);
Reshaper.ReshapeTextview(tv, "title.TTF");
}
but when i launch it i got a force close !
and here is the log:
11-29 19:13:48.637: E/AndroidRuntime(1218): Uncaught handler: thread main exiting due to uncaught exception
11-29 19:13:48.678: E/AndroidRuntime(1218): java.lang.NoClassDefFoundError: mr.persian.reshape.Reshaper
11-29 19:13:48.678: E/AndroidRuntime(1218): at com.example.mm.Main.onCreate(Main.java:15)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.os.Looper.loop(Looper.java:123)
11-29 19:13:48.678: E/AndroidRuntime(1218): at android.app.ActivityThread.main(ActivityThread.java:4363)
11-29 19:13:48.678: E/AndroidRuntime(1218): at java.lang.reflect.Method.invokeNative(Native Method)
11-29 19:13:48.678: E/AndroidRuntime(1218): at java.lang.reflect.Method.invoke(Method.java:521)
11-29 19:13:48.678: E/AndroidRuntime(1218): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
11-29 19:13:48.678: E/AndroidRuntime(1218): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
11-29 19:13:48.678: E/AndroidRuntime(1218): at dalvik.system.NativeStart.main(Native Method)