import com.example.testQRCode.*; //<--external project
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// create a new intent based on your library activity
Intent myIntent = new Intent(this, QRCode.class); // QRCode is a class from the external projects
startActivityForResult(myIntent, 0);
}
The exception displays that the system is unable to instantiate the activity.
Please help me.
If you mean to include a library that is an Android Library project in Eclipse, you can simply add it via
Project Properties->AndroidIn this screen, you will see two sections “Project Build Target” and “Library”. In the “Library” section you can add the reference to the other project.
If you mean to include an external jar file, you would do that through the
Project Properties->Java Build Path->Libraries tabIn here, there is a button for “Add External Jars…” which you can include the jars you need.