我想从Parse接收推送通知并打开List活动并在开始活动之前使用intent.putextra("dataFromParse").我能够接收推送,但只使用以下命令打开MainActivity:
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
Run Code Online (Sandbox Code Playgroud)
我希望将此作为默认值,但也应该能够启动List活动.我也试过使用客户接收器,但是我只能在接收推送时直接打开活动,而不是点击它.
manifest.xml文件:
<receiver android:name="com.example.Push android:exported="false">
<intent-filter>
<action android:name="com.example.UPDATE_STATUS" />
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud)
Push.java:
public class Push extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//Start activity
}
}
Run Code Online (Sandbox Code Playgroud)
我不确定的是我应该如何在后台捕获推送,并说当用户单击通知时它应该使用特定的intent.putExtra("dataFromParse")打开List活动.我应该在哪里编码以及如何编码?在MainActivity中,在List活动中,还是在客户接收器上执行其他操作?
notifications android broadcastreceiver push-notification parse-platform
我在listView中有一个imageView.设置如下:main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@+id/listView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
image.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="center"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这很好用,用http请求从url填充许多图像.但我的图像大小有问题.无论分辨率或大小如何,我希望它们填满屏幕.试过不同的布局高度,宽度和scaleType但不能让它正常工作.
第一个图像是它现在的样子,第二个图像是我想要它的样子.
编辑:尝试使用scaleType ="fitXY",这给了我100%的宽度,但在较长的图像上是一个坏的高度.

我正在使用Json.net进行序列化,然后创建一个如下所示的JObject:
"RegistrationList": [
{
"CaseNumber": "120654-1330",
"Priority": 5,
"PersonId": 7,
"Person": {
"FirstName": "",
"LastName": "",
},
"UserId": 7,
"User": {
"Id": 7,
"CreatedTime": "2013-07-05T13:09:57.87",
"Comment": "",
},
Run Code Online (Sandbox Code Playgroud)
我如何查询到一个新的对象或列表,这很容易放入一些html表/视图.我只想显示CaseNumber,FirstName和Comment.