forked from organicmaps/organicmaps
[android, test] Receiver for tasks.
This commit is contained in:
parent
f87a0fc96b
commit
1f466460ee
4 changed files with 42 additions and 5 deletions
|
@ -38,9 +38,9 @@
|
|||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<!-- Used by instrumentation tests only. Do not include in production apps unless necessary! -->
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<!-- Used by instrumentation tests only. Do not include in production apps unless necessary! -->
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
|
@ -204,6 +204,12 @@
|
|||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
|
||||
<receiver android:name="com.mapswithme.test.TestEventsReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="mwmtest" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="MapsWithMePro" default="help">
|
||||
<project name="MapsWithMeTest" default="help">
|
||||
|
||||
<property name="mwm.tools.dir" value="../../tools"/>
|
||||
<property name="mwm.data.dir" value="../../../data"/>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.mapswithme.test;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mapswithme.maps.MWMActivity;
|
||||
import com.mapswithme.maps.MWMActivity.OpenUrlTask;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.SimpleLogger;
|
||||
|
||||
public class TestEventsReceiver extends BroadcastReceiver
|
||||
{
|
||||
|
||||
|
||||
Logger l = SimpleLogger.get("TestBro");
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
l.d(intent.toString());
|
||||
final String uri = intent.getStringExtra("uri");
|
||||
l.d(uri);
|
||||
|
||||
MWMActivity.OpenUrlTask oTask = new OpenUrlTask(uri);
|
||||
|
||||
intent = new Intent(context, MWMActivity.class);
|
||||
intent.putExtra(MWMActivity.EXTRA_TASK, oTask);
|
||||
}
|
||||
|
||||
}
|
|
@ -1124,5 +1124,5 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
|
||||
private native boolean nativeIsInChina(double lat, double lon);
|
||||
|
||||
private native boolean setViewPortByUrl(String url);
|
||||
public native boolean setViewPortByUrl(String url);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue