package zero.zd.zquestionnaire;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

public class QnaBuilderActivity extends AppCompatActivity {

    public static Intent getStartIntent(Context context) {
        return new Intent(context, QnaBuilderActivity.class);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_qna_builder);

        if (getSupportActionBar() != null)
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_qna_builder, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {

            case R.id.action_save:
                // @TODO add action to write to a file
                break;

            case android.R.id.home:
                finish();
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public void onClickAdd(View view) {
        // @TODO add action to add QnA
        Toast.makeText(QnaBuilderActivity.this, "ADD!!!", Toast.LENGTH_SHORT).show();
    }
}

@@ -115,16 +115,57 @@
 Bundle;%0A
+import android.support.v7.app.ActionBar;%0A
 import a
@@ -689,33 +689,74 @@
     
-if (getSupportActionBar()
+ActionBar actionBar = getSupportActionBar();%0A        if (actionBar
  != 
@@ -760,16 +760,18 @@
 != null)
+ %7B
 %0A       
@@ -775,35 +775,72 @@
         
-getSupportA
+actionBar.setTitle(%22QnA Builder%22);%0A            a
 ctionBar
 ().setDi
@@ -831,18 +831,16 @@
 ctionBar
-()
 .setDisp
@@ -864,16 +864,26 @@
 d(true);
+%0A        %7D
 %0A%0A    %7D%0A

Add ActionBar title on QnaBuilder