小编san*_*oid的帖子

iOs将故事板方向设置为横向

我希望在Storyboard 中将View Controller的方向设置为landscape.我引用了以下链接,但无法在任何地方找到"方向"选项(附上截图) 在此输入图像描述

链接提到:

使用Storyboard在景观中进行设计

iOS 7 XCode 5 Storyboard将方向设置为横向

xcode storyboard orientation ios xcode8

14
推荐指数
1
解决办法
1万
查看次数

PANIC:缺少'arm'CPUS的模拟器引擎程序

我得到了与下面链接中提到的相同的问题.但是这个问题已被搁置,我仍在寻求解决方案. /sf/ask/1900255801/

所以我想在这里提出问题并提出问题.直到昨天,模拟器工作正常.但是从今天起,我在尝试打开模拟器时收到以下错误

PANIC: Missing emulator engine program for 'arm' CPUS
Run Code Online (Sandbox Code Playgroud)

我的AVD: AVD

这是我收到的错误:

在此输入图像描述

我已经通过SDK Manager更新并安装了组件,我甚至尝试重启eclipse和我的电脑.我尝试创建新的AVD但这里没有任何作用.

先感谢您.

eclipse android arm android-emulator

8
推荐指数
2
解决办法
2万
查看次数

Android:在viewpager片段之间传递数据的最佳方法

我在ViewPager活动中有3个片段.所有3个片段都有输入字段.在这里,我试图将前两个片段数据传递给第三个片段.我在这里阅读了一些帖子,其中大多数建议使用接口(即通过父活动传递数据)我也经历了这个链接 http://developer.android.com/training/basics/fragments/communicating.html

接口:当我们通过某个用户事件发送数据时,使用接口是很好的方法.这里我试图在没有任何用户事件的情况下发送数据.因此我想到onPause()因为总是调用onPause().但ViewPager的功能不同.加载片段时,也会加载相邻的片段.我会成功地在第一个片段和第三个片段之间传递数据.但是第二个片段的onPause()不会被调用,除非我导航到一些与它不相邻的片段(在我的情况下不存在)

Setter/Getters:我在几篇文章中读过人们说不使用二传手/吸气剂(我还没有理解原因)吸气鬼和二传手设计不佳?看到矛盾的建议

捆绑:我还没考虑过这个.由于我在这里再次感到困惑,我将如何使用bundle传递数据.(我应该在哪个方法中发送数据?以及如何?)

对不起,如果我的问题听起来很愚蠢.我正在尝试理解片段,我想知道在viewpager中片段之间传递数据的最佳方法.先感谢您.

TabPAgerAdapter - >

  package com.jbandroid.model;

import com.jbandroid.fragment.LocationInfoFragment;
import com.jbandroid.fragment.PersonalInfoFragment;
import com.jbandroid.fragment.PostInfoFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class TabsPagerAdapter extends FragmentPagerAdapter {

    public TabsPagerAdapter(FragmentManager fm){
        super(fm);
    }


    @Override
    public Fragment getItem(int index) {

        switch(index) {

        case 0 : //PostInfoFragment
                         return new PostInfoFragment();

        case 1 : //LocationInfoFragment
                        return new LocationInfoFragment();

        case 2 : //PersonalInfoFragment
                         return new PersonalInfoFragment();

        }

        return null;
    }

    @Override
    public int getCount() {
        // get item count - …
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-viewpager

6
推荐指数
2
解决办法
2万
查看次数

离子检查文件(路径,文件名)NOT_FOUND_ERR

文件路径 - file:///data/data/io.ionic.starter/data.json

我想检查提到的路径中是否存在“ data.json ”。

但是我收到一个错误 -{"code":1,"message":"NOT_FOUND_ERR"} 目前该文件不存在于路径中,所以我希望Promise<>返回false,但最终会引发错误。

示例代码:

var fileName = "data.json";
     this.file.checkFile(this.file.applicationStorageDirectory, fileName)
    .then((result) => {
    console.log('file exists :' + result);
    },(error){
    console.log('error : ' + JSON.stringify(error)});
Run Code Online (Sandbox Code Playgroud)

android ionic-framework ionic2 ionic-native

5
推荐指数
1
解决办法
4641
查看次数

JSONObject["locationInfo"] 不是字符串

很抱歉重复提问。几个小时以来,我一直在思考这个问题。我正在尝试将 json 解析为 setter/getter 类的对象。

String location = request.getParameter("location");
System.out.print(location);

org.json.JSONObject json = new org.json.JSONObject(location);
/* JSONObject js = json.getJSONObject("locationInfo");
String mapLoc = js.getString("locationInfo"); */
String mapLoc = json.getString("locationInfo");  <--- receiving the error on this line

Gson gsn = new Gson();
MapObject mLocObj = gsn.fromJson(mapLoc, MapObject.class);
System.out.println(mLocObj.getLongitude());
double longitude = Double.parseDouble(mLocObj.getLongitude());
double latitude = Double.parseDouble(mLocObj.getLatitude());
Run Code Online (Sandbox Code Playgroud)

这是我的 json 字符串位置:

{"locationInfo":{"latitude":"19.3828815","longitude":"72.8296205"}}
Run Code Online (Sandbox Code Playgroud)

这是错误日志:

19: System.out.print(location);
20: 
21: org.json.JSONObject json = new org.json.JSONObject(location);
22: String mapLoc = json.getString("locationInfo");
23: 
24:     Gson gsn = new …
Run Code Online (Sandbox Code Playgroud)

java json gson

2
推荐指数
1
解决办法
2万
查看次数