1

i wanna register my overrided Application class in the manifest file

already asked questionn (didnt help my case) Register Application class in Manifest?

in the above question. the user got his answer . but in my case . android:name="" is filled by android name="io.branch.refferal.branchApp"

if i replace that name with my application class name, my branch api does'nt work.

so, how do i register my application class in manifest file

p.s. i have made application file to use chrisjenx's Calligraphy api, to set my font for the entire application

code snippet:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:name="io.branch.referral.BranchApp"
    >
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

my application class below :

package absdevelopers.com.brankreferal;

import uk.co.chrisjenx.calligraphy.CalligraphyConfig;


public class Application extends android.app.Application {

    @Override
    public void onCreate() {
        super.onCreate();

        CalligraphyConfig.initDefault("fonts/My-font.ttf");

    }
}
Community
  • 1
  • 1
Aman Rana
  • 77
  • 6

1 Answers1

1

Look at your package name + class name for the Manifest value.

If you want to use the BranchApp features, though, you will need to extend that instead of the raw Application class.

package absdevelopers.com.brankreferal;

import uk.co.chrisjenx.calligraphy.CalligraphyConfig
import io.branch.referral.BranchApp;

public class Application extends BranchApp

Then use your Application in the Manifest

<application
    android:name="absdevelopers.com.brankreferal.Application"
OneCricketeer
  • 126,858
  • 14
  • 92
  • 185
  • @jared burrows - please read both the questions and anwers properly, you'll know the difference in both. that was a sad call from a guy with such a high repo :) – Bawa Apr 07 '16 at 19:33
  • @cricket_007 - thank you very much , it worked like a charm :) – Aman Rana Apr 07 '16 at 19:35
  • @AmanRana You may want to rename your `Application` class to not conflict with `android.app.Application` – OneCricketeer Apr 07 '16 at 19:36