FreddyJohn opened a new issue #1147:
URL: https://github.com/apache/cordova-android/issues/1147
# Bug Report
## Problem
### What is expected to happen?
I expect tickMarks to be added when I call seekBar.setTickMark, specify
target API version in Manifest file, and call seekBar.setMax prior.
### What does actually happen?
The application gets a runtime exception error:
java.lang.NoSuchMethodError: No virtual method
setTickMark(Landroid/graphics/drawable/Drawable;)V in class
Landroid/widget/SeekBar; or its super classes (declaration of
'android.widget.SeekBar' appears in
/system/framework/framework.jar:classes2.dex)
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
<!-- class that adds the ticks to seekbar programmatically-->
package com.example.customparam;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
public class Param extends LinearLayout {
public Param(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
SeekBar seekBar = new SeekBar(context);
float p = Resources.getSystem().getDisplayMetrics().density;
int height = (int) (90*p);
int width = (int) (100*p);
seekBar.setLayoutParams(new LayoutParams(width, height));
Drawable d = context.getDrawable(R.drawable.seekbar_tickmark);
seekBar.setMax(10);
seekBar.setTickMark(d); //fails regardless of minimum target API
versions or device
seekBar.setRotation(270);
int w = LayoutParams.WRAP_CONTENT;
setLayoutParams(new LayoutParams(w,w));
addView(seekBar);
setGravity(Gravity.CENTER);
setOrientation(LinearLayout.VERTICAL);
}
}
<!-- MainActivity that adds Param to LinearLayout defined in XML-->
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Param param = new Param(this,null);
LinearLayout useless = findViewById(R.id.useless);
useless.addView(param);
}
}
<!-- Android Manifest sdk declaration-->
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24"/>
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
Min API is 24 and target it 24 I am experiencing issue on LeX520 and
tracfone LG L322DL
### Version information
<!--
What are relevant versions you are using?
Android Studio
-->
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ ] I searched for existing GitHub issues [x]
- [ ] I updated all Cordova tooling to most recent version []
- [ ] I included all the necessary information above [x]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]