Android studio提示Override method in .....

安装上测试了一下,他出现这个错误,在网上查了一下,他说是sdk配置问题,我设置了下,但是还是不行,大家帮我看以ixia,什么问题??图片说明

2个回答

你贴出的这个不是错误信息。贴出实际的错误信息才知道,如果程序都不是你写的,并且原来是正常的,估计是少了什么包。建议你还是找个懂程序的人。

在红线上点一下Ctrl+Enter就好了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于android studio中override报错的问题

![图片说明](https://img-ask.csdn.net/upload/201710/18/1508341601_398832.png) 如图,出现Method does not override method from its superclass。如何解决? 本人新手上路,还望大神赐教!

Android Studio报错 java.lang.IllegalStateException

package com.example.q9722.biancheng1; import android.media.Image; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.widget.ImageView; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements View.OnClickListener{ ViewPager mviewPager; mFragmentAdapter madapter; FragmentOne mone; FragmentTwo mtwo; FragmentThree mthree; List<Fragment> mFragmentList; ImageView[] mimageViews; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().hide(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); initViews(); madapter = new mFragmentAdapter(getSupportFragmentManager(),mFragmentList); mviewPager.setOffscreenPageLimit(3); mviewPager.setAdapter(madapter); mviewPager.setCurrentItem(0); mimageViews[1].setImageResource(R.drawable.blue_circle); mviewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { for(int i=0;i<3;i++) { mimageViews[i].setImageResource(R.drawable.write_circle); } mimageViews[position].setImageResource(R.drawable.blue_circle); } @Override public void onPageScrollStateChanged(int state) { } }); } private void initViews() { mviewPager = (ViewPager) findViewById(R.id.viewpager); mFragmentList = new ArrayList<Fragment>(); mone = new FragmentOne(); mtwo = new FragmentTwo(); mthree = new FragmentThree(); mFragmentList.add(mone); mFragmentList.add(mtwo); mFragmentList.add(mthree); mimageViews = new ImageView[3]; mimageViews[0] = (ImageView) findViewById(R.id.iv1); mimageViews[1] = (ImageView) findViewById(R.id.iv2); mimageViews[2] = (ImageView) findViewById(R.id.iv3); mimageViews[0].setOnClickListener(this); mimageViews[1].setOnClickListener(this); mimageViews[2].setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.iv1: mviewPager.setCurrentItem(0,true); break; case R.id.iv2: mviewPager.setCurrentItem(1,true); break; case R.id.iv3: mviewPager.setCurrentItem(2,true); break; } } }

Android studio报错:无法解析v4.app.FragmentActivity

