本文整理汇总了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;
}
}