Reputation: 117
When I try to create a new activity it says NullPointerException
It says IDE fatal when I tried look into the error from the event log
Upvotes: 4
Views: 6283
Reputation: 91
Because you have another layout/activity/menu/or other things. I faced the same issue, it inserts the activity into Manifest but never creates a new file. Try these things Try to use another name activity/fragment/... Delete other unnecessary things/files e.g. from drawable, files created previously in other directories as well.
Upvotes: 0
Reputation: 4074
Follow the below steps:
Open the folder bin under the directory where you installed your Android Studio.
Open the file "idea.properties" and open it with Notepad++/UltraEdit/other_edit_tools.
Add "disable.android.first.run=true" as the final line and save the file.
Upvotes: 0
Reputation: 56
You may not have created entry for intent-filter in manifest.If you are creating both java and layout file separately without directly creating a activity.
use following code :
public class Main extends AppCompatActivity{
@Override
protected void onCreate(Bundle savedState)
{
super.onCreate(savedState);
setContentView(R.layout.your_layout);
}
and in manifest add after application tag
<activity
android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Upvotes: 1
Reputation: 117
Oops!! I was doing it wrong There is no Issue if I create the new Activity this way.
Upvotes: 1
Reputation: 640
Try this following things...
and let me know what happens.
Hope this will helps...(:
Upvotes: -1