import android.content.Context; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import com.bigkoo.convenientbanner.ConvenientBanner; import com.bigkoo.convenientbanner.holder.CBViewHolderCreator; import com.bigkoo.convenientbanner.holder.Holder; import com.example.administrator.cookbook.R; import com.example.administrator.cookbook.books.CookBookPresenter; import com.example.administrator.cookbook.books.CookBookPresenterImpl; import com.example.administrator.cookbook.books.CookBookView; import com.example.administrator.cookbook.cookbook.beans.CookBook; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.List; public class HomeFragment extends Fragment implements CookBookView{ ConvenientBanner convenientBanner; ListView listView; static List<Integer> localImages = new ArrayList<>(); CookBookPresenter cookBookPresenter; List<CookBook> list; static { localImages.add(R.drawable.test01); localImages.add(R.drawable.test02); localImages.add(R.drawable.test03); localImages.add(R.drawable.test04); } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); list = new ArrayList<>(); cookBookPresenter = new CookBookPresenterImpl(this); cookBookPresenter.getCookBookListById(getActivity(),"xxx"); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_home,container,false); initViews(view); initBanner(); return view; } void initViews(View view){ listView = (ListView) view.findViewById(R.id.listview); convenientBanner = (ConvenientBanner)view.findViewById(R.id.convenientBanner); } @Override public void setCookBookList(List<CookBook> list) { this.list = list; } @Override public void setFail() { } class MyAdapter extends BaseAdapter{ @Override public int getCount() { return list.size(); } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { View myView; if(convertView == null){ myView = getActivity().getLayoutInflater().inflate(R.layout.list_cookbook_item,null); }else { myView = convertView; } ImageView iv = (ImageView) myView.findViewById(R.id.imageView); TextView tv1 = (TextView) myView.findViewById(R.id.title); TextView tv2 = (TextView) myView.findViewById(R.id.intro); CookBook cookBook = list.get(position); String url = cookBook.getAlbums().get(0); String title = cookBook.getTitle(); String intro = cookBook.getImtro(); tv1.setText(title); tv2.setText(intro); Picasso.with(getActivity()).load(url).resize(120,120).into(iv); return myView; } } void initBanner(){ convenientBanner.setPages( new CBViewHolderCreator<LocalImageHolderView>() { @Override public LocalImageHolderView createHolder() { return new LocalImageHolderView(); } }, localImages) //设置两个点图片作为翻页指示器,不设置则没有指示器,可以根据自己需求自行配合自己的指示器,不需要圆点指示器可用不设 .setPageIndicator(new int[]{R.drawable.ic_page_indicator, R.drawable.ic_page_indicator_focused}) //设置指示器的方向 .setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.ALIGN_PARENT_RIGHT); } class LocalImageHolderView implements Holder<Integer> { private ImageView imageView; @Override public View createView(Context context) { imageView = new ImageView(context); imageView.setScaleType(ImageView.ScaleType.FIT_XY); return imageView; } @Override public void UpdateUI(Context context, final int position, Integer data) { imageView.setImageResource(data); } } } 其中Picasso.with(getActivity()).load(url).resize(120,120).into(iv);中with报错Cannot resolve method 'with(android.support.v4.app.FragmentActivity),该如何解决,本人小白能否给出详细过程

android studio错误日志这样的 不知道哪里错误 郁闷哭了

错误日志 ``` E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.wechat, PID: 3124 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.wechat/com.example.wechat.ListViewActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at com.example.wechat.ListViewActivity.onCreate(ListViewActivity.java:16) at android.app.Activity.performCreate(Activity.java:7136) at android.app.Activity.performCreate(Activity.java:7127) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6669)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)  ``` MyListAdapter.java ``` package com.example.wechat; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; //Adapter 适配器 用来写列表每一行,每一个网格是什么样子的 public class MyListAdapter extends BaseAdapter { protected Context mContext; protected LayoutInflater mLayoutInflater; public MyListAdapter(Context context){ this.mContext = context; mLayoutInflater = LayoutInflater.from(context); } @Override //列表长度 public int getCount() { return 10; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } static class ViewHolder{ public ImageView imageView; public TextView tv_title,tv_time,tv_content; } @Override //列表每一行是什么样子 public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null){ convertView =mLayoutInflater.inflate(R.layout.layout_list_item,null); holder = new ViewHolder(); holder.imageView = convertView.findViewById(R.id.iv_1); holder.tv_title = convertView.findViewById(R.id.tv_title); holder.tv_time = convertView.findViewById(R.id.tv_time); holder.tv_content = convertView.findViewById(R.id.tv_content); convertView.setTag(holder); }else { holder = (ViewHolder) convertView.getTag(); } //给控件赋值 holder.tv_title.setText("这是标题"); holder.tv_time.setText("2088-08-08"); holder.tv_content.setText("这是内容"); Glide.with(mContext).load("https://blog.hkmovie6.com/wp-content/uploads/2018/12/946848-1024x576.jpg").into(holder.imageView); return convertView; } } ``` ListViewActivity.java ``` package com.example.wechat; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ListView; public class ListViewActivity extends AppCompatActivity { protected ListView mLv1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list_view); mLv1 = findViewById(R.id.lv_1); mLv1.setAdapter(new MyListAdapter(com.example.wechat.ListViewActivity.this)); } } ```

android studio 错误提示 no such table: shuju

Android Studio 本人初学android ,求帮忙看看有什么问题! public class ShujuSQLiteHelper extends SQLiteOpenHelper { public ShujuSQLiteHelper(Context context){ super(context,"shuju.db",null,5); } //当goods.db创建完成的时候,调用onCreate方法,在其中创建数据表 @Override public void onCreate(SQLiteDatabase db) { db.execSQL("create table shuju(id integer primary key autoincrement," + "name varchar(20)," + "price integer)" ); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } } Caused by: android.database.sqlite.SQLiteException: no such table: shuju (code 1): , while compiling: alter table shuju add account varchar(20) default 1000 at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500) at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588) at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58) at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31) at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1674) at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1605) at com.example.lenovo.gaoxiao30.ShujuSQLiteHelper.onUpgrade(ShujuSQLiteHelper.java:24) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:256) at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187) at com.example.lenovo.gaoxiao30.ShujuDao.query(ShujuDao.java:51) at com.example.lenovo.gaoxiao30.ShujuActivity.onCreate(ShujuActivity.java:34) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)

android studio连接web报错?

1.问题描述 可以通过浏览器连接web应用,但用android studio连接报错 2.代码如下 Android端 **activity_main.xml:** <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <EditText android:id="@+id/et_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入用户名 " /> <EditText android:id="@+id/et_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入密码" /> <Button android:onClick="click1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="get"/> <Button android:onClick="click2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="post"/> </LinearLayout> </android.support.constraint.ConstraintLayout> ``` ``` MainActivity private EditText username; private EditText password; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); username = (EditText) findViewById(R.id.et_username); password = (EditText) findViewById(R.id.et_password); } public void click1(View v) { new Thread() { @Override public void run() { super.run(); } }.start(); try { String name = username.getText().toString().trim(); String pwd = password.getText().toString().trim(); String path = "http://10.0.2.2:8080/login/loginServlet?username=" + name + "&password=" + pwd + ""; URL url = new URL(path); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(5000); int code = conn.getResponseCode(); if (code == 200) { showToast("连接成功"); } } catch (Exception e) { e.printStackTrace(); } } public void click2(View v) { } public void showToast(final String content) { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(getApplicationContext(), content, Toast.LENGTH_LONG).show(); } }); } } ``` ``` AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.administrator.myapplication1"> <uses-permission android:name="android.permission.INTERNET"></uses-permission> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> ``` ``` 点击按钮后的日志 05-01 04:50:39.613 9826-9826/? I/art: Not late-enabling -Xcheck:jni (already on) 05-01 04:50:39.613 9826-9826/? W/art: Unexpected CPU variant for X86 using defaults: x86 05-01 04:50:39.911 9826-9826/com.example.administrator.myapplication1 W/System: ClassLoader referenced unknown path: /data/app/com.example.administrator.myapplication1-2/lib/x86 05-01 04:50:39.933 9826-9826/com.example.administrator.myapplication1 I/InstantRun: starting instant run server: is main process 05-01 04:50:40.140 9826-9826/com.example.administrator.myapplication1 W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 05-01 04:50:40.727 9826-9852/com.example.administrator.myapplication1 I/OpenGLRenderer: Initialized EGL, version 1.4 05-01 04:50:40.727 9826-9852/com.example.administrator.myapplication1 D/OpenGLRenderer: Swap behavior 1 05-01 04:50:40.727 9826-9852/com.example.administrator.myapplication1 W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 05-01 04:50:40.727 9826-9852/com.example.administrator.myapplication1 D/OpenGLRenderer: Swap behavior 0 05-01 04:50:40.896 9826-9826/com.example.administrator.myapplication1 W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView 05-01 04:51:59.575 9826-9826/com.example.administrator.myapplication1 W/IInputConnectionWrapper: finishComposingText on inactive InputConnection 05-01 04:52:02.649 9826-9826/com.example.administrator.myapplication1 D/NetworkSecurityConfig: No Network Security Config specified, using platform default 05-01 04:52:02.651 9826-9826/com.example.administrator.myapplication1 W/System.err: android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:333) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:196) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:356) 05-01 04:52:02.652 9826-9826/com.example.administrator.myapplication1 W/System.err: at java.net.Socket.connect(Socket.java:605) at com.android.okhttp.internal.Platform.connectSocket(Platform.java:113) at com.android.okhttp.Connection.connectSocket(Connection.java:196) at com.android.okhttp.Connection.connect(Connection.java:172) at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367) at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130) at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:329) at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521) at com.example.administrator.myapplication1.MainActivity.click1(MainActivity.java:44) at java.lang.reflect.Method.invoke(Native Method) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288) at android.view.View.performClick(View.java:5637) at android.view.View$PerformClick.run(View.java:22429) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) 05-01 04:52:02.655 9826-9826/com.example.administrator.myapplication1 W/System.err: at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

请问为什么我只要在android studio中加入线程就会程序就会闪退呀?

下面是MainActivity的代码。 ``` package wjsd.sfy.suyan.test; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; public class MainActivity extends AppCompatActivity { private ProgressBar progressBar = (ProgressBar)findViewById(R.id.progressBar); // private TextView textView = (TextView)findViewById(R.id.textView); private Button button = (Button)findViewById(R.id.button); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button.setOnClickListener(new ButtonListener()); } class ButtonListener implements View.OnClickListener{ @Override public void onClick(View v) { MyThread myThread = new MyThread(); myThread.start(); } } class MyThread extends Thread{ @Override public void run() { for(int i = 0;i < 100;i++){ try { Thread.sleep(100); }catch (Exception e){ e.printStackTrace(); } progressBar.setProgress(progressBar.getProgress() + 1); } } } } ``` 下面是错误信息: 07-24 07:41:57.002 4672-4672/wjsd.sfy.suyan.test W/System: ClassLoader referenced unknown path: /data/app/wjsd.sfy.suyan.test-1/lib/x86_64 07-24 07:41:57.066 4672-4672/wjsd.sfy.suyan.test D/AndroidRuntime: Shutting down VM 07-24 07:41:57.066 4672-4672/wjsd.sfy.suyan.test E/AndroidRuntime: FATAL EXCEPTION: main Process: wjsd.sfy.suyan.test, PID: 4672 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{wjsd.sfy.suyan.test/wjsd.sfy.suyan.test.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:68) at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146) at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28) at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41) at android.support.v7.app.AppCompatDelegateImplV23.<init>(AppCompatDelegateImplV23.java:29) at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:188) at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:172) at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:512) at android.support.v7.app.AppCompatActivity.findViewById(AppCompatActivity.java:184) at wjsd.sfy.suyan.test.MainActivity.<init>(MainActivity.java:10) at java.lang.Class.newInstance(Native Method) at android.app.Instrumentation.newActivity(Instrumentation.java:1067) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  07-24 07:42:00.272 4672-4672/wjsd.sfy.suyan.test I/Process: Sending signal. PID: 4672 SIG: 9 求教,谢谢了。

Attempt to read from field 'android.widget.ImageView com.example.smartdoor.ui.SmartDoorActivity.video' on a null object reference。

在android开发中使用ImageView实现视频显示时出现如下报错: ``` java.lang.NullPointerException: Attempt to read from field 'android.widget.ImageView com.example.smartdoor.ui.SmartDoorActivity.video' on a null object reference at com.example.smartdoor.ui.SmartDoorActivity.access$500(SmartDoorActivity.java:49) at com.example.smartdoor.ui.SmartDoorActivity$6.handleMessage(SmartDoorActivity.java:353) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8169) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) ``` 搜索问题后仍无法解决,希望有大佬能够解惑。 出错代码如下: ``` public static Handler updateUIHandler=new Handler(){ @Override public void handleMessage(Message msg) { switch (msg.what){ case 1: Log.e("SmartDoorActivity", "handleMessage: 接收视频帧"); Log.e("SmartDoorActivity", msg.obj.toString()); ((SmartDoorActivity)context).video.setImageBitmap((Bitmap)msg.obj); default: break; } } }; ``` 在这bao'c ``` ((SmartDoorActivity)context).video.setImageBitmap((Bitmap)msg.obj); ```

android PopupMenu 不能弹出菜单

我每隔一行写了一个System.out,发现前面的代码都运行了,最后的show()没运行。 下面是代码及logcat内容: PopupMenu popupMenu = new PopupMenu(getBaseContext(), view, 10); popupMenu.getMenuInflater().inflate(R.menu.list_of_popup_menu, popupMenu.getMenu()); popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.hello: Toast.makeText(getBaseContext(), "hello", Toast.LENGTH_SHORT).show(); case R.id.world: Toast.makeText(getBaseContext(), "world", Toast.LENGTH_SHORT).show(); } return true; } }); popupMenu.show(); mypopupmenu W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView mypopupmenu I/ListPopupWindow: Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well. mypopupmenu D/AndroidRuntime: Shutting down VM mypopupmenu E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.zwm12.mypopupmenu, PID: 2926 java.lang.RuntimeException: Failed to resolve attribute at index 6 at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:603) at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:6423) at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6591) at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:735) at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:679) at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:62) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.support.v7.view.menu.MenuAdapter.getView(MenuAdapter.java:85) at android.support.v7.view.menu.MenuPopup.measureIndividualMenuWidth(MenuPopup.java:156) at android.support.v7.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:153) at android.support.v7.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:187) at android.support.v7.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:286) at android.support.v7.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:171) at android.support.v7.view.menu.MenuPopupHelper.show(MenuPopupHelper.java:137) at android.support.v7.widget.PopupMenu.show(PopupMenu.java:233) at com.example.zwm12.mypopupmenu.MainActivity$1.onClick(MainActivity.java:43) at android.view.View.performClick(View.java:4756) at android.view.View$PerformClick.run(View.java:19749) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

org.json.JSONException:类型java.lang.String的值记录无法转换为JSONObject

