Buggy code:
public class MainActivity extends AppCompatActivity { private LinearLayout mLayout ; final Context context = this ; ArrayAdapter < String > adapter ; private ArrayList < String > arrayList ; private ArrayList < String > projectList ; ListView listViewProj ; Server x = new Server ( ) ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; Toolbar toolbar = ( ( Toolbar ) ( findViewById ( toolbar ) ) ) ; setSupportActionBar ( toolbar ) ; FloatingActionButton fab = ( ( FloatingActionButton ) ( findViewById ( fab ) ) ) ; listViewProj = ( ( ListView ) ( findViewById ( listViewProject ) ) ) ; arrayList = new ArrayList < String > ( ) ; adapter = new ArrayAdapter < String > ( getApplicationContext ( ) , layout . mytextview , arrayList ) ; listViewProj . setAdapter ( adapter ) ; fab . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View arg0 ) { LayoutInflater li = LayoutInflater . from ( context ) ; View promptsView = li . inflate ( activity_project , null ) ; AlertDialog . Builder alertDialogBuilder = new AlertDialog . Builder ( context ) ; alertDialogBuilder . setView ( promptsView ) ; final EditText ProjName = ( ( EditText ) ( promptsView . findViewById ( editText ) ) ) ; ProjName . setSingleLine ( ) ; final EditText StartDate = ( ( EditText ) ( promptsView . findViewById ( editText2 ) ) ) ; StartDate . setSingleLine ( ) ; final EditText EndDate = ( ( EditText ) ( promptsView . findViewById ( editText3 ) ) ) ; EndDate . setSingleLine ( ) ; final EditText ProjDesc = ( ( EditText ) ( promptsView . findViewById ( editText4 ) ) ) ; ProjDesc . setSingleLine ( ) ; alertDialogBuilder . setCancelable ( false ) . setPositiveButton ( "OK" , null ) . setNegativeButton ( "Cancel" , null ) ; final AlertDialog mAlertDialog = alertDialogBuilder . create ( ) ; mAlertDialog . setOnShowListener ( new DialogInterface . OnShowListener ( ) { @ Override public void onShow ( DialogInterface dialog ) { Button b = mAlertDialog . getButton ( BUTTON_POSITIVE ) ; b . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { if ( ( ! ( ProjName . getText ( ) . toString ( ) . matches ( "" ) ) ) && ( ! ( ProjDesc . getText ( ) . toString ( ) . matches ( "" ) ) ) ) { mAlertDialog . dismiss ( ) ; adapter . add ( ProjName . getText ( ) . toString ( ) ) ; adapter . notifyDataSetChanged ( ) ; LoginActivity ne = new LoginActivity ( ) ; int uid = ne . uid ; x . createProject ( ProjName . getText ( ) . toString ( ) , ProjDesc . getText ( ) . toString ( ) , StartDate . getText ( ) . toString ( ) , EndDate . getText ( ) . toString ( ) , uid , context ) ; listViewProj . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > arg0 , View arg1 , int position , long arg3 ) { Intent i = new Intent ( MainActivity . this , TaskActivity . class ) ; startActivity ( i ) ; } } ) ; listViewProj . setOnItemLongClickListener ( new AdapterView . OnItemLongClickListener ( ) { @ Override public boolean onItemLongClick ( AdapterView < ? > parent , View view , final int arg2 , long arg3 ) { AlertDialog . Builder adb = new AlertDialog . Builder ( context ) ; adb . setTitle ( "Delete<seq2seq4repair_space>entry" ) ; adb . setMessage ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>this<seq2seq4repair_space>entry?" ) ; adb . setPositiveButton ( yes , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { arrayList . remove ( arg2 ) ; adapter . notifyDataSetChanged ( ) ; } } ) . setNegativeButton ( no , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { } } ) . setIcon ( ic_dialog_alert ) . show ( ) ; <START_BUG> return false ; <END_BUG> } } ) ; } else if ( ProjName . getText ( ) . toString ( ) . matches ( "" ) ) { ProjName . setError ( getString ( error_field_required ) ) ; } else if ( ProjDesc . getText ( ) . toString ( ) . matches ( "" ) ) { ProjDesc . setError ( getString ( error_field_required ) ) ; } } } ) ; } } ) ; mAlertDialog . show ( ) ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } No newline ; at end ; of file ; }

Fix:
return true ;