20160817

  • react native 中 pageA->pageB 想在pageB返回时刷新pageA的内容

    方案一:

    props传递
    

    方案二:

    DeviceEventEmitter
    
  • sina微博 授权未安装客户端登陆出错:

    android.content.ActivityNotFoundException: Unable to find explicit activity class {edu.gdut.myweibo/
    
    com.sina.weibo.sdk.component.WeiboSdkBrowser}; have you declared this 
    
    activity in your AndroidManifest.xml?
    

    在Manifest.xml中注入SDK的WebBrowser

    <activity
        android:name="com.sina.weibo.sdk.component.WeiboSdkBrowser"
        android:configChanges="keyboardHidden|orientation"
        android:exported="false"
        android:windowSoftInputMode="adjustResize" >
    </activity>
    
  • react native 再次点击退出

    onBackAndroid() {
       let routers = this.nav.getCurrentRoutes();
     if (this.nav && routers.length > 1) {
           this.nav.pop();
          return true;
    }
    
    let current = new Date().getTime();
        if (current - last > 2000) {
      last = current;
      ToastAndroid.show('再次点击退出', 1000);
      return true;
        } else {
          return false;
            }
      }