<div class="post-text" itemprop="text"> <p>I am making an activity to update user profile in android studio using volley,php and mysql.But whenever i am clicking the save button to save all the info nothing is happening</p> <p>android activity</p> <pre><code>public class ProfileInfoSignup extends AppCompatActivity { ImageView dp; ProgressBar pb; EditText save_name,save_bio; Button b1; RequestQueue requestQueue; boolean IMAGE_STATUS = false; Bitmap profilePicture; String name,bio,profile; String user_email; private static String SIGNUP_URL = "http://10.0.2.2/app2/profile_ru.php?apicall=updateuser"; SharedPreferences sp; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.profile_info_signup); dp=findViewById(R.id.circleView); save_name=findViewById(R.id.edit_name); save_bio=findViewById(R.id.edit_bio); b1=findViewById(R.id.btn_start); pb=findViewById(R.id.progress_bar3); sp=getApplicationContext().getSharedPreferences("myPref", Context.MODE_PRIVATE); if(sp.contains("user_email")) { user_email = sp.getString("user_email", "Data not found"); }else{ Toast.makeText(getApplicationContext(), "no email found", Toast.LENGTH_SHORT).show(); } //creating request queue requestQueue = Volley.newRequestQueue(this); //Adding onClickListener to the ImageView to select the profile Picture dp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent, 1000); //result will be available in onActivityResult which is overridden } }); b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { name = save_name.getText().toString(); bio = save_bio.getText().toString(); if ( //perform validation by calling all the validate functions inside the IF condition validateName(name) &amp;&amp; validateBio(bio)&amp;&amp; validateProfile() ) { //Validation Success convertBitmapToString(profilePicture); saveProfileInfo(SIGNUP_URL,name,bio,user_email); } } }); } private void saveProfileInfo(String signupUrl, final String getuserName, final String getuserBio, final String getuserEmail) { RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext()); StringRequest stringRequest = new StringRequest(Request.Method.POST, signupUrl, new Response.Listener&lt;String&gt;() { @Override public void onResponse(String response) { try { Toast.makeText(getApplicationContext(), "making new json object and going to another activity", Toast.LENGTH_LONG).show(); JSONObject jsonObject = new JSONObject(response); if (jsonObject.getBoolean("success")) { Toast.makeText(getApplicationContext(), "Connected to json", Toast.LENGTH_LONG).show(); Intent intent = new Intent(ProfileInfoSignup.this, Activity2.class); startActivity(intent); } else Toast.makeText(getApplicationContext(), "Something went wrong", Toast.LENGTH_LONG).show(); }catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { error.printStackTrace(); } }) { @Override protected Map&lt;String, String&gt; getParams() { Map&lt;String, String&gt; param = new HashMap&lt;String, String&gt;(); param.put("name", getuserName); param.put("bio", getuserBio); param.put("email", getuserEmail); return param; } }; int socketTimeout = 30000; RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT); stringRequest.setRetryPolicy(policy); requestQueue.add(stringRequest); } private void convertBitmapToString(Bitmap profilePicture) { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); profilePicture.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); byte[] array = byteArrayOutputStream.toByteArray(); profile = Base64.encodeToString(array, Base64.DEFAULT); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 1000 &amp;&amp; resultCode == Activity.RESULT_OK &amp;&amp; data != null) { //Image Successfully Selected Toast.makeText(getApplicationContext(), "Image successfully selected", Toast.LENGTH_SHORT).show(); try { //parsing the Intent data and displaying it in the imageview Uri imageUri = data.getData();//Geting uri of the data InputStream imageStream = getContentResolver().openInputStream(imageUri);//creating an imputstrea profilePicture = BitmapFactory.decodeStream(imageStream);//decoding the input stream to bitmap dp.setImageBitmap(profilePicture); IMAGE_STATUS = true;//setting the flag } catch (FileNotFoundException e) { e.printStackTrace(); } } } private boolean validateName(String string) { if (string.equals("")) { save_name.setError("Enter Your Name"); return false; } else if (string.length() &gt; 50) { save_name.setError("Maximum 50 Characters"); return false; } return true; } private boolean validateBio(String string) { if (string.equals("")) { save_bio.setError("Enter Your Email Address"); return false; } else if (string.length() &gt; 300) { save_name.setError("Maximum 300 Characters"); return false; } return true; } private boolean validateProfile() { if (!IMAGE_STATUS) Toast.makeText(this, "Select A Profile Picture", Toast.LENGTH_SHORT).show(); return IMAGE_STATUS; } } </code></pre> <p>Every time i run the app and click the save button this comes up in log</p> <pre><code> 08-04 15:05:23.058 4409-4431/com.example.user.myapplication D/EGL_emulation: eglMakeCurrent: 0xb2eb8860: ver 2 0 (tinfo 0xb2e8b280) 08-04 15:05:23.180 1384-4481/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 1865147 , only wrote 1864800 08-04 15:05:23.848 4409-4409/com.example.user.myapplication W/System.err: org.json.JSONException: Value Record of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.&lt;init&gt;(JSONObject.java:163) at org.json.JSONObject.&lt;init&gt;(JSONObject.java:176) 08-04 15:05:23.849 4409-4409/com.example.user.myapplication W/System.err: at com.example.user.myapplication.Login.ProfileInfoSignup$3.onResponse(ProfileInfoSignup.java:114) at com.example.user.myapplication.Login.ProfileInfoSignup$3.onResponse(ProfileInfoSignup.java:109) at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:67) at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30) 08-04 15:05:23.850 4409-4409/com.example.user.myapplication W/System.err: at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) 08-04 15:05:23.851 4409-4409/com.example.user.myapplication W/System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) </code></pre> <p>php</p> <pre><code> @$name= $_POST['name']; @$bio=$_POST['bio']; @$email=$_POST['email']; @$id=$_POST['id']; if(!empty($_POST['name']) &amp;&amp; !empty($_POST['bio']) &amp;&amp; !empty($_POST['email']) ) { $result="SELECT id FROM accounts where email='$email'"; $row = mysqli_fetch_assoc(mysqli_query($con,$result)); $id=$row['id']; $Sql_Query =mysqli_prepare($con,"UPDATE profile SET name= ?, bio = ? WHERE id = ?"); /* bind parameters for markers */ mysqli_stmt_bind_param($Sql_Query, "ssi", $name,$bio,$id); /* execute query */ $sql= mysqli_stmt_execute($Sql_Query); if($sql){ echo 'Record Updated Successfully'; } else{ echo 'Something went wrong, whether id is not present or something else'.mysqli_error($con); } }else { echo 'missing parameters'; } </code></pre> <p>I am not to figure out whether the problem is in php or android code. Any help will be deeply appreciated</p> </div>

Android反射问题, InvocationTargetException

