Android Run zaman istisna

oy
-2

Ben bir ana faaliyeti ve başka bir etkinlik var. ne zaman i düğmeye uygulaması durur göndermek tıklayın. Günlük mahsus bir istisna çalıştırmak gösterir. İşte benim kodu lütfen Bunu düzeltmek yardımcı olur. Sadece android uygulamalar oluşturan öğrenmeye başladılar.

     <?xml version=1.0 encoding=utf-8?>
<manifest xmlns:android=http://schemas.android.com/apk/res/android
    package=com.example.dinesh.mdk>

    <application
        android:allowBackup=true
        android:icon=@mipmap/ic_launcher
        android:label=@string/app_name
        android:roundIcon=@mipmap/ic_launcher_round
        android:supportsRtl=true
        android:theme=@style/AppTheme>
        <activity android:name=.MainActivity>
            <intent-filter>
                <action android:name=android.intent.action.MAIN />

                <category android:name=android.intent.category.LAUNCHER />
            </intent-filter>
        </activity>
        <activity android:name=.DisplayMessageActivity
            android:parentActivityName=.MainActivity>
            <!-- The meta-data tag is required if you support API level 15 and lower -->
            <meta-data
                android:name=android.support.PARENT_ACTIVITY
                android:value=.MainActivity />
        </activity>
    </application>

</manifest>

Bu, ana faaliyeti için

package com.example.dinesh.mdk

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.content.Intent
import android.widget.EditText


const val EXTRA_MESSAGE = com.example.myfirstapp.MESSAGE

class MainActivity : AppCompatActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    fun sendMessage(view: View) {
        val editText = findViewById<EditText>(R.id.editText3)
        val message = editText.text.toString()
        val intent = Intent(this, DisplayMessageActivity::class.java).apply {
            putExtra(EXTRA_MESSAGE, message)
        }
        startActivity(intent)

    }

}

Bu ekran mesajı aktivite için kodudur.

package com.example.dinesh.mdk

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
import android.content.Intent



class DisplayMessageActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_display_message)

    }
    // Get the Intent that started this activity and extract the string
    val message = intent.getStringExtra(EXTRA_MESSAGE)


    // Capture the layout's TextView and set the string as its text
    val textView = findViewById<TextView>(R.id.textView).apply {
        text = message
    }

}

Ben sorunun ne olduğu konusunda çözemedim. İşte benim logcat olduğunu. Ben Ubuntu kullanıyorum

10-20 19:53:00.634 2526-2526/android.process.media E/libprocessgroup: failed to make and chown /acct/uid_10005: Read-only file system
10-20 19:53:00.634 2526-2526/android.process.media W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
10-20 19:53:03.941 2526-2714/android.process.media E/SQLiteLog: (283) recovered 60 frames from WAL file /data/user/0/com.android.providers.media/databases/internal.db-wal
10-20 19:53:04.352 2526-2714/android.process.media W/MediaScanner: Error opening directory '/oem/media/', skipping: No such file or directory.
10-20 19:53:04.395 2526-2714/android.process.media W/MediaProvider: no database for scanned volume external
10-20 19:53:04.613 2526-2714/android.process.media E/SQLiteLog: (283) recovered 30 frames from WAL file /data/user/0/com.android.providers.media/databases/external.db-wal
10-20 19:53:04.746 2526-2714/android.process.media D/MediaProvider: object removed 10
10-20 19:53:04.747 2526-2714/android.process.media D/MediaProvider: object removed 20
    object removed 21
    object removed 22
    object removed 23
    object removed 24
    object removed 25
    object removed 26
    object removed 27
10-20 19:53:05.221 2526-2714/android.process.media V/MediaScanner: pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor@315e15bc
10-20 19:53:05.222 2526-2714/android.process.media V/MediaScanner: /pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor@315e15bc
10-20 19:53:11.137 2526-2932/android.process.media D/DownloadManager: [5] Starting
10-20 19:53:11.417 2526-2932/android.process.media W/ActivityThread: ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());
10-20 19:53:14.595 2526-2932/android.process.media D/DownloadManager: [5] Finished with status SUCCESS
10-20 19:53:16.139 2526-3062/android.process.media D/DownloadManager: [6] Starting
10-20 19:53:16.488 2526-3062/android.process.media D/DownloadManager: [6] Finished with status SUCCESS
Oluştur 20/10/2018 saat 14:16
kaynak kullanıcı
Diğer dillerde...                            


1 cevaplar

oy
0

Bunu kullan

fun sendMessage(view: View) {
        val editText = findViewById<EditText>(R.id.editText3)
        val message = editText.text.toString()
        val intent = Intent(this, DisplayMessageActivity::class.java)
        intent.putExtra(EXTRA_MESSAGE, message)
        startActivity(intent)
    }
Cevap 20/10/2018 saat 14:24
kaynak kullanıcı

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more