teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

タグの追加

2018/07/06 14:07

投稿

akawo
akawo

スコア23

title CHANGED
File without changes
body CHANGED
File without changes

1

コード内容に間違いがあったので修正

2018/07/06 14:07

投稿

akawo
akawo

スコア23

title CHANGED
File without changes
body CHANGED
@@ -223,70 +223,6 @@
223
223
 
224
224
  ```
225
225
 
226
- **build.gradle(project)**
227
- ```
228
- package com.nifty.user
229
226
 
230
- import android.content.Intent
231
- import android.os.Bundle
232
- import android.support.v7.app.AppCompatActivity
233
- import android.view.Menu
234
- import android.view.MenuItem
235
-
236
-
237
-
238
- import com.nifty.cloud.mb.core.NCMB
239
- import com.nifty.cloud.mb.core.NCMBUser
240
-
241
- class MainActivity : AppCompatActivity() {
242
-
243
- override fun onCreate(savedInstanceState: Bundle?) {
244
- super.onCreate(savedInstanceState)
245
- setContentView(R.layout.activity_main)
246
-
247
- //**************** APIキーの設定とSDKの初期化 **********************
248
- NCMB.initialize(this.applicationContext, "7e6d6479ddc9c642f4229d2041c4a6093d2d1f45385c350543523c9b4c328e4f",
249
- "c81eea502681d9c069ca4104b98420ff59318b07f76aeec1cca3c816bbf08e87")
250
-
251
- val intent = Intent(this, LoginActivity::class.java)
252
- startActivity(intent)
253
- }
254
-
255
- override fun onCreateOptionsMenu(menu: Menu): Boolean {
256
- // Inflate the menu; this adds items to the action bar if it is present.
257
- menuInflater.inflate(R.menu.menu_main, menu)
258
- return true
259
- }
260
-
261
- override fun onOptionsItemSelected(item: MenuItem): Boolean {
262
- // Handle action bar item clicks here. The action bar will
263
- // automatically handle clicks on the Home/Up button, so long
264
- // as you specify a parent activity in AndroidManifest.xml.
265
- val id = item.itemId
266
-
267
-
268
- if (id == R.id.action_settings) {
269
- return true
270
- }
271
-
272
- if (id == R.id.action_logout) {
273
- NCMBUser.logoutInBackground { e ->
274
- if (e != null) {
275
- //エラー時の処理
276
- }
277
- }
278
- val intent = Intent(this, LoginActivity::class.java)
279
- startActivity(intent)
280
- return true
281
- }
282
-
283
- return super.onOptionsItemSelected(item)
284
- }
285
- }
286
-
287
- ```
288
-
289
-
290
-
291
227
  この問題に長い時間を取られております、、、
292
228
  何卒、何卒、ご教授のほどよろしくお願いします!!!