通过反射调用私有无参函数,函数内部: ``` private int TargetFunction() { Log.d("DEBUG","进入了宿主函数TargetFunction"); Dialog alertDialog = new AlertDialog.Builder(MainActivity.this). setTitle("确定删除?"). setMessage("您确定删除该条信息吗?"). setIcon(R.mipmap.ic_launcher). setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub myFunction(); } }). setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). setNeutralButton("查看详情", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). create(); alertDialog.show(); return 9991; } ``` 当调用之后可以成功进入该函数内,但随即抛错,log信息如下: ``` 进入了宿主函数TargetFunction java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at tools.unicorn.dexinject.MyApplication.abcd(MyApplication.java:55) at tools.unicorn.dexinject.MyApplication.dexInject(MyApplication.java:21) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.aninterface.hook.hook_target.MainActivity.loadUninstallApk(MainActivity.java:123) at com.aninterface.hook.hook_target.MainActivity.access$100(MainActivity.java:22) at com.aninterface.hook.hook_target.MainActivity$2.onClick(MainActivity.java:39) at android.view.View.performClick(View.java:4780) at android.view.View$PerformClick.run(View.java:19866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:149) at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:99) at android.app.AlertDialog.resolveDialogTheme(AlertDialog.java:154) at android.app.AlertDialog$Builder.<init>(AlertDialog.java:379) at com.aninterface.hook.hook_target.MainActivity.TargetFunction(MainActivity.java:46) ... 19 more ``` 不知有谁遇到过这样的问题,小弟实在是找不到原因了

Could not execute method for android :onClicked

最近在学android的camera,在拍照按钮的点击事件中做了如下参数设置: ``` public void capture(View view){ if(mCamera!=null){ WindowManager manager= (WindowManager) getSystemService(Context.WINDOW_SERVICE); Display display=manager.getDefaultDisplay(); Log.i("capture",display.getWidth()+" "+display.getHeight()); Camera.Parameters parameters=mCamera.getParameters(); //设置拍照格式 parameters.setPictureFormat(PixelFormat.YCbCr_422_SP); //设置拍照大小 parameters.setPictureSize(213,350); //设置自动对焦 parameters.setFlashMode(Camera.Parameters.FOCUS_MODE_AUTO); mCamera.setParameters(parameters); mCamera.autoFocus(new Camera.AutoFocusCallback() { @Override public void onAutoFocus(boolean success, Camera camera) { mCamera.takePicture(null,null,mPictureCallback); } }); } } ``` 点击拍照按钮的时候程序崩溃了,出现如下的日志信息: ``` Process: com.example.vampire.facelearning, PID: 14489 java.lang.IllegalStateException: Could not execute method for android:onClick at android.view.View$DeclaredOnClickListener.onClick(View.java:4461) at android.view.View.performClick(View.java:5207) at android.view.View$PerformClick.run(View.java:21177) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5432) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:735) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at android.view.View$DeclaredOnClickListener.onClick(View.java:4456) at android.view.View.performClick(View.java:5207)  at android.view.View$PerformClick.run(View.java:21177)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5432)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:735)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)  Caused by: java.lang.RuntimeException: setParameters failed at android.hardware.Camera.native_setParameters(Native Method) at android.hardware.Camera.setParameters(Camera.java:2003) at com.example.vampire.facelearning.CustomCamera.capture(CustomCamera.java:85) at java.lang.reflect.Method.invoke(Native Method)  at android.view.View$DeclaredOnClickListener.onClick(View.java:4456)  at android.view.View.performClick(View.java:5207)  at android.view.View$PerformClick.run(View.java:21177)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5432)  at java.lang.reflect.Method.invoke(Native Method)  ``` 我把mCamera.setParameters(parameters);注析掉后程序就可以进行拍照了,但遇到了另一个问题。拍照获取的图片尺寸非常小:![图片说明](https://img-ask.csdn.net/upload/201604/02/1459603192_651468.png) 这是onPictureToken方法的实现方法: ``` private Camera.PictureCallback mPictureCallback=new Camera.PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { //将数据写入SD卡的temp.png文件当中 File tempFile=new File("/sdcard/temp.png"); try { FileOutputStream fileOutputStream=new FileOutputStream(tempFile); fileOutputStream.write(data); fileOutputStream.close(); Intent intent=new Intent(CustomCamera.this,ResultAty.class); intent.putExtra("picPath",tempFile.getAbsolutePath()); startActivity(intent); CustomCamera.this.finish(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }; ``` 跳转到另一个activity来进行显示图片: ``` String path=getIntent().getStringExtra("picPath"); ImageView imageView= (ImageView) findViewById(R.id.pic); //对图像的显示角度进行调整 try { FileInputStream fis=new FileInputStream(path); //把图像转换成字节流 Bitmap bitmap=BitmapFactory.decodeStream(fis); Matrix matrix=new Matrix(); matrix.setRotate(90); //调整角度 bitmap=Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),matrix,true); imageView.setImageBitmap(bitmap); } catch (FileNotFoundException e) { e.printStackTrace(); } } ``` 麻烦各位大神给个提示,我自己debug了很久都没有找出问题所在,谢谢!

android studio发送短信程序添加权限依然报错

MainActivity: public class MainActivity extends AppCompatActivity { private EditText messageeditText; private EditText numbereditText; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); numbereditText= (EditText) findViewById(R.id.numbereditText); messageeditText= (EditText) findViewById(R.id.messageeditetext); button= (Button) findViewById(R.id.button); final PendingIntent pendingIntent=PendingIntent.getBroadcast(this,0,new Intent(),0); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { SmsManager smsManager=SmsManager.getDefault(); smsManager.sendTextMessage(numbereditText.getText().toString(),null, messageeditText.getText().toString(),null,null); } }); } } 配置文件: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.study.sendreceivemessage"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.SEND_SMS"></uses-permission> </manifest> logcat: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.study.sendreceivemessage, PID: 4115 java.lang.SecurityException: Sending SMS message: uid 10058 does not have android.permission.SEND_SMS. at android.os.Parcel.readException(Parcel.java:1599) at android.os.Parcel.readException(Parcel.java:1552) at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:768) at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:310) at android.telephony.SmsManager.sendTextMessage(SmsManager.java:293) at com.example.study.sendreceivemessage.MainActivity$1.onClick(MainActivity.java:29) at android.view.View.performClick(View.java:5198) at android.view.View$PerformClick.run(View.java:21147) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Android studio 连接数据库问题 我这样写有错吗帮我看看

