numberformat exception using alarmamanager - crashes before on start(使用警报管理器的 numberformat 异常 - 在开始之前崩溃)
问题描述
---------更新 -----------------------------
---------UPDATE -----------------------------------------
当应用程序启动时,我在以下行收到 numberformat 异常:
When the app starts I receive numberformat exception at line :
final long thetime=Long.parseLong(time_value);
但以上内容不在主要活动中...
But the above aren't in the main activity...
在我在edittex中的xml文件中
In the xml file I have in the edittex
android:inputType="number" .
android:inputType="number" .
这一行在我有警报管理器的 myservice 类中(注意我不能使用 catch,因为在下面(alarm.setRepeating)它不能识别时间"值.
This line is in myservice class in which I have the alarmamanager(note I can't use catch because below(alarm.setRepeating) it doesn't recognize "thetime" value.
protected void onHandleIntent(Intent intent) {
//try{
String time_value;
time_value=(String) intent.getStringExtra("time_value");
final long thetime=Long.parseLong(time_value);// }
// catch (NumberFormatException e) {
/