60 lines
1.8 KiB
Java
60 lines
1.8 KiB
Java
package beyondsoft.bewomitarbeiterapp;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.support.v7.app.ActionBarActivity;
|
|
import android.view.Menu;
|
|
import android.view.MenuItem;
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebViewClient;
|
|
|
|
import soapConnection.SoapCalls;
|
|
import tcpConnection.SocketManager;
|
|
|
|
/**
|
|
* Created by bib on 02.05.2016.
|
|
*/
|
|
public class WebdokuActivity extends ActionBarActivity {
|
|
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.webdoku);
|
|
|
|
WebView view = (WebView) this.findViewById(R.id.webView1);
|
|
|
|
view.getSettings().setJavaScriptEnabled(true);
|
|
|
|
//TODO: Url anhand des überprüften Tokens bestimmen (Welcher Server)
|
|
view.loadUrl(SoapCalls.WEB_DOKU_URL);
|
|
view.setWebViewClient(new WebViewClient());
|
|
}
|
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
// Inflate the menu; this adds items to the action bar if it is present.
|
|
getMenuInflater().inflate(R.menu.menu_webdoku, menu);
|
|
return true;
|
|
}
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
// Handle item selection
|
|
switch (item.getItemId()) {
|
|
case R.id.action_chat:
|
|
Intent kontaktChatActivity = new Intent(getBaseContext(), KontaktChatActivity.class);
|
|
|
|
startActivity(kontaktChatActivity);
|
|
return true;
|
|
case R.id.action_Logout:
|
|
SocketManager.logout();
|
|
|
|
Intent intent = new Intent(WebdokuActivity.this, LoginActivity.class);
|
|
WebdokuActivity.this.startActivity(intent);
|
|
|
|
return true;
|
|
default:
|
|
return super.onOptionsItemSelected(item);
|
|
}
|
|
}
|
|
}
|