PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 24 → BroadcastReceiver - This function need help to complete, was unable to operate the BroadcastReceiver
BroadcastReceiver - This function need help to complete, was unable to operate the BroadcastReceiver
Débuté par adrianoboller, 24 nov. 2014 12:04 - Aucune réponse
Membre enregistré
2 958 messages
Popularité : +89 (91 votes)
Posté le 24 novembre 2014 - 12:04
BroadcastReceiver - This function need help to complete, was unable to operate the BroadcastReceiver :(

//BroadcastReceiver

import android.app.Activity;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

PUBLIC static boolean BroadcastReceiver(string Aplicativo, string NomeClasse, string NomeAcao)
{
try {

IF (Aplicativo == null){
RETURN False;
}
ELSE{

Intent Apk = getActiviteEnCours().getPackageManager().getLaunchIntentForPackage(Aplicativo);
Apk.setClassName(Aplicativo, NomeClasse);
Apk.setAction(NomeAcao);
getActiviteEnCours().sendBroadcast(Apk);
RETURN True;

}

}
catch(EXCEPTION e) {
Log.e("WM",e.toString());
RETURN False;
}
}