Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java IllegalArgumentException:值的类型无效:class android.widget.SeekBar_Java_Android_Android Layout_Android Activity_Parse Platform - Fatal编程技术网

Java IllegalArgumentException:值的类型无效:class android.widget.SeekBar

Java IllegalArgumentException:值的类型无效:class android.widget.SeekBar,java,android,android-layout,android-activity,parse-platform,Java,Android,Android Layout,Android Activity,Parse Platform,活动启动后,单击profileactivity页面上的确认按钮时,我收到以下错误: IllegalArgumentException: invalid type for value: class android.widget.SeekBar 我基本上是在尝试记录各种信息,比如解析,以便以后能够检索它。 下面是日志 08-13 14:56:24.366: E/AndroidRuntime(1306): FATAL EXCEPTION: main 08-13 15:49:13.758: E/And

活动启动后,单击profileactivity页面上的确认按钮时,我收到以下错误:

IllegalArgumentException: invalid type for value: class android.widget.SeekBar
我基本上是在尝试记录各种信息,比如解析,以便以后能够检索它。 下面是日志

08-13 14:56:24.366: E/AndroidRuntime(1306): FATAL EXCEPTION: main
08-13 15:49:13.758: E/AndroidRuntime(1365): FATAL EXCEPTION: main
08-13 15:49:13.758: E/AndroidRuntime(1365): Process: com.dooba.beta, PID: 1365
08-13 15:49:13.758: E/AndroidRuntime(1365): java.lang.IllegalArgumentException: invalid type for value: class android.widget.SeekBar
08-13 15:49:13.758: E/AndroidRuntime(1365):     at com.parse.ParseObject.put(ParseObject.java:2152)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at com.parse.ParseUser.put(ParseUser.java:315)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at com.dooba.beta.ProfileCreation$1.onClick(ProfileCreation.java:136)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at android.view.View.performClick(View.java:4438)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at android.view.View$PerformClick.run(View.java:18422)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at android.os.Handler.handleCallback(Handler.java:733)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at android.os.Handler.dispatchMessage(Handler.java:95)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at android.os.Looper.loop(Looper.java:136)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at android.app.ActivityThread.main(ActivityThread.java:5017)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at java.lang.reflect.Method.invokeNative(Native Method)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at java.lang.reflect.Method.invoke(Method.java:515)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-13 15:49:13.758: E/AndroidRuntime(1365):     at dalvik.system.NativeStart.main(Native Method)
更新代码

公共类概要文件创建扩展了活动{

private static final int RESULT_LOAD_IMAGE = 1;
FrameLayout layout;
Button save;
protected EditText mName;
protected EditText mAge;
protected EditText mHeadline;
protected ImageView mprofilePicture;
RadioButton male, female;
String gender;
RadioButton lmale, lfemale;
String lgender;
protected SeekBar seekBarMinimum;
protected SeekBar seekBarMaximum;
protected SeekBar seekBarDistance;


protected Button mConfirm;


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile_creation);

    RelativeLayout v = (RelativeLayout) findViewById(R.id.main); 

    v.requestFocus();

    Parse.initialize(this, "ID", "ID");

    mName = (EditText)findViewById(R.id.etxtname);
    mAge = (EditText)findViewById(R.id.etxtage);
    mHeadline = (EditText)findViewById(R.id.etxtheadline);
    mprofilePicture = (ImageView)findViewById(R.id.profilePicturePreview);
    male = (RadioButton)findViewById(R.id.rimale);
    female = (RadioButton)findViewById(R.id.rifemale);
    lmale = (RadioButton)findViewById(R.id.rlmale);
    lfemale = (RadioButton)findViewById(R.id.rlfemale);
    seekBarMinimum = (SeekBar) findViewById(R.id.sbseekBarMinimumAge);
    seekBarMaximum = (SeekBar) findViewById(R.id.sbseekBarMaximumAge);
    seekBarDistance = (SeekBar) findViewById(R.id.sbseekBarDistance);



    mConfirm = (Button)findViewById(R.id.btnConfirm);
    mConfirm.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            String name = mName.getText().toString();
            String age = mAge.getText().toString();
            String headline = mHeadline.getText().toString();




            age = age.trim();
            name = name.trim();
            headline = headline.trim();

            if (age.isEmpty() || name.isEmpty() || headline.isEmpty()) {
                AlertDialog.Builder builder = new AlertDialog.Builder(ProfileCreation.this);
                builder.setMessage(R.string.signup_error_message)
                    .setTitle(R.string.signup_error_title)
                    .setPositiveButton(android.R.string.ok, null);
                AlertDialog dialog = builder.create();
                dialog.show();
            }
            else {
                // create the new user!
                setProgressBarIndeterminateVisibility(true);

                ParseUser currentUser = ParseUser.getCurrentUser();





                if(male.isChecked())
                    gender = "Male";
                else
                    gender = "Female";

                if(lmale.isChecked())
                    lgender = "Male";
                else
                    lgender = "Female";


                currentUser.put("Name", name); 
                currentUser.put("Age", age); 
                currentUser.put("Headline", headline); 
                currentUser.put("Gender", gender);
                currentUser.put("Looking_Gender", lgender);
                currentUser.put("Minimum_Age", seekBarMinimum.getProgress());
                currentUser.put("Maximum_Age", seekBarMaximum.getProgress());
                currentUser.put("Maximum_Distance_Age", seekBarDistance.getProgress());




                currentUser.saveInBackground(new SaveCallback() {
                    @Override
                    public void done(ParseException e) {
                        setProgressBarIndeterminateVisibility(false);

                        if (e == null) {
                            // Success!
                            Intent intent = new Intent(ProfileCreation.this, MoodActivity.class);
                            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                            startActivity(intent);
                        }
                        else {
                            AlertDialog.Builder builder = new AlertDialog.Builder(ProfileCreation.this);
                            builder.setMessage(e.getMessage())
                                .setTitle(R.string.signup_error_title)
                                .setPositiveButton(android.R.string.ok, null);
                            AlertDialog dialog = builder.create();
                            dialog.show();
                        }
                    }
                });
            }
        }
    });



    SeekBar seekBar = (SeekBar) findViewById(R.id.sbseekBarDistance);
    final TextView seekBarValue = (TextView) findViewById(R.id.tvseekBarDistanceValue);

    seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress,
                boolean fromUser) {
            // TODO Auto-generated method stub 
            seekBarValue.setText(String.valueOf(progress));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub 
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub 
        }

    }); // Add this

    Button mcancel = (Button)findViewById(R.id.btnBack);
    mcancel.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ProfileCreation.this.startActivity(new Intent(ProfileCreation.this, LoginActivity.class));
        }
    });




    SeekBar seekBarMinimum = (SeekBar) findViewById(R.id.sbseekBarMinimumAge);
    final TextView txtMinimum = (TextView) findViewById(R.id.tvMinAge);

    seekBarMinimum.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress,
                boolean fromUser) {
            // TODO Auto-generated method stub 
            txtMinimum.setText(String.valueOf(progress));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub 
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub 
        }

    }); // Add this

    SeekBar seekBarMaximum = (SeekBar) findViewById(R.id.sbseekBarMaximumAge);
    final TextView txtMaximum = (TextView) findViewById(R.id.tvMaxAge);

    seekBarMaximum.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress,
                boolean fromUser) {
            // TODO Auto-generated method stub 
            txtMaximum.setText(String.valueOf(progress));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub 
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub 
        }

    }); // Add this




    Button buttonLoadImage = (Button) findViewById(R.id.btnPictureSelect);
    buttonLoadImage.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
            Intent i = new Intent(
                    Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            startActivityForResult(i, RESULT_LOAD_IMAGE);
        }
    });

} 

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK
                && null != data) {
            Uri selectedImage = data.getData();
            String[] filePathColumn = { MediaStore.Images.Media.DATA };

            Cursor cursor = getContentResolver().query(selectedImage,
                    filePathColumn, null, null, null);
            cursor.moveToFirst();

            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
            String picturePath = cursor.getString(columnIndex);
            cursor.close();

            ImageView imageView = (ImageView) findViewById(R.id.profilePicturePreview);
            imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));

        }

    }

    private byte[] readInFile(String path) throws IOException {
        // TODO Auto-generated method stub
        byte[] data = null;
        File file = new File(path);
        InputStream input_stream = new BufferedInputStream(new FileInputStream(
                file));
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        data = new byte[16384]; // 16K
        int bytes_read;
        while ((bytes_read = input_stream.read(data, 0, data.length)) != -1) {
            buffer.write(data, 0, bytes_read);
        }
        input_stream.close();
        return buffer.toByteArray();

    }
}
布局代码

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollProfile"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/dark_texture_blue" >

<RelativeLayout
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="797dp"
    android:gravity="center"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/profilePicturePreview"
        android:layout_width="132dp"
        android:layout_height="120dp"
        android:layout_below="@+id/textView5"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="7dp"
        android:layout_marginBottom="9dp"
        android:padding="3dp"
        android:scaleType="centerCrop"
        android:cropToPadding="true"
        android:background="@drawable/border_image"
        android:alpha="1" />

    <Button
        android:id="@+id/bRemove"
        android:layout_width="120dp"
        android:layout_height="60dp"
        android:layout_above="@+id/etxtage"
        android:layout_alignLeft="@+id/etxtname"
        android:alpha="0.8"
        android:background="#330099"
        android:text="Upload from Facebook"
        android:textColor="#ffffff"
        android:textSize="17sp"
        android:textStyle="bold" />

    <Button
        android:id="@+id/btnPictureSelect"
        android:layout_width="118dp"
        android:layout_height="60dp"
        android:layout_alignRight="@+id/etxtname"
        android:layout_below="@+id/profilePicturePreview"
        android:layout_marginRight="8dp"
        android:alpha="0.8"
        android:background="#000000"
        android:onClick="pickPhoto"
        android:text="Select photo from gallery"
        android:textColor="#ffffff"
        android:textSize="17sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/textView6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView4"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="9dp"
        android:text="Preferred Name"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="#ADD8E6"
        android:textSize="20sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="39dp"
        android:gravity="center"
        android:text="Profile Creation"
        android:textColor="#ffffff"
        android:textSize="28sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <EditText
        android:id="@+id/etxtname"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView6"
        android:layout_centerHorizontal="true"
        android:ems="10"
        android:enabled="true"
        android:hint="Please type your name here"
        android:inputType="textPersonName"
        android:textColor="#ffffff"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/etxtname"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="8dp"
        android:text="Upload your Profile Picture"
        android:textColor="#f2f2f2"
        android:textSize="18sp"
        android:textStyle="bold"
        android:typeface="sans" />

    <RadioGroup
        android:id="@+id/radioGroup1"
        android:layout_width="wrap_content"
        android:layout_alignLeft="@+id/etxtheadline"
        android:layout_height="wrap_content"
        android:layout_below="@+id/texperience"
        android:layout_toLeftOf="@+id/textView3" >

        <RadioButton
            android:id="@+id/rimale"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:text="Male"
            android:textColor="#f2f2f2" />

        <RadioButton
            android:id="@+id/rifemale"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Female"
            android:textColor="#f2f2f2" />
    </RadioGroup>

    <SeekBar
        android:id="@+id/sbseekBarDistance"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView12"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="11dp"
        android:progress="50" />

    <RadioGroup
        android:id="@+id/radioGroup3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView4"
        android:layout_alignTop="@+id/radioGroup2"
        android:layout_marginTop="10dp" >
    </RadioGroup>

    <RadioGroup
        android:id="@+id/radioGroup2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/etxtheadline"
        android:layout_below="@+id/textView2" >

        <RadioButton
            android:id="@+id/rlmale"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:text="Male"
            android:textColor="#f2f2f2" />

        <RadioButton
            android:id="@+id/rlfemale"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Female"
            android:textColor="#f2f2f2" />
    </RadioGroup>

    <SeekBar
        android:id="@+id/sbseekBarMinimumAge"
        android:layout_width="220dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView7"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="11dp"
        android:progress="25" />

    <TextView
        android:id="@+id/textView7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/etxtage"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="20dp"
        android:text="Minimum Age Looking For"
        android:textColor="#f2f2f2"
        android:textSize="16sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <TextView
        android:id="@+id/tvseekBarDistanceValue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/tvMinAge"
        android:layout_below="@+id/sbseekBarDistance"
        android:text="50"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="#f2f2f2"
        android:textSize="20sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <TextView
        android:id="@+id/textView12"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/radioGroup1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="19dp"
        android:text="Search Distance "
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="#ADD8E6"
        android:textSize="20sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <TextView
        android:id="@+id/tvMinAge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/sbseekBarMinimumAge"
        android:layout_centerHorizontal="true"
        android:text="25"
        android:textColor="#f2f2f2"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/textView8"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tvMaxAge"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="15dp"
        android:text="Headline"
        android:textColor="#ADD8E6"
        android:textSize="20sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <TextView
        android:id="@+id/textView14"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tvMinAge"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="15dp"
        android:text="Maximum Age Looking For"
        android:textColor="#f2f2f2"
        android:textSize="16sp"
        android:textStyle="bold"
        android:typeface="serif" />

    <SeekBar
        android:id="@+id/sbseekBarMaximumAge"
        android:layout_width="221dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView14"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="11dp"
        android:progress="50" />

    <TextView
        android:id="@+id/tvMaxAge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/sbseekBarMaximumAge"
        android:layout_centerHorizontal="true"
        android:text="50"
        android:textColor="#f2f2f2"
        android:textSize="18sp" />

    <TextView
        android:id="@+id/conditions"
        android:layout_width="280dp"
        android:layout_height="130dp"
        android:layout_below="@+id/btnConfirm"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="7dp"
        android:layout_marginTop="7dp"
        android:alpha="0.6"
        android:gravity="center"
        android:text="@string/disclaimer"
        android:textColor="#99CCFF"
        android:textSize="12sp" />

    <Button
        android:id="@+id/btnConfirm"
        android:layout_width="120dp"
        android:layout_height="60dp"
        android:layout_below="@+id/tvseekBarDistanceValue"
        android:layout_marginBottom="7dp"
        android:layout_marginTop="14dp"
        android:layout_toRightOf="@+id/tvseekBarDistanceValue"
        android:alpha="0.8"
        android:background="#151B54"
        android:text="Confirm"
        android:textColor="#ffffff"
        android:textSize="17sp"
        android:textStyle="bold" />

    <EditText
        android:id="@+id/etxtheadline"
        android:layout_width="270dp"
        android:layout_height="70dp"
        android:layout_below="@+id/textView8"
        android:layout_centerHorizontal="true"
        android:hint="A quick description of yourself"
        android:singleLine="true"
        android:textAlignment="center"
        android:textColor="#f2f2f2"
        android:textSize="18dp" >

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/etxtage"
        android:layout_width="230dp"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView4"
        android:layout_below="@+id/btnPictureSelect"
        android:layout_marginTop="48dp"
        android:ems="10"
        android:hint="Please type your age here"
        android:inputType="number"
        android:maxLength="2"
        android:textAlignment="center"
        android:textColor="#f2f2f2"
        android:textSize="18dp" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/radioGroup1"
        android:layout_alignRight="@+id/btnConfirm"
        android:text="Looking for"
        android:textColor="#ADD8E6"
        android:textSize="20sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/texperience"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/radioGroup1"
        android:layout_below="@+id/etxtheadline"
        android:layout_marginTop="39dp"
        android:text="I am a"
        android:textColor="#ADD8E6"
        android:textSize="20sp"
        android:textStyle="bold" />

    <Button
        android:id="@+id/btnBack"
        android:layout_width="120dp"
        android:layout_height="60dp"
        android:layout_alignBaseline="@+id/btnConfirm"
        android:layout_alignBottom="@+id/btnConfirm"
        android:layout_alignLeft="@+id/radioGroup1"
        android:alpha="0.8"
        android:background="#25383C"
        android:text="Back"
        android:textColor="#ffffff"
        android:textSize="17sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/bRemove"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="19dp"
        android:text="Age"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="#ADD8E6"
        android:textSize="20sp"
        android:textStyle="bold"
        android:typeface="serif" />

</RelativeLayout>

</ScrollView>

提前谢谢

currentUser.put("Minimum_Age", seekBarMinimum);
currentUser.put("Maximum_Age", seekBarMaximum);
currentUser.put("Maximum_Distance_Age", seekBarDistance);
这里不是设置seekbar值,而是设置seekbar本身

使用以下命令:

currentUser.put("Minimum_Age", seekBarMinimum.getProgress());
currentUser.put("Maximum_Age", seekBarMaximum.getProgress());
currentUser.put("Maximum_Distance_Age", seekBarDistance.getProgress());
这里不是设置seekbar值,而是设置seekbar本身

使用以下命令:

currentUser.put("Minimum_Age", seekBarMinimum.getProgress());
currentUser.put("Maximum_Age", seekBarMaximum.getProgress());
currentUser.put("Maximum_Distance_Age", seekBarDistance.getProgress());
这里不是设置seekbar值,而是设置seekbar本身

使用以下命令:

currentUser.put("Minimum_Age", seekBarMinimum.getProgress());
currentUser.put("Maximum_Age", seekBarMaximum.getProgress());
currentUser.put("Maximum_Distance_Age", seekBarDistance.getProgress());
这里不是设置seekbar值,而是设置seekbar本身

使用以下命令:

currentUser.put("Minimum_Age", seekBarMinimum.getProgress());
currentUser.put("Maximum_Age", seekBarMaximum.getProgress());
currentUser.put("Maximum_Distance_Age", seekBarDistance.getProgress());

我在添加动态单选组和按钮时遇到了同样的问题, 最后,我在特定活动的宣言文件中添加了以下代码:

<activity android:name="Activity_" 
            android:configChanges="orientation|keyboardHidden|screenSize">

我在添加动态单选组和按钮时遇到了同样的问题, 最后,我在特定活动的宣言文件中添加了以下代码:

<activity android:name="Activity_" 
            android:configChanges="orientation|keyboardHidden|screenSize">

我在添加动态单选组和按钮时遇到了同样的问题, 最后,我在特定活动的宣言文件中添加了以下代码:

<activity android:name="Activity_" 
            android:configChanges="orientation|keyboardHidden|screenSize">

我在添加动态单选组和按钮时遇到了同样的问题, 最后,我在特定活动的宣言文件中添加了以下代码:

<activity android:name="Activity_" 
            android:configChanges="orientation|keyboardHidden|screenSize">



哪个是profileCreation的137行?哪个是profileCreation的137行?哪个是profileCreation的137行?哪个是profileCreation的137行?感谢您的及时回复和澄清。应用这些更改后,我收到以下弹出消息错误:“找不到要更新的对象”。您的意思是它正在输入
else{AlertDialog.Builder=new AlertDialog.Builder(ProfileCreation.this);Builder.setMessage(e.getMessage()).setTitle(R.string.signup\u error\u title)。setPositiveButton(android.R.string.ok,null);AlertDialog=builder.create();dialog.show();}
block?是的,它正在输入else语句,我觉得这很奇怪,因为当seekbar没有被引用时,其他信息(如年龄、性别、标题、姓名等)会在解析时被记录,所以我发现奇怪的是,只有seekbar没有被处理。本质上,用户记录了诸如最小年龄、最大年龄和搜索距离等信息nce使用seekbar,其值在相应的文本字段中更新,但由于某些原因,我无法记录这些信息。我感谢您迄今为止的支持,如果您能进一步帮助我,那将是非常重要的helpful@user3827788我想这可能是因为类型。
getProgress()
返回
int
尝试使用
String.valueOf(seekBarMaximum.getProgress())
。这只是一个假设。感谢您的建议。我在修改代码时收到以下错误:“密钥最大期限的类型无效,预期的数字,但得到一个字符串”但是为什么我不能只记录数字,例如年龄是一个数字,并且被记录下来,或者我只是感到困惑。感谢您的及时回复和澄清。应用这些更改后,我收到以下弹出消息错误:“找不到要更新的对象”。您的意思是它正在输入
else{AlertDialog.Builder Builder=new AlertDialog.Builder(ProfileCreation.this);Builder.setMessage(e.getMessage()).setTitle(R.string.signup\u error\u title)。setPositiveButton(android.R.string.ok,null);AlertDialog dialog=builder.create();dialog.show();}
block?是的,它正在输入else语句,我觉得这很奇怪,因为当seekbar没有被引用时,其他信息(如年龄、性别、标题、姓名等)会在解析时被记录,所以我发现奇怪的是,只有seekbar没有被处理。本质上,用户记录了诸如最小年龄、最大年龄和搜索距离等信息nce使用seekbar,其值在相应的文本字段中更新,但由于某些原因,我无法记录这些信息。我感谢您迄今为止的支持,如果您能进一步帮助我,那将是非常重要的helpful@user3827788我想这可能是因为类型。
getProgress()
返回
int
尝试使用
String.valueOf(seekBarMaximum.getProgress())
。这只是一个假设。感谢您的建议。我在修改代码时收到以下错误:“密钥最大期限的类型无效,预期的数字,但得到一个字符串”但是为什么我不能只记录数字,例如年龄是一个数字,并且被记录下来,或者我只是感到困惑。感谢您的及时回复和澄清。应用这些更改后,我收到以下弹出消息错误:“找不到要更新的对象”。您的意思是它正在输入
else{AlertDialog.Builder=new AlertDialog.Builder(ProfileCreation.this);Builder.setMessage(e.getMessage()).setTitle(R.string.signup\u error\u title)