[General Questions and Answers] athiravibin:
I tried to read rtf file in asset folder. Tried many third party libraries. Bt getting the same error as 'class not not found' . I have the following logcat error. I was stuck with this pblm for past 1 week. I have upgraded my adt version to 23.3 and sdk too. Also added libraries in Java build path. Bt no use. Still my logcat gives this output. Experts please help me.. Thanks in advance.

02-28 16:53:36.290: D/dalvikvm(639): GC_FOR_ALLOC freed 52K, 8% free 2425K/2612K, paused 175ms, total 176ms

02-28 16:53:36.390: I/Choreographer(639): Skipped 217 frames! The application may be doing too much work on its main thread.

02-28 16:53:36.620: E/dalvikvm(639): Could not find class 'com.lowagie.text.Document', referenced from method com.example.ipraxis.FragmentTab.onCreateView

02-28 16:53:36.620: W/dalvikvm(639): VFY: unable to resolve new-instance 1470 (Lcom/lowagie/text/Document;) in Lcom/example/ipraxis/FragmentTab;

02-28 16:53:36.620: D/dalvikvm(639): VFY: replacing opcode 0x22 at 0x0029

02-28 16:53:36.630: D/dalvikvm(639): DexOpt: unable to opt direct call 0x2ec3 at 0x2b in Lcom/example/ipraxis/FragmentTab;.onCreateView

02-28 16:53:36.650: D/dalvikvm(639): DexOpt: unable to opt direct call 0x2ec5 at 0x34 in Lcom/example/ipraxis/FragmentTab;.onCreateView

02-28 16:53:36.720: D/AndroidRuntime(639): Shutting down VM

02-28 16:53:36.730: W/dalvikvm(639): threadid=1: thread exiting with uncaught exception (group=0xb2addd70)

02-28 16:53:37.140: E/AndroidRuntime(639): FATAL EXCEPTION: main

02-28 16:53:37.140: E/AndroidRuntime(639): Process: com.example.ipraxis, PID: 639

02-28 16:53:37.140: E/AndroidRuntime(639): java.lang.NoClassDefFoundError: com.lowagie.text.Document

02-28 16:53:37.140: E/AndroidRuntime(639):	at com.example.ipraxis.FragmentTab.onCreateView(FragmentTab.java:49)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:486)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.support.v4.app.FragmentTabHost.onAttachedToWindow(FragmentTabHost.java:283)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.View.dispatchAttachedToWindow(View.java:12736)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2457)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2464)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2464)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2464)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2464)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2464)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1263)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1032)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5657)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.Choreographer.doCallbacks(Choreographer.java:574)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.Choreographer.doFrame(Choreographer.java:544)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.os.Handler.handleCallback(Handler.java:733)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.os.Handler.dispatchMessage(Handler.java:95)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.os.Looper.loop(Looper.java:136)

02-28 16:53:37.140: E/AndroidRuntime(639):	at android.app.ActivityThread.main(ActivityThread.java:5026)

02-28 16:53:37.140: E/AndroidRuntime(639):	at java.lang.reflect.Method.invokeNative(Native Method)

02-28 16:53:37.140: E/AndroidRuntime(639):	at java.lang.reflect.Method.invoke(Method.java:515)

02-28 16:53:37.140: E/AndroidRuntime(639):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)

02-28 16:53:37.140: E/AndroidRuntime(639):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)

02-28 16:53:37.140: E/AndroidRuntime(639):	at dalvik.system.NativeStart.main(Native Method)

My code is as follows.

import java.io.ByteArrayInputStream;

import java.io.FileInputStream;

import java.io.IOException;

import java.io.InputStream;

/*

import java.io.FileInputStream;

import javax.swing.*;

import javax.swing.text.*;

import javax.swing.text.BadLocationException;

import javax.swing.text.Document;

import javax.swing.text.rtf.*;

*/

import com.lowagie.text.*;

import com.lowagie.text.rtf.*;

import com.lowagie.text.rtf.parser.RtfParser;

import android.os.Bundle;

import android.support.v4.app.Fragment;

import android.view.LayoutInflater;

import android.view.View;

import android.view.ViewGroup;

import android.widget.TextView;

public class FragmentTab extends Fragment {

[MENTION=439709]override[/MENTION]

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

}

[MENTION=439709]override[/MENTION]

public View onCreateView (LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState)

{

View rootView = inflater.inflate (R.layout.fragment_layout,container,false);

TextView tv = (TextView) rootView.findViewById (R.id.directions);

TextView tt = (TextView) rootView.findViewById (R.id.questions);

InputStream istr = null;

try {

istr = (InputStream) getActivity().getAssets().open("Hellooo.rtf");

Document document = new Document();

document.open();

RtfParser parser = new RtfParser(null);

parser.convertRtfDocument(istr,document);

} catch (IOException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

};

/* FileInputStream fis;

RTFEditorKit rtf = null;

try {

fis = (FileInputStream) getActivity().getAssets().open("Hellooo.rtf");

byte[] input = new byte[fis.available()];

rtf = new RTFEditorKit();

Document doc = rtf.createDefaultDocument();

rtf.read(new ByteArrayInputStream(input), doc, 0);

String content = new String(doc.getText(0, doc.getLength()));

//tv.setText(content);

} catch (IOException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

} catch (BadLocationException e) {

// TODO Auto-generated catch block

e.printStackTrace();

};

*/

return rootView;

}