本文整理匯總了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;
}
}
示例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;
}
}