package com.example.administrator.testdate; import android.os.Bundle; import android.os.StrictMode; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.Statement; public class MainActivity extends AppCompatActivity { String Username="root"; //数据库用户名 String Password="12345678"; //数据库用户密码 Button button1; Button button2; EditText textView1; EditText textView2; Connection conn=null; Statement stmt=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); button1 = (Button) findViewById(R.id.button1); button2 = (Button) findViewById(R.id.button2); textView1=(EditText)findViewById(R.id.editText2); textView2=(EditText)findViewById(R.id.editText) ; StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build()); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { connection(); } }); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { textView1.setText(""); textView2.setText(""); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } public void connection() { String username = textView1.getText().toString(); String password=textView2.getText().toString(); if (username != null) { //打开数据库 try {//注册驱动程序 Class.forName("com.mysql.jdbc.Driver"); } catch (java.lang.ClassNotFoundException e) { System.err.println("Driver Error " + e.getMessage()); } //连接数据库并创建Statement 对象 String sConnStr = "jdbc:mysql://localhost/testdate?user=" + Username + "&password=" + Password + "&useUnicode=true&characterEncoding=utf8"; try { conn = DriverManager.getConnection(sConnStr); conn.setAutoCommit(true); //更新数据库 String sql = "insert into testdate(username,password) values(?,?)"; PreparedStatement sta = conn.prepareStatement(sql); sta.setString(1, username); sta.setString(2, password); sta.executeUpdate(); sta.close(); conn.close(); } catch (Exception e) { System.err.println("数据库连接错误: " + e.getMessage()); return; } } } }

service本地服务通信(无法查看状态)

可以绑定服务与解绑,但是无法查看状态 ![图片说明](https://img-ask.csdn.net/upload/201911/09/1573263669_233388.png) 也没有服务断开连接的提示 MainActivity的代码 ``` public class MainActivity extends AppCompatActivity { MyService.MyBinder myBinder; //定义一个ServiceConnection对象 private ServiceConnection connection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { Log.v("MainActivity", "服务连接成功"); myBinder = (MyService.MyBinder) iBinder; } @Override public void onServiceDisconnected(ComponentName componentName) { Log.v("MainActivity", "服务断开连接"); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void onClick(View view) { switch (view.getId()) { case R.id.b1: //绑定服务service Intent intent = new Intent(this, MyService.class); bindService(intent, connection, BIND_AUTO_CREATE); break; case R.id.b2: //解除绑定服务service unbindService(connection); break; case R.id.b3: Toast.makeText(this, myBinder.getCount(), Toast.LENGTH_SHORT).show(); break; default: break; } } } ``` 以下是报错信息 ``` E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.sixteenapplication, PID: 2005 java.lang.IllegalStateException: Could not execute method for android:onClick at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:402) at android.view.View.performClick(View.java:5198) at android.view.View$PerformClick.run(View.java:21147) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397) at android.view.View.performClick(View.java:5198)  at android.view.View$PerformClick.run(View.java:21147)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x5 at android.content.res.Resources.getText(Resources.java:312) at android.widget.Toast.makeText(Toast.java:286) at com.example.sixteenapplication.MainActivity.onClick(MainActivity.java:42) at java.lang.reflect.Method.invoke(Native Method)  at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397)  at android.view.View.performClick(View.java:5198)  at android.view.View$PerformClick.run(View.java:21147)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  I/Process: Sending signal. PID: 2005 SIG: 9 Application terminated. ```

初学andriod,工具为studio,就是一个简单的按钮事件,模拟器执行时报错,请专家指点

初学andriod,工具为studio,就是一个简单的按钮事件,请专家指点: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()) .commit(); } myText = (TextView)findViewById(R.id.zrmtextView); myButton = (Button)findViewById(R.id.zrmbutton); myButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { myText.setText("你点击了Button"); } }); } logcat报错信息: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

