我有一个本机应用程序,默认语言是英语.我有一个个人资料页面,用户可以在其中将语言从英语更改为另一种语言.当用户保存语言更改时,包括标题,抽屉导航名称在内的语言都应更改为用户选择的语言.我们如何在本机中实现此功能?
我正在使用 Retrofit 2.0 以 pojo 类的 post 请求的形式发布数据,并返回字符串作为失败或成功的响应,现在的问题是它说 json 不能被使用。
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:okhttp:2.4.0
Run Code Online (Sandbox Code Playgroud)
现在我尝试发布 jsonobect,如下所示。我的pojo类如下
public class RecruiterProfileModel implements Serializable
{
@SerializedName("fname")
private String firstname;
@SerializedName("lname")
private String lastname;
@SerializedName("company")
private String companyName;
@SerializedName("address")
private String address;
@SerializedName("email")
private String email;
@SerializedName("paswd")
private String password;
@SerializedName("ph")
private String phone;
@SerializedName("location")
private String location;
@SerializedName("city")
private String city;
@SerializedName("state")
private String state;
@SerializedName("contry")
private String contry;
@SerializedName("pincode")
private String pincode;
@SerializedName("landmark")
private String landmark;
public RecruiterProfileModel(String …Run Code Online (Sandbox Code Playgroud) 我有一个全屏活动,但是当我在其上方显示警报对话框时,系统 UI 显示(系统通知栏)。有谁能够帮助我 ?我不想让它被看见。有什么方法可以隐藏系统通知栏,使其在警报对话框出现时不显示?


我的React Native项目中有一个领域数据库。我想在另一页中更新语言的值。我最初能够写入该值,但是我是否坚持对其进行更新。下面是我的代码。
配置文件架构(领域数据库架构)
“严格使用”;
import Realm from 'realm';
class Profile extends Realm.Object {}
Profile.schema = {
name: 'Profile',
properties: {
Onetime: 'string',
Name: 'string',
Email: 'string',
Phone: 'string',
Language:'string',
Url:'string',
},
};
export default new Realm({schema: [Profile]});
Run Code Online (Sandbox Code Playgroud)
加载初始数据
let objects = realm.objects('Profile');
var name,url,phone,onetime;
if (firebase.auth().currentUser.displayName == null ) {
onetime= 'true';
name= 'Name';
url = 'https://media2.giphy.com/media/sbLpwwHlgls8E/giphy.gif';
phone = '0000000000';
}
else {
onetime= 'true';
name=firebase.auth().currentUser.displayName;
url=firebase.auth().currentUser.photoURL;
phone = '0000000000';
}
if (objects.length == 0) {
realm.write(() => {
realm.create('Profile', …Run Code Online (Sandbox Code Playgroud)