Android app loads but crashes when SeekBar is released. [duplicate]
This question already has an answer here:
android.content.res.Resources$NotFoundException: String resource ID #0x0
4 answers
Sorry about what is likely a noob question.
I am working on a simple android app that involves a seekbar.
The app runs, however, when I release the seekBar it causes my app to crash.
Im trying to set a textview when the seekbar is released, but instead of setting the textview, the app crashes.
I believe this is my issue. When I comment it out, I can drag the seekbar with no issues.
progressTextView.setText(progressChangedValue) ;
XML CODE
<SeekBar
android:id="@+id/seekBar"
android:layout_width="329dp"
android:layout_height="32dp"
android:layout_marginStart="29dp"
android:layout_marginLeft="29dp"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:layout_marginBottom="52dp"
android:max="1000"
android:progress="500" />
JAVA
SeekBar seeker = (SeekBar) findViewById(R.id.seekBar) ;
progressTextView = (TextView)findViewById(R.id.seekBarLabel);
seeker.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
int progressChangedValue = 0;
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
progressChangedValue = progress;
@Override
public void onStartTrackingTouch(SeekBar seekBar)
@Override
public void onStopTrackingTouch(SeekBar seekBar)
progressTextView.setText(progressChangedValue) ;
);
java android xml android-studio
marked as duplicate by Mike M.
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 2:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
android.content.res.Resources$NotFoundException: String resource ID #0x0
4 answers
Sorry about what is likely a noob question.
I am working on a simple android app that involves a seekbar.
The app runs, however, when I release the seekBar it causes my app to crash.
Im trying to set a textview when the seekbar is released, but instead of setting the textview, the app crashes.
I believe this is my issue. When I comment it out, I can drag the seekbar with no issues.
progressTextView.setText(progressChangedValue) ;
XML CODE
<SeekBar
android:id="@+id/seekBar"
android:layout_width="329dp"
android:layout_height="32dp"
android:layout_marginStart="29dp"
android:layout_marginLeft="29dp"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:layout_marginBottom="52dp"
android:max="1000"
android:progress="500" />
JAVA
SeekBar seeker = (SeekBar) findViewById(R.id.seekBar) ;
progressTextView = (TextView)findViewById(R.id.seekBarLabel);
seeker.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
int progressChangedValue = 0;
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
progressChangedValue = progress;
@Override
public void onStartTrackingTouch(SeekBar seekBar)
@Override
public void onStopTrackingTouch(SeekBar seekBar)
progressTextView.setText(progressChangedValue) ;
);
java android xml android-studio
marked as duplicate by Mike M.
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 2:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Crash you say ? Please post your stacktrace
– Scary Wombat
Nov 15 '18 at 1:53
add a comment |
This question already has an answer here:
android.content.res.Resources$NotFoundException: String resource ID #0x0
4 answers
Sorry about what is likely a noob question.
I am working on a simple android app that involves a seekbar.
The app runs, however, when I release the seekBar it causes my app to crash.
Im trying to set a textview when the seekbar is released, but instead of setting the textview, the app crashes.
I believe this is my issue. When I comment it out, I can drag the seekbar with no issues.
progressTextView.setText(progressChangedValue) ;
XML CODE
<SeekBar
android:id="@+id/seekBar"
android:layout_width="329dp"
android:layout_height="32dp"
android:layout_marginStart="29dp"
android:layout_marginLeft="29dp"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:layout_marginBottom="52dp"
android:max="1000"
android:progress="500" />
JAVA
SeekBar seeker = (SeekBar) findViewById(R.id.seekBar) ;
progressTextView = (TextView)findViewById(R.id.seekBarLabel);
seeker.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
int progressChangedValue = 0;
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
progressChangedValue = progress;
@Override
public void onStartTrackingTouch(SeekBar seekBar)
@Override
public void onStopTrackingTouch(SeekBar seekBar)
progressTextView.setText(progressChangedValue) ;
);
java android xml android-studio
This question already has an answer here:
android.content.res.Resources$NotFoundException: String resource ID #0x0
4 answers
Sorry about what is likely a noob question.
I am working on a simple android app that involves a seekbar.
The app runs, however, when I release the seekBar it causes my app to crash.
Im trying to set a textview when the seekbar is released, but instead of setting the textview, the app crashes.
I believe this is my issue. When I comment it out, I can drag the seekbar with no issues.
progressTextView.setText(progressChangedValue) ;
XML CODE
<SeekBar
android:id="@+id/seekBar"
android:layout_width="329dp"
android:layout_height="32dp"
android:layout_marginStart="29dp"
android:layout_marginLeft="29dp"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:layout_marginBottom="52dp"
android:max="1000"
android:progress="500" />
JAVA
SeekBar seeker = (SeekBar) findViewById(R.id.seekBar) ;
progressTextView = (TextView)findViewById(R.id.seekBarLabel);
seeker.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
int progressChangedValue = 0;
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
progressChangedValue = progress;
@Override
public void onStartTrackingTouch(SeekBar seekBar)
@Override
public void onStopTrackingTouch(SeekBar seekBar)
progressTextView.setText(progressChangedValue) ;
);
This question already has an answer here:
android.content.res.Resources$NotFoundException: String resource ID #0x0
4 answers
java android xml android-studio
java android xml android-studio
asked Nov 15 '18 at 1:52
ayellowbusmanayellowbusman
3218
3218
marked as duplicate by Mike M.
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 2:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Mike M.
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 2:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Crash you say ? Please post your stacktrace
– Scary Wombat
Nov 15 '18 at 1:53
add a comment |
1
Crash you say ? Please post your stacktrace
– Scary Wombat
Nov 15 '18 at 1:53
1
1
Crash you say ? Please post your stacktrace
– Scary Wombat
Nov 15 '18 at 1:53
Crash you say ? Please post your stacktrace
– Scary Wombat
Nov 15 '18 at 1:53
add a comment |
1 Answer
1
active
oldest
votes
You're passing an integer to setText(int), which is a resource id and does not exist in your case, so try changing it to a String
or other types instead:
progressTextView.setText(String.valueOf(progressChangedValue));
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're passing an integer to setText(int), which is a resource id and does not exist in your case, so try changing it to a String
or other types instead:
progressTextView.setText(String.valueOf(progressChangedValue));
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
add a comment |
You're passing an integer to setText(int), which is a resource id and does not exist in your case, so try changing it to a String
or other types instead:
progressTextView.setText(String.valueOf(progressChangedValue));
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
add a comment |
You're passing an integer to setText(int), which is a resource id and does not exist in your case, so try changing it to a String
or other types instead:
progressTextView.setText(String.valueOf(progressChangedValue));
You're passing an integer to setText(int), which is a resource id and does not exist in your case, so try changing it to a String
or other types instead:
progressTextView.setText(String.valueOf(progressChangedValue));
answered Nov 15 '18 at 1:57
AaronAaron
1,8282213
1,8282213
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
add a comment |
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
Thanks! That took care of it. Makes sense. The stack trace was giving me this: "Invalid ID 0x00000200." and then a bunch of other stuff.
– ayellowbusman
Nov 15 '18 at 2:09
add a comment |
1
Crash you say ? Please post your stacktrace
– Scary Wombat
Nov 15 '18 at 1:53