是因为
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
中 Builder虽然需要的是Context参数。但只有在同一个activity中可以用getApplicationContext() 得到Context 。否则要用Activity.this传递Context 即Builder(<span style="font-family: 宋体; font-size: 12pt; background-color: rgb(255, 255, 255);">Activity.this</span><span style="font-family: 宋体; font-size: 12pt;">)</span>