- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在学习一个 coursera 类(class),我真的到了我认为我不适合这个工作领域(开发)并且应该坚持图形设计的地步。至少我想完成这门类(class),但我不断收到我不明白的错误!根据 logcat
,以下行有问题
titleView.setText(toDoItem.getTitle());
但对于我的生活看不到问题!下面是完整的程序,如果您需要任何东西,请告诉我。
package course.labs.todomanager;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.text.ParseException;
import java.util.Date;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.TextView;
import course.labs.todomanager.ToDoItem.Priority;
import course.labs.todomanager.ToDoItem.Status;
public class ToDoManagerActivity extends ListActivity {
private static final int ADD_TODO_ITEM_REQUEST = 0;
private static final String FILE_NAME = "TodoManagerActivityData.txt";
private static final String TAG = "Lab-UserInterface";
// IDs for menu items
private static final int MENU_DELETE = Menu.FIRST;
private static final int MENU_DUMP = Menu.FIRST + 1;
ToDoListAdapter mAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create a new TodoListAdapter for this ListActivity's ListView
mAdapter = new ToDoListAdapter(getApplicationContext());
// Put divider between ToDoItems and FooterView
getListView().setFooterDividersEnabled(true);
// TODO - Inflate footerView for footer_view.xml file
//TextView footerView = (TextView) findViewById(R.id.footerView);
//LayoutInflater inflitrate= getLayoutInflater();
//inflitrate.inflate(R.id.footerView, getListView());
TextView footerView = (TextView) getLayoutInflater().inflate(R.layout.footer_view, null);
// NOTE: You can remove this block once you've implemented the assignment
//if (null == footerView) {
// return;
//}
// TODO - Add footerView to ListView
ListView viewer= getListView();
viewer.addFooterView(footerView);
footerView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG,"Entered footerView.OnClickListener.onClick()");
//TODO - Implement OnClick().
Intent addone= new Intent (ToDoManagerActivity.this, AddToDoActivity.class);
startActivityForResult(addone, ADD_TODO_ITEM_REQUEST);
}
});
// TODO - Attach the adapter to this ListActivity's ListView
viewer.setAdapter(mAdapter);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.i(TAG,"Entered onActivityResult()");
// TODO - Check result code and request code
// if user submitted a new ToDoItem
// Create a new ToDoItem from the data Intent
// and then add it to the adapter
if (requestCode == ADD_TODO_ITEM_REQUEST && resultCode == RESULT_OK)
{
ToDoItem toDoItem = new ToDoItem(data);
mAdapter.add(toDoItem);
}
}
// Do not modify below here
@Override
public void onResume() {
super.onResume();
// Load saved ToDoItems, if necessary
if (mAdapter.getCount() == 0)
loadItems();
}
@Override
protected void onPause() {
super.onPause();
// Save ToDoItems
saveItems();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(Menu.NONE, MENU_DELETE, Menu.NONE, "Delete all");
menu.add(Menu.NONE, MENU_DUMP, Menu.NONE, "Dump to log");
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_DELETE:
mAdapter.clear();
return true;
case MENU_DUMP:
dump();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void dump() {
for (int i = 0; i < mAdapter.getCount(); i++) {
String data = ((ToDoItem) mAdapter.getItem(i)).toLog();
Log.i(TAG, "Item " + i + ": " + data.replace(ToDoItem.ITEM_SEP, ","));
}
}
// Load stored ToDoItems
private void loadItems() {
BufferedReader reader = null;
try {
FileInputStream fis = openFileInput(FILE_NAME);
reader = new BufferedReader(new InputStreamReader(fis));
String title = null;
String priority = null;
String status = null;
Date date = null;
while (null != (title = reader.readLine())) {
priority = reader.readLine();
status = reader.readLine();
date = ToDoItem.FORMAT.parse(reader.readLine());
mAdapter.add(new ToDoItem(title, Priority.valueOf(priority),
Status.valueOf(status), date));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
} finally {
if (null != reader) {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
// Save ToDoItems to file
private void saveItems() {
PrintWriter writer = null;
try {
FileOutputStream fos = openFileOutput(FILE_NAME, MODE_PRIVATE);
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
fos)));
for (int idx = 0; idx < mAdapter.getCount(); idx++) {
writer.println(mAdapter.getItem(idx));
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (null != writer) {
writer.close();
}
}
}
}
package course.labs.todomanager;
import java.util.Calendar;
import java.util.Date;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.TimePicker;
import course.labs.todomanager.ToDoItem.Priority;
import course.labs.todomanager.ToDoItem.Status;
public class AddToDoActivity extends Activity {
// 7 days in milliseconds - 7 * 24 * 60 * 60 * 1000
private static final int SEVEN_DAYS = 604800000;
private static final String TAG = "Lab-UserInterface";
private static String timeString;
private static String dateString;
private static TextView dateView;
private static TextView timeView;
private Date mDate;
private RadioGroup mPriorityRadioGroup;
private RadioGroup mStatusRadioGroup;
private EditText mTitleText;
private RadioButton mDefaultStatusButton;
private RadioButton mDefaultPriorityButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add_todo);
mTitleText = (EditText) findViewById(R.id.title);
mDefaultStatusButton = (RadioButton) findViewById(R.id.statusNotDone);
mDefaultPriorityButton = (RadioButton) findViewById(R.id.medPriority);
mPriorityRadioGroup = (RadioGroup) findViewById(R.id.priorityGroup);
mStatusRadioGroup = (RadioGroup) findViewById(R.id.statusGroup);
dateView = (TextView) findViewById(R.id.date);
timeView = (TextView) findViewById(R.id.time);
// Set the default date and time
setDefaultDateTime();
// OnClickListener for the Date button, calls showDatePickerDialog() to
// show
// the Date dialog
final Button datePickerButton = (Button) findViewById(R.id.date_picker_button);
datePickerButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showDatePickerDialog();
}
});
// OnClickListener for the Time button, calls showTimePickerDialog() to
// show the Time Dialog
final Button timePickerButton = (Button) findViewById(R.id.time_picker_button);
timePickerButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showTimePickerDialog();
}
});
// OnClickListener for the Cancel Button,
final Button cancelButton = (Button) findViewById(R.id.cancelButton);
cancelButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "Entered cancelButton.OnClickListener.onClick()");
// TODO - Indicate result and finish
Intent returnIntent = new Intent();
setResult(RESULT_CANCELED,returnIntent);
finish();
}
});
// TODO - Set up OnClickListener for the Reset Button
final Button resetButton = (Button) findViewById(R.id.resetButton);
resetButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "Entered resetButton.OnClickListener.onClick()");
// TODO - Reset data to default values
mTitleText.setText("");
setDefaultDateTime();
mDefaultStatusButton.setChecked(true);
mDefaultPriorityButton.setChecked(true);
}
});
// Set up OnClickListener for the Submit Button
final Button submitButton = (Button) findViewById(R.id.submitButton);
submitButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "Entered submitButton.OnClickListener.onClick()");
// gather ToDoItem data
// TODO - Get the current Priority
Priority priority = getPriority();
// TODO - Get the current Status
Status status = getStatus();
// TODO - Get the current ToDoItem Title
String titleString = getToDoTitle();
// Construct the Date string
String fullDate = dateString + " " + timeString;
// Package ToDoItem data into an Intent
Intent data = new Intent();
ToDoItem.packageIntent(data, titleString, priority, status,
fullDate);
// TODO - return data Intent and finish
setResult(Activity.RESULT_OK,data);
finish();
}
});
}
// Do not modify below this point.
private void setDefaultDateTime() {
// Default is current time + 7 days
mDate = new Date();
mDate = new Date(mDate.getTime() + SEVEN_DAYS);
Calendar c = Calendar.getInstance();
c.setTime(mDate);
setDateString(c.get(Calendar.YEAR), c.get(Calendar.MONTH),
c.get(Calendar.DAY_OF_MONTH));
dateView.setText(dateString);
setTimeString(c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE),
c.get(Calendar.MILLISECOND));
timeView.setText(timeString);
}
private static void setDateString(int year, int monthOfYear, int dayOfMonth) {
// Increment monthOfYear for Calendar/Date -> Time Format setting
monthOfYear++;
String mon = "" + monthOfYear;
String day = "" + dayOfMonth;
if (monthOfYear < 10)
mon = "0" + monthOfYear;
if (dayOfMonth < 10)
day = "0" + dayOfMonth;
dateString = year + "-" + mon + "-" + day;
}
private static void setTimeString(int hourOfDay, int minute, int mili) {
String hour = "" + hourOfDay;
String min = "" + minute;
if (hourOfDay < 10)
hour = "0" + hourOfDay;
if (minute < 10)
min = "0" + minute;
timeString = hour + ":" + min + ":00";
}
private Priority getPriority() {
switch (mPriorityRadioGroup.getCheckedRadioButtonId()) {
case R.id.lowPriority: {
return Priority.LOW;
}
case R.id.highPriority: {
return Priority.HIGH;
}
default: {
return Priority.MED;
}
}
}
private Status getStatus() {
switch (mStatusRadioGroup.getCheckedRadioButtonId()) {
case R.id.statusDone: {
return Status.DONE;
}
default: {
return Status.NOTDONE;
}
}
}
private String getToDoTitle() {
return mTitleText.getText().toString();
}
// DialogFragment used to pick a ToDoItem deadline date
public static class DatePickerFragment extends DialogFragment implements
DatePickerDialog.OnDateSetListener {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
// Create a new instance of DatePickerDialog and return it
return new DatePickerDialog(getActivity(), this, year, month, day);
}
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
setDateString(year, monthOfYear, dayOfMonth);
dateView.setText(dateString);
}
}
// DialogFragment used to pick a ToDoItem deadline time
public static class TimePickerFragment extends DialogFragment implements
TimePickerDialog.OnTimeSetListener {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current time as the default values for the picker
final Calendar c = Calendar.getInstance();
int hour = c.get(Calendar.HOUR_OF_DAY);
int minute = c.get(Calendar.MINUTE);
// Create a new instance of TimePickerDialog and return
return new TimePickerDialog(getActivity(), this, hour, minute, true);
}
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
setTimeString(hourOfDay, minute, 0);
timeView.setText(timeString);
}
}
private void showDatePickerDialog() {
DialogFragment newFragment = new DatePickerFragment();
newFragment.show(getFragmentManager(), "datePicker");
}
private void showTimePickerDialog() {
DialogFragment newFragment = new TimePickerFragment();
newFragment.show(getFragmentManager(), "timePicker");
}
}
package course.labs.todomanager;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import android.content.Intent;
public class ToDoItem {
public static final String ITEM_SEP = System.getProperty("line.separator");
public enum Priority {
LOW, MED, HIGH
};
public enum Status {
NOTDONE, DONE
};
public final static String TITLE = "title";
public final static String PRIORITY = "priority";
public final static String STATUS = "status";
public final static String DATE = "date";
public final static String FILENAME = "filename";
public final static SimpleDateFormat FORMAT = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss", Locale.US);
private String mTitle = new String();
private Priority mPriority = Priority.LOW;
private Status mStatus = Status.NOTDONE;
private Date mDate = new Date();
ToDoItem(String title, Priority priority, Status status, Date date) {
this.mTitle = title;
this.mPriority = priority;
this.mStatus = status;
this.mDate = date;
}
// Create a new ToDoItem from data packaged in an Intent
ToDoItem(Intent intent) {
mTitle = intent.getStringExtra(ToDoItem.TITLE);
mPriority = Priority.valueOf(intent.getStringExtra(ToDoItem.PRIORITY));
mStatus = Status.valueOf(intent.getStringExtra(ToDoItem.STATUS));
try {
mDate = ToDoItem.FORMAT.parse(intent.getStringExtra(ToDoItem.DATE));
} catch (ParseException e) {
mDate = new Date();
}
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public Priority getPriority() {
return mPriority;
}
public void setPriority(Priority priority) {
mPriority = priority;
}
public Status getStatus() {
return mStatus;
}
public void setStatus(Status status) {
mStatus = status;
}
public Date getDate() {
return mDate;
}
public void setDate(Date date) {
mDate = date;
}
// Take a set of String data values and
// package them for transport in an Intent
public static void packageIntent(Intent intent, String title,
Priority priority, Status status, String date) {
intent.putExtra(ToDoItem.TITLE, title);
intent.putExtra(ToDoItem.PRIORITY, priority.toString());
intent.putExtra(ToDoItem.STATUS, status.toString());
intent.putExtra(ToDoItem.DATE, date);
}
public String toString() {
return mTitle + ITEM_SEP + mPriority + ITEM_SEP + mStatus + ITEM_SEP
+ FORMAT.format(mDate);
}
public String toLog() {
return "Title:" + mTitle + ITEM_SEP + "Priority:" + mPriority
+ ITEM_SEP + "Status:" + mStatus + ITEM_SEP + "Date:"
+ FORMAT.format(mDate);
}
}
package course.labs.todomanager;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.os.AsyncTask.Status;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class ToDoListAdapter extends BaseAdapter {
private final List<ToDoItem> mItems = new ArrayList<ToDoItem>();
private final Context mContext;
private static final String TAG = "Lab-UserInterface";
public ToDoListAdapter(Context context) {
mContext = context;
}
// Add a ToDoItem to the adapter
// Notify observers that the data set has changed
public void add(ToDoItem item) {
mItems.add(item);
notifyDataSetChanged();
}
// Clears the list adapter of all items.
public void clear() {
mItems.clear();
notifyDataSetChanged();
}
// Returns the number of ToDoItems
@Override
public int getCount() {
return mItems.size();
}
// Retrieve the number of ToDoItems
@Override
public Object getItem(int pos) {
return mItems.get(pos);
}
// Get the ID for the ToDoItem
// In this case it's just the position
@Override
public long getItemId(int pos) {
return pos;
}
// Create a View for the ToDoItem at specified position
// Remember to check whether convertView holds an already allocated View
// before created a new View.
// Consider using the ViewHolder pattern to make scrolling more efficient
// See: http://developer.android.com/training/improving-layouts/smooth-scrolling.html
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO - Get the current ToDoItem
final ToDoItem toDoItem = (ToDoItem) getItem(position);
// TODO - Inflate the View for this ToDoItem
// from todo_item.xml
//RelativeLayout itemLayout = null;
// TODO - Fill in specific ToDoItem data
// Remember that the data that goes in this View
// corresponds to the user interface elements defined
// in the layout file
if (convertView==null){
LayoutInflater inflator= (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView=inflator.inflate(R.layout.add_todo, null);
}
// TODO - Display Title in TextView
final TextView titleView = (TextView) convertView.findViewById(R.id.titleView);
titleView.setText(toDoItem.getTitle());
// TODO - Set up Status CheckBox
final CheckBox statusView = (CheckBox)convertView.findViewById(R.id.statusCheckBox);
statusView.setChecked(toDoItem.getStatus()==course.labs.todomanager.ToDoItem.Status.DONE);
statusView.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
Log.i(TAG, "Entered onCheckedChanged()");
// TODO - set up an OnCheckedChangeListener, which
// is called when the user toggles the status checkbox
if (toDoItem.getStatus().equals(course.labs.todomanager.ToDoItem.Status.DONE))
{
toDoItem.setStatus(course.labs.todomanager.ToDoItem.Status.NOTDONE); //Change it
}
else
{
toDoItem.setStatus(course.labs.todomanager.ToDoItem.Status.DONE); //Change it
}
}
});
// TODO - Display Priority in a TextView
final TextView priorityView = (TextView) convertView.findViewById(R.id.priorityView);
priorityView.setText(toDoItem.getPriority().toString());
// TODO - Display Time and Date.
// Hint - use ToDoItem.FORMAT.format(toDoItem.getDate()) to get date and
// time String
final TextView dateView = (TextView)convertView.findViewById(R.id.dateView);
dateView.setText(ToDoItem.FORMAT.format(toDoItem.getDate()));
// Return the View you just created
return convertView;
}
}
02-06 13:11:20.711: E/AndroidRuntime(1288): FATAL EXCEPTION: main 02-06 13:11:20.711: E/AndroidRuntime(1288): java.lang.NullPointerException 02-06 13:11:20.711: E/AndroidRuntime(1288): at >course.labs.todomanager.ToDoListAdapter.getView(ToDoListAdapter.java:105) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.AbsListView.obtainView(AbsListView.java:2177) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.ListView.makeAndAddView(ListView.java:1840) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.ListView.fillSpecific(ListView.java:1321) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.ListView.layoutChildren(ListView.java:1633) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.AbsListView.onLayout(AbsListView.java:2012) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.View.layout(View.java:14289) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewGroup.layout(ViewGroup.java:4562) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.View.layout(View.java:14289) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewGroup.layout(ViewGroup.java:4562) 02-06 13:11:20.711: E/AndroidRuntime(1288): at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:349) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.View.layout(View.java:14289) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewGroup.layout(ViewGroup.java:4562) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.View.layout(View.java:14289) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewGroup.layout(ViewGroup.java:4562) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1976) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1730) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.Choreographer.doCallbacks(Choreographer.java:562) 02-06 13:11:20.711: E/AndroidRuntime(1288): at android.view.Choreographer.doFrame(Choreographer.java:532) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >android.os.Handler.handleCallback(Handler.java:730) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >android.os.Handler.dispatchMessage(Handler.java:92) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >android.os.Looper.loop(Looper.java:137) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >android.app.ActivityThread.main(ActivityThread.java:5103) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >java.lang.reflect.Method.invokeNative(Native Method) 02-06 13:11:20.711: E/AndroidRuntime(1288): at java.lang.reflect.Method.invoke(Method.java:525) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 02-06 13:11:20.711: E/AndroidRuntime(1288): at >dalvik.system.NativeStart.main(Native Method) 02-06 13:11:26.121: I/Process(1288): Sending signal. PID: 1288 SIG: 9
感谢您提前提供的任何帮助!
最佳答案
请确保您的 titleView(id:priorityView)位于您为 R.layout.add_todo 扩充的布局中
如果不是这样,你应该把它放在那里。如果这没有帮助,请发布您的布局 xml 文件。
关于java - 我不明白的 TitleView 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28367010/
我已经使用 vue-cli 两个星期了,直到今天一切正常。我在本地建立这个项目。 https://drive.google.com/open?id=0BwGw1zyyKjW7S3RYWXRaX24tQ
您好,我正在尝试使用 python 库 pytesseract 从图像中提取文本。请找到代码: from PIL import Image from pytesseract import image_
我的错误 /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference
我已经训练了一个模型,我正在尝试使用 predict函数但它返回以下错误。 Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]])
根据Microsoft DataConnectors的信息我想通过 this ODBC driver 创建一个从 PowerBi 到 PostgreSQL 的连接器使用直接查询。我重用了 Micros
我已经为 SoundManagement 创建了一个包,其中有一个扩展 MediaPlayer 的类。我希望全局控制这个变量。这是我的代码: package soundmanagement; impo
我在Heroku上部署了一个应用程序。我正在使用免费服务。 我经常收到以下错误消息。 PG::Error: ERROR: out of memory 如果刷新浏览器,就可以了。但是随后,它又随机发生
我正在运行 LAMP 服务器,这个 .htaccess 给我一个 500 错误。其作用是过滤关键字并重定向到相应的域名。 Options +FollowSymLinks RewriteEngine
我有两个驱动器 A 和 B。使用 python 脚本,我在“A”驱动器中创建一些文件,并运行 powerscript,该脚本以 1 秒的间隔将驱动器 A 中的所有文件复制到驱动器 B。 我在 powe
下面的函数一直返回这个错误信息。我认为可能是 double_precision 字段类型导致了这种情况,我尝试使用 CAST,但要么不是这样,要么我没有做对...帮助? 这是错误: ERROR: i
这个问题已经有答案了: Syntax error due to using a reserved word as a table or column name in MySQL (1 个回答) 已关闭
我的数据库有这个小问题。 我创建了一个表“articoli”,其中包含商品的品牌、型号和价格。 每篇文章都由一个 id (ID_ARTICOLO)` 定义,它是一个自动递增字段。 好吧,现在当我尝试插
我是新来的。我目前正在 DeVry 在线学习中级 C++ 编程。我们正在使用 C++ Primer Plus 这本书,到目前为止我一直做得很好。我的老师最近向我们扔了一个曲线球。我目前的任务是这样的:
这个问题在这里已经有了答案: What is an undefined reference/unresolved external symbol error and how do I fix it?
我的网站中有一段代码有问题;此错误仅发生在 Internet Explorer 7 中。 我没有在这里发布我所有的 HTML/CSS 标记,而是发布了网站的一个版本 here . 如您所见,我在列中有
如果尝试在 USB 设备上构建 node.js 应用程序时在我的树莓派上使用 npm 时遇到一些问题。 package.json 看起来像这样: { "name" : "node-todo",
在 Python 中,您有 None单例,在某些情况下表现得很奇怪: >>> a = None >>> type(a) >>> isinstance(a,None) Traceback (most
这是我的 build.gradle (Module:app) 文件: apply plugin: 'com.android.application' android { compileSdkV
我是 android 的新手,我的项目刚才编译和运行正常,但在我尝试实现抽屉导航后,它给了我这个错误 FAILURE: Build failed with an exception. What wen
谁能解释一下?我想我正在做一些非常愚蠢的事情,并且急切地等待着启蒙。 我得到这个输出: phpversion() == 7.2.25-1+0~20191128.32+debian8~1.gbp108
我是一名优秀的程序员,十分优秀!