理解RemoteViews

书上很多东西都过时了或者在Android8.0上会出现问题,下面的总结都是在Android8.0上运行成功的,会有一些需要注意的地方。

一、RemoteViews概述

1 ) RemoteViews

RemoteViews是可以在别的进程(系统进程)中显示的View,并且提供了一组跨进程更新它界面的操作。

2 ) 局限性

  • 由于运行在不同的进程中,所以RemoteViews无法像正常的View一样更新UI。
  • RemoteViews提供了一系列的set方法,但是这些set方法只是View全部方法的子集。
  • RemoteView支持的View的类型也是有限的。

3 ) 使用

1. 构造方法

最常用的是下面的这个构造方法,第一个参数是包名,第二个是加载的布局资源文件。

public RemoteViews(String packageName, int layoutId) {
    this(getApplicationInfo(packageName, UserHandle.myUserId()), layoutId);
}
2. 支持的View类型
  • FrameLayout、LinearLayout、RelativeLayout、GridLayout、AnalogClock、Button、Chronometer、ImageButton、ImageView、ProgressBar、TextView、ViewFlipper、ListView、GridView、StackView、AdapterViewFlipper、ViewStub。
  • 只支持上述的View,不支持它们的子类和其他类型的View,所以无法在RemoteViews中自定义View。
3. 提供的方法

RemoteViews没有提供findViewById(),因为无法直接访问View元素,必须通过RemoteView提供的一系列set方法。
详细看这里
比如:

public void setTextViewText (int viewId, CharSequence text)

传入布局id和需要设置的字,方法的声明很像是通过反射来完成的,事实上大部分set方法都是通过反射来完成的。

4 ) 应用场景

  1. 通知:通过NotificationManager的notify()实现。
  2. 桌面小部件 :通过AppWidgetProvider来实现。

二、RemoteViews通知的应用

1 ) 普通通知

  1. 判断api版本,8.0之后需要NotificationChannel创建Notification。
  2. 使用Builder模式向Notification里添加通知的各种样式。
  3. 使用NotificationManager发送Notification。
public void sendNotification() {

    String id = "utte_channel_01";
    String name="utte_channel";
    
    NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    Notification notification;
    Notification.Builder builder;
    
    if (manager != null) {
    
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
            // 8.0之后需要传入一个 channelId
            NotificationChannel mChannel = new NotificationChannel(id, name, NotificationManager.IMPORTANCE_LOW);
            manager.createNotificationChannel(mChannel);
            builder = new Notification.Builder(mContext, id);
        } else {
            // 8.0之前
            builder = new Notification.Builder(mContext);
        }
        
        // 构建通知 添加各种样式
        notification = builder
                .setTicker("h")
                .setContentTitle("hello")
                .setContentText("hello world")
                .setSmallIcon(R.drawable.ic_launcher_foreground)
                .setWhen(System.currentTimeMillis())
                .setAutoCancel(true) // 自动消除
                .setContentIntent(PendingIntent.getActivity(mContext, 0,
                        new Intent(this, MainActivity.class),
                        PendingIntent.FLAG_UPDATE_CURRENT)) // 设置跳转
                .build();
                
        // 发送通知
        manager.notify(0, notification);
    }
    
}

2 ) 自定义通知样式

  1. 使用RemoteViews去加载自定义布局。
  2. 利用RemoteViews中提供的set方法改变内容。
  3. 将RemoteViews添加进Notification。
// 使用remoteViews去加载自定义布局
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification_custom);

// 利用RemoteViews中提供的set方法改变布局内容
// 设置文字
remoteViews.setTextViewText(R.id.tv, "hello");
// 设置图片资源
remoteViews.setImageViewResource(R.id.im, R.drawable.aa);
PendingIntent imClickPendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
// 添加点击事件
remoteViews.setOnClickPendingIntent(R.id.im, imClickPendingIntent);

// 构建Notification
notification = builder
        // 向Notification中传入RemoteViews
        .setContent(remoteViews) 
        // 其它的属性添加......
        .build();

3 ) PendingIntent

上面有使用到PendingIntent这个东西,它实际上就是一个预备状态的Intent,RemoteViews如果需要设置单击事件,就必须使用PendingIntent。

a. PendingIntent支持的类型

