如何从我的应用程序发送按摩到whatsapp中的特殊号码,我知道这个代码分享按摩到分组或联系whatsapp
Intent waIntent = new Intent(Intent.ACTION_SEND);
waIntent.setType("text/plain");
String text = "Sorry For Interruption,I'm Just Trying Something";
waIntent.setPackage("com.whatsapp");
if (waIntent != null) {
waIntent.putExtra(Intent.EXTRA_TEXT, text);//
startActivity(Intent.createChooser(waIntent,"Share with"));
Run Code Online (Sandbox Code Playgroud)
但我想按照特殊号码发送按摩,如"966xxxxxxx"我怎么能这样做?
我试图在eclipse中为android佩戴创建一个新项目,但是在主要布局中有一个问题我现在不知道如何解决它,这是我的主要布局:
<android.support.wearable.view.WatchViewStub
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/watch_view_stub"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rectLayout="@layout/rect"
app:roundLayout="@layout/round"
tools:context=".MyActivity"
tools:deviceIds="wear">
</android.support.wearable.view.WatchViewStub>
Run Code Online (Sandbox Code Playgroud)
它给我这个错误:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'rectLayout' in package
'com.example.wear'
- error: No resource identifier found for attribute 'roundLayout' in package
'com.example.wear'
Run Code Online (Sandbox Code Playgroud)
我的项目有两个布局"rect.xml"和"round.xml",它是用4.4W编译的,目标是4.4W,而且我在libs文件夹中有一个classes.jar的副本.
如何在解锁屏幕时启动服务?也许就像AlarmAanger!
context.startService(new Intent(context, Widget.class));
Run Code Online (Sandbox Code Playgroud)