當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyEventCompat.getKeyDispatcherState方法代碼示例

本文整理匯總了Java中android.support.v4.view.KeyEventCompat.getKeyDispatcherState方法的典型用法代碼示例。如果您正苦於以下問題:Java KeyEventCompat.getKeyDispatcherState方法的具體用法?Java KeyEventCompat.getKeyDispatcherState怎麽用?Java KeyEventCompat.getKeyDispatcherState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.KeyEventCompat的用法示例。


在下文中一共展示了KeyEventCompat.getKeyDispatcherState方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TransportMediator

import android.support.v4.view.KeyEventCompat; //導入方法依賴的package包/類
private TransportMediator(Activity activity, View view, TransportPerformer callbacks) {
    mContext = activity != null ? activity : view.getContext();
    mCallbacks = callbacks;
    mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
    mView = activity != null ? activity.getWindow().getDecorView() : view;
    mDispatcherState = KeyEventCompat.getKeyDispatcherState(mView);
    if (Build.VERSION.SDK_INT >= 18) { // JellyBean MR2
        mController = new TransportMediatorJellybeanMR2(mContext, mAudioManager,
                mView, mTransportKeyCallback);
    } else {
        mController = null;
    }
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:14,代碼來源:TransportMediator.java

示例2: TransportMediator

import android.support.v4.view.KeyEventCompat; //導入方法依賴的package包/類
private TransportMediator(Activity activity, View view, TransportPerformer transportperformer)
{
    g = new ArrayList();
    h = new a(this);
    i = new b(this);
    Object obj;
    if (activity != null)
    {
        obj = activity;
    } else
    {
        obj = view.getContext();
    }
    a = ((Context) (obj));
    b = transportperformer;
    c = (AudioManager)a.getSystemService("audio");
    if (activity != null)
    {
        view = activity.getWindow().getDecorView();
    }
    d = view;
    e = KeyEventCompat.getKeyDispatcherState(d);
    if (android.os.Build.VERSION.SDK_INT >= 18)
    {
        f = new d(a, c, d, h);
        return;
    } else
    {
        f = null;
        return;
    }
}
 
開發者ID:vishnudevk,項目名稱:MiBandDecompiled,代碼行數:33,代碼來源:TransportMediator.java


注:本文中的android.support.v4.view.KeyEventCompat.getKeyDispatcherState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。