PendingIntent支持三种intent:

  • getActivity(Context context, int requestCode,
    Intent intent, int flags)
  • getBroadcast(Context context, int requestCode,
    Intent intent, int flags)
  • getService(Context context, int requestCode,
    Intent intent, int flags)

当这些PendingIntent发生时,效果和startActivity()、sendBroadcaset()、startService()效果一样。

b. PendingIntent匹配规则

匹配即两个PendingIntent是相同的,需要满足下面两个要求:

  • 内部的Intent相同
    • ComponentName相同
    • intent-filter相同
    • 与Extras内容无关
  • requestCode相同
c. PendingIntent的FLAG
  • FLAG_ONE_SHOT:表示这个PendingIntent只能使用一次。
  • FLAG_NO_CREATE:如果描述的PendingIntent不存在,就直接返回null而不是创建。
  • FLAG_CANCEL_CURRENT:如果描述的PendingIntent已存在,就在产生新的之前取消当前的。
  • FLAG_UPDATE_CURRENT:如果描述的PendingIntent已存在,就保留它,但extras中的信息会替换成新的。
  • FLAG_IMMUTABLE:表示所创建的PendingIntent应该是可变的。

虽然有五种Flag,但是常用的是FLAG_ONE_SHOT、FLAG_CANCEL_CURRENT、FLAG_UPDATE_CURRENT。

d. 实例

为了更容易理解一些,在这里讨论manager.notify(0, notification)多次调用,每次id不同且PendingIntent匹配的情况下使用不同Flag产生的不同影响。

  • FLAG_ONE_SHOT:后续通知的PendingIntent会和第一个保持一致,包括Extras。单击任何一条通知后,其他通知都无法再打开。
  • FLAG_CANCEL_CURRENT:只有最新的通知可以打开,之前的都无法打开。
  • FLAG_UPDATE_CURRENT:之前通知PendingIntent的Extras都会更新为最后一个通知相同的,并且都能够打开。

为什么只讨论id不同且PendingIntent匹配的情况,是因为:

  • 如果每次的id相同,不管PendingIntent怎么样,后面的通知都会直接替换掉前面的通知。
  • 如果PendingIntent不匹配,那么不管用哪种Flag,通知之间都不会互相干扰。
e. 点击事件的PendingIntent

RemoteViews中不支持直接setOnClickListener()来设置点击事件,提供了下面的三种方法,给出它们的区别。

  • setOnClickPendingIntent()用于设置普通点击事件。
  • setPendingIntentTemplate()、setOnClickFillInIntent()组合使用,用来给集合类的View(比如ListView)的item设置点击事件。

三、RemoteViews桌面小部件的应用

AppWidgetProvider继承了BroadcastReceiver,所以它本质上是一个广播。

1 ) 定义小部件布局

在res/layout/下定义部件的布局。比如下面的widget.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/im"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:src="@drawable/aa"/>

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="START"/>

</RelativeLayout>

2 ) 定义小部件配置信息

在res/xml/下定义小部件的配置信息,其实也就是对应了AppWidgetProviderInfo封装的属性,比如下面的app_widget.xml:

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:initialLayout="@layout/widget"
    android:minHeight="84dp"
    android:minWidth="84dp"
    android:updatePeriodMillis="86400000" />

initialLayout是小部件的初始布局,minHeight和minWidth定义了最小尺寸,updatePeriodMillis定义了自动更新的周期,单位为毫秒。

这里还能声明很多属性,详细看这里

3 ) 定义小部件实现类

继承AppWidgetProvider去实现自己的需要。实现点击小部件后发送CLICK广播,开始跑计数。

public class SimpleAppWidget extends AppWidgetProvider {

    private static final String TAG = "SimpleAppWidget";
    public static final String CLICK = "com.utte.action.CLICK";

    public SimpleAppWidget() {
        super();
    }

    // 接收到广播时,此方法会被调用
    @Override
    public void onReceive(final Context context, Intent intent) {
        super.onReceive(context, intent);
        Log.d(TAG, "onReceive: " + intent.getAction());
        // 如果部件有自己的action,就判断,处理对应的广播
        if (CLICK.equals(intent.getAction())) {
            // 如果是CLICK的action,就开始一个线程去一直更新RemoteViews达到旋转的效果
            new Thread(new Runnable() {
                @Override
                public void run() {
                    AppWidgetManager manager = AppWidgetManager.getInstance(context);
                    RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);
                    for (int i = 0; i < 100; i++) {
                        remoteViews.setTextViewText(R.id.tv, i + "");// 设置数字
                        // 调用updateAppWidget去更新RemoteViews
                        manager.updateAppWidget(new ComponentName(context, SimpleAppWidget.class), remoteViews);
                        SystemClock.sleep(18);
                    }
                    remoteViews.setTextViewText(R.id.tv, "END");
                    // 调用updateAppWidget去更新RemoteViews
                    manager.updateAppWidget(new ComponentName(context, SimpleAppWidget.class), remoteViews);
                }
            }).start();
        }
    }

    // 部件添加或更新时会调用此方法
    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        super.onUpdate(context, appWidgetManager, appWidgetIds);
        final int count = appWidgetIds.length;
        Log.d(TAG, "onUpdate: " + count);
        for (int appWidgetId : appWidgetIds) {
            onWidgetUpdate(context, appWidgetManager, appWidgetId);
        }
    }

    private void onWidgetUpdate(Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
        Log.d(TAG, "onWidgetUpdate: " + appWidgetId);
        RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);
        Intent intent = new Intent(context, SimpleAppWidget.class);
        intent.setAction(CLICK);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
        // 保持Button设置点击事件,触发一个Intent,这里是发送广播
        remoteViews.setOnClickPendingIntent(R.id.im, pendingIntent);
        appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
    }

}

这里重写了两个方法,onReceive()和onUpdate(),分别会在接收到广播时和部件更新时被调用。

  • 在onReceive()中,判断了广播的action属性,如果是action为CLICK的广播,就利用RemoteViews更新小部件的文字。
  • 在onUpdate()中,遍历所有在桌面上的此部件的实例,利用RemoteViews设置图片的点击事件,点击发送CLICK广播。

除了常用的onUpdate(),其实还有一些方法,在一个广播到达时,onReceive()被调用,它会根据该广播的action去调用对应的onXXX(),分发过程可以从onReceive()源码中看出来,判断action后去调用onXXX()。

public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action)) {
        Bundle extras = intent.getExtras();
        if (extras != null) {
            int[] appWidgetIds = extras.getIntArray(AppWidgetManager.EXTRA_APPWIDGET_IDS);
            if (appWidgetIds != null && appWidgetIds.length > 0) {
                this.onUpdate(context, AppWidgetManager.getInstance(context), appWidgetIds);
            }
        }
    } 
    // ......
    } else if (AppWidgetManager.ACTION_APPWIDGET_ENABLED.equals(action)) {
        this.onEnabled(context);
    } else if (AppWidgetManager.ACTION_APPWIDGET_DISABLED.equals(action)) {
        this.onDisabled(context);
    } else if (AppWidgetManager.ACTION_APPWIDGET_RESTORED.equals(action)) {
        // ......
    }
}

这是这些方法的调用时机:

  • onEnable():小部件第一次添加到桌面时调用此方法,可以添加多次,但是只会在第一次添加时调用。
  • onUpdate():小部件被添加或更新时都会调用一次该方法。
  • onDelete():删除一次小部件就会调用一次该方法。
  • onDisabled():当最后一个该小部件的实例被删除时调用。
  • onReceive():广播的方法,用于分发给具体的事件。

这里有一点需要注意的是,《Android开发艺术探索》中,Intent使用的是:

Intent intent = new Intent();
intent.setAction(CLICK);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_ONE_SHOT);

这种方法会导致有些手机接收不到次CLICK的广播,需要使用下面这种方式:

Intent intent = new Intent(context, SimpleAppWidget.class);
intent.setAction(CLICK);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_ONE_SHOT);

坑了我好久才解决。

4 ) 在AndroidManifest.xml中声明小部件

小部件实质上是广播,所以需要注册,Android8.0虽然禁止了大部分静态广播的注册,但是没有去掉小部件的注册。

<receiver android:name=".SimpleAppWidget">
    <meta-data
        android:name="android.appwidget.provider"
        android:resource="@xml/app_widget">
    </meta-data>
    <intent-filter>
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
        <action android:name="com.utte.action.CLICK"/>
    </intent-filter>
</receiver>

intent-filter中添加了两个action,一个是小部件必须加的APPWIDGET_UPDATE,如果不写这个,此部件就不会出现在小部件列表中。另一个就是我们需要用于点击事件的CLICK的action了。

