mainactivity


作业7

走远了吗. 提交于 2019-12-04 09:09:44
package com.example.qerw; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends ActionBarActivity { private Button button; private EditText editText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void click(View view) { button = (Button) findViewById(R.id.button3); editText = (EditText)

第8个作业

穿精又带淫゛_ 提交于 2019-12-02 19:22:08
package com.example.an2; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.Map; import android.content.Context; import android.content.SharedPreferences; public class SPSaveQQ { /** * 保存数据 * * @param context * @param account * @param password * @return */ public static boolean saveUserInfo(Context context, String account, String password) { SharedPreferences sp = context.getSharedPreferences("data", Context.MODE_PRIVATE); SharedPreferences.Editor edit = sp.edit(); edit

Android ADT 23.0.0无法更新到23.0.2问题解决方案

守給你的承諾、 提交于 2019-12-02 18:28:20
android SDK更新到23.0.2后创建新项目无法创建MainActivity和默认布局,这个时候就需要更新ADT到23.0.2 更新时报如下错误 Your original request has been modified. "Android DDMS" is already installed, so an update will be performed instead. "Android Development Tools" is already installed, so an update will be performed instead. "Android Hierarchy Viewer" is already installed, so an update will be performed instead. "Android Native Development Tools" is already installed, so an update will be performed instead. "Android Traceview" is already installed, so an update will be performed instead. "Tracer for OpenGL ES" is already installed, so

运动轨迹的暂停、继续问题

孤街醉人 提交于 2019-11-27 16:19:16
由于运动轨迹是在子线程里面完成的,我们自然而然会想到线程的等待、唤醒,也就是wait、notify的问题了 因此我们在运动过程加上就如下代码就可以了 if (pause) { try { lock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } 1 2 3 4 5 6 7 8 怎么让他恢复运动呢?notify一下即可 public void reStartMove() { synchronized (lock) { pause = false; lock.notify(); } } 完整的代码如下: /** * Description: <MoveCarCustomThread><br> * Author: mxdl<br> * Date: 2019/7/10<br> * Version: V1.0.0<br> * Update: <br> */ public class MoveCarCustomThread extends Thread { public static final String TAG = MoveCarCustomThread.class.getSimpleName(); private Handler moveCarHandler;//发送数据的异步消息处理器

高德API实现的实时运动轨迹

守給你的承諾、 提交于 2019-11-27 16:18:47
/** * Description: <MoveCarCustomThread><br> * Author: mxdl<br> * Date: 2019/7/10<br> * Version: V1.0.0<br> * Update: <br> */ public class MoveCarSmoothThread implements IMoveCar { public static final String TAG = MoveCarSmoothThread.class.getSimpleName(); private MovingPointOverlay mMovingPointOverlay; private WeakReference<MainActivity> mActivityWeakReference; private boolean isfirst = true; private MOVE_STATE currMoveState = MOVE_STATE.START_STATUS; public void setCurrMoveState(MOVE_STATE currMoveState) { this.currMoveState = currMoveState; } public MOVE_STATE getCurrMoveState() { return

工具导航Map