求大神指导Android 空指针异常问题

代码如下: private OnPreferenceClickListener mPrefClickListener = new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Intent intent = preference.getIntent(); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(getActivity(), R.string.plugin_app_unavailable, Toast.LENGTH_LONG).show(); Log.w(TAG, preference.getKey() + " not available", e); } return true; } }; log 如下: 01-19 06:34:24.911 6327 6327 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData()' on a null object reference 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1622) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.app.Activity.startActivityFromFragment(Activity.java:4548) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.app.Activity.startActivityFromFragment(Activity.java:4510) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.app.Fragment.startActivity(Fragment.java:1086) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.app.Fragment.startActivity(Fragment.java:1065) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at com.lenovo.settings.CharSettings$2.onPreferenceClick(CharSettings.java:114) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.preference.Preference.performClick(Preference.java:1015) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:214) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.widget.AdapterView.performItemClick(AdapterView.java:310) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.widget.AbsListView.performItemClick(AbsListView.java:1188) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.widget.AbsListView$PerformClick.run(AbsListView.java:3231) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.widget.AbsListView$3.run(AbsListView.java:4165) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:815) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:104) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.os.Looper.loop(Looper.java:194) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5731) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) 01-19 06:34:24.911 6327 6327 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) 求大神指教,小白一枚,谢谢

android studio打包APK后安装完成后打开按钮不可点,桌面也无图标,但应用里显示已安装

估计是代码问题,网上down的代码,是不是哪里错了?功能很简单,就一个webview控件,点开应用直接启动,代码如下,求大神查错修改,谢谢。 ## AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.ricky.myapplication"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name="com.example.ricky.myapplication.MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LUNCHER"/> </intent-filter> </activity><!-- ATTENTION: This was auto-generated to add Google Play services to your project for App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. --> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application> </manifest> ## MainActivity.java package com.example.ricky.myapplication; import android.app.Activity; import android.net.Uri; import android.os.Bundle; import android.webkit.WebView; import android.webkit.WebViewClient; import com.google.android.gms.appindexing.Action; import com.google.android.gms.appindexing.AppIndex; import com.google.android.gms.appindexing.Thing; import com.google.android.gms.common.api.GoogleApiClient; public class MainActivity extends Activity { private WebView webView; /** * ATTENTION: This was auto-generated to implement the App Indexing API. * See https://g.co/AppIndexing/AndroidStudio for more information. */ private GoogleApiClient client; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test); init(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See https://g.co/AppIndexing/AndroidStudio for more information. client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); } private void init() { webView = (WebView) findViewById(R.id.webView); //WebView加载web资源 webView.loadUrl("http://baidu.com/"); //覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开 webView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub //返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器 view.loadUrl(url); return true; } }); } /** * ATTENTION: This was auto-generated to implement the App Indexing API. * See https://g.co/AppIndexing/AndroidStudio for more information. */ public Action getIndexApiAction() { Thing object = new Thing.Builder() .setName("Main Page") // TODO: Define a title for the content shown. // TODO: Make sure this auto-generated URL is correct. .setUrl(Uri.parse("http://baidu.com/")) .build(); return new Action.Builder(Action.TYPE_VIEW) .setObject(object) .setActionStatus(Action.STATUS_TYPE_COMPLETED) .build(); } @Override public void onStart() { super.onStart(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See https://g.co/AppIndexing/AndroidStudio for more information. client.connect(); AppIndex.AppIndexApi.start(client, getIndexApiAction()); } @Override public void onStop() { super.onStop(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See https://g.co/AppIndexing/AndroidStudio for more information. AppIndex.AppIndexApi.end(client, getIndexApiAction()); client.disconnect(); } } ## layout下test.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <WebView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/webView" /> </LinearLayout>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

百度工程师,获利10万,判刑3年!

所有一夜暴富的方法都写在刑法中,但总有人心存侥幸。这些年互联网犯罪高发,一些工程师高技术犯罪更是引发关注。这两天,一个百度运维工程师的案例传遍朋友圈。1...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

实时更新:计算机编程语言排行榜—TIOBE世界编程语言排行榜(2020年6月份最新版)

内容导航: 1、TIOBE排行榜 2、总榜(2020年6月份) 3、本月前三名 3.1、C 3.2、Java 3.3、Python 4、学习路线图 5、参考地址 1、TIOBE排行榜 TIOBE排行榜是根据全世界互联网上有经验的程序员、课程和第三方厂商的数量,并使用搜索引擎(如Google、Bing、Yahoo!)以及Wikipedia、Amazon、YouTube统计出排名数据。

阿里面试官让我用Zk(Zookeeper)实现分布式锁

他可能没想到,我当场手写出来了

立即提问
相关内容推荐