经过上面的四个步骤,一个简单的桌面小部件就完成了。

从上面两个例子中可以看出来,实现通知和实现桌面小部件,都依赖于RemoteViews去操作布局。

四、RemoteViews的工作过程

1 ) IPC场景的构成

  • NotificationManager和AppWidgetManager通过Binder分别和SystemServer进程中的NotificationManagerService以及AppWidgetService进行通信。
  • 通知栏和桌面小部件是在NotificationManagerService和AppWidgetService中被加载的。
  • 通知栏和桌面小部件是运行在系统的SystemServer中的。

2 ) 流程

  1. RemoteViews通过Binder传递到SystemServer进程。
    • RemoteViews实现了Parcelable接口。
  2. 系统根据RemoteViews中的包名等信息,获取该应用的资源。
  3. 通过LayoutInflater加载RemoteViews中的布局文件。
  4. 系统对RemoteViews执行一系列的界面更新任务。
    • 调用的一系列set方法,通过NotificationManager和AppWidgetManager来提交更新任务。
    • 提交的任务,这些更新并不是立即执行,会等到RemoteViews被加载好才执行。
    • RemoteViews内部会记录更新操作,到时机才会执行。
    • 具体操作还是在SystemServer中执行的。

3 ) View操作的封装

1. 为什么不去支持所有的操作?

系统完全可以支持使用Binder去支持所有的View和View操作,为什么没有这么做?

  • View的操作方法太多,会导致需要定义大量的Binder接口。
  • 大量的IPC操作会影响效率。

2. Action封装View操作

因为以上两个原因,所以系统并没有通过Binder去直接支持View的跨进程访问,而是提供了Action,Action实现了Parcelable,一个Action代表一个View操作。

  1. 每当调用一次set方法,就会将该View操作封装成一个Action。
  2. 当调用Manager提交更新的操作时,就会将这些Action传输到SystemServer进程中。
  3. 到达后,在SystemServer中调用RemoteViews的apply(),apply()会遍历所有的Action并依次其执行apply()。

3. RemoteViews的apply()

上面有提到在SystemServer中,是通过apply()去执行View操作的。

RemoteViews # apply()

RemoteViews的apply()首先是加载布局,然后加载动画资源,最后调用performApply()。

public View apply(Context context, ViewGroup parent, OnClickHandler handler) {
    RemoteViews rvToApply = getRemoteViewsToApply(context);
    // 加载布局
    View result = inflateView(context, rvToApply, parent);
    // 加载动画资源
    loadTransitionOverride(context, handler);
    // 分发执行apply()
    rvToApply.performApply(result, parent, handler);
    return result;
}
RemoteViews # performApply

在这个方法里,就看到分发调用的操作了。会遍历所有的Action,执行每一个Action的apply(),所以apply()才是真正操作View的地方。

private void performApply(View v, ViewGroup parent, OnClickHandler handler) {
    if (mActions != null) {
        handler = handler == null ? DEFAULT_ON_CLICK_HANDLER : handler;
        final int count = mActions.size();
        for (int i = 0; i < count; i++) {
            Action a = mActions.get(i);
            // 遍历调用每个Action的apply()
            a.apply(v, parent, handler);
        }
    }
}

在系统源码的BaseStatusBar的updateNotification()和AppWidgetHostView的updateAppWidget()中,都能找到调用RemoteViews的apply()和reapply()去更新的地方。

  • apply():能加载布局并且更新界面。
  • reapply():只会更新界面。

4. 一个实例

比如来看RemoteViews的setTextViewText()。

RemoteViews # setTextViewText()

这里传入的第二个参数是View操作的方法名,用于在后面的获取setText()的Methon对象。

public void setTextViewText(int viewId, CharSequence text) {
    setCharSequence(viewId, "setText", text);
}
RemoteViews # setCharSequence()

创建了一个ReflectionAction对象,调用addAction()传入此Action对象。

public void setCharSequence(int viewId, String methodName, CharSequence value) {
    addAction(new ReflectionAction(viewId, methodName, ReflectionAction.CHAR_SEQUENCE, value));
}
RemoteViews # addAction()

mActions也就是Action集合了。把上一步new的TextViewSizeAction加入了这个集合中。

private ArrayList<Action> mActions;
// ......
private void addAction(Action a) {
    // ......
    if (mActions == null) {
        mActions = new ArrayList<Action>();
    }
    mActions.add(a);
    // ......
}
ReflectionAction

这个类继承了Action,主要看apply(),其中,先拿到对应的View实例,然后获取View操作的Method对象,最后执行View操作。

private final class ReflectionAction extends Action {
    
    // ......
    
    // 以反射的方式调用View操作
    @Override
    public void apply(View root, ViewGroup rootParent, OnClickHandler handler) {
        final View view = root.findViewById(viewId);
        if (view == null) return;
        // 获取value类型
        Class<?> param = getParameterType();
        if (param == null) {
            throw new ActionException("bad type: " + this.type);
        }
        try {
            // 获取View操作的方法并执行
            getMethod(view, this.methodName, param).invoke(view, wrapArg(this.value));
        } catch (ActionException e) {
            throw e;
        } catch (Exception ex) {
            throw new ActionException(ex);
        }
    }
    
    // ......
    
}

使用ReflectionAction的set方法非常多,就像名字一样,是通过反射来实现的。当然也有其他的Action实现,比如TextViewSizeAction,这个Action没有使用反射,直接调用了View操作的方法。

五、RemoteViews跨进程更新UI实践

如果一个进程需要去更新另一个进程的UI,就可以使用RemoteViews。当然也可以使用前面讲过的IPC方式,考虑到如果对界面更改频繁,RemoteViews的性能会更优一些。对比IPC方式,RemoteViews也会有缺陷,最大的缺陷就是支持的View种类有限。

我们用两个Activity模拟跨进程,一个Activity创建RemoteViews,通过广播发送给另一个进程中的Activity让它显示。

实现:

AndroidManifest.xml
<activity
    android:name=".AActivity"
    android:process=":remote" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity android:name=".BActivity">
</activity>
AActivity
public class AActivity extends AppCompatActivity {
    private LinearLayout mContent;
    private static final String TAG = "AActivity";
    private BroadcastReceiver mReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            Log.d(TAG, "onReceive: ");
            RemoteViews remoteViews = intent.getParcelableExtra("remoteViews");
            if (remoteViews != null) {
                Log.d(TAG, "onReceive: ");
                View view = remoteViews.apply(context, mContent);
                mContent.addView(view);
            }
        }
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_a);
        mContent = findViewById(R.id.ll);
        IntentFilter filter = new IntentFilter();
        filter.addAction("com.utte.MYBroadcast");
        registerReceiver(mReceiver, filter);
    }
    @Override
    protected void onDestroy() {
        unregisterReceiver(mReceiver);
        super.onDestroy();
    }
    public void onClick(View view) {
        startActivity(new Intent(AActivity.this, BActivity.class));
    }
}
BActivity
public class BActivity extends AppCompatActivity {
    private static final String TAG = "BActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_b);
    }
    public void onClick(View view) {
        RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.widget);
        remoteViews.setTextViewText(R.id.tv, "from BActivity");
        Intent intent = new Intent();
        intent.setAction("com.utte.MYBroadcast");
        Log.d(TAG, "onClick: ");
        intent.putExtra("remoteViews", remoteViews);
        sendBroadcast(intent);
    }
}

运行情况就是首先打开了AActivty,onCreate()时注册了广播监听。按下按钮进入BActivty,点击按钮发送携带RemoteViews的广播。这时返回AActivity就会发现RemoteViews显示在上面。其实这里的AActivty模拟的就是通知栏或是桌面。

如果真正运行在两个应用中,会在下面这段代码中出现问题。

View view = remoteViews.apply(context, mContent);
mContent.addView(view);

当RemoteViews的布局资源文件传输到AActivty时,布局文件的id可能是无效。所以需要使用布局资源文件名来加载。修改如下,先确定id,加载布局,调用reapply()更新RemoteViews,最后add。

int layoutId = getResources().getIdentifier("widget", "layout", getPackageName());
View view = getLayoutInflater().inflate(layoutId, mContent, false);
remoteViews.reapply(context, view);
mContent.addView(view);
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,524评论 5 460
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,869评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,813评论 0 320
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,210评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,085评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,117评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,533评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,219评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,487评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,582评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,362评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,218评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,589评论 3 299
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,899评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,176评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,503评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,707评论 2 335

推荐阅读更多精彩内容