java - DDMS Won't Show Debug Output -
i taking android course , learned ddms , debugging logcat.
however, problem have there no outputs being shown on ddms whenever run program on emulator (using eclipse ide)
here code
package com.fv.android.practice.project; import java.io.fileoutputstream; import android.content.context; import android.os.bundle; import android.support.v7.app.actionbaractivity; import android.util.log; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.edittext; public class mainactivity extends actionbaractivity { public static final string debugtag = "fv"; public static final string textfile = "notesquirrel.txt"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); addsavebuttonlistener(); } private void addsavebuttonlistener() { button savebtn = (button) findviewbyid(r.id.save); savebtn.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { edittext edittext = (edittext) findviewbyid(r.id.text); string text = edittext.gettext().tostring(); log.d(debugtag, "save button clicked: " + text); } }); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } }
and xml
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <edittext android:id="@+id/text" android:maxlength="400" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="top" android:hint="enter text here" /> <button android:id="@+id/save" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="save" /> </linearlayout>
when type "note" app, should have sort of output saying typed something, have 0 output ddms. nothing @ all. can fix this? went manifest , tried set debuggable true eclipse tells me not hardcode debugging process, or that.
also, checked see if emulator selected debugging in ddms, , is.
fixed issue. using android studio.
Comments
Post a Comment