I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors.... Any one have some hint..?
ERROR from LogCat:<
I recently encountered this with fresh re-install of Eclipse. Turns out my Compiler compliance level was set to Java 1.7 and project required 1.6.
In Eclipse: Project -> Properties -> Java Compiler -> JDK Compliance
Right click on project > properties > android > and try with different version of the android earlier i was doing with android 4.4 then i changed to android 4.3 and it worked !
I had the same issue (Unable to instantiate Activity) :
FIRST reason :
I was accessing
Camera mCamera;
Camera.Parameters params = mCamera.getParameters();
before
mCamera = Camera.open();
So right way of doing is, open the camera first and then access parameters.
SECOND reason : Declare your activity in the manifest file
<activity android:name=".activities.MainActivity"/>
THIRD reason : Declare Camera permission in your manifest file.
<uses-feature android:name="android.hardware.Camera"></uses-feature>
<uses-permission android:name="android.permission.CAMERA" />
Hope this helps
Simply Clean your working project or restart eclipse. Then run your project. it will work.
You may be trying to find the view before onCreate()
which is incorrect.
public class MainActivity extends Activity {
ImageView mainImage = (ImageView) findViewById(R.id.imageViewMain); //incorrect
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
...
}
It is a problem of your Intent.
Please add your Activity
in your AndroidManifest.xml
.
When you want to make a new activity, you should register it in your AndroidManifest.xml
.