2016-03-20 13 views
1

私はマニフェストファイルにマニフェストにアプリケーションクラスを登録しますか?

を私のオーバーライドApplicationクラスを登録したいが、すでに(私の場合を助けるdidntは)上記の質問でRegister Application class in Manifest?

をquestionn尋ねました。ユーザーは彼の答えを得た。私の場合は。 android:name = ""は、android name = "io.branch.refferal.branchApp"で埋められます。

私のアプリケーションクラス名で置き換えると、私のブランチAPIは動作しません。

私のアプリケーションクラスをマニフェストファイルに登録するにはどうすればいいですか

p.s.私は、アプリケーション全体のための私のフォントを設定するには、chrisjenxの書道のAPIを使用するアプリケーションファイルを作ってきた

コードスニペット:

<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> 

私のアプリケーションクラス以下:で

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"); 

    } 
} 

答えて

1

ルックあなたパッケージ名+マニフェスト値のクラス名。

ブランチアプリケーション機能を使用する場合は、生のアプリケーションクラスではなく、その機能を拡張する必要があります。

package absdevelopers.com.brankreferal; 

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

public class Application extends BranchApp 

はその後マニフェスト

<application 
    android:name="absdevelopers.com.brankreferal.Application" 
+0

@jared巣穴にあなたのアプリケーションを使用する - 両方の質問を読み、適切anwersしてください、あなたは、両方の違いを知っていますよ。それはそのような高レポを持つ男からの悲しい呼び出しでした:) – Bawa

+0

@ cricket_007 - ありがとう、それは魅力のように働いた:) –

+0

@AmanRana 'Application 'クラスの名前を' android .app.Application' –

関連する問題