Mr
DonManfred , i don't know from where to start new thread and how to make code tags, tell me please.
thank u
JordiCP
i passed the prevouis error and i meet new one
''''''''''''''''''''''''''
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("x")
If FirstTime Then
nativeMe.InitializeContext
End If
nativeMe.runMethod("onClickWhatsapp",Array(nativeMe))
End Sub
#If JAVA
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.content.DialogInterface;
import android.app.Activity;
import android.database.Cursor;
import android.provider.ContactsContract;
import android.content.pm.PackageManager;
public void onClickWhatsApp(Context context)
{
PackageManager pm = context.getPackageManager();
try {
pm.getPackageInfo("com.whatsapp", PackageManager.GET_ACTIVITIES);
Intent intent = new Intent();
intent.setComponent(new ComponentName(packageName,
ri.activityInfo.name));
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, element);
} catch (NameNotFoundException e) {
ToastHelper.MakeShortText("Whatsapp have not been installed.");
}
}
#end if
Sub Button1_Down
nativeMe.runMethod("onClickWhatsapp",Array(nativeMe))
End Sub
''''''''''''''''''''''''''''''''''
error is
''''''''''''''''''''''''''''''''
B4A version: 5.02
Parsing code. (0.00s)
Compiling code. (0.06s)
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.00s)
Generating R file. (0.15s)
Compiling generated Java code. Error
javac 1.7.0_09
src\b4a\example\main.java:391: error: cannot find symbol
intent.setComponent(new ComponentName(packageName,
^
symbol: class ComponentName
location: class main
Note: src\b4a\example\service1.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error