So I know how to rename a package, however that just changes the end
package com.example.android.navigationdrawerexample;
In this example what I want to do is get rid of the .example
How would you go about this without breaking things?
1- Go to androidmanifest.xml
2- Search for:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
3- Use Refactor over the content of "package" to change your package name
4- Reload project
I hope this can help somebody!
what i'm doing is to open some class file, go to the top and choose the part of the package you want to rename, right click on it and go to Refactor > Rename. I guess Studio should ask you then whether you want to rename either directory or whole package - choose the latter.
E.g when you have package pl.warsjawa.android2;
and want to change warsjawa
into dzwoniec
right click on warsjawa -> Refactor -> Rename.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With