我正在尝试使用以下命令从 Android Wear 中的表盘开始活动:
Intent myIntent = new Intent(this, com.jorc.android.wearable.watchface.watchface.MainActivity.class);
getApplicationContext().startActivity(myIntent);
但是,我收到此错误。
Error:(564, 39) error: no suitable constructor found for Intent(DigitalWatchFaceService.Engine,Class<MainActivity>)
constructor Intent.Intent(String,Uri) is not applicable
(argument mismatch; DigitalWatchFaceService.Engine cannot be converted to String)
constructor Intent.Intent(Context,Class<?>) is not applicable
(argument mismatch; DigitalWatchFaceService.Engine cannot be converted to Context)
我的问题是:“有没有办法从表盘开始活动”?Watchface 使用 CanvasWatchFaceService.Engine 扩展 CanvasWatchFaceService。