1

I am trying to add a new activity to my APP. Im trying to do this on the following way: Res -> Layout -> Right click on layout -> New -> Activity -> Blank activity

When I do this I keep getting the error message: Package Name is not a valid Package nameenter image description here

How can I make a new activity?

joey
  • 241
  • 1
  • 4
  • 16
  • Check this first: http://stackoverflow.com/questions/6273892/android-package-name-convention Try to put pakcage name with dots ex: `my.project` – Rafal May 22 '16 at 20:05
  • `Right click on layout` why would you do that? – njzk2 May 22 '16 at 20:10

2 Answers2

4

Under package name, put the full name of your app package. You can find this information under the AndroidManifest then the package tag.

Example package name:

com.danielkaparunakis.stackoverflowquestions

Daniel
  • 2,355
  • 9
  • 23
  • 30
  • Hi. How to know what is the "full name" of my package? Can I put anything or does it depend on the project folder? So for example, my project's android folder is `D:\@WORK\personal_projects\android_projects\MyAppName\android`. By default, the package name is `MyAppName`. However, when I run this, it returns the invalid package name error. – akmalmzamri Jan 20 '19 at 02:24
1

Open the .java file of the Main Activity of your App. The very first line shows the statement starting with the word "Package". Copy the text following the word "Package" excluding it and paste it to the package name while creating the new Activity.

Hope this helps !

Jaymeen_JK
  • 322
  • 4
  • 5