Commit 8e466b5b by Jinqiu Bai

error happend

parent 2fab7818
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".ActivityTest"> <activity android:name=".ActivityTest">
......
...@@ -11,6 +11,7 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -11,6 +11,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -191,7 +192,7 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner ...@@ -191,7 +192,7 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner
xPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { xPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override @Override
public void onPageScrolled(int i, float v, int i1) { public void onPageScrolled(int i, float v, int i1) {
Log.i(TAG, "onPageScrolled: " + i + " " + v + " " + i1); // Log.i(TAG, "onPageScrolled: " + i + " " + v + " " + i1);
// if (i == 0) { // if (i == 0) {
// xPager.setCurrentItem(7); // xPager.setCurrentItem(7);
// } // }
...@@ -211,12 +212,12 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner ...@@ -211,12 +212,12 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner
@Override @Override
public void onPageSelected(int i) { public void onPageSelected(int i) {
Log.i(TAG, "onPageSelected: "); // Log.i(TAG, "onPageSelected: ");
} }
@Override @Override
public void onPageScrollStateChanged(int i) { public void onPageScrollStateChanged(int i) {
Log.i(TAG, "onPageScrollStateChanged: "); // Log.i(TAG, "onPageScrollStateChanged: ");
} }
}); });
xPager.setScrollDuration(700); xPager.setScrollDuration(700);
...@@ -227,7 +228,7 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner ...@@ -227,7 +228,7 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner
public void run() { public void run() {
while (true) { while (true) {
try { try {
Thread.sleep(5000); Thread.sleep(10000);
xPager.postDelayed(new Runnable() { xPager.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -462,4 +463,18 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner ...@@ -462,4 +463,18 @@ public class MainActivity extends AppCompatActivity implements IHandlerListerner
} }
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == event.KEYCODE_HOME) {
return true;
}
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
if (keyCode ==KeyEvent.KEYCODE_MENU){
return true;
}
return super.onKeyDown(keyCode, event);
}
} }
...@@ -5,3 +5,4 @@ import android.os.Message; ...@@ -5,3 +5,4 @@ import android.os.Message;
public interface IHandlerListerner { public interface IHandlerListerner {
void handleMessage(Message msg); void handleMessage(Message msg);
} }
\ No newline at end of file
...@@ -22,3 +22,4 @@ public class Myhandler { ...@@ -22,3 +22,4 @@ public class Myhandler {
mListener = listener; mListener = listener;
} }
} }
\ No newline at end of file
...@@ -15,3 +15,4 @@ public class Utils { ...@@ -15,3 +15,4 @@ public class Utils {
} }
\ No newline at end of file
...@@ -5,3 +5,4 @@ ...@@ -5,3 +5,4 @@
android:pathData="M7.75,8.25m-6.75,0a6.75,6.75 0,1 1,13.5 0a6.75,6.75 0,1 1,-13.5 0" android:pathData="M7.75,8.25m-6.75,0a6.75,6.75 0,1 1,13.5 0a6.75,6.75 0,1 1,-13.5 0"
android:strokeColor="#00FFFF" android:strokeWidth="1"/> android:strokeColor="#00FFFF" android:strokeWidth="1"/>
</vector